Class: Google::Apis::FirebaseV1beta1::TypedMessage

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/firebase_v1beta1/classes.rb,
generated/google/apis/firebase_v1beta1/representations.rb,
generated/google/apis/firebase_v1beta1/representations.rb

Overview

Message that groups a protocol type_id (as defined by MessageSet), with an encoded message of that type. Its use is similar to MessageSet, except it represents a single (type, encoded message) instead of a set. To fill for known protocol type: MyProtocolMsg proto; TypedMessage typed_msg; typed_msg.set_type_id(MyProtocolMsg::MESSAGE_TYPE_ID); proto.AppendToCord(typed_msg.mutable_message()); To fill for unknown protocol type: ProtocolMessage proto; TypedMessage typed_msg; typed_msg.set_type_id(proto.GetMapper()->type_id()); proto.AppendToCord(typed_msg.mutable_message());

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ TypedMessage

Returns a new instance of TypedMessage



939
940
941
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 939

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#messageString

Message bytes. Corresponds to the JSON property message NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


932
933
934
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 932

def message
  @message
end

#type_idFixnum

Identifier for the type. Corresponds to the JSON property typeId

Returns:

  • (Fixnum)


937
938
939
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 937

def type_id
  @type_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



944
945
946
947
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 944

def update!(**args)
  @message = args[:message] if args.key?(:message)
  @type_id = args[:type_id] if args.key?(:type_id)
end