pingram 0.1.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.
Files changed (187) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +54 -0
  4. data/Rakefile +10 -0
  5. data/lib/pingram/api/account_api.rb +506 -0
  6. data/lib/pingram/api/addresses_api.rb +209 -0
  7. data/lib/pingram/api/components_api.rb +396 -0
  8. data/lib/pingram/api/default_api.rb +88 -0
  9. data/lib/pingram/api/domains_api.rb +204 -0
  10. data/lib/pingram/api/editor_api.rb +88 -0
  11. data/lib/pingram/api/environments_api.rb +215 -0
  12. data/lib/pingram/api/health_api.rb +77 -0
  13. data/lib/pingram/api/insights_api.rb +88 -0
  14. data/lib/pingram/api/keys_api.rb +204 -0
  15. data/lib/pingram/api/logs_api.rb +375 -0
  16. data/lib/pingram/api/members_api.rb +433 -0
  17. data/lib/pingram/api/sender_api.rb +221 -0
  18. data/lib/pingram/api/templates_api.rb +479 -0
  19. data/lib/pingram/api/types_api.rb +335 -0
  20. data/lib/pingram/api/user_api.rb +587 -0
  21. data/lib/pingram/api/users_api.rb +228 -0
  22. data/lib/pingram/api_client.rb +397 -0
  23. data/lib/pingram/api_error.rb +58 -0
  24. data/lib/pingram/api_model_base.rb +88 -0
  25. data/lib/pingram/client_wrapper.rb +212 -0
  26. data/lib/pingram/configuration.rb +330 -0
  27. data/lib/pingram/models/account_addresses_response.rb +166 -0
  28. data/lib/pingram/models/account_addresses_response_addresses_inner.rb +301 -0
  29. data/lib/pingram/models/account_get_response.rb +354 -0
  30. data/lib/pingram/models/account_get_response_pending_downgrade_usage_limit.rb +201 -0
  31. data/lib/pingram/models/address_response.rb +164 -0
  32. data/lib/pingram/models/auto_join_get_response.rb +192 -0
  33. data/lib/pingram/models/auto_join_post_response.rb +192 -0
  34. data/lib/pingram/models/auto_join_request_body.rb +166 -0
  35. data/lib/pingram/models/bee_token_v2.rb +190 -0
  36. data/lib/pingram/models/billing_post_request_body.rb +216 -0
  37. data/lib/pingram/models/billing_post_response_body.rb +367 -0
  38. data/lib/pingram/models/billing_post_response_body_pending_downgrade_usage_limit.rb +202 -0
  39. data/lib/pingram/models/channels_enum.rb +45 -0
  40. data/lib/pingram/models/create_account_request_body.rb +164 -0
  41. data/lib/pingram/models/create_account_response.rb +190 -0
  42. data/lib/pingram/models/create_address_request.rb +182 -0
  43. data/lib/pingram/models/create_key_request.rb +227 -0
  44. data/lib/pingram/models/create_key_response.rb +308 -0
  45. data/lib/pingram/models/delete_key_response.rb +165 -0
  46. data/lib/pingram/models/delete_user_response.rb +164 -0
  47. data/lib/pingram/models/email_auth_token_post_request.rb +147 -0
  48. data/lib/pingram/models/email_component_patch_request.rb +174 -0
  49. data/lib/pingram/models/email_component_post_request.rb +217 -0
  50. data/lib/pingram/models/email_component_response.rb +424 -0
  51. data/lib/pingram/models/email_component_response_referenced_by_inner.rb +238 -0
  52. data/lib/pingram/models/environment.rb +270 -0
  53. data/lib/pingram/models/environment_create_request.rb +164 -0
  54. data/lib/pingram/models/environment_patch_request.rb +176 -0
  55. data/lib/pingram/models/get_account_metadata_response.rb +164 -0
  56. data/lib/pingram/models/get_account_metadata_response_user_account_metadata.rb +216 -0
  57. data/lib/pingram/models/get_email_components_response_inner.rb +424 -0
  58. data/lib/pingram/models/get_environments_response_inner.rb +270 -0
  59. data/lib/pingram/models/get_inapp_notifications_response.rb +166 -0
  60. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner.rb +389 -0
  61. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options.rb +206 -0
  62. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_instant.rb +191 -0
  63. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_off.rb +164 -0
  64. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_replies_inner.rb +190 -0
  65. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_template.rb +103 -0
  66. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_template_any_of.rb +301 -0
  67. data/lib/pingram/models/get_keys_response.rb +168 -0
  68. data/lib/pingram/models/get_keys_response_keys_inner.rb +371 -0
  69. data/lib/pingram/models/get_logs_response.rb +175 -0
  70. data/lib/pingram/models/get_logs_response_messages_inner.rb +419 -0
  71. data/lib/pingram/models/get_logs_response_messages_inner_attachments_inner.rb +225 -0
  72. data/lib/pingram/models/get_members_response_inner.rb +236 -0
  73. data/lib/pingram/models/get_metrics_response_inner.rb +238 -0
  74. data/lib/pingram/models/get_metrics_response_inner_messages_inner.rb +159 -0
  75. data/lib/pingram/models/get_notifications_response_inner.rb +317 -0
  76. data/lib/pingram/models/get_notifications_response_inner_deduplication.rb +164 -0
  77. data/lib/pingram/models/get_notifications_response_inner_options.rb +201 -0
  78. data/lib/pingram/models/get_notifications_response_inner_options_email.rb +242 -0
  79. data/lib/pingram/models/get_notifications_response_inner_options_email_daily.rb +173 -0
  80. data/lib/pingram/models/get_notifications_response_inner_options_email_monthly.rb +216 -0
  81. data/lib/pingram/models/get_notifications_response_inner_options_email_weekly.rb +182 -0
  82. data/lib/pingram/models/get_notifications_response_inner_templates_inner.rb +214 -0
  83. data/lib/pingram/models/get_notifications_response_inner_throttling.rb +294 -0
  84. data/lib/pingram/models/get_senders_response_inner.rb +342 -0
  85. data/lib/pingram/models/get_templates_response.rb +103 -0
  86. data/lib/pingram/models/get_users_response.rb +201 -0
  87. data/lib/pingram/models/get_users_response_users_inner.rb +268 -0
  88. data/lib/pingram/models/get_users_response_users_inner_email_suppression_status.rb +214 -0
  89. data/lib/pingram/models/get_users_response_users_inner_push_tokens_inner.rb +252 -0
  90. data/lib/pingram/models/get_users_response_users_inner_push_tokens_inner_device.rb +209 -0
  91. data/lib/pingram/models/get_users_response_users_inner_slack_token.rb +317 -0
  92. data/lib/pingram/models/get_users_response_users_inner_slack_token_authed_user.rb +192 -0
  93. data/lib/pingram/models/get_users_response_users_inner_slack_token_enterprise.rb +156 -0
  94. data/lib/pingram/models/get_users_response_users_inner_slack_token_incoming_webhook.rb +174 -0
  95. data/lib/pingram/models/get_users_response_users_inner_slack_token_response_metadata.rb +200 -0
  96. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner.rb +164 -0
  97. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub.rb +191 -0
  98. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub_keys.rb +190 -0
  99. data/lib/pingram/models/in_app_notification_patch_request.rb +231 -0
  100. data/lib/pingram/models/in_app_notification_unread_clear_request.rb +156 -0
  101. data/lib/pingram/models/inapp_unread_count_response.rb +164 -0
  102. data/lib/pingram/models/inbound_request_body.rb +103 -0
  103. data/lib/pingram/models/inbound_response_body.rb +216 -0
  104. data/lib/pingram/models/inbound_response_body_results_inner.rb +216 -0
  105. data/lib/pingram/models/ingishts_post_request.rb +288 -0
  106. data/lib/pingram/models/ingishts_post_request_label_options.rb +147 -0
  107. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner.rb +208 -0
  108. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat.rb +211 -0
  109. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric.rb +171 -0
  110. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric_dimensions_inner.rb +159 -0
  111. data/lib/pingram/models/intercom_webhook.rb +293 -0
  112. data/lib/pingram/models/intercom_webhook_data.rb +164 -0
  113. data/lib/pingram/models/intercom_webhook_data_item.rb +103 -0
  114. data/lib/pingram/models/intercom_webhook_data_item_any_of.rb +453 -0
  115. data/lib/pingram/models/intercom_webhook_data_item_any_of_contacts.rb +216 -0
  116. data/lib/pingram/models/intercom_webhook_data_item_any_of_contacts_contacts_inner.rb +199 -0
  117. data/lib/pingram/models/intercom_webhook_data_item_any_of_source.rb +260 -0
  118. data/lib/pingram/models/intercom_webhook_data_item_any_of_source_author.rb +208 -0
  119. data/lib/pingram/models/invite_post_response.rb +156 -0
  120. data/lib/pingram/models/log_query_post_body.rb +251 -0
  121. data/lib/pingram/models/logs_bulk_request.rb +167 -0
  122. data/lib/pingram/models/logs_get_response.rb +167 -0
  123. data/lib/pingram/models/logs_get_response_logs_inner.rb +1808 -0
  124. data/lib/pingram/models/logs_query_response.rb +165 -0
  125. data/lib/pingram/models/logs_query_result_response.rb +194 -0
  126. data/lib/pingram/models/logs_retention_response.rb +165 -0
  127. data/lib/pingram/models/logs_tail_response.rb +167 -0
  128. data/lib/pingram/models/member_invite_request.rb +173 -0
  129. data/lib/pingram/models/member_update_request.rb +164 -0
  130. data/lib/pingram/models/message_response.rb +164 -0
  131. data/lib/pingram/models/notification.rb +317 -0
  132. data/lib/pingram/models/notification_create_request.rb +227 -0
  133. data/lib/pingram/models/notification_patch_request.rb +203 -0
  134. data/lib/pingram/models/post_email_test_request.rb +303 -0
  135. data/lib/pingram/models/post_email_test_response.rb +175 -0
  136. data/lib/pingram/models/post_senders_request_body.rb +164 -0
  137. data/lib/pingram/models/post_user_request.rb +215 -0
  138. data/lib/pingram/models/sender_post_body.rb +324 -0
  139. data/lib/pingram/models/sender_post_body_email.rb +217 -0
  140. data/lib/pingram/models/sender_post_body_inapp.rb +182 -0
  141. data/lib/pingram/models/sender_post_body_mobile_push.rb +190 -0
  142. data/lib/pingram/models/sender_post_body_options.rb +165 -0
  143. data/lib/pingram/models/sender_post_body_options_apn.rb +201 -0
  144. data/lib/pingram/models/sender_post_body_options_email.rb +209 -0
  145. data/lib/pingram/models/sender_post_body_options_email_attachments_inner.rb +103 -0
  146. data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of.rb +190 -0
  147. data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of1.rb +199 -0
  148. data/lib/pingram/models/sender_post_body_options_fcm.rb +147 -0
  149. data/lib/pingram/models/sender_post_body_options_fcm_android.rb +208 -0
  150. data/lib/pingram/models/sender_post_body_slack.rb +299 -0
  151. data/lib/pingram/models/sender_post_body_slack_metadata.rb +173 -0
  152. data/lib/pingram/models/sender_post_body_slack_metadata_entities_inner.rb +257 -0
  153. data/lib/pingram/models/sender_post_body_slack_metadata_entities_inner_external_ref.rb +174 -0
  154. data/lib/pingram/models/sender_post_body_sms.rb +156 -0
  155. data/lib/pingram/models/sender_post_body_sms_auto_reply.rb +164 -0
  156. data/lib/pingram/models/sender_post_body_to.rb +251 -0
  157. data/lib/pingram/models/sender_post_body_user.rb +268 -0
  158. data/lib/pingram/models/sender_post_body_web_push.rb +208 -0
  159. data/lib/pingram/models/sender_post_response.rb +192 -0
  160. data/lib/pingram/models/set_default_template_request.rb +204 -0
  161. data/lib/pingram/models/slack_interactivity_response.rb +165 -0
  162. data/lib/pingram/models/slack_oauth_request.rb +190 -0
  163. data/lib/pingram/models/success_response.rb +164 -0
  164. data/lib/pingram/models/supabase_configure_request.rb +242 -0
  165. data/lib/pingram/models/supabase_configure_response.rb +173 -0
  166. data/lib/pingram/models/supabase_o_auth_request.rb +216 -0
  167. data/lib/pingram/models/supabase_o_auth_response.rb +173 -0
  168. data/lib/pingram/models/supabase_projects_response.rb +166 -0
  169. data/lib/pingram/models/supabase_projects_response_projects_inner.rb +268 -0
  170. data/lib/pingram/models/supabase_status_response.rb +208 -0
  171. data/lib/pingram/models/template.rb +301 -0
  172. data/lib/pingram/models/template_patch_request.rb +104 -0
  173. data/lib/pingram/models/template_patch_request_any_of.rb +199 -0
  174. data/lib/pingram/models/template_patch_request_any_of1.rb +187 -0
  175. data/lib/pingram/models/template_patch_request_any_of1_batch.rb +217 -0
  176. data/lib/pingram/models/template_patch_request_any_of1_instant.rb +184 -0
  177. data/lib/pingram/models/template_post_request.rb +346 -0
  178. data/lib/pingram/models/template_post_request_batch.rb +217 -0
  179. data/lib/pingram/models/template_post_request_instant.rb +183 -0
  180. data/lib/pingram/models/update_address_request.rb +182 -0
  181. data/lib/pingram/models/user.rb +268 -0
  182. data/lib/pingram/models/user_suppression_delete_response.rb +164 -0
  183. data/lib/pingram/models/webhook_response.rb +182 -0
  184. data/lib/pingram/version.rb +15 -0
  185. data/lib/pingram.rb +215 -0
  186. data/pingram.gemspec +38 -0
  187. metadata +270 -0
@@ -0,0 +1,367 @@
1
+ =begin
2
+ #NotificationAPI
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ class BillingPostResponseBody < ApiModelBase
18
+ attr_accessor :account_id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :account_type
23
+
24
+ attr_accessor :created_at
25
+
26
+ attr_accessor :creator
27
+
28
+ attr_accessor :stripe_customer_id
29
+
30
+ attr_accessor :stripe_subscription_id
31
+
32
+ attr_accessor :subscription_status
33
+
34
+ # ISO date (YYYY-MM-DD) when the billing cycle resets. Used for anniversary-based billing.
35
+ attr_accessor :anniversary_date
36
+
37
+ # ISO date (YYYY-MM-DD) when the pending downgrade takes effect
38
+ attr_accessor :pending_downgrade_effective_date
39
+
40
+ # The account type to switch to when downgrade takes effect
41
+ attr_accessor :pending_downgrade_account_type
42
+
43
+ attr_accessor :pending_downgrade_usage_limit
44
+
45
+ attr_accessor :session_id
46
+
47
+ attr_accessor :url
48
+
49
+ class EnumAttributeValidator
50
+ attr_reader :datatype
51
+ attr_reader :allowable_values
52
+
53
+ def initialize(datatype, allowable_values)
54
+ @allowable_values = allowable_values.map do |value|
55
+ case datatype.to_s
56
+ when /Integer/i
57
+ value.to_i
58
+ when /Float/i
59
+ value.to_f
60
+ else
61
+ value
62
+ end
63
+ end
64
+ end
65
+
66
+ def valid?(value)
67
+ !value || allowable_values.include?(value)
68
+ end
69
+ end
70
+
71
+ # Attribute mapping from ruby-style variable name to JSON key.
72
+ def self.attribute_map
73
+ {
74
+ :'account_id' => :'accountId',
75
+ :'name' => :'name',
76
+ :'account_type' => :'accountType',
77
+ :'created_at' => :'createdAt',
78
+ :'creator' => :'creator',
79
+ :'stripe_customer_id' => :'stripeCustomerId',
80
+ :'stripe_subscription_id' => :'stripeSubscriptionId',
81
+ :'subscription_status' => :'subscriptionStatus',
82
+ :'anniversary_date' => :'anniversaryDate',
83
+ :'pending_downgrade_effective_date' => :'pendingDowngradeEffectiveDate',
84
+ :'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
85
+ :'pending_downgrade_usage_limit' => :'pendingDowngradeUsageLimit',
86
+ :'session_id' => :'sessionId',
87
+ :'url' => :'url'
88
+ }
89
+ end
90
+
91
+ # Returns attribute mapping this model knows about
92
+ def self.acceptable_attribute_map
93
+ attribute_map
94
+ end
95
+
96
+ # Returns all the JSON keys this model knows about
97
+ def self.acceptable_attributes
98
+ acceptable_attribute_map.values
99
+ end
100
+
101
+ # Attribute type mapping.
102
+ def self.openapi_types
103
+ {
104
+ :'account_id' => :'String',
105
+ :'name' => :'String',
106
+ :'account_type' => :'String',
107
+ :'created_at' => :'String',
108
+ :'creator' => :'String',
109
+ :'stripe_customer_id' => :'String',
110
+ :'stripe_subscription_id' => :'String',
111
+ :'subscription_status' => :'String',
112
+ :'anniversary_date' => :'String',
113
+ :'pending_downgrade_effective_date' => :'String',
114
+ :'pending_downgrade_account_type' => :'String',
115
+ :'pending_downgrade_usage_limit' => :'BillingPostResponseBodyPendingDowngradeUsageLimit',
116
+ :'session_id' => :'String',
117
+ :'url' => :'String'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ :'subscription_status',
125
+ ])
126
+ end
127
+
128
+ # Initializes the object
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ def initialize(attributes = {})
131
+ if (!attributes.is_a?(Hash))
132
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::BillingPostResponseBody` initialize method"
133
+ end
134
+
135
+ # check to see if the attribute exists and convert string to symbol for hash key
136
+ acceptable_attribute_map = self.class.acceptable_attribute_map
137
+ attributes = attributes.each_with_object({}) { |(k, v), h|
138
+ if (!acceptable_attribute_map.key?(k.to_sym))
139
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::BillingPostResponseBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
140
+ end
141
+ h[k.to_sym] = v
142
+ }
143
+
144
+ if attributes.key?(:'account_id')
145
+ self.account_id = attributes[:'account_id']
146
+ else
147
+ self.account_id = nil
148
+ end
149
+
150
+ if attributes.key?(:'name')
151
+ self.name = attributes[:'name']
152
+ end
153
+
154
+ if attributes.key?(:'account_type')
155
+ self.account_type = attributes[:'account_type']
156
+ else
157
+ self.account_type = nil
158
+ end
159
+
160
+ if attributes.key?(:'created_at')
161
+ self.created_at = attributes[:'created_at']
162
+ else
163
+ self.created_at = nil
164
+ end
165
+
166
+ if attributes.key?(:'creator')
167
+ self.creator = attributes[:'creator']
168
+ end
169
+
170
+ if attributes.key?(:'stripe_customer_id')
171
+ self.stripe_customer_id = attributes[:'stripe_customer_id']
172
+ end
173
+
174
+ if attributes.key?(:'stripe_subscription_id')
175
+ self.stripe_subscription_id = attributes[:'stripe_subscription_id']
176
+ end
177
+
178
+ if attributes.key?(:'subscription_status')
179
+ self.subscription_status = attributes[:'subscription_status']
180
+ end
181
+
182
+ if attributes.key?(:'anniversary_date')
183
+ self.anniversary_date = attributes[:'anniversary_date']
184
+ end
185
+
186
+ if attributes.key?(:'pending_downgrade_effective_date')
187
+ self.pending_downgrade_effective_date = attributes[:'pending_downgrade_effective_date']
188
+ end
189
+
190
+ if attributes.key?(:'pending_downgrade_account_type')
191
+ self.pending_downgrade_account_type = attributes[:'pending_downgrade_account_type']
192
+ end
193
+
194
+ if attributes.key?(:'pending_downgrade_usage_limit')
195
+ self.pending_downgrade_usage_limit = attributes[:'pending_downgrade_usage_limit']
196
+ end
197
+
198
+ if attributes.key?(:'session_id')
199
+ self.session_id = attributes[:'session_id']
200
+ end
201
+
202
+ if attributes.key?(:'url')
203
+ self.url = attributes[:'url']
204
+ end
205
+ end
206
+
207
+ # Show invalid properties with the reasons. Usually used together with valid?
208
+ # @return Array for valid properties with the reasons
209
+ def list_invalid_properties
210
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
211
+ invalid_properties = Array.new
212
+ if @account_id.nil?
213
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
214
+ end
215
+
216
+ if @account_type.nil?
217
+ invalid_properties.push('invalid value for "account_type", account_type cannot be nil.')
218
+ end
219
+
220
+ if @created_at.nil?
221
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
222
+ end
223
+
224
+ invalid_properties
225
+ end
226
+
227
+ # Check to see if the all the properties in the model are valid
228
+ # @return true if the model is valid
229
+ def valid?
230
+ warn '[DEPRECATED] the `valid?` method is obsolete'
231
+ return false if @account_id.nil?
232
+ return false if @account_type.nil?
233
+ account_type_validator = EnumAttributeValidator.new('String', ["free", "paid"])
234
+ return false unless account_type_validator.valid?(@account_type)
235
+ return false if @created_at.nil?
236
+ subscription_status_validator = EnumAttributeValidator.new('String', ["active", "canceled", "past_due", "paused"])
237
+ return false unless subscription_status_validator.valid?(@subscription_status)
238
+ pending_downgrade_account_type_validator = EnumAttributeValidator.new('String', ["free"])
239
+ return false unless pending_downgrade_account_type_validator.valid?(@pending_downgrade_account_type)
240
+ true
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] account_id Value to be assigned
245
+ def account_id=(account_id)
246
+ if account_id.nil?
247
+ fail ArgumentError, 'account_id cannot be nil'
248
+ end
249
+
250
+ @account_id = account_id
251
+ end
252
+
253
+ # Custom attribute writer method checking allowed values (enum).
254
+ # @param [Object] account_type Object to be assigned
255
+ def account_type=(account_type)
256
+ validator = EnumAttributeValidator.new('String', ["free", "paid"])
257
+ unless validator.valid?(account_type)
258
+ fail ArgumentError, "invalid value for \"account_type\", must be one of #{validator.allowable_values}."
259
+ end
260
+ @account_type = account_type
261
+ end
262
+
263
+ # Custom attribute writer method with validation
264
+ # @param [Object] created_at Value to be assigned
265
+ def created_at=(created_at)
266
+ if created_at.nil?
267
+ fail ArgumentError, 'created_at cannot be nil'
268
+ end
269
+
270
+ @created_at = created_at
271
+ end
272
+
273
+ # Custom attribute writer method checking allowed values (enum).
274
+ # @param [Object] subscription_status Object to be assigned
275
+ def subscription_status=(subscription_status)
276
+ validator = EnumAttributeValidator.new('String', ["active", "canceled", "past_due", "paused"])
277
+ unless validator.valid?(subscription_status)
278
+ fail ArgumentError, "invalid value for \"subscription_status\", must be one of #{validator.allowable_values}."
279
+ end
280
+ @subscription_status = subscription_status
281
+ end
282
+
283
+ # Custom attribute writer method checking allowed values (enum).
284
+ # @param [Object] pending_downgrade_account_type Object to be assigned
285
+ def pending_downgrade_account_type=(pending_downgrade_account_type)
286
+ validator = EnumAttributeValidator.new('String', ["free"])
287
+ unless validator.valid?(pending_downgrade_account_type)
288
+ fail ArgumentError, "invalid value for \"pending_downgrade_account_type\", must be one of #{validator.allowable_values}."
289
+ end
290
+ @pending_downgrade_account_type = pending_downgrade_account_type
291
+ end
292
+
293
+ # Checks equality by comparing each attribute.
294
+ # @param [Object] Object to be compared
295
+ def ==(o)
296
+ return true if self.equal?(o)
297
+ self.class == o.class &&
298
+ account_id == o.account_id &&
299
+ name == o.name &&
300
+ account_type == o.account_type &&
301
+ created_at == o.created_at &&
302
+ creator == o.creator &&
303
+ stripe_customer_id == o.stripe_customer_id &&
304
+ stripe_subscription_id == o.stripe_subscription_id &&
305
+ subscription_status == o.subscription_status &&
306
+ anniversary_date == o.anniversary_date &&
307
+ pending_downgrade_effective_date == o.pending_downgrade_effective_date &&
308
+ pending_downgrade_account_type == o.pending_downgrade_account_type &&
309
+ pending_downgrade_usage_limit == o.pending_downgrade_usage_limit &&
310
+ session_id == o.session_id &&
311
+ url == o.url
312
+ end
313
+
314
+ # @see the `==` method
315
+ # @param [Object] Object to be compared
316
+ def eql?(o)
317
+ self == o
318
+ end
319
+
320
+ # Calculates hash code according to all attributes.
321
+ # @return [Integer] Hash code
322
+ def hash
323
+ [account_id, name, account_type, created_at, creator, stripe_customer_id, stripe_subscription_id, subscription_status, anniversary_date, pending_downgrade_effective_date, pending_downgrade_account_type, pending_downgrade_usage_limit, session_id, url].hash
324
+ end
325
+
326
+ # Builds the object from hash
327
+ # @param [Hash] attributes Model attributes in the form of hash
328
+ # @return [Object] Returns the model itself
329
+ def self.build_from_hash(attributes)
330
+ return nil unless attributes.is_a?(Hash)
331
+ attributes = attributes.transform_keys(&:to_sym)
332
+ transformed_hash = {}
333
+ openapi_types.each_pair do |key, type|
334
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
335
+ transformed_hash["#{key}"] = nil
336
+ elsif type =~ /\AArray<(.*)>/i
337
+ # check to ensure the input is an array given that the attribute
338
+ # is documented as an array but the input is not
339
+ if attributes[attribute_map[key]].is_a?(Array)
340
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
341
+ end
342
+ elsif !attributes[attribute_map[key]].nil?
343
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
344
+ end
345
+ end
346
+ new(transformed_hash)
347
+ end
348
+
349
+ # Returns the object in the form of hash
350
+ # @return [Hash] Returns the object in the form of hash
351
+ def to_hash
352
+ hash = {}
353
+ self.class.attribute_map.each_pair do |attr, param|
354
+ value = self.send(attr)
355
+ if value.nil?
356
+ is_nullable = self.class.openapi_nullable.include?(attr)
357
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
358
+ end
359
+
360
+ hash[param] = _to_hash(value)
361
+ end
362
+ hash
363
+ end
364
+
365
+ end
366
+
367
+ end
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #NotificationAPI
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ # Optional new usage limits to apply when downgrade takes effect
18
+ class BillingPostResponseBodyPendingDowngradeUsageLimit < ApiModelBase
19
+ attr_accessor :email
20
+
21
+ attr_accessor :inapp_web
22
+
23
+ attr_accessor :sms
24
+
25
+ attr_accessor :call
26
+
27
+ attr_accessor :push
28
+
29
+ attr_accessor :web_push
30
+
31
+ attr_accessor :slack
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'email' => :'EMAIL',
37
+ :'inapp_web' => :'INAPP_WEB',
38
+ :'sms' => :'SMS',
39
+ :'call' => :'CALL',
40
+ :'push' => :'PUSH',
41
+ :'web_push' => :'WEB_PUSH',
42
+ :'slack' => :'SLACK'
43
+ }
44
+ end
45
+
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ acceptable_attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'email' => :'Float',
60
+ :'inapp_web' => :'Float',
61
+ :'sms' => :'Float',
62
+ :'call' => :'Float',
63
+ :'push' => :'Float',
64
+ :'web_push' => :'Float',
65
+ :'slack' => :'Float'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::BillingPostResponseBodyPendingDowngradeUsageLimit` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::BillingPostResponseBodyPendingDowngradeUsageLimit`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'email')
92
+ self.email = attributes[:'email']
93
+ end
94
+
95
+ if attributes.key?(:'inapp_web')
96
+ self.inapp_web = attributes[:'inapp_web']
97
+ end
98
+
99
+ if attributes.key?(:'sms')
100
+ self.sms = attributes[:'sms']
101
+ end
102
+
103
+ if attributes.key?(:'call')
104
+ self.call = attributes[:'call']
105
+ end
106
+
107
+ if attributes.key?(:'push')
108
+ self.push = attributes[:'push']
109
+ end
110
+
111
+ if attributes.key?(:'web_push')
112
+ self.web_push = attributes[:'web_push']
113
+ end
114
+
115
+ if attributes.key?(:'slack')
116
+ self.slack = attributes[:'slack']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ email == o.email &&
141
+ inapp_web == o.inapp_web &&
142
+ sms == o.sms &&
143
+ call == o.call &&
144
+ push == o.push &&
145
+ web_push == o.web_push &&
146
+ slack == o.slack
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [email, inapp_web, sms, call, push, web_push, slack].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ end
201
+
202
+ end
@@ -0,0 +1,45 @@
1
+ =begin
2
+ #NotificationAPI
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ class ChannelsEnum
18
+ EMAIL = "EMAIL".freeze
19
+ INAPP_WEB = "INAPP_WEB".freeze
20
+ SMS = "SMS".freeze
21
+ CALL = "CALL".freeze
22
+ PUSH = "PUSH".freeze
23
+ WEB_PUSH = "WEB_PUSH".freeze
24
+ SLACK = "SLACK".freeze
25
+
26
+ def self.all_vars
27
+ @all_vars ||= [EMAIL, INAPP_WEB, SMS, CALL, PUSH, WEB_PUSH, SLACK].freeze
28
+ end
29
+
30
+ # Builds the enum from string
31
+ # @param [String] The enum value in the form of the string
32
+ # @return [String] The enum value
33
+ def self.build_from_hash(value)
34
+ new.build_from_hash(value)
35
+ end
36
+
37
+ # Builds the enum from string
38
+ # @param [String] The enum value in the form of the string
39
+ # @return [String] The enum value
40
+ def build_from_hash(value)
41
+ return value if ChannelsEnum.all_vars.include?(value)
42
+ raise "Invalid ENUM value #{value} for class #ChannelsEnum"
43
+ end
44
+ end
45
+ end