pingram 1.0.29 → 1.0.31

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 (23) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/pingram/api/account_api.rb +66 -0
  4. data/lib/pingram/api/webhooks_api.rb +117 -39
  5. data/lib/pingram/api_client.rb +1 -1
  6. data/lib/pingram/models/account_get_response.rb +14 -4
  7. data/lib/pingram/models/account_patch_request.rb +149 -0
  8. data/lib/pingram/models/billing_post_response_body.rb +11 -1
  9. data/lib/pingram/models/{events_webhook_response.rb → webhook_endpoint.rb} +22 -22
  10. data/lib/pingram/models/{events_webhook_upsert_request.rb → webhook_endpoint_upsert_request.rb} +4 -4
  11. data/lib/pingram/models/webhook_endpoints_response.rb +168 -0
  12. data/lib/pingram/models/webhook_endpoints_response_endpoints_inner.rb +261 -0
  13. data/lib/pingram/version.rb +1 -1
  14. data/lib/pingram.rb +5 -2
  15. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  16. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  17. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/gem_make.out +5 -5
  18. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/mkmf.log +3 -3
  19. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  20. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  21. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  22. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  23. metadata +7 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab6b12d140400b9c491e3025a6e639755a4b6886e63bcc4e2598d0188ce88b03
4
- data.tar.gz: b6d665310b2a86321250102351d6cf0e33e075762100cd1f1241a0de94d95081
3
+ metadata.gz: 1f6ad60125911770d223ca8d214b8a2940219d857890a112e0e59944e5095482
4
+ data.tar.gz: 01da7ff2cf74ab8edcbb47f1820f950175fbadfc12266733e4d8ddfefeba38ab
5
5
  SHA512:
6
- metadata.gz: e66a6cf106093028d03e68973ae5bd38ea5ccf83361652fbb3e0dc7aca6c79f406026d7c01f74000a70206f937c7cd37fd342631a037f2b5ff6b0098c0c04d11
7
- data.tar.gz: 71085fe7822cbb180feef15ee59f2b0efb2d9ba584e64c80c84c07e4a0e29659e187b16c1ca5eaa77d419b25bfe552523f671d94e6976021e25e545de22d9cf4
6
+ metadata.gz: e384d353b41c0671b702397a051003ab56603716b2b97da359aac7365332c2e56dbafd38a008ff136a4426f2b35c430569c4224eadabbb0a74989f2ba982defb
7
+ data.tar.gz: d711627dc58b22961656bcd76845c55efe0f22687bc71eec569f9d64b64dcacf18ee2b7da0f3f33987e44427a19633dd382558d246a4f7e5b8d656f6f246a3b1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pingram (1.0.29)
4
+ pingram (1.0.31)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -630,5 +630,71 @@ module Pingram
630
630
  end
631
631
  return data, status_code, headers
632
632
  end
633
+
634
+ # Update account billing preferences. Only account owners can change these settings.
635
+ # @param account_patch_request [AccountPatchRequest]
636
+ # @param [Hash] opts the optional parameters
637
+ # @return [AccountGetResponse]
638
+ def account_update_account_settings(account_patch_request, opts = {})
639
+ data, _status_code, _headers = account_update_account_settings_with_http_info(account_patch_request, opts)
640
+ data
641
+ end
642
+
643
+ # Update account billing preferences. Only account owners can change these settings.
644
+ # @param account_patch_request [AccountPatchRequest]
645
+ # @param [Hash] opts the optional parameters
646
+ # @return [Array<(AccountGetResponse, Integer, Hash)>] AccountGetResponse data, response status code and response headers
647
+ def account_update_account_settings_with_http_info(account_patch_request, opts = {})
648
+ if @api_client.config.debugging
649
+ @api_client.config.logger.debug 'Calling API: AccountApi.account_update_account_settings ...'
650
+ end
651
+ # verify the required parameter 'account_patch_request' is set
652
+ if @api_client.config.client_side_validation && account_patch_request.nil?
653
+ fail ArgumentError, "Missing the required parameter 'account_patch_request' when calling AccountApi.account_update_account_settings"
654
+ end
655
+ # resource path
656
+ local_var_path = '/account'
657
+
658
+ # query parameters
659
+ query_params = opts[:query_params] || {}
660
+
661
+ # header parameters
662
+ header_params = opts[:header_params] || {}
663
+ # HTTP header 'Accept' (if needed)
664
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
665
+ # HTTP header 'Content-Type'
666
+ content_type = @api_client.select_header_content_type(['application/json'])
667
+ if !content_type.nil?
668
+ header_params['Content-Type'] = content_type
669
+ end
670
+
671
+ # form parameters
672
+ form_params = opts[:form_params] || {}
673
+
674
+ # http body (model)
675
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(account_patch_request)
676
+
677
+ # return_type
678
+ return_type = opts[:debug_return_type] || 'AccountGetResponse'
679
+
680
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
681
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
682
+
683
+ new_options = opts.merge(
684
+ :operation => :"AccountApi.account_update_account_settings",
685
+ :header_params => header_params,
686
+ :query_params => query_params,
687
+ :form_params => form_params,
688
+ :body => post_body,
689
+ :auth_names => auth_names,
690
+ :return_type => return_type
691
+ )
692
+
693
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
694
+ if @api_client.config.debugging
695
+ @api_client.config.logger.debug "API called: AccountApi#account_update_account_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
696
+ end
697
+ return data, status_code, headers
698
+ end
633
699
  end
634
700
  end
@@ -19,23 +19,95 @@ module Pingram
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Delete the events webhook configuration for the current account/environment.
22
+ # Create a webhook.
23
+ # @param webhook_endpoint_upsert_request [WebhookEndpointUpsertRequest]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [WebhookEndpoint]
26
+ def webhooks_create_webhook(webhook_endpoint_upsert_request, opts = {})
27
+ data, _status_code, _headers = webhooks_create_webhook_with_http_info(webhook_endpoint_upsert_request, opts)
28
+ data
29
+ end
30
+
31
+ # Create a webhook.
32
+ # @param webhook_endpoint_upsert_request [WebhookEndpointUpsertRequest]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(WebhookEndpoint, Integer, Hash)>] WebhookEndpoint data, response status code and response headers
35
+ def webhooks_create_webhook_with_http_info(webhook_endpoint_upsert_request, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_create_webhook ...'
38
+ end
39
+ # verify the required parameter 'webhook_endpoint_upsert_request' is set
40
+ if @api_client.config.client_side_validation && webhook_endpoint_upsert_request.nil?
41
+ fail ArgumentError, "Missing the required parameter 'webhook_endpoint_upsert_request' when calling WebhooksApi.webhooks_create_webhook"
42
+ end
43
+ # resource path
44
+ local_var_path = '/webhooks'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/json'])
55
+ if !content_type.nil?
56
+ header_params['Content-Type'] = content_type
57
+ end
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_endpoint_upsert_request)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'WebhookEndpoint'
67
+
68
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
69
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"WebhooksApi.webhooks_create_webhook",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # Delete a webhook.
89
+ # @param endpoint_id [String] Webhook endpoint id
23
90
  # @param [Hash] opts the optional parameters
24
91
  # @return [nil]
25
- def webhooks_delete_events_webhook(opts = {})
26
- webhooks_delete_events_webhook_with_http_info(opts)
92
+ def webhooks_delete_webhook(endpoint_id, opts = {})
93
+ webhooks_delete_webhook_with_http_info(endpoint_id, opts)
27
94
  nil
28
95
  end
29
96
 
30
- # Delete the events webhook configuration for the current account/environment.
97
+ # Delete a webhook.
98
+ # @param endpoint_id [String] Webhook endpoint id
31
99
  # @param [Hash] opts the optional parameters
32
100
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
33
- def webhooks_delete_events_webhook_with_http_info(opts = {})
101
+ def webhooks_delete_webhook_with_http_info(endpoint_id, opts = {})
34
102
  if @api_client.config.debugging
35
- @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_delete_events_webhook ...'
103
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_delete_webhook ...'
104
+ end
105
+ # verify the required parameter 'endpoint_id' is set
106
+ if @api_client.config.client_side_validation && endpoint_id.nil?
107
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WebhooksApi.webhooks_delete_webhook"
36
108
  end
37
109
  # resource path
38
- local_var_path = '/webhooks/events'
110
+ local_var_path = '/webhooks/{endpointId}'.sub('{' + 'endpointId' + '}', CGI.escape(endpoint_id.to_s))
39
111
 
40
112
  # query parameters
41
113
  query_params = opts[:query_params] || {}
@@ -58,7 +130,7 @@ module Pingram
58
130
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
59
131
 
60
132
  new_options = opts.merge(
61
- :operation => :"WebhooksApi.webhooks_delete_events_webhook",
133
+ :operation => :"WebhooksApi.webhooks_delete_webhook",
62
134
  :header_params => header_params,
63
135
  :query_params => query_params,
64
136
  :form_params => form_params,
@@ -69,28 +141,28 @@ module Pingram
69
141
 
70
142
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
71
143
  if @api_client.config.debugging
72
- @api_client.config.logger.debug "API called: WebhooksApi#webhooks_delete_events_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
145
  end
74
146
  return data, status_code, headers
75
147
  end
76
148
 
77
- # Get the events webhook configuration for the current account/environment.
149
+ # List webhooks for the current account.
78
150
  # @param [Hash] opts the optional parameters
79
- # @return [EventsWebhookResponse]
80
- def webhooks_get_events_webhook(opts = {})
81
- data, _status_code, _headers = webhooks_get_events_webhook_with_http_info(opts)
151
+ # @return [WebhookEndpointsResponse]
152
+ def webhooks_list_webhooks(opts = {})
153
+ data, _status_code, _headers = webhooks_list_webhooks_with_http_info(opts)
82
154
  data
83
155
  end
84
156
 
85
- # Get the events webhook configuration for the current account/environment.
157
+ # List webhooks for the current account.
86
158
  # @param [Hash] opts the optional parameters
87
- # @return [Array<(EventsWebhookResponse, Integer, Hash)>] EventsWebhookResponse data, response status code and response headers
88
- def webhooks_get_events_webhook_with_http_info(opts = {})
159
+ # @return [Array<(WebhookEndpointsResponse, Integer, Hash)>] WebhookEndpointsResponse data, response status code and response headers
160
+ def webhooks_list_webhooks_with_http_info(opts = {})
89
161
  if @api_client.config.debugging
90
- @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_get_events_webhook ...'
162
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_list_webhooks ...'
91
163
  end
92
164
  # resource path
93
- local_var_path = '/webhooks/events'
165
+ local_var_path = '/webhooks'
94
166
 
95
167
  # query parameters
96
168
  query_params = opts[:query_params] || {}
@@ -107,13 +179,13 @@ module Pingram
107
179
  post_body = opts[:debug_body]
108
180
 
109
181
  # return_type
110
- return_type = opts[:debug_return_type] || 'EventsWebhookResponse'
182
+ return_type = opts[:debug_return_type] || 'WebhookEndpointsResponse'
111
183
 
112
184
  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
113
185
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
114
186
 
115
187
  new_options = opts.merge(
116
- :operation => :"WebhooksApi.webhooks_get_events_webhook",
188
+ :operation => :"WebhooksApi.webhooks_list_webhooks",
117
189
  :header_params => header_params,
118
190
  :query_params => query_params,
119
191
  :form_params => form_params,
@@ -124,34 +196,40 @@ module Pingram
124
196
 
125
197
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
126
198
  if @api_client.config.debugging
127
- @api_client.config.logger.debug "API called: WebhooksApi#webhooks_get_events_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
199
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
128
200
  end
129
201
  return data, status_code, headers
130
202
  end
131
203
 
132
- # Create or update the events webhook configuration for the current account/environment.
133
- # @param events_webhook_upsert_request [EventsWebhookUpsertRequest]
204
+ # Update a webhook. The signing secret is preserved.
205
+ # @param endpoint_id [String] Webhook endpoint id
206
+ # @param webhook_endpoint_upsert_request [WebhookEndpointUpsertRequest]
134
207
  # @param [Hash] opts the optional parameters
135
- # @return [EventsWebhookResponse]
136
- def webhooks_upsert_events_webhook(events_webhook_upsert_request, opts = {})
137
- data, _status_code, _headers = webhooks_upsert_events_webhook_with_http_info(events_webhook_upsert_request, opts)
208
+ # @return [WebhookEndpoint]
209
+ def webhooks_update_webhook(endpoint_id, webhook_endpoint_upsert_request, opts = {})
210
+ data, _status_code, _headers = webhooks_update_webhook_with_http_info(endpoint_id, webhook_endpoint_upsert_request, opts)
138
211
  data
139
212
  end
140
213
 
141
- # Create or update the events webhook configuration for the current account/environment.
142
- # @param events_webhook_upsert_request [EventsWebhookUpsertRequest]
214
+ # Update a webhook. The signing secret is preserved.
215
+ # @param endpoint_id [String] Webhook endpoint id
216
+ # @param webhook_endpoint_upsert_request [WebhookEndpointUpsertRequest]
143
217
  # @param [Hash] opts the optional parameters
144
- # @return [Array<(EventsWebhookResponse, Integer, Hash)>] EventsWebhookResponse data, response status code and response headers
145
- def webhooks_upsert_events_webhook_with_http_info(events_webhook_upsert_request, opts = {})
218
+ # @return [Array<(WebhookEndpoint, Integer, Hash)>] WebhookEndpoint data, response status code and response headers
219
+ def webhooks_update_webhook_with_http_info(endpoint_id, webhook_endpoint_upsert_request, opts = {})
146
220
  if @api_client.config.debugging
147
- @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_upsert_events_webhook ...'
221
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_update_webhook ...'
222
+ end
223
+ # verify the required parameter 'endpoint_id' is set
224
+ if @api_client.config.client_side_validation && endpoint_id.nil?
225
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WebhooksApi.webhooks_update_webhook"
148
226
  end
149
- # verify the required parameter 'events_webhook_upsert_request' is set
150
- if @api_client.config.client_side_validation && events_webhook_upsert_request.nil?
151
- fail ArgumentError, "Missing the required parameter 'events_webhook_upsert_request' when calling WebhooksApi.webhooks_upsert_events_webhook"
227
+ # verify the required parameter 'webhook_endpoint_upsert_request' is set
228
+ if @api_client.config.client_side_validation && webhook_endpoint_upsert_request.nil?
229
+ fail ArgumentError, "Missing the required parameter 'webhook_endpoint_upsert_request' when calling WebhooksApi.webhooks_update_webhook"
152
230
  end
153
231
  # resource path
154
- local_var_path = '/webhooks/events'
232
+ local_var_path = '/webhooks/{endpointId}'.sub('{' + 'endpointId' + '}', CGI.escape(endpoint_id.to_s))
155
233
 
156
234
  # query parameters
157
235
  query_params = opts[:query_params] || {}
@@ -170,16 +248,16 @@ module Pingram
170
248
  form_params = opts[:form_params] || {}
171
249
 
172
250
  # http body (model)
173
- post_body = opts[:debug_body] || @api_client.object_to_http_body(events_webhook_upsert_request)
251
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_endpoint_upsert_request)
174
252
 
175
253
  # return_type
176
- return_type = opts[:debug_return_type] || 'EventsWebhookResponse'
254
+ return_type = opts[:debug_return_type] || 'WebhookEndpoint'
177
255
 
178
256
  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
179
257
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
180
258
 
181
259
  new_options = opts.merge(
182
- :operation => :"WebhooksApi.webhooks_upsert_events_webhook",
260
+ :operation => :"WebhooksApi.webhooks_update_webhook",
183
261
  :header_params => header_params,
184
262
  :query_params => query_params,
185
263
  :form_params => form_params,
@@ -190,7 +268,7 @@ module Pingram
190
268
 
191
269
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
192
270
  if @api_client.config.debugging
193
- @api_client.config.logger.debug "API called: WebhooksApi#webhooks_upsert_events_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
271
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
194
272
  end
195
273
  return data, status_code, headers
196
274
  end
@@ -32,7 +32,7 @@ module Pingram
32
32
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
33
33
  def initialize(config = Configuration.default)
34
34
  @config = config
35
- @user_agent = "pingram-ruby/1.0.29"
35
+ @user_agent = "pingram-ruby/1.0.31"
36
36
  @default_headers = {
37
37
  'Content-Type' => 'application/json',
38
38
  'User-Agent' => @user_agent
@@ -52,6 +52,9 @@ module Pingram
52
52
 
53
53
  attr_accessor :pending_downgrade_account_type
54
54
 
55
+ # When true, paid accounts move up one budget tier at 90% of the monthly budget.
56
+ attr_accessor :auto_upgrade
57
+
55
58
  class EnumAttributeValidator
56
59
  attr_reader :datatype
57
60
  attr_reader :allowable_values
@@ -93,7 +96,8 @@ module Pingram
93
96
  :'subscription_status' => :'subscriptionStatus',
94
97
  :'pending_downgrade_effective_date' => :'pendingDowngradeEffectiveDate',
95
98
  :'pending_downgrade_cost_cap' => :'pendingDowngradeCostCap',
96
- :'pending_downgrade_account_type' => :'pendingDowngradeAccountType'
99
+ :'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
100
+ :'auto_upgrade' => :'autoUpgrade'
97
101
  }
98
102
  end
99
103
 
@@ -126,7 +130,8 @@ module Pingram
126
130
  :'subscription_status' => :'String',
127
131
  :'pending_downgrade_effective_date' => :'String',
128
132
  :'pending_downgrade_cost_cap' => :'Float',
129
- :'pending_downgrade_account_type' => :'String'
133
+ :'pending_downgrade_account_type' => :'String',
134
+ :'auto_upgrade' => :'Boolean'
130
135
  }
131
136
  end
132
137
 
@@ -234,6 +239,10 @@ module Pingram
234
239
  if attributes.key?(:'pending_downgrade_account_type')
235
240
  self.pending_downgrade_account_type = attributes[:'pending_downgrade_account_type']
236
241
  end
242
+
243
+ if attributes.key?(:'auto_upgrade')
244
+ self.auto_upgrade = attributes[:'auto_upgrade']
245
+ end
237
246
  end
238
247
 
239
248
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -427,7 +436,8 @@ module Pingram
427
436
  subscription_status == o.subscription_status &&
428
437
  pending_downgrade_effective_date == o.pending_downgrade_effective_date &&
429
438
  pending_downgrade_cost_cap == o.pending_downgrade_cost_cap &&
430
- pending_downgrade_account_type == o.pending_downgrade_account_type
439
+ pending_downgrade_account_type == o.pending_downgrade_account_type &&
440
+ auto_upgrade == o.auto_upgrade
431
441
  end
432
442
 
433
443
  # @see the `==` method
@@ -439,7 +449,7 @@ module Pingram
439
449
  # Calculates hash code according to all attributes.
440
450
  # @return [Integer] Hash code
441
451
  def hash
442
- [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type].hash
452
+ [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type, auto_upgrade].hash
443
453
  end
444
454
 
445
455
  # Builds the object from hash
@@ -0,0 +1,149 @@
1
+ =begin
2
+ #Pingram
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
+ # PATCH /account request: billing preferences.
18
+ class AccountPatchRequest < ApiModelBase
19
+ # When true, automatically move up one budget tier at 90% of the monthly budget.
20
+ attr_accessor :auto_upgrade
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'auto_upgrade' => :'autoUpgrade'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'auto_upgrade' => :'Boolean'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::AccountPatchRequest` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::AccountPatchRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'auto_upgrade')
69
+ self.auto_upgrade = attributes[:'auto_upgrade']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ auto_upgrade == o.auto_upgrade
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [auto_upgrade].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end
@@ -52,6 +52,9 @@ module Pingram
52
52
 
53
53
  attr_accessor :pending_downgrade_account_type
54
54
 
55
+ # When true, paid accounts move up one budget tier at 90% of the monthly budget.
56
+ attr_accessor :auto_upgrade
57
+
55
58
  attr_accessor :session_id
56
59
 
57
60
  attr_accessor :url
@@ -98,6 +101,7 @@ module Pingram
98
101
  :'pending_downgrade_effective_date' => :'pendingDowngradeEffectiveDate',
99
102
  :'pending_downgrade_cost_cap' => :'pendingDowngradeCostCap',
100
103
  :'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
104
+ :'auto_upgrade' => :'autoUpgrade',
101
105
  :'session_id' => :'sessionId',
102
106
  :'url' => :'url'
103
107
  }
@@ -133,6 +137,7 @@ module Pingram
133
137
  :'pending_downgrade_effective_date' => :'String',
134
138
  :'pending_downgrade_cost_cap' => :'Float',
135
139
  :'pending_downgrade_account_type' => :'String',
140
+ :'auto_upgrade' => :'Boolean',
136
141
  :'session_id' => :'String',
137
142
  :'url' => :'String'
138
143
  }
@@ -243,6 +248,10 @@ module Pingram
243
248
  self.pending_downgrade_account_type = attributes[:'pending_downgrade_account_type']
244
249
  end
245
250
 
251
+ if attributes.key?(:'auto_upgrade')
252
+ self.auto_upgrade = attributes[:'auto_upgrade']
253
+ end
254
+
246
255
  if attributes.key?(:'session_id')
247
256
  self.session_id = attributes[:'session_id']
248
257
  end
@@ -444,6 +453,7 @@ module Pingram
444
453
  pending_downgrade_effective_date == o.pending_downgrade_effective_date &&
445
454
  pending_downgrade_cost_cap == o.pending_downgrade_cost_cap &&
446
455
  pending_downgrade_account_type == o.pending_downgrade_account_type &&
456
+ auto_upgrade == o.auto_upgrade &&
447
457
  session_id == o.session_id &&
448
458
  url == o.url
449
459
  end
@@ -457,7 +467,7 @@ module Pingram
457
467
  # Calculates hash code according to all attributes.
458
468
  # @return [Integer] Hash code
459
469
  def hash
460
- [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type, session_id, url].hash
470
+ [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type, auto_upgrade, session_id, url].hash
461
471
  end
462
472
 
463
473
  # Builds the object from hash