2019-05-17 00:37:21 +00:00
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
require 'date'
|
|
|
|
require 'google/apis/core/base_service'
|
|
|
|
require 'google/apis/core/json_representation'
|
|
|
|
require 'google/apis/core/hashable'
|
|
|
|
require 'google/apis/errors'
|
|
|
|
|
|
|
|
module Google
|
|
|
|
module Apis
|
|
|
|
module FcmV1
|
|
|
|
|
|
|
|
class AndroidConfig
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
2019-06-06 00:40:37 +00:00
|
|
|
class AndroidFcmOptions
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
2019-05-17 00:37:21 +00:00
|
|
|
class AndroidNotification
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
|
|
|
class ApnsConfig
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
2019-05-25 00:38:22 +00:00
|
|
|
class ApnsFcmOptions
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
2019-08-21 00:37:59 +00:00
|
|
|
class Color
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
2019-06-06 00:40:37 +00:00
|
|
|
class FcmOptions
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
2019-08-21 00:37:59 +00:00
|
|
|
class LightSettings
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
2019-05-17 00:37:21 +00:00
|
|
|
class Message
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
|
|
|
class Notification
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
|
|
|
class SendMessageRequest
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
|
|
|
class WebpushConfig
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
|
|
|
class WebpushFcmOptions
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
|
|
|
|
|
|
include Google::Apis::Core::JsonObjectSupport
|
|
|
|
end
|
|
|
|
|
|
|
|
class AndroidConfig
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :collapse_key, as: 'collapseKey'
|
|
|
|
hash :data, as: 'data'
|
2019-11-21 00:37:03 +00:00
|
|
|
property :direct_boot_ok, as: 'directBootOk'
|
2019-06-06 00:40:37 +00:00
|
|
|
property :fcm_options, as: 'fcmOptions', class: Google::Apis::FcmV1::AndroidFcmOptions, decorator: Google::Apis::FcmV1::AndroidFcmOptions::Representation
|
|
|
|
|
2019-05-17 00:37:21 +00:00
|
|
|
property :notification, as: 'notification', class: Google::Apis::FcmV1::AndroidNotification, decorator: Google::Apis::FcmV1::AndroidNotification::Representation
|
|
|
|
|
|
|
|
property :priority, as: 'priority'
|
|
|
|
property :restricted_package_name, as: 'restrictedPackageName'
|
|
|
|
property :ttl, as: 'ttl'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-06-06 00:40:37 +00:00
|
|
|
class AndroidFcmOptions
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :analytics_label, as: 'analyticsLabel'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-05-17 00:37:21 +00:00
|
|
|
class AndroidNotification
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :body, as: 'body'
|
|
|
|
collection :body_loc_args, as: 'bodyLocArgs'
|
|
|
|
property :body_loc_key, as: 'bodyLocKey'
|
|
|
|
property :channel_id, as: 'channelId'
|
|
|
|
property :click_action, as: 'clickAction'
|
|
|
|
property :color, as: 'color'
|
2019-08-21 00:37:59 +00:00
|
|
|
property :default_light_settings, as: 'defaultLightSettings'
|
|
|
|
property :default_sound, as: 'defaultSound'
|
|
|
|
property :default_vibrate_timings, as: 'defaultVibrateTimings'
|
|
|
|
property :event_time, as: 'eventTime'
|
2019-05-17 00:37:21 +00:00
|
|
|
property :icon, as: 'icon'
|
2019-07-12 00:38:14 +00:00
|
|
|
property :image, as: 'image'
|
2019-08-21 00:37:59 +00:00
|
|
|
property :light_settings, as: 'lightSettings', class: Google::Apis::FcmV1::LightSettings, decorator: Google::Apis::FcmV1::LightSettings::Representation
|
|
|
|
|
|
|
|
property :local_only, as: 'localOnly'
|
|
|
|
property :notification_count, as: 'notificationCount'
|
|
|
|
property :notification_priority, as: 'notificationPriority'
|
2019-05-17 00:37:21 +00:00
|
|
|
property :sound, as: 'sound'
|
2019-08-21 00:37:59 +00:00
|
|
|
property :sticky, as: 'sticky'
|
2019-05-17 00:37:21 +00:00
|
|
|
property :tag, as: 'tag'
|
2019-08-21 00:37:59 +00:00
|
|
|
property :ticker, as: 'ticker'
|
2019-05-17 00:37:21 +00:00
|
|
|
property :title, as: 'title'
|
|
|
|
collection :title_loc_args, as: 'titleLocArgs'
|
|
|
|
property :title_loc_key, as: 'titleLocKey'
|
2019-08-21 00:37:59 +00:00
|
|
|
collection :vibrate_timings, as: 'vibrateTimings'
|
|
|
|
property :visibility, as: 'visibility'
|
2019-05-17 00:37:21 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class ApnsConfig
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
2019-05-25 00:38:22 +00:00
|
|
|
property :fcm_options, as: 'fcmOptions', class: Google::Apis::FcmV1::ApnsFcmOptions, decorator: Google::Apis::FcmV1::ApnsFcmOptions::Representation
|
|
|
|
|
2019-05-17 00:37:21 +00:00
|
|
|
hash :headers, as: 'headers'
|
|
|
|
hash :payload, as: 'payload'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-05-25 00:38:22 +00:00
|
|
|
class ApnsFcmOptions
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
2019-06-06 00:40:37 +00:00
|
|
|
property :analytics_label, as: 'analyticsLabel'
|
2019-07-12 00:38:14 +00:00
|
|
|
property :image, as: 'image'
|
2019-06-06 00:40:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-08-21 00:37:59 +00:00
|
|
|
class Color
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :alpha, as: 'alpha'
|
|
|
|
property :blue, as: 'blue'
|
|
|
|
property :green, as: 'green'
|
|
|
|
property :red, as: 'red'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-06-06 00:40:37 +00:00
|
|
|
class FcmOptions
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :analytics_label, as: 'analyticsLabel'
|
2019-05-25 00:38:22 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-08-21 00:37:59 +00:00
|
|
|
class LightSettings
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :color, as: 'color', class: Google::Apis::FcmV1::Color, decorator: Google::Apis::FcmV1::Color::Representation
|
|
|
|
|
|
|
|
property :light_off_duration, as: 'lightOffDuration'
|
|
|
|
property :light_on_duration, as: 'lightOnDuration'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-05-17 00:37:21 +00:00
|
|
|
class Message
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :android, as: 'android', class: Google::Apis::FcmV1::AndroidConfig, decorator: Google::Apis::FcmV1::AndroidConfig::Representation
|
|
|
|
|
|
|
|
property :apns, as: 'apns', class: Google::Apis::FcmV1::ApnsConfig, decorator: Google::Apis::FcmV1::ApnsConfig::Representation
|
|
|
|
|
|
|
|
property :condition, as: 'condition'
|
|
|
|
hash :data, as: 'data'
|
2019-06-06 00:40:37 +00:00
|
|
|
property :fcm_options, as: 'fcmOptions', class: Google::Apis::FcmV1::FcmOptions, decorator: Google::Apis::FcmV1::FcmOptions::Representation
|
|
|
|
|
2019-05-17 00:37:21 +00:00
|
|
|
property :name, as: 'name'
|
|
|
|
property :notification, as: 'notification', class: Google::Apis::FcmV1::Notification, decorator: Google::Apis::FcmV1::Notification::Representation
|
|
|
|
|
|
|
|
property :token, as: 'token'
|
|
|
|
property :topic, as: 'topic'
|
|
|
|
property :webpush, as: 'webpush', class: Google::Apis::FcmV1::WebpushConfig, decorator: Google::Apis::FcmV1::WebpushConfig::Representation
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Notification
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :body, as: 'body'
|
2019-07-12 00:38:14 +00:00
|
|
|
property :image, as: 'image'
|
2019-05-17 00:37:21 +00:00
|
|
|
property :title, as: 'title'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class SendMessageRequest
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
property :message, as: 'message', class: Google::Apis::FcmV1::Message, decorator: Google::Apis::FcmV1::Message::Representation
|
|
|
|
|
|
|
|
property :validate_only, as: 'validateOnly'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class WebpushConfig
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
|
|
hash :data, as: 'data'
|
|
|
|
property :fcm_options, as: 'fcmOptions', class: Google::Apis::FcmV1::WebpushFcmOptions, decorator: Google::Apis::FcmV1::WebpushFcmOptions::Representation
|
|
|
|
|
|
|
|
hash :headers, as: 'headers'
|
|
|
|
hash :notification, as: 'notification'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class WebpushFcmOptions
|
|
|
|
# @private
|
|
|
|
class Representation < Google::Apis::Core::JsonRepresentation
|
2019-11-13 00:37:45 +00:00
|
|
|
property :analytics_label, as: 'analyticsLabel'
|
2019-05-17 00:37:21 +00:00
|
|
|
property :link, as: 'link'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|