Class: Google::Apis::Messages::MessageObject
- Inherits:
-
Object
- Object
- Google::Apis::Messages::MessageObject
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/messages/classes.rb,
lib/google/apis/messages/representations.rb,
lib/google/apis/messages/representations.rb
Defined Under Namespace
Classes: Representation
Instance Attribute Summary collapse
-
#android ⇒ Object
Returns the value of attribute android.
-
#apns ⇒ Object
Returns the value of attribute apns.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#data ⇒ Object
Returns the value of attribute data.
-
#fcm_options ⇒ Object
Returns the value of attribute fcm_options.
-
#notification ⇒ Object
Returns the value of attribute notification.
-
#token ⇒ Object
Returns the value of attribute token.
-
#topic ⇒ Object
Returns the value of attribute topic.
-
#webpush ⇒ Object
Returns the value of attribute webpush.
Instance Method Summary collapse
-
#initialize(**args) ⇒ MessageObject
constructor
A new instance of MessageObject.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ MessageObject
Returns a new instance of MessageObject.
81 82 83 |
# File 'lib/google/apis/messages/classes.rb', line 81 def initialize(**args) update!(**args) end |
Instance Attribute Details
#android ⇒ Object
Returns the value of attribute android.
76 77 78 |
# File 'lib/google/apis/messages/classes.rb', line 76 def android @android end |
#apns ⇒ Object
Returns the value of attribute apns.
77 78 79 |
# File 'lib/google/apis/messages/classes.rb', line 77 def apns @apns end |
#condition ⇒ Object
Returns the value of attribute condition.
72 73 74 |
# File 'lib/google/apis/messages/classes.rb', line 72 def condition @condition end |
#data ⇒ Object
Returns the value of attribute data.
75 76 77 |
# File 'lib/google/apis/messages/classes.rb', line 75 def data @data end |
#fcm_options ⇒ Object
Returns the value of attribute fcm_options.
79 80 81 |
# File 'lib/google/apis/messages/classes.rb', line 79 def @fcm_options end |
#notification ⇒ Object
Returns the value of attribute notification.
74 75 76 |
# File 'lib/google/apis/messages/classes.rb', line 74 def notification @notification end |
#token ⇒ Object
Returns the value of attribute token.
73 74 75 |
# File 'lib/google/apis/messages/classes.rb', line 73 def token @token end |
#topic ⇒ Object
Returns the value of attribute topic.
71 72 73 |
# File 'lib/google/apis/messages/classes.rb', line 71 def topic @topic end |
#webpush ⇒ Object
Returns the value of attribute webpush.
78 79 80 |
# File 'lib/google/apis/messages/classes.rb', line 78 def webpush @webpush end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/google/apis/messages/classes.rb', line 86 def update!(**args) @topic = args[:topic] if args.key?(:topic) @condition = args[:condition] if args.key?(:condition) @token = args[:token] if args.key?(:token) @notification = args[:notification] if args.key?(:notification) if args.key?(:data) && args[:data].is_a?(Hash) @data = { 'payload' => JSON.dump(args[:data]) } end if args.key?(:extra) && args[:extra].is_a?(Hash) args[:extra].each do |key, value| @data[key] = value.to_s end end @android = args[:android] if args.key?(:android) @apns = args[:apns] if args.key?(:apns) @webpush = args[:webpush] if args.key?(:webpush) @fcm_options = args[:fcm_options] if args.key?(:fcm_options) end |