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,323 @@
|
|
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 NotificationWithMetaAllOf
|
18
|
+
# Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set.
|
19
|
+
attr_accessor :remaining
|
20
|
+
|
21
|
+
# Number of notifications that were successfully delivered.
|
22
|
+
attr_accessor :successful
|
23
|
+
|
24
|
+
# Number of notifications that could not be delivered due to those devices being unsubscribed.
|
25
|
+
attr_accessor :failed
|
26
|
+
|
27
|
+
# Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard.
|
28
|
+
attr_accessor :errored
|
29
|
+
|
30
|
+
# Number of users who have clicked / tapped on your notification.
|
31
|
+
attr_accessor :converted
|
32
|
+
|
33
|
+
# Unix timestamp indicating when the notification was created.
|
34
|
+
attr_accessor :queued_at
|
35
|
+
|
36
|
+
# Unix timestamp indicating when notification delivery should begin.
|
37
|
+
attr_accessor :send_after
|
38
|
+
|
39
|
+
# Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after.
|
40
|
+
attr_accessor :completed_at
|
41
|
+
|
42
|
+
attr_accessor :platform_delivery_stats
|
43
|
+
|
44
|
+
# Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0.
|
45
|
+
attr_accessor :received
|
46
|
+
|
47
|
+
# number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details.
|
48
|
+
attr_accessor :throttle_rate_per_minute
|
49
|
+
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
51
|
+
def self.attribute_map
|
52
|
+
{
|
53
|
+
:'remaining' => :'remaining',
|
54
|
+
:'successful' => :'successful',
|
55
|
+
:'failed' => :'failed',
|
56
|
+
:'errored' => :'errored',
|
57
|
+
:'converted' => :'converted',
|
58
|
+
:'queued_at' => :'queued_at',
|
59
|
+
:'send_after' => :'send_after',
|
60
|
+
:'completed_at' => :'completed_at',
|
61
|
+
:'platform_delivery_stats' => :'platform_delivery_stats',
|
62
|
+
:'received' => :'received',
|
63
|
+
:'throttle_rate_per_minute' => :'throttle_rate_per_minute'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Returns all the JSON keys this model knows about
|
68
|
+
def self.acceptable_attributes
|
69
|
+
attribute_map.values
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.openapi_types
|
74
|
+
{
|
75
|
+
:'remaining' => :'Integer',
|
76
|
+
:'successful' => :'Integer',
|
77
|
+
:'failed' => :'Integer',
|
78
|
+
:'errored' => :'Integer',
|
79
|
+
:'converted' => :'Integer',
|
80
|
+
:'queued_at' => :'Integer',
|
81
|
+
:'send_after' => :'Integer',
|
82
|
+
:'completed_at' => :'Integer',
|
83
|
+
:'platform_delivery_stats' => :'PlatformDeliveryData',
|
84
|
+
:'received' => :'Integer',
|
85
|
+
:'throttle_rate_per_minute' => :'Integer'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# List of attributes with nullable: true
|
90
|
+
def self.openapi_nullable
|
91
|
+
Set.new([
|
92
|
+
:'send_after',
|
93
|
+
:'completed_at',
|
94
|
+
:'received',
|
95
|
+
:'throttle_rate_per_minute'
|
96
|
+
])
|
97
|
+
end
|
98
|
+
|
99
|
+
# Initializes the object
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
def initialize(attributes = {})
|
102
|
+
if (!attributes.is_a?(Hash))
|
103
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::NotificationWithMetaAllOf` initialize method"
|
104
|
+
end
|
105
|
+
|
106
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
108
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::NotificationWithMetaAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
110
|
+
end
|
111
|
+
h[k.to_sym] = v
|
112
|
+
}
|
113
|
+
|
114
|
+
if attributes.key?(:'remaining')
|
115
|
+
self.remaining = attributes[:'remaining']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'successful')
|
119
|
+
self.successful = attributes[:'successful']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'failed')
|
123
|
+
self.failed = attributes[:'failed']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'errored')
|
127
|
+
self.errored = attributes[:'errored']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'converted')
|
131
|
+
self.converted = attributes[:'converted']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'queued_at')
|
135
|
+
self.queued_at = attributes[:'queued_at']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'send_after')
|
139
|
+
self.send_after = attributes[:'send_after']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'completed_at')
|
143
|
+
self.completed_at = attributes[:'completed_at']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:'platform_delivery_stats')
|
147
|
+
self.platform_delivery_stats = attributes[:'platform_delivery_stats']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.key?(:'received')
|
151
|
+
self.received = attributes[:'received']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'throttle_rate_per_minute')
|
155
|
+
self.throttle_rate_per_minute = attributes[:'throttle_rate_per_minute']
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
160
|
+
# @return Array for valid properties with the reasons
|
161
|
+
def list_invalid_properties
|
162
|
+
invalid_properties = Array.new
|
163
|
+
invalid_properties
|
164
|
+
end
|
165
|
+
|
166
|
+
# Check to see if the all the properties in the model are valid
|
167
|
+
# @return true if the model is valid
|
168
|
+
def valid?
|
169
|
+
true
|
170
|
+
end
|
171
|
+
|
172
|
+
# Checks equality by comparing each attribute.
|
173
|
+
# @param [Object] Object to be compared
|
174
|
+
def ==(o)
|
175
|
+
return true if self.equal?(o)
|
176
|
+
self.class == o.class &&
|
177
|
+
remaining == o.remaining &&
|
178
|
+
successful == o.successful &&
|
179
|
+
failed == o.failed &&
|
180
|
+
errored == o.errored &&
|
181
|
+
converted == o.converted &&
|
182
|
+
queued_at == o.queued_at &&
|
183
|
+
send_after == o.send_after &&
|
184
|
+
completed_at == o.completed_at &&
|
185
|
+
platform_delivery_stats == o.platform_delivery_stats &&
|
186
|
+
received == o.received &&
|
187
|
+
throttle_rate_per_minute == o.throttle_rate_per_minute
|
188
|
+
end
|
189
|
+
|
190
|
+
# @see the `==` method
|
191
|
+
# @param [Object] Object to be compared
|
192
|
+
def eql?(o)
|
193
|
+
self == o
|
194
|
+
end
|
195
|
+
|
196
|
+
# Calculates hash code according to all attributes.
|
197
|
+
# @return [Integer] Hash code
|
198
|
+
def hash
|
199
|
+
[remaining, successful, failed, errored, converted, queued_at, send_after, completed_at, platform_delivery_stats, received, throttle_rate_per_minute].hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Builds the object from hash
|
203
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
204
|
+
# @return [Object] Returns the model itself
|
205
|
+
def self.build_from_hash(attributes)
|
206
|
+
new.build_from_hash(attributes)
|
207
|
+
end
|
208
|
+
|
209
|
+
# Builds the object from hash
|
210
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
211
|
+
# @return [Object] Returns the model itself
|
212
|
+
def build_from_hash(attributes)
|
213
|
+
return nil unless attributes.is_a?(Hash)
|
214
|
+
attributes = attributes.transform_keys(&:to_sym)
|
215
|
+
self.class.openapi_types.each_pair do |key, type|
|
216
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
217
|
+
self.send("#{key}=", nil)
|
218
|
+
elsif type =~ /\AArray<(.*)>/i
|
219
|
+
# check to ensure the input is an array given that the attribute
|
220
|
+
# is documented as an array but the input is not
|
221
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
222
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
223
|
+
end
|
224
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
225
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
self
|
230
|
+
end
|
231
|
+
|
232
|
+
# Deserializes the data based on type
|
233
|
+
# @param string type Data type
|
234
|
+
# @param string value Value to be deserialized
|
235
|
+
# @return [Object] Deserialized data
|
236
|
+
def _deserialize(type, value)
|
237
|
+
case type.to_sym
|
238
|
+
when :Time
|
239
|
+
Time.parse(value)
|
240
|
+
when :Date
|
241
|
+
Date.parse(value)
|
242
|
+
when :String
|
243
|
+
value.to_s
|
244
|
+
when :Integer
|
245
|
+
value.to_i
|
246
|
+
when :Float
|
247
|
+
value.to_f
|
248
|
+
when :Boolean
|
249
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
250
|
+
true
|
251
|
+
else
|
252
|
+
false
|
253
|
+
end
|
254
|
+
when :Object
|
255
|
+
# generic object (usually a Hash), return directly
|
256
|
+
value
|
257
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
258
|
+
inner_type = Regexp.last_match[:inner_type]
|
259
|
+
value.map { |v| _deserialize(inner_type, v) }
|
260
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
261
|
+
k_type = Regexp.last_match[:k_type]
|
262
|
+
v_type = Regexp.last_match[:v_type]
|
263
|
+
{}.tap do |hash|
|
264
|
+
value.each do |k, v|
|
265
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
else # model
|
269
|
+
# models (e.g. Pet) or oneOf
|
270
|
+
klass = OneSignal.const_get(type)
|
271
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
# Returns the string representation of the object
|
276
|
+
# @return [String] String presentation of the object
|
277
|
+
def to_s
|
278
|
+
to_hash.to_s
|
279
|
+
end
|
280
|
+
|
281
|
+
# to_body is an alias to to_hash (backward compatibility)
|
282
|
+
# @return [Hash] Returns the object in the form of hash
|
283
|
+
def to_body
|
284
|
+
to_hash
|
285
|
+
end
|
286
|
+
|
287
|
+
# Returns the object in the form of hash
|
288
|
+
# @return [Hash] Returns the object in the form of hash
|
289
|
+
def to_hash
|
290
|
+
hash = {}
|
291
|
+
self.class.attribute_map.each_pair do |attr, param|
|
292
|
+
value = self.send(attr)
|
293
|
+
if value.nil?
|
294
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
295
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
296
|
+
end
|
297
|
+
|
298
|
+
hash[param] = _to_hash(value)
|
299
|
+
end
|
300
|
+
hash
|
301
|
+
end
|
302
|
+
|
303
|
+
# Outputs non-array value in the form of hash
|
304
|
+
# For object, use to_hash. Otherwise, just return the value
|
305
|
+
# @param [Object] value Any valid value
|
306
|
+
# @return [Hash] Returns the value in the form of hash
|
307
|
+
def _to_hash(value)
|
308
|
+
if value.is_a?(Array)
|
309
|
+
value.compact.map { |v| _to_hash(v) }
|
310
|
+
elsif value.is_a?(Hash)
|
311
|
+
{}.tap do |hash|
|
312
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
313
|
+
end
|
314
|
+
elsif value.respond_to? :to_hash
|
315
|
+
value.to_hash
|
316
|
+
else
|
317
|
+
value
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
end
|
322
|
+
|
323
|
+
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
|
|
@@ -142,6 +142,7 @@ module OneSignal
|
|
142
142
|
# @return [Object] Returns the model itself
|
143
143
|
def build_from_hash(attributes)
|
144
144
|
return nil unless attributes.is_a?(Hash)
|
145
|
+
attributes = attributes.transform_keys(&:to_sym)
|
145
146
|
self.class.openapi_types.each_pair do |key, type|
|
146
147
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
147
148
|
self.send("#{key}=", nil)
|
@@ -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
|
|
@@ -174,6 +174,7 @@ module OneSignal
|
|
174
174
|
# @return [Object] Returns the model itself
|
175
175
|
def build_from_hash(attributes)
|
176
176
|
return nil unless attributes.is_a?(Hash)
|
177
|
+
attributes = attributes.transform_keys(&:to_sym)
|
177
178
|
self.class.openapi_types.each_pair do |key, type|
|
178
179
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
179
180
|
self.send("#{key}=", nil)
|
@@ -0,0 +1,221 @@
|
|
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 OutcomesData
|
18
|
+
attr_accessor :outcomes
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'outcomes' => :'outcomes'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'outcomes' => :'Array<OutcomeData>'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::OutcomesData` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::OutcomesData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'outcomes')
|
61
|
+
if (value = attributes[:'outcomes']).is_a?(Array)
|
62
|
+
self.outcomes = value
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
68
|
+
# @return Array for valid properties with the reasons
|
69
|
+
def list_invalid_properties
|
70
|
+
invalid_properties = Array.new
|
71
|
+
invalid_properties
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check to see if the all the properties in the model are valid
|
75
|
+
# @return true if the model is valid
|
76
|
+
def valid?
|
77
|
+
true
|
78
|
+
end
|
79
|
+
|
80
|
+
# Checks equality by comparing each attribute.
|
81
|
+
# @param [Object] Object to be compared
|
82
|
+
def ==(o)
|
83
|
+
return true if self.equal?(o)
|
84
|
+
self.class == o.class &&
|
85
|
+
outcomes == o.outcomes
|
86
|
+
end
|
87
|
+
|
88
|
+
# @see the `==` method
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def eql?(o)
|
91
|
+
self == o
|
92
|
+
end
|
93
|
+
|
94
|
+
# Calculates hash code according to all attributes.
|
95
|
+
# @return [Integer] Hash code
|
96
|
+
def hash
|
97
|
+
[outcomes].hash
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def self.build_from_hash(attributes)
|
104
|
+
new.build_from_hash(attributes)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def build_from_hash(attributes)
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
113
|
+
self.class.openapi_types.each_pair do |key, type|
|
114
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
115
|
+
self.send("#{key}=", nil)
|
116
|
+
elsif type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :Time
|
137
|
+
Time.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :Boolean
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
# models (e.g. Pet) or oneOf
|
168
|
+
klass = OneSignal.const_get(type)
|
169
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the string representation of the object
|
174
|
+
# @return [String] String presentation of the object
|
175
|
+
def to_s
|
176
|
+
to_hash.to_s
|
177
|
+
end
|
178
|
+
|
179
|
+
# to_body is an alias to to_hash (backward compatibility)
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_body
|
182
|
+
to_hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the object in the form of hash
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_hash
|
188
|
+
hash = {}
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
190
|
+
value = self.send(attr)
|
191
|
+
if value.nil?
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
+
end
|
195
|
+
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
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
|
|
@@ -28,6 +28,10 @@ module OneSignal
|
|
28
28
|
|
29
29
|
attr_accessor :ios
|
30
30
|
|
31
|
+
attr_accessor :sms
|
32
|
+
|
33
|
+
attr_accessor :email
|
34
|
+
|
31
35
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
36
|
def self.attribute_map
|
33
37
|
{
|
@@ -36,7 +40,9 @@ module OneSignal
|
|
36
40
|
:'firefox_web_push' => :'firefox_web_push',
|
37
41
|
:'safari_web_push' => :'safari_web_push',
|
38
42
|
:'android' => :'android',
|
39
|
-
:'ios' => :'ios'
|
43
|
+
:'ios' => :'ios',
|
44
|
+
:'sms' => :'sms',
|
45
|
+
:'email' => :'email'
|
40
46
|
}
|
41
47
|
end
|
42
48
|
|
@@ -53,13 +59,17 @@ module OneSignal
|
|
53
59
|
:'firefox_web_push' => :'DeliveryData',
|
54
60
|
:'safari_web_push' => :'DeliveryData',
|
55
61
|
:'android' => :'DeliveryData',
|
56
|
-
:'ios' => :'DeliveryData'
|
62
|
+
:'ios' => :'DeliveryData',
|
63
|
+
:'sms' => :'DeliveryData',
|
64
|
+
:'email' => :'DeliveryData'
|
57
65
|
}
|
58
66
|
end
|
59
67
|
|
60
68
|
# List of attributes with nullable: true
|
61
69
|
def self.openapi_nullable
|
62
70
|
Set.new([
|
71
|
+
:'sms',
|
72
|
+
:'email'
|
63
73
|
])
|
64
74
|
end
|
65
75
|
|
@@ -101,6 +111,14 @@ module OneSignal
|
|
101
111
|
if attributes.key?(:'ios')
|
102
112
|
self.ios = attributes[:'ios']
|
103
113
|
end
|
114
|
+
|
115
|
+
if attributes.key?(:'sms')
|
116
|
+
self.sms = attributes[:'sms']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'email')
|
120
|
+
self.email = attributes[:'email']
|
121
|
+
end
|
104
122
|
end
|
105
123
|
|
106
124
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -126,7 +144,9 @@ module OneSignal
|
|
126
144
|
firefox_web_push == o.firefox_web_push &&
|
127
145
|
safari_web_push == o.safari_web_push &&
|
128
146
|
android == o.android &&
|
129
|
-
ios == o.ios
|
147
|
+
ios == o.ios &&
|
148
|
+
sms == o.sms &&
|
149
|
+
email == o.email
|
130
150
|
end
|
131
151
|
|
132
152
|
# @see the `==` method
|
@@ -138,7 +158,7 @@ module OneSignal
|
|
138
158
|
# Calculates hash code according to all attributes.
|
139
159
|
# @return [Integer] Hash code
|
140
160
|
def hash
|
141
|
-
[edge_web_push, chrome_web_push, firefox_web_push, safari_web_push, android, ios].hash
|
161
|
+
[edge_web_push, chrome_web_push, firefox_web_push, safari_web_push, android, ios, sms, email].hash
|
142
162
|
end
|
143
163
|
|
144
164
|
# Builds the object from hash
|
@@ -153,6 +173,7 @@ module OneSignal
|
|
153
173
|
# @return [Object] Returns the model itself
|
154
174
|
def build_from_hash(attributes)
|
155
175
|
return nil unless attributes.is_a?(Hash)
|
176
|
+
attributes = attributes.transform_keys(&:to_sym)
|
156
177
|
self.class.openapi_types.each_pair do |key, type|
|
157
178
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
158
179
|
self.send("#{key}=", nil)
|