Class: Google::Apis::FcmV1::Message

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

Overview

Message to send by Firebase Cloud Messaging Service.

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) ⇒ Message

Returns a new instance of Message



798
799
800
# File 'generated/google/apis/fcm_v1/classes.rb', line 798

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

Instance Attribute Details

#androidGoogle::Apis::FcmV1::AndroidConfig

Android specific options for messages sent through FCM connection server. Corresponds to the JSON property android



748
749
750
# File 'generated/google/apis/fcm_v1/classes.rb', line 748

def android
  @android
end

#apnsGoogle::Apis::FcmV1::ApnsConfig

Apple Push Notification Service specific options. Corresponds to the JSON property apns



753
754
755
# File 'generated/google/apis/fcm_v1/classes.rb', line 753

def apns
  @apns
end

#conditionString

Condition to send a message to, e.g. "'foo' in topics && 'bar' in topics". Corresponds to the JSON property condition

Returns:

  • (String)


759
760
761
# File 'generated/google/apis/fcm_v1/classes.rb', line 759

def condition
  @condition
end

#dataHash<String,String>

Input only. Arbitrary key/value payload. Corresponds to the JSON property data

Returns:

  • (Hash<String,String>)


764
765
766
# File 'generated/google/apis/fcm_v1/classes.rb', line 764

def data
  @data
end

#fcm_optionsGoogle::Apis::FcmV1::FcmOptions

Platform independent options for features provided by the FCM SDKs. Corresponds to the JSON property fcmOptions



769
770
771
# File 'generated/google/apis/fcm_v1/classes.rb', line 769

def fcm_options
  @fcm_options
end

#nameString

Output Only. The identifier of the message sent, in the format of projects/*/messages/message_id`. Corresponds to the JSON propertyname`

Returns:

  • (String)


775
776
777
# File 'generated/google/apis/fcm_v1/classes.rb', line 775

def name
  @name
end

#notificationGoogle::Apis::FcmV1::Notification

Basic notification template to use across all platforms. Corresponds to the JSON property notification



780
781
782
# File 'generated/google/apis/fcm_v1/classes.rb', line 780

def notification
  @notification
end

#tokenString

Registration token to send a message to. Corresponds to the JSON property token

Returns:

  • (String)


785
786
787
# File 'generated/google/apis/fcm_v1/classes.rb', line 785

def token
  @token
end

#topicString

Topic name to send a message to, e.g. "weather". Note: "/topics/" prefix should not be provided. Corresponds to the JSON property topic

Returns:

  • (String)


791
792
793
# File 'generated/google/apis/fcm_v1/classes.rb', line 791

def topic
  @topic
end

#webpushGoogle::Apis::FcmV1::WebpushConfig

Webpush protocol options. Corresponds to the JSON property webpush



796
797
798
# File 'generated/google/apis/fcm_v1/classes.rb', line 796

def webpush
  @webpush
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



803
804
805
806
807
808
809
810
811
812
813
814
# File 'generated/google/apis/fcm_v1/classes.rb', line 803

def update!(**args)
  @android = args[:android] if args.key?(:android)
  @apns = args[:apns] if args.key?(:apns)
  @condition = args[:condition] if args.key?(:condition)
  @data = args[:data] if args.key?(:data)
  @fcm_options = args[:fcm_options] if args.key?(:fcm_options)
  @name = args[:name] if args.key?(:name)
  @notification = args[:notification] if args.key?(:notification)
  @token = args[:token] if args.key?(:token)
  @topic = args[:topic] if args.key?(:topic)
  @webpush = args[:webpush] if args.key?(:webpush)
end