class Gapic::Schema::Message
Wrapper for a protobuf Message
.
@!attribute [r] fields
@ return [Enumerable<Field>] The fields of a message.
@!attribute [r] extensions
@ return [Enumerable<Field>] The extensions of a message.
@!attribute [r] resource
@ return [Resource,nil] A representation of the resource.
@!attribute [r] nested_messages
@ return [Enumerable<Message>] The nested message declarations of a message.
@!attribute [r] nested_enums
@ return [Enumerable<Enum>] The nested enum declarations of a message.
Attributes
Public Class Methods
Initializes a message object. @param descriptor [Google::Protobuf::DescriptorProto] the protobuf
representation of this service.
@param address [Enumerable<String>] The address of the proto. See
#address for more info.
@param docs [Google::Protobuf::SourceCodeInfo::Location] The docs
of the proto. See #docs for more info.
@param fields [Enumerable<Field>] The fields of this message. @param extensions [Enumerable<Field>] The extensions of this message. @param resource [Resource,nil] The resource of this message, or nil if none. @param nested_messages
[Enumerable<Message>] The nested message
declarations of this message.
@param nested_enums
[Enumerable<Enum>] The nested enum declarations
of this message.
Gapic::Schema::Proto::new
# File lib/gapic/schema/wrappers.rb, line 558 def initialize descriptor, address, docs, fields, extensions, resource, nested_messages, nested_enums super descriptor, address, docs @fields = fields || [] @extensions = extensions || [] @resource = resource @nested_messages = nested_messages || [] @nested_enums = nested_enums || [] @fields.each { |f| f.parent = self } @extensions.each { |x| x.parent = self } @nested_messages.each { |m| m.parent = self } @nested_enums.each { |e| e.parent = self } @resource.parent = self if @resource end
Public Instance Methods
@return [Boolean] whether this type is a map entry
# File lib/gapic/schema/wrappers.rb, line 575 def map_entry? descriptor.options&.map_entry end