onesignal 1.0.0.beta1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/Gemfile.lock +74 -0
- data/LICENSE +24 -0
- data/README.md +77 -23
- data/RELEASE_INSTRUCTIONS.md +11 -0
- data/docs/App.md +9 -1
- data/docs/BasicNotification.md +230 -0
- data/docs/BasicNotificationAllOf.md +202 -0
- data/docs/{NotificationAllOfAndroidBackgroundLayout.md → BasicNotificationAllOfAndroidBackgroundLayout.md} +2 -2
- data/docs/BeginLiveActivityRequest.md +20 -0
- data/docs/CancelNotificationSuccessResponse.md +18 -0
- data/docs/CreateNotificationSuccessResponse.md +24 -0
- data/docs/{InlineResponse2004.md → CreatePlayerSuccessResponse.md} +2 -2
- data/docs/{InlineResponse409.md → CreateSegmentConflictResponse.md} +2 -2
- data/docs/CreateSegmentSuccessResponse.md +20 -0
- data/docs/CreateSubscriptionRequestBody.md +20 -0
- data/docs/CreateUserConflictResponse.md +18 -0
- data/docs/CreateUserConflictResponseErrorsInner.md +22 -0
- data/docs/CreateUserConflictResponseErrorsItemsMeta.md +18 -0
- data/docs/DefaultApi.md +1629 -304
- data/docs/DeletePlayerNotFoundResponse.md +18 -0
- data/docs/{InlineResponse2001.md → DeletePlayerSuccessResponse.md} +3 -3
- data/docs/DeleteSegmentNotFoundResponse.md +18 -0
- data/docs/DeleteSegmentSuccessResponse.md +18 -0
- data/docs/DeliveryData.md +5 -5
- data/docs/{InlineResponse2005.md → ExportEventsSuccessResponse.md} +2 -2
- data/docs/ExportPlayersRequestBody.md +2 -2
- data/docs/ExportPlayersSuccessResponse.md +18 -0
- data/docs/Filter.md +1 -1
- data/docs/FilterExpressions.md +1 -1
- data/docs/GenericError.md +18 -0
- data/docs/GenericErrorErrorsInner.md +20 -0
- data/docs/InlineResponse200.md +2 -8
- data/docs/InlineResponse2003.md +2 -2
- data/docs/InlineResponse201.md +2 -4
- data/docs/InlineResponse202.md +18 -0
- data/docs/InvalidIdentifierError.md +20 -0
- data/docs/Notification.md +33 -41
- data/docs/Notification200Errors.md +49 -0
- data/docs/NotificationAllOf.md +2 -176
- data/docs/{InlineResponse2002.md → NotificationHistorySuccessResponse.md} +3 -3
- data/docs/NotificationSlice.md +1 -1
- data/docs/NotificationTarget.md +6 -26
- data/docs/NotificationWithMeta.md +252 -0
- data/docs/NotificationWithMetaAllOf.md +38 -0
- data/docs/OutcomesData.md +18 -0
- data/docs/PlatformDeliveryData.md +5 -1
- data/docs/PlatformDeliveryDataEmailAllOf.md +30 -0
- data/docs/PlatformDeliveryDataSmsAllOf.md +22 -0
- data/docs/Player.md +3 -3
- data/docs/PlayerNotificationTarget.md +6 -2
- data/docs/PlayerNotificationTargetIncludeAliases.md +18 -0
- data/docs/PropertiesDeltas.md +22 -0
- data/docs/PropertiesObject.md +38 -0
- data/docs/Purchase.md +4 -2
- data/docs/RateLimiterError.md +18 -0
- data/docs/StringMap.md +1 -1
- data/docs/SubscriptionObject.md +50 -0
- data/docs/TransferSubscriptionRequestBody.md +18 -0
- data/docs/UpdateLiveActivityRequest.md +24 -0
- data/docs/UpdateLiveActivitySuccessResponse.md +20 -0
- data/docs/UpdatePlayerSuccessResponse.md +18 -0
- data/docs/UpdatePlayerTagsSuccessResponse.md +18 -0
- data/docs/UpdateSubscriptionRequestBody.md +18 -0
- data/docs/UpdateUserRequest.md +22 -0
- data/docs/User.md +24 -0
- data/docs/UserIdentityRequestBody.md +18 -0
- data/docs/UserIdentityResponse.md +18 -0
- data/docs/UserSubscriptionOptions.md +18 -0
- data/lib/onesignal/api/default_api.rb +1657 -268
- data/lib/onesignal/api_client.rb +9 -7
- data/lib/onesignal/api_error.rb +2 -2
- data/lib/onesignal/configuration.rb +11 -8
- data/lib/onesignal/models/app.rb +59 -8
- data/lib/onesignal/models/basic_notification.rb +1442 -0
- data/lib/onesignal/models/basic_notification_all_of.rb +1252 -0
- data/lib/onesignal/models/{notification_all_of_android_background_layout.rb → basic_notification_all_of_android_background_layout.rb} +6 -5
- data/lib/onesignal/models/begin_live_activity_request.rb +238 -0
- data/lib/onesignal/models/button.rb +3 -2
- data/lib/onesignal/models/cancel_notification_success_response.rb +219 -0
- data/lib/onesignal/models/create_notification_success_response.rb +248 -0
- data/lib/onesignal/models/{inline_response2004.rb → create_player_success_response.rb} +6 -5
- data/lib/onesignal/models/{inline_response409.rb → create_segment_conflict_response.rb} +6 -5
- data/lib/onesignal/models/create_segment_success_response.rb +229 -0
- data/lib/onesignal/models/create_subscription_request_body.rb +228 -0
- data/lib/onesignal/models/{inline_response4001.rb → create_user_conflict_response.rb} +8 -16
- data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +237 -0
- data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +219 -0
- data/lib/onesignal/models/delete_player_not_found_response.rb +219 -0
- data/lib/onesignal/models/{inline_response2001.rb → delete_player_success_response.rb} +7 -6
- data/lib/onesignal/models/delete_segment_not_found_response.rb +219 -0
- data/lib/onesignal/models/delete_segment_success_response.rb +219 -0
- data/lib/onesignal/models/delivery_data.rb +13 -2
- data/lib/onesignal/models/{inline_response2005.rb → export_events_success_response.rb} +6 -5
- data/lib/onesignal/models/export_players_request_body.rb +5 -4
- data/lib/onesignal/models/export_players_success_response.rb +219 -0
- data/lib/onesignal/models/filter.rb +4 -3
- data/lib/onesignal/models/filter_expressions.rb +4 -3
- data/lib/onesignal/models/{inline_response400.rb → generic_error.rb} +7 -6
- data/lib/onesignal/models/generic_error_errors_inner.rb +228 -0
- data/lib/onesignal/models/get_notification_request_body.rb +3 -2
- data/lib/onesignal/models/inline_response200.rb +12 -47
- data/lib/onesignal/models/inline_response2003.rb +12 -9
- data/lib/onesignal/models/inline_response201.rb +10 -19
- data/lib/onesignal/models/{inline_response4002.rb → inline_response202.rb} +13 -14
- data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
- data/lib/onesignal/models/notification.rb +209 -157
- data/lib/onesignal/models/notification200_errors.rb +105 -0
- data/lib/onesignal/models/notification_all_of.rb +8 -911
- data/lib/onesignal/models/{inline_response2002.rb → notification_history_success_response.rb} +7 -6
- data/lib/onesignal/models/notification_slice.rb +4 -3
- data/lib/onesignal/models/notification_target.rb +63 -128
- data/lib/onesignal/models/notification_with_meta.rb +1557 -0
- data/lib/onesignal/models/notification_with_meta_all_of.rb +323 -0
- data/lib/onesignal/models/operator.rb +3 -2
- data/lib/onesignal/models/outcome_data.rb +3 -2
- data/lib/onesignal/models/outcomes_data.rb +221 -0
- data/lib/onesignal/models/platform_delivery_data.rb +27 -6
- data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +287 -0
- data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +243 -0
- data/lib/onesignal/models/player.rb +14 -13
- data/lib/onesignal/models/player_notification_target.rb +63 -7
- data/lib/onesignal/models/player_notification_target_include_aliases.rb +221 -0
- data/lib/onesignal/models/player_slice.rb +3 -2
- data/lib/onesignal/models/properties_deltas.rb +239 -0
- data/lib/onesignal/models/properties_object.rb +313 -0
- data/lib/onesignal/models/purchase.rb +17 -7
- data/lib/onesignal/models/rate_limiter_error.rb +221 -0
- data/lib/onesignal/models/segment.rb +3 -2
- data/lib/onesignal/models/segment_notification_target.rb +3 -2
- data/lib/onesignal/models/string_map.rb +3 -7
- data/lib/onesignal/models/{filter_notification_target.rb → subscription_object.rb} +147 -79
- data/lib/onesignal/models/transfer_subscription_request_body.rb +221 -0
- data/lib/onesignal/models/update_live_activity_request.rb +309 -0
- data/lib/onesignal/models/update_live_activity_success_response.rb +228 -0
- data/lib/onesignal/models/update_player_success_response.rb +219 -0
- data/lib/onesignal/models/update_player_tags_request_body.rb +3 -2
- data/lib/onesignal/models/update_player_tags_success_response.rb +219 -0
- data/lib/onesignal/models/update_subscription_request_body.rb +219 -0
- data/lib/onesignal/models/update_user_request.rb +239 -0
- data/lib/onesignal/models/user.rb +250 -0
- data/lib/onesignal/models/user_identity_request_body.rb +221 -0
- data/lib/onesignal/models/user_identity_response.rb +221 -0
- data/lib/onesignal/models/user_subscription_options.rb +219 -0
- data/lib/onesignal/version.rb +3 -3
- data/lib/onesignal.rb +111 -0
- data/onesignal.gemspec +5 -4
- data/spec/api/default_api_spec.rb +263 -26
- data/spec/api_client_spec.rb +4 -4
- data/spec/configuration_spec.rb +5 -5
- data/spec/models/app_spec.rb +26 -2
- data/spec/models/{notification_all_of_android_background_layout_spec.rb → basic_notification_all_of_android_background_layout_spec.rb} +8 -8
- data/spec/models/basic_notification_all_of_spec.rb +590 -0
- data/spec/models/basic_notification_spec.rb +678 -0
- data/spec/models/begin_live_activity_request_spec.rb +40 -0
- data/spec/models/button_spec.rb +2 -2
- data/spec/models/cancel_notification_success_response_spec.rb +34 -0
- data/spec/models/create_notification_success_response_spec.rb +52 -0
- data/spec/models/{inline_response2004_spec.rb → create_player_success_response_spec.rb} +8 -8
- data/spec/models/{inline_response4001_spec.rb → create_segment_conflict_response_spec.rb} +8 -8
- data/spec/models/{inline_response409_spec.rb → create_segment_success_response_spec.rb} +9 -9
- data/spec/models/create_subscription_request_body_spec.rb +40 -0
- data/spec/models/create_user_conflict_response_errors_inner_spec.rb +46 -0
- data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +34 -0
- data/spec/models/create_user_conflict_response_spec.rb +34 -0
- data/spec/models/delete_player_not_found_response_spec.rb +34 -0
- data/spec/models/{inline_response2001_spec.rb → delete_player_success_response_spec.rb} +8 -8
- data/spec/models/delete_segment_not_found_response_spec.rb +34 -0
- data/spec/models/delete_segment_success_response_spec.rb +34 -0
- data/spec/models/delivery_data_spec.rb +2 -2
- data/spec/models/{inline_response2005_spec.rb → export_events_success_response_spec.rb} +8 -8
- data/spec/models/export_players_request_body_spec.rb +2 -2
- data/spec/models/export_players_success_response_spec.rb +34 -0
- data/spec/models/filter_expressions_spec.rb +2 -2
- data/spec/models/filter_spec.rb +2 -2
- data/spec/models/generic_error_errors_inner_spec.rb +40 -0
- data/spec/models/{inline_response4002_spec.rb → generic_error_spec.rb} +9 -9
- data/spec/models/get_notification_request_body_spec.rb +2 -2
- data/spec/models/inline_response2003_spec.rb +3 -3
- data/spec/models/inline_response200_spec.rb +3 -21
- data/spec/models/inline_response201_spec.rb +3 -9
- data/spec/models/{inline_response400_spec.rb → inline_response202_spec.rb} +9 -9
- data/spec/models/invalid_identifier_error_spec.rb +40 -0
- data/spec/models/notification200_errors_spec.rb +31 -0
- data/spec/models/notification_all_of_spec.rb +2 -528
- data/spec/models/{inline_response2002_spec.rb → notification_history_success_response_spec.rb} +8 -8
- data/spec/models/notification_slice_spec.rb +2 -2
- data/spec/models/notification_spec.rb +58 -78
- data/spec/models/notification_target_spec.rb +18 -74
- data/spec/models/notification_with_meta_all_of_spec.rb +94 -0
- data/spec/models/notification_with_meta_spec.rb +744 -0
- data/spec/models/operator_spec.rb +2 -2
- data/spec/models/outcome_data_spec.rb +2 -2
- data/spec/models/outcomes_data_spec.rb +34 -0
- data/spec/models/platform_delivery_data_email_all_of_spec.rb +70 -0
- data/spec/models/platform_delivery_data_sms_all_of_spec.rb +46 -0
- data/spec/models/platform_delivery_data_spec.rb +14 -2
- data/spec/models/player_notification_target_include_aliases_spec.rb +34 -0
- data/spec/models/player_notification_target_spec.rb +18 -2
- data/spec/models/player_slice_spec.rb +2 -2
- data/spec/models/player_spec.rb +2 -2
- data/spec/models/properties_deltas_spec.rb +46 -0
- data/spec/models/{filter_notification_target_spec.rb → properties_object_spec.rb} +19 -25
- data/spec/models/purchase_spec.rb +8 -2
- data/spec/models/rate_limiter_error_spec.rb +34 -0
- data/spec/models/segment_notification_target_spec.rb +2 -2
- data/spec/models/segment_spec.rb +2 -2
- data/spec/models/string_map_spec.rb +2 -2
- data/spec/models/subscription_object_spec.rb +134 -0
- data/spec/models/transfer_subscription_request_body_spec.rb +34 -0
- data/spec/models/update_live_activity_request_spec.rb +60 -0
- data/spec/models/update_live_activity_success_response_spec.rb +40 -0
- data/spec/models/update_player_success_response_spec.rb +34 -0
- data/spec/models/update_player_tags_request_body_spec.rb +2 -2
- data/spec/models/update_player_tags_success_response_spec.rb +34 -0
- data/spec/models/update_subscription_request_body_spec.rb +34 -0
- data/spec/models/update_user_request_spec.rb +46 -0
- data/spec/models/user_identity_request_body_spec.rb +34 -0
- data/spec/models/user_identity_response_spec.rb +34 -0
- data/spec/models/user_spec.rb +52 -0
- data/spec/models/user_subscription_options_spec.rb +34 -0
- data/spec/spec_helper.rb +2 -2
- metadata +198 -51
- data/docs/FilterNotificationTarget.md +0 -40
- data/docs/InlineResponse400.md +0 -18
- data/docs/InlineResponse4001.md +0 -20
- data/docs/InlineResponse4002.md +0 -18
- data/git_push.sh +0 -58
- data/lib/OneSignal.rb +0 -75
@@ -0,0 +1,287 @@
|
|
1
|
+
=begin
|
2
|
+
#OneSignal
|
3
|
+
|
4
|
+
#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.4.0
|
7
|
+
Contact: devrel@onesignal.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OneSignal
|
17
|
+
class PlatformDeliveryDataEmailAllOf
|
18
|
+
# Number of times an email has been opened.
|
19
|
+
attr_accessor :opened
|
20
|
+
|
21
|
+
# Number of unique recipients who have opened your email.
|
22
|
+
attr_accessor :unique_opens
|
23
|
+
|
24
|
+
# Number of clicked links from your email. This can include the recipient clicking email links multiple times.
|
25
|
+
attr_accessor :clicks
|
26
|
+
|
27
|
+
# Number of unique clicks that your recipients have made on links from your email.
|
28
|
+
attr_accessor :unique_clicks
|
29
|
+
|
30
|
+
# Number of recipients who registered as a hard or soft bounce and didn't receive your email.
|
31
|
+
attr_accessor :bounced
|
32
|
+
|
33
|
+
# Number of recipients who reported this email as spam.
|
34
|
+
attr_accessor :reported_spam
|
35
|
+
|
36
|
+
# Number of recipients who opted out of your emails using the unsubscribe link in this email.
|
37
|
+
attr_accessor :unsubscribed
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'opened' => :'opened',
|
43
|
+
:'unique_opens' => :'unique_opens',
|
44
|
+
:'clicks' => :'clicks',
|
45
|
+
:'unique_clicks' => :'unique_clicks',
|
46
|
+
:'bounced' => :'bounced',
|
47
|
+
:'reported_spam' => :'reported_spam',
|
48
|
+
:'unsubscribed' => :'unsubscribed'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.openapi_types
|
59
|
+
{
|
60
|
+
:'opened' => :'Integer',
|
61
|
+
:'unique_opens' => :'Integer',
|
62
|
+
:'clicks' => :'Integer',
|
63
|
+
:'unique_clicks' => :'Integer',
|
64
|
+
:'bounced' => :'Integer',
|
65
|
+
:'reported_spam' => :'Integer',
|
66
|
+
:'unsubscribed' => :'Integer'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# List of attributes with nullable: true
|
71
|
+
def self.openapi_nullable
|
72
|
+
Set.new([
|
73
|
+
:'opened',
|
74
|
+
:'unique_opens',
|
75
|
+
:'clicks',
|
76
|
+
:'unique_clicks',
|
77
|
+
:'bounced',
|
78
|
+
:'reported_spam',
|
79
|
+
:'unsubscribed'
|
80
|
+
])
|
81
|
+
end
|
82
|
+
|
83
|
+
# Initializes the object
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
def initialize(attributes = {})
|
86
|
+
if (!attributes.is_a?(Hash))
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PlatformDeliveryDataEmailAllOf` initialize method"
|
88
|
+
end
|
89
|
+
|
90
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
91
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
92
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::PlatformDeliveryDataEmailAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
94
|
+
end
|
95
|
+
h[k.to_sym] = v
|
96
|
+
}
|
97
|
+
|
98
|
+
if attributes.key?(:'opened')
|
99
|
+
self.opened = attributes[:'opened']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'unique_opens')
|
103
|
+
self.unique_opens = attributes[:'unique_opens']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'clicks')
|
107
|
+
self.clicks = attributes[:'clicks']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'unique_clicks')
|
111
|
+
self.unique_clicks = attributes[:'unique_clicks']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'bounced')
|
115
|
+
self.bounced = attributes[:'bounced']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'reported_spam')
|
119
|
+
self.reported_spam = attributes[:'reported_spam']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'unsubscribed')
|
123
|
+
self.unsubscribed = attributes[:'unsubscribed']
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
128
|
+
# @return Array for valid properties with the reasons
|
129
|
+
def list_invalid_properties
|
130
|
+
invalid_properties = Array.new
|
131
|
+
invalid_properties
|
132
|
+
end
|
133
|
+
|
134
|
+
# Check to see if the all the properties in the model are valid
|
135
|
+
# @return true if the model is valid
|
136
|
+
def valid?
|
137
|
+
true
|
138
|
+
end
|
139
|
+
|
140
|
+
# Checks equality by comparing each attribute.
|
141
|
+
# @param [Object] Object to be compared
|
142
|
+
def ==(o)
|
143
|
+
return true if self.equal?(o)
|
144
|
+
self.class == o.class &&
|
145
|
+
opened == o.opened &&
|
146
|
+
unique_opens == o.unique_opens &&
|
147
|
+
clicks == o.clicks &&
|
148
|
+
unique_clicks == o.unique_clicks &&
|
149
|
+
bounced == o.bounced &&
|
150
|
+
reported_spam == o.reported_spam &&
|
151
|
+
unsubscribed == o.unsubscribed
|
152
|
+
end
|
153
|
+
|
154
|
+
# @see the `==` method
|
155
|
+
# @param [Object] Object to be compared
|
156
|
+
def eql?(o)
|
157
|
+
self == o
|
158
|
+
end
|
159
|
+
|
160
|
+
# Calculates hash code according to all attributes.
|
161
|
+
# @return [Integer] Hash code
|
162
|
+
def hash
|
163
|
+
[opened, unique_opens, clicks, unique_clicks, bounced, reported_spam, unsubscribed].hash
|
164
|
+
end
|
165
|
+
|
166
|
+
# Builds the object from hash
|
167
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
168
|
+
# @return [Object] Returns the model itself
|
169
|
+
def self.build_from_hash(attributes)
|
170
|
+
new.build_from_hash(attributes)
|
171
|
+
end
|
172
|
+
|
173
|
+
# Builds the object from hash
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
175
|
+
# @return [Object] Returns the model itself
|
176
|
+
def build_from_hash(attributes)
|
177
|
+
return nil unless attributes.is_a?(Hash)
|
178
|
+
attributes = attributes.transform_keys(&:to_sym)
|
179
|
+
self.class.openapi_types.each_pair do |key, type|
|
180
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
181
|
+
self.send("#{key}=", nil)
|
182
|
+
elsif type =~ /\AArray<(.*)>/i
|
183
|
+
# check to ensure the input is an array given that the attribute
|
184
|
+
# is documented as an array but the input is not
|
185
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
186
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
187
|
+
end
|
188
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
189
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
self
|
194
|
+
end
|
195
|
+
|
196
|
+
# Deserializes the data based on type
|
197
|
+
# @param string type Data type
|
198
|
+
# @param string value Value to be deserialized
|
199
|
+
# @return [Object] Deserialized data
|
200
|
+
def _deserialize(type, value)
|
201
|
+
case type.to_sym
|
202
|
+
when :Time
|
203
|
+
Time.parse(value)
|
204
|
+
when :Date
|
205
|
+
Date.parse(value)
|
206
|
+
when :String
|
207
|
+
value.to_s
|
208
|
+
when :Integer
|
209
|
+
value.to_i
|
210
|
+
when :Float
|
211
|
+
value.to_f
|
212
|
+
when :Boolean
|
213
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
214
|
+
true
|
215
|
+
else
|
216
|
+
false
|
217
|
+
end
|
218
|
+
when :Object
|
219
|
+
# generic object (usually a Hash), return directly
|
220
|
+
value
|
221
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
222
|
+
inner_type = Regexp.last_match[:inner_type]
|
223
|
+
value.map { |v| _deserialize(inner_type, v) }
|
224
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
225
|
+
k_type = Regexp.last_match[:k_type]
|
226
|
+
v_type = Regexp.last_match[:v_type]
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each do |k, v|
|
229
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
else # model
|
233
|
+
# models (e.g. Pet) or oneOf
|
234
|
+
klass = OneSignal.const_get(type)
|
235
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
# Returns the string representation of the object
|
240
|
+
# @return [String] String presentation of the object
|
241
|
+
def to_s
|
242
|
+
to_hash.to_s
|
243
|
+
end
|
244
|
+
|
245
|
+
# to_body is an alias to to_hash (backward compatibility)
|
246
|
+
# @return [Hash] Returns the object in the form of hash
|
247
|
+
def to_body
|
248
|
+
to_hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Returns the object in the form of hash
|
252
|
+
# @return [Hash] Returns the object in the form of hash
|
253
|
+
def to_hash
|
254
|
+
hash = {}
|
255
|
+
self.class.attribute_map.each_pair do |attr, param|
|
256
|
+
value = self.send(attr)
|
257
|
+
if value.nil?
|
258
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
259
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
260
|
+
end
|
261
|
+
|
262
|
+
hash[param] = _to_hash(value)
|
263
|
+
end
|
264
|
+
hash
|
265
|
+
end
|
266
|
+
|
267
|
+
# Outputs non-array value in the form of hash
|
268
|
+
# For object, use to_hash. Otherwise, just return the value
|
269
|
+
# @param [Object] value Any valid value
|
270
|
+
# @return [Hash] Returns the value in the form of hash
|
271
|
+
def _to_hash(value)
|
272
|
+
if value.is_a?(Array)
|
273
|
+
value.compact.map { |v| _to_hash(v) }
|
274
|
+
elsif value.is_a?(Hash)
|
275
|
+
{}.tap do |hash|
|
276
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
277
|
+
end
|
278
|
+
elsif value.respond_to? :to_hash
|
279
|
+
value.to_hash
|
280
|
+
else
|
281
|
+
value
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
end
|
286
|
+
|
287
|
+
end
|
@@ -0,0 +1,243 @@
|
|
1
|
+
=begin
|
2
|
+
#OneSignal
|
3
|
+
|
4
|
+
#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.4.0
|
7
|
+
Contact: devrel@onesignal.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module OneSignal
|
17
|
+
class PlatformDeliveryDataSmsAllOf
|
18
|
+
# Number of messages reported as delivered successfully by the SMS service provider.
|
19
|
+
attr_accessor :provider_successful
|
20
|
+
|
21
|
+
# Number of recipients who didn't receive your message as reported by the SMS service provider.
|
22
|
+
attr_accessor :provider_failed
|
23
|
+
|
24
|
+
# Number of errors reported by the SMS service provider.
|
25
|
+
attr_accessor :provider_errored
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'provider_successful' => :'provider_successful',
|
31
|
+
:'provider_failed' => :'provider_failed',
|
32
|
+
:'provider_errored' => :'provider_errored'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
41
|
+
# Attribute type mapping.
|
42
|
+
def self.openapi_types
|
43
|
+
{
|
44
|
+
:'provider_successful' => :'Integer',
|
45
|
+
:'provider_failed' => :'Integer',
|
46
|
+
:'provider_errored' => :'Integer'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# List of attributes with nullable: true
|
51
|
+
def self.openapi_nullable
|
52
|
+
Set.new([
|
53
|
+
:'provider_successful',
|
54
|
+
:'provider_failed',
|
55
|
+
:'provider_errored'
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PlatformDeliveryDataSmsAllOf` initialize method"
|
64
|
+
end
|
65
|
+
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::PlatformDeliveryDataSmsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
73
|
+
|
74
|
+
if attributes.key?(:'provider_successful')
|
75
|
+
self.provider_successful = attributes[:'provider_successful']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'provider_failed')
|
79
|
+
self.provider_failed = attributes[:'provider_failed']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'provider_errored')
|
83
|
+
self.provider_errored = attributes[:'provider_errored']
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
invalid_properties
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check to see if the all the properties in the model are valid
|
95
|
+
# @return true if the model is valid
|
96
|
+
def valid?
|
97
|
+
true
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def ==(o)
|
103
|
+
return true if self.equal?(o)
|
104
|
+
self.class == o.class &&
|
105
|
+
provider_successful == o.provider_successful &&
|
106
|
+
provider_failed == o.provider_failed &&
|
107
|
+
provider_errored == o.provider_errored
|
108
|
+
end
|
109
|
+
|
110
|
+
# @see the `==` method
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def eql?(o)
|
113
|
+
self == o
|
114
|
+
end
|
115
|
+
|
116
|
+
# Calculates hash code according to all attributes.
|
117
|
+
# @return [Integer] Hash code
|
118
|
+
def hash
|
119
|
+
[provider_successful, provider_failed, provider_errored].hash
|
120
|
+
end
|
121
|
+
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def self.build_from_hash(attributes)
|
126
|
+
new.build_from_hash(attributes)
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def build_from_hash(attributes)
|
133
|
+
return nil unless attributes.is_a?(Hash)
|
134
|
+
attributes = attributes.transform_keys(&:to_sym)
|
135
|
+
self.class.openapi_types.each_pair do |key, type|
|
136
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
137
|
+
self.send("#{key}=", nil)
|
138
|
+
elsif type =~ /\AArray<(.*)>/i
|
139
|
+
# check to ensure the input is an array given that the attribute
|
140
|
+
# is documented as an array but the input is not
|
141
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
142
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
143
|
+
end
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
self
|
150
|
+
end
|
151
|
+
|
152
|
+
# Deserializes the data based on type
|
153
|
+
# @param string type Data type
|
154
|
+
# @param string value Value to be deserialized
|
155
|
+
# @return [Object] Deserialized data
|
156
|
+
def _deserialize(type, value)
|
157
|
+
case type.to_sym
|
158
|
+
when :Time
|
159
|
+
Time.parse(value)
|
160
|
+
when :Date
|
161
|
+
Date.parse(value)
|
162
|
+
when :String
|
163
|
+
value.to_s
|
164
|
+
when :Integer
|
165
|
+
value.to_i
|
166
|
+
when :Float
|
167
|
+
value.to_f
|
168
|
+
when :Boolean
|
169
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
170
|
+
true
|
171
|
+
else
|
172
|
+
false
|
173
|
+
end
|
174
|
+
when :Object
|
175
|
+
# generic object (usually a Hash), return directly
|
176
|
+
value
|
177
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
178
|
+
inner_type = Regexp.last_match[:inner_type]
|
179
|
+
value.map { |v| _deserialize(inner_type, v) }
|
180
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
181
|
+
k_type = Regexp.last_match[:k_type]
|
182
|
+
v_type = Regexp.last_match[:v_type]
|
183
|
+
{}.tap do |hash|
|
184
|
+
value.each do |k, v|
|
185
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
else # model
|
189
|
+
# models (e.g. Pet) or oneOf
|
190
|
+
klass = OneSignal.const_get(type)
|
191
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the string representation of the object
|
196
|
+
# @return [String] String presentation of the object
|
197
|
+
def to_s
|
198
|
+
to_hash.to_s
|
199
|
+
end
|
200
|
+
|
201
|
+
# to_body is an alias to to_hash (backward compatibility)
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_body
|
204
|
+
to_hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the object in the form of hash
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
209
|
+
def to_hash
|
210
|
+
hash = {}
|
211
|
+
self.class.attribute_map.each_pair do |attr, param|
|
212
|
+
value = self.send(attr)
|
213
|
+
if value.nil?
|
214
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
215
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
216
|
+
end
|
217
|
+
|
218
|
+
hash[param] = _to_hash(value)
|
219
|
+
end
|
220
|
+
hash
|
221
|
+
end
|
222
|
+
|
223
|
+
# Outputs non-array value in the form of hash
|
224
|
+
# For object, use to_hash. Otherwise, just return the value
|
225
|
+
# @param [Object] value Any valid value
|
226
|
+
# @return [Hash] Returns the value in the form of hash
|
227
|
+
def _to_hash(value)
|
228
|
+
if value.is_a?(Array)
|
229
|
+
value.compact.map { |v| _to_hash(v) }
|
230
|
+
elsif value.is_a?(Hash)
|
231
|
+
{}.tap do |hash|
|
232
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
233
|
+
end
|
234
|
+
elsif value.respond_to? :to_hash
|
235
|
+
value.to_hash
|
236
|
+
else
|
237
|
+
value
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 1.
|
6
|
+
The version of the OpenAPI document: 1.4.0
|
7
7
|
Contact: devrel@onesignal.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.0.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -153,7 +153,7 @@ module OneSignal
|
|
153
153
|
:'sdk' => :'String',
|
154
154
|
:'session_count' => :'Integer',
|
155
155
|
:'tags' => :'Object',
|
156
|
-
:'amount_spent' => :'
|
156
|
+
:'amount_spent' => :'Float',
|
157
157
|
:'created_at' => :'Integer',
|
158
158
|
:'playtime' => :'Integer',
|
159
159
|
:'badge_count' => :'Integer',
|
@@ -169,6 +169,16 @@ module OneSignal
|
|
169
169
|
# List of attributes with nullable: true
|
170
170
|
def self.openapi_nullable
|
171
171
|
Set.new([
|
172
|
+
:'external_user_id',
|
173
|
+
:'identifier',
|
174
|
+
:'timezone',
|
175
|
+
:'game_version',
|
176
|
+
:'device_model',
|
177
|
+
:'device_os',
|
178
|
+
:'ad_id',
|
179
|
+
:'sdk',
|
180
|
+
:'tags',
|
181
|
+
:'test_type',
|
172
182
|
])
|
173
183
|
end
|
174
184
|
|
@@ -300,14 +310,6 @@ module OneSignal
|
|
300
310
|
# @return Array for valid properties with the reasons
|
301
311
|
def list_invalid_properties
|
302
312
|
invalid_properties = Array.new
|
303
|
-
if @id.nil?
|
304
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
305
|
-
end
|
306
|
-
|
307
|
-
if @app_id.nil?
|
308
|
-
invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
|
309
|
-
end
|
310
|
-
|
311
313
|
if @device_type.nil?
|
312
314
|
invalid_properties.push('invalid value for "device_type", device_type cannot be nil.')
|
313
315
|
end
|
@@ -318,8 +320,6 @@ module OneSignal
|
|
318
320
|
# Check to see if the all the properties in the model are valid
|
319
321
|
# @return true if the model is valid
|
320
322
|
def valid?
|
321
|
-
return false if @id.nil?
|
322
|
-
return false if @app_id.nil?
|
323
323
|
return false if @device_type.nil?
|
324
324
|
true
|
325
325
|
end
|
@@ -382,6 +382,7 @@ module OneSignal
|
|
382
382
|
# @return [Object] Returns the model itself
|
383
383
|
def build_from_hash(attributes)
|
384
384
|
return nil unless attributes.is_a?(Hash)
|
385
|
+
attributes = attributes.transform_keys(&:to_sym)
|
385
386
|
self.class.openapi_types.each_pair do |key, type|
|
386
387
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
387
388
|
self.send("#{key}=", nil)
|