Class: Google::Apis::FirebaseV1beta1::TypedMessage
- Inherits:
-
Object
- Object
- Google::Apis::FirebaseV1beta1::TypedMessage
- 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
-
#message ⇒ String
Message bytes.
-
#type_id ⇒ Fixnum
Identifier for the type.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TypedMessage
constructor
A new instance of TypedMessage.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ TypedMessage
Returns a new instance of TypedMessage
1207 1208 1209 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1207 def initialize(**args) update!(**args) end |
Instance Attribute Details
#message ⇒ String
Message bytes.
Corresponds to the JSON property message
NOTE: Values are automatically base64 encoded/decoded in the client library.
1200 1201 1202 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1200 def @message end |
#type_id ⇒ Fixnum
Identifier for the type.
Corresponds to the JSON property typeId
1205 1206 1207 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1205 def type_id @type_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1212 1213 1214 1215 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1212 def update!(**args) @message = args[:message] if args.key?(:message) @type_id = args[:type_id] if args.key?(:type_id) end |