class Google::Cloud::Logging::ResourceDescriptor::LabelDescriptor
A definition of a label that can be used to describe instances of a {Resource}. For example, Cloud
SQL databases must be labeled with their `database_id`. See {ResourceDescriptor#labels}.
@example
require "google/cloud/logging" logging = Google::Cloud::Logging.new resource_descriptor = logging.resource_descriptors.first label_descriptor = resource_descriptor.labels.first label_descriptor.key #=> "database_id" label_descriptor.description #=> "The ID of the database."
Attributes
description[R]
A human-readable description for the label.
key[R]
The key (name) of the label.
type[R]
The type of data that can be assigned to the label.
@return [Symbol, nil] Returns `:string`, `:boolean`, `:integer`, or
`nil` if there is no type.
Public Class Methods
from_grpc(grpc)
click to toggle source
@private New LabelDescriptor
from a Google::Api::LabelDescriptor object.
# File lib/google/cloud/logging/resource_descriptor.rb, line 123 def self.from_grpc grpc type_sym = { STRING: :string, BOOL: :boolean, INT64: :integer }[grpc.value_type] new.tap do |l| l.instance_variable_set :@key, grpc.key l.instance_variable_set :@type, type_sym l.instance_variable_set :@description, grpc.description end end