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.
1221 1222 1223 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1221 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.
1214 1215 1216 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1214 def @message end |
#type_id ⇒ Fixnum
Identifier for the type.
Corresponds to the JSON property typeId
1219 1220 1221 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1219 def type_id @type_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1226 1227 1228 1229 |
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1226 def update!(**args) @message = args[:message] if args.key?(:message) @type_id = args[:type_id] if args.key?(:type_id) end |