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.



1221
1222
1223
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1221

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)


1214
1215
1216
# File 'generated/google/apis/firebase_v1beta1/classes.rb', line 1214

def message
  @message
end

#type_idFixnum

Identifier for the type. Corresponds to the JSON property typeId

Returns:

  • (Fixnum)


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