pingram 1.0.36 → 1.0.37
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/Gemfile.lock +1 -1
- data/lib/pingram/api/account_api.rb +244 -2
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/models/account_get_response.rb +13 -4
- data/lib/pingram/models/account_get_response_billing_alerts.rb +224 -0
- data/lib/pingram/models/account_patch_request.rb +13 -4
- data/lib/pingram/models/billing_email.rb +177 -0
- data/lib/pingram/models/billing_post_response_body.rb +10 -1
- data/lib/pingram/models/cancel_subscription_request.rb +168 -0
- data/lib/pingram/models/phone_verify_start_response.rb +14 -4
- data/lib/pingram/models/sender_post_body_sms.rb +1 -1
- data/lib/pingram/models/sender_post_body_sms_auto_reply.rb +2 -1
- data/lib/pingram/models/slack_connect_invite_response.rb +190 -0
- data/lib/pingram/models/update_billing_email_request.rb +184 -0
- data/lib/pingram/models/webhook_event.rb +88 -6
- data/lib/pingram/models/webhook_event_usage_value.rb +193 -0
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +6 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/mkmf.log +3 -3
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 72c7ebf52ff9504c319d6ce2a61380c6caa1b1db45b3ac999ad62e10f6df81df
|
|
4
|
+
data.tar.gz: f47e1d381c9e1d50e4a3a3ff9ff5ab2dceeec901cf9f06ce667ff9f3fa4a4d79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df935ca664ef3c1c248651cbed7849dba8f309b6343e075472d8d35f1ddfef879621dae44808160b7db6087229b1ec45aab6b4a075cc4e50cf7f2379b860ba8c
|
|
7
|
+
data.tar.gz: 19b0faff8ad1f538cb177d18783d9706be4fff58e7940a0dac9afc101dc09e245bbe4caeaab7fc7bd467a5e94902c33bb76f14e11d935df563c4f6a2c0bbfa3d
|
data/Gemfile.lock
CHANGED
|
@@ -19,6 +19,72 @@ module Pingram
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Cancel the paid plan at the end of the current billing cycle. Access continues until then.
|
|
23
|
+
# @param cancel_subscription_request [CancelSubscriptionRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [AccountGetResponse]
|
|
26
|
+
def account_cancel_subscription(cancel_subscription_request, opts = {})
|
|
27
|
+
data, _status_code, _headers = account_cancel_subscription_with_http_info(cancel_subscription_request, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Cancel the paid plan at the end of the current billing cycle. Access continues until then.
|
|
32
|
+
# @param cancel_subscription_request [CancelSubscriptionRequest]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(AccountGetResponse, Integer, Hash)>] AccountGetResponse data, response status code and response headers
|
|
35
|
+
def account_cancel_subscription_with_http_info(cancel_subscription_request, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_cancel_subscription ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'cancel_subscription_request' is set
|
|
40
|
+
if @api_client.config.client_side_validation && cancel_subscription_request.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'cancel_subscription_request' when calling AccountApi.account_cancel_subscription"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/account/subscription/cancel'
|
|
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(cancel_subscription_request)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'AccountGetResponse'
|
|
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 => :"AccountApi.account_cancel_subscription",
|
|
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: AccountApi#account_cancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
22
88
|
# Configure SMTP settings for a Supabase project
|
|
23
89
|
# @param supabase_configure_request [SupabaseConfigureRequest]
|
|
24
90
|
# @param [Hash] opts the optional parameters
|
|
@@ -140,6 +206,61 @@ module Pingram
|
|
|
140
206
|
return data, status_code, headers
|
|
141
207
|
end
|
|
142
208
|
|
|
209
|
+
# Get the email address that receives invoices for this account.
|
|
210
|
+
# @param [Hash] opts the optional parameters
|
|
211
|
+
# @return [BillingEmail]
|
|
212
|
+
def account_get_billing_email(opts = {})
|
|
213
|
+
data, _status_code, _headers = account_get_billing_email_with_http_info(opts)
|
|
214
|
+
data
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Get the email address that receives invoices for this account.
|
|
218
|
+
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @return [Array<(BillingEmail, Integer, Hash)>] BillingEmail data, response status code and response headers
|
|
220
|
+
def account_get_billing_email_with_http_info(opts = {})
|
|
221
|
+
if @api_client.config.debugging
|
|
222
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_get_billing_email ...'
|
|
223
|
+
end
|
|
224
|
+
# resource path
|
|
225
|
+
local_var_path = '/account/billing-email'
|
|
226
|
+
|
|
227
|
+
# query parameters
|
|
228
|
+
query_params = opts[:query_params] || {}
|
|
229
|
+
|
|
230
|
+
# header parameters
|
|
231
|
+
header_params = opts[:header_params] || {}
|
|
232
|
+
# HTTP header 'Accept' (if needed)
|
|
233
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
234
|
+
|
|
235
|
+
# form parameters
|
|
236
|
+
form_params = opts[:form_params] || {}
|
|
237
|
+
|
|
238
|
+
# http body (model)
|
|
239
|
+
post_body = opts[:debug_body]
|
|
240
|
+
|
|
241
|
+
# return_type
|
|
242
|
+
return_type = opts[:debug_return_type] || 'BillingEmail'
|
|
243
|
+
|
|
244
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
245
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
246
|
+
|
|
247
|
+
new_options = opts.merge(
|
|
248
|
+
:operation => :"AccountApi.account_get_billing_email",
|
|
249
|
+
:header_params => header_params,
|
|
250
|
+
:query_params => query_params,
|
|
251
|
+
:form_params => form_params,
|
|
252
|
+
:body => post_body,
|
|
253
|
+
:auth_names => auth_names,
|
|
254
|
+
:return_type => return_type
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
258
|
+
if @api_client.config.debugging
|
|
259
|
+
@api_client.config.logger.debug "API called: AccountApi#account_get_billing_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
260
|
+
end
|
|
261
|
+
return data, status_code, headers
|
|
262
|
+
end
|
|
263
|
+
|
|
143
264
|
# Get Supabase integration status for the account
|
|
144
265
|
# @param [Hash] opts the optional parameters
|
|
145
266
|
# @return [SupabaseStatusResponse]
|
|
@@ -513,6 +634,61 @@ module Pingram
|
|
|
513
634
|
return data, status_code, headers
|
|
514
635
|
end
|
|
515
636
|
|
|
637
|
+
# Keep the current paid plan and undo a cancellation scheduled for the end of the billing cycle.
|
|
638
|
+
# @param [Hash] opts the optional parameters
|
|
639
|
+
# @return [AccountGetResponse]
|
|
640
|
+
def account_resume_subscription(opts = {})
|
|
641
|
+
data, _status_code, _headers = account_resume_subscription_with_http_info(opts)
|
|
642
|
+
data
|
|
643
|
+
end
|
|
644
|
+
|
|
645
|
+
# Keep the current paid plan and undo a cancellation scheduled for the end of the billing cycle.
|
|
646
|
+
# @param [Hash] opts the optional parameters
|
|
647
|
+
# @return [Array<(AccountGetResponse, Integer, Hash)>] AccountGetResponse data, response status code and response headers
|
|
648
|
+
def account_resume_subscription_with_http_info(opts = {})
|
|
649
|
+
if @api_client.config.debugging
|
|
650
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_resume_subscription ...'
|
|
651
|
+
end
|
|
652
|
+
# resource path
|
|
653
|
+
local_var_path = '/account/subscription/resume'
|
|
654
|
+
|
|
655
|
+
# query parameters
|
|
656
|
+
query_params = opts[:query_params] || {}
|
|
657
|
+
|
|
658
|
+
# header parameters
|
|
659
|
+
header_params = opts[:header_params] || {}
|
|
660
|
+
# HTTP header 'Accept' (if needed)
|
|
661
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
662
|
+
|
|
663
|
+
# form parameters
|
|
664
|
+
form_params = opts[:form_params] || {}
|
|
665
|
+
|
|
666
|
+
# http body (model)
|
|
667
|
+
post_body = opts[:debug_body]
|
|
668
|
+
|
|
669
|
+
# return_type
|
|
670
|
+
return_type = opts[:debug_return_type] || 'AccountGetResponse'
|
|
671
|
+
|
|
672
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
673
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
674
|
+
|
|
675
|
+
new_options = opts.merge(
|
|
676
|
+
:operation => :"AccountApi.account_resume_subscription",
|
|
677
|
+
:header_params => header_params,
|
|
678
|
+
:query_params => query_params,
|
|
679
|
+
:form_params => form_params,
|
|
680
|
+
:body => post_body,
|
|
681
|
+
:auth_names => auth_names,
|
|
682
|
+
:return_type => return_type
|
|
683
|
+
)
|
|
684
|
+
|
|
685
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
686
|
+
if @api_client.config.debugging
|
|
687
|
+
@api_client.config.logger.debug "API called: AccountApi#account_resume_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
688
|
+
end
|
|
689
|
+
return data, status_code, headers
|
|
690
|
+
end
|
|
691
|
+
|
|
516
692
|
# Revoke Supabase integration (removes stored tokens and project info)
|
|
517
693
|
# @param [Hash] opts the optional parameters
|
|
518
694
|
# @return [SupabaseConfigureResponse]
|
|
@@ -634,7 +810,7 @@ module Pingram
|
|
|
634
810
|
return data, status_code, headers
|
|
635
811
|
end
|
|
636
812
|
|
|
637
|
-
# Update account billing preferences such as auto upgrade.
|
|
813
|
+
# Update account billing preferences such as auto upgrade and usage email alerts.
|
|
638
814
|
# @param account_patch_request [AccountPatchRequest]
|
|
639
815
|
# @param [Hash] opts the optional parameters
|
|
640
816
|
# @return [AccountGetResponse]
|
|
@@ -643,7 +819,7 @@ module Pingram
|
|
|
643
819
|
data
|
|
644
820
|
end
|
|
645
821
|
|
|
646
|
-
# Update account billing preferences such as auto upgrade.
|
|
822
|
+
# Update account billing preferences such as auto upgrade and usage email alerts.
|
|
647
823
|
# @param account_patch_request [AccountPatchRequest]
|
|
648
824
|
# @param [Hash] opts the optional parameters
|
|
649
825
|
# @return [Array<(AccountGetResponse, Integer, Hash)>] AccountGetResponse data, response status code and response headers
|
|
@@ -699,5 +875,71 @@ module Pingram
|
|
|
699
875
|
end
|
|
700
876
|
return data, status_code, headers
|
|
701
877
|
end
|
|
878
|
+
|
|
879
|
+
# Update the email address that receives invoices for this account.
|
|
880
|
+
# @param update_billing_email_request [UpdateBillingEmailRequest]
|
|
881
|
+
# @param [Hash] opts the optional parameters
|
|
882
|
+
# @return [BillingEmail]
|
|
883
|
+
def account_update_billing_email(update_billing_email_request, opts = {})
|
|
884
|
+
data, _status_code, _headers = account_update_billing_email_with_http_info(update_billing_email_request, opts)
|
|
885
|
+
data
|
|
886
|
+
end
|
|
887
|
+
|
|
888
|
+
# Update the email address that receives invoices for this account.
|
|
889
|
+
# @param update_billing_email_request [UpdateBillingEmailRequest]
|
|
890
|
+
# @param [Hash] opts the optional parameters
|
|
891
|
+
# @return [Array<(BillingEmail, Integer, Hash)>] BillingEmail data, response status code and response headers
|
|
892
|
+
def account_update_billing_email_with_http_info(update_billing_email_request, opts = {})
|
|
893
|
+
if @api_client.config.debugging
|
|
894
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_update_billing_email ...'
|
|
895
|
+
end
|
|
896
|
+
# verify the required parameter 'update_billing_email_request' is set
|
|
897
|
+
if @api_client.config.client_side_validation && update_billing_email_request.nil?
|
|
898
|
+
fail ArgumentError, "Missing the required parameter 'update_billing_email_request' when calling AccountApi.account_update_billing_email"
|
|
899
|
+
end
|
|
900
|
+
# resource path
|
|
901
|
+
local_var_path = '/account/billing-email'
|
|
902
|
+
|
|
903
|
+
# query parameters
|
|
904
|
+
query_params = opts[:query_params] || {}
|
|
905
|
+
|
|
906
|
+
# header parameters
|
|
907
|
+
header_params = opts[:header_params] || {}
|
|
908
|
+
# HTTP header 'Accept' (if needed)
|
|
909
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
910
|
+
# HTTP header 'Content-Type'
|
|
911
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
912
|
+
if !content_type.nil?
|
|
913
|
+
header_params['Content-Type'] = content_type
|
|
914
|
+
end
|
|
915
|
+
|
|
916
|
+
# form parameters
|
|
917
|
+
form_params = opts[:form_params] || {}
|
|
918
|
+
|
|
919
|
+
# http body (model)
|
|
920
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_billing_email_request)
|
|
921
|
+
|
|
922
|
+
# return_type
|
|
923
|
+
return_type = opts[:debug_return_type] || 'BillingEmail'
|
|
924
|
+
|
|
925
|
+
# auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
|
|
926
|
+
auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
|
|
927
|
+
|
|
928
|
+
new_options = opts.merge(
|
|
929
|
+
:operation => :"AccountApi.account_update_billing_email",
|
|
930
|
+
:header_params => header_params,
|
|
931
|
+
:query_params => query_params,
|
|
932
|
+
:form_params => form_params,
|
|
933
|
+
:body => post_body,
|
|
934
|
+
:auth_names => auth_names,
|
|
935
|
+
:return_type => return_type
|
|
936
|
+
)
|
|
937
|
+
|
|
938
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
939
|
+
if @api_client.config.debugging
|
|
940
|
+
@api_client.config.logger.debug "API called: AccountApi#account_update_billing_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
941
|
+
end
|
|
942
|
+
return data, status_code, headers
|
|
943
|
+
end
|
|
702
944
|
end
|
|
703
945
|
end
|
data/lib/pingram/api_client.rb
CHANGED
|
@@ -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.
|
|
35
|
+
@user_agent = "pingram-ruby/1.0.37"
|
|
36
36
|
@default_headers = {
|
|
37
37
|
'Content-Type' => 'application/json',
|
|
38
38
|
'User-Agent' => @user_agent
|
|
@@ -55,6 +55,8 @@ module Pingram
|
|
|
55
55
|
# When true, paid accounts move up one budget tier at 90% of the monthly budget.
|
|
56
56
|
attr_accessor :auto_upgrade
|
|
57
57
|
|
|
58
|
+
attr_accessor :billing_alerts
|
|
59
|
+
|
|
58
60
|
class EnumAttributeValidator
|
|
59
61
|
attr_reader :datatype
|
|
60
62
|
attr_reader :allowable_values
|
|
@@ -97,7 +99,8 @@ module Pingram
|
|
|
97
99
|
:'pending_downgrade_effective_date' => :'pendingDowngradeEffectiveDate',
|
|
98
100
|
:'pending_downgrade_cost_cap' => :'pendingDowngradeCostCap',
|
|
99
101
|
:'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
|
|
100
|
-
:'auto_upgrade' => :'autoUpgrade'
|
|
102
|
+
:'auto_upgrade' => :'autoUpgrade',
|
|
103
|
+
:'billing_alerts' => :'billingAlerts'
|
|
101
104
|
}
|
|
102
105
|
end
|
|
103
106
|
|
|
@@ -131,7 +134,8 @@ module Pingram
|
|
|
131
134
|
:'pending_downgrade_effective_date' => :'String',
|
|
132
135
|
:'pending_downgrade_cost_cap' => :'Float',
|
|
133
136
|
:'pending_downgrade_account_type' => :'String',
|
|
134
|
-
:'auto_upgrade' => :'Boolean'
|
|
137
|
+
:'auto_upgrade' => :'Boolean',
|
|
138
|
+
:'billing_alerts' => :'AccountGetResponseBillingAlerts'
|
|
135
139
|
}
|
|
136
140
|
end
|
|
137
141
|
|
|
@@ -243,6 +247,10 @@ module Pingram
|
|
|
243
247
|
if attributes.key?(:'auto_upgrade')
|
|
244
248
|
self.auto_upgrade = attributes[:'auto_upgrade']
|
|
245
249
|
end
|
|
250
|
+
|
|
251
|
+
if attributes.key?(:'billing_alerts')
|
|
252
|
+
self.billing_alerts = attributes[:'billing_alerts']
|
|
253
|
+
end
|
|
246
254
|
end
|
|
247
255
|
|
|
248
256
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -437,7 +445,8 @@ module Pingram
|
|
|
437
445
|
pending_downgrade_effective_date == o.pending_downgrade_effective_date &&
|
|
438
446
|
pending_downgrade_cost_cap == o.pending_downgrade_cost_cap &&
|
|
439
447
|
pending_downgrade_account_type == o.pending_downgrade_account_type &&
|
|
440
|
-
auto_upgrade == o.auto_upgrade
|
|
448
|
+
auto_upgrade == o.auto_upgrade &&
|
|
449
|
+
billing_alerts == o.billing_alerts
|
|
441
450
|
end
|
|
442
451
|
|
|
443
452
|
# @see the `==` method
|
|
@@ -449,7 +458,7 @@ module Pingram
|
|
|
449
458
|
# Calculates hash code according to all attributes.
|
|
450
459
|
# @return [Integer] Hash code
|
|
451
460
|
def 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
|
|
461
|
+
[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, billing_alerts].hash
|
|
453
462
|
end
|
|
454
463
|
|
|
455
464
|
# Builds the object from hash
|
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
# Email alerts for monthly usage. New accounts start enabled for the creator at 80% and 100%.
|
|
18
|
+
class AccountGetResponseBillingAlerts < ApiModelBase
|
|
19
|
+
# When false, saved addresses and thresholds are kept but no email is sent.
|
|
20
|
+
attr_accessor :enabled
|
|
21
|
+
|
|
22
|
+
# Addresses that receive threshold emails. At most three.
|
|
23
|
+
attr_accessor :emails
|
|
24
|
+
|
|
25
|
+
# Percents to email, from 5 to 100 in steps of 5. At most two. At least one is required while enabled.
|
|
26
|
+
attr_accessor :thresholds
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'enabled' => :'enabled',
|
|
32
|
+
:'emails' => :'emails',
|
|
33
|
+
:'thresholds' => :'thresholds'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'enabled' => :'Boolean',
|
|
51
|
+
:'emails' => :'Array<String>',
|
|
52
|
+
:'thresholds' => :'Array<Float>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::AccountGetResponseBillingAlerts` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::AccountGetResponseBillingAlerts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'enabled')
|
|
79
|
+
self.enabled = attributes[:'enabled']
|
|
80
|
+
else
|
|
81
|
+
self.enabled = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'emails')
|
|
85
|
+
if (value = attributes[:'emails']).is_a?(Array)
|
|
86
|
+
self.emails = value
|
|
87
|
+
end
|
|
88
|
+
else
|
|
89
|
+
self.emails = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'thresholds')
|
|
93
|
+
if (value = attributes[:'thresholds']).is_a?(Array)
|
|
94
|
+
self.thresholds = value
|
|
95
|
+
end
|
|
96
|
+
else
|
|
97
|
+
self.thresholds = nil
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
if @enabled.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if @emails.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "emails", emails cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @thresholds.nil?
|
|
115
|
+
invalid_properties.push('invalid value for "thresholds", thresholds cannot be nil.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
invalid_properties
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Check to see if the all the properties in the model are valid
|
|
122
|
+
# @return true if the model is valid
|
|
123
|
+
def valid?
|
|
124
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
125
|
+
return false if @enabled.nil?
|
|
126
|
+
return false if @emails.nil?
|
|
127
|
+
return false if @thresholds.nil?
|
|
128
|
+
true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Custom attribute writer method with validation
|
|
132
|
+
# @param [Object] enabled Value to be assigned
|
|
133
|
+
def enabled=(enabled)
|
|
134
|
+
if enabled.nil?
|
|
135
|
+
fail ArgumentError, 'enabled cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@enabled = enabled
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] emails Value to be assigned
|
|
143
|
+
def emails=(emails)
|
|
144
|
+
if emails.nil?
|
|
145
|
+
fail ArgumentError, 'emails cannot be nil'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
@emails = emails
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Custom attribute writer method with validation
|
|
152
|
+
# @param [Object] thresholds Value to be assigned
|
|
153
|
+
def thresholds=(thresholds)
|
|
154
|
+
if thresholds.nil?
|
|
155
|
+
fail ArgumentError, 'thresholds cannot be nil'
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
@thresholds = thresholds
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Checks equality by comparing each attribute.
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def ==(o)
|
|
164
|
+
return true if self.equal?(o)
|
|
165
|
+
self.class == o.class &&
|
|
166
|
+
enabled == o.enabled &&
|
|
167
|
+
emails == o.emails &&
|
|
168
|
+
thresholds == o.thresholds
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# @see the `==` method
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def eql?(o)
|
|
174
|
+
self == o
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Calculates hash code according to all attributes.
|
|
178
|
+
# @return [Integer] Hash code
|
|
179
|
+
def hash
|
|
180
|
+
[enabled, emails, thresholds].hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Builds the object from hash
|
|
184
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
185
|
+
# @return [Object] Returns the model itself
|
|
186
|
+
def self.build_from_hash(attributes)
|
|
187
|
+
return nil unless attributes.is_a?(Hash)
|
|
188
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
189
|
+
transformed_hash = {}
|
|
190
|
+
openapi_types.each_pair do |key, type|
|
|
191
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = nil
|
|
193
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
194
|
+
# check to ensure the input is an array given that the attribute
|
|
195
|
+
# is documented as an array but the input is not
|
|
196
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
197
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
198
|
+
end
|
|
199
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
200
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
new(transformed_hash)
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Returns the object in the form of hash
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_hash
|
|
209
|
+
hash = {}
|
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
211
|
+
value = self.send(attr)
|
|
212
|
+
if value.nil?
|
|
213
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
214
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
hash[param] = _to_hash(value)
|
|
218
|
+
end
|
|
219
|
+
hash
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
end
|
|
@@ -19,10 +19,13 @@ module Pingram
|
|
|
19
19
|
# When true, automatically move up one budget tier at 90% of the monthly budget.
|
|
20
20
|
attr_accessor :auto_upgrade
|
|
21
21
|
|
|
22
|
+
attr_accessor :billing_alerts
|
|
23
|
+
|
|
22
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
25
|
def self.attribute_map
|
|
24
26
|
{
|
|
25
|
-
:'auto_upgrade' => :'autoUpgrade'
|
|
27
|
+
:'auto_upgrade' => :'autoUpgrade',
|
|
28
|
+
:'billing_alerts' => :'billingAlerts'
|
|
26
29
|
}
|
|
27
30
|
end
|
|
28
31
|
|
|
@@ -39,7 +42,8 @@ module Pingram
|
|
|
39
42
|
# Attribute type mapping.
|
|
40
43
|
def self.openapi_types
|
|
41
44
|
{
|
|
42
|
-
:'auto_upgrade' => :'Boolean'
|
|
45
|
+
:'auto_upgrade' => :'Boolean',
|
|
46
|
+
:'billing_alerts' => :'AccountGetResponseBillingAlerts'
|
|
43
47
|
}
|
|
44
48
|
end
|
|
45
49
|
|
|
@@ -68,6 +72,10 @@ module Pingram
|
|
|
68
72
|
if attributes.key?(:'auto_upgrade')
|
|
69
73
|
self.auto_upgrade = attributes[:'auto_upgrade']
|
|
70
74
|
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'billing_alerts')
|
|
77
|
+
self.billing_alerts = attributes[:'billing_alerts']
|
|
78
|
+
end
|
|
71
79
|
end
|
|
72
80
|
|
|
73
81
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -90,7 +98,8 @@ module Pingram
|
|
|
90
98
|
def ==(o)
|
|
91
99
|
return true if self.equal?(o)
|
|
92
100
|
self.class == o.class &&
|
|
93
|
-
auto_upgrade == o.auto_upgrade
|
|
101
|
+
auto_upgrade == o.auto_upgrade &&
|
|
102
|
+
billing_alerts == o.billing_alerts
|
|
94
103
|
end
|
|
95
104
|
|
|
96
105
|
# @see the `==` method
|
|
@@ -102,7 +111,7 @@ module Pingram
|
|
|
102
111
|
# Calculates hash code according to all attributes.
|
|
103
112
|
# @return [Integer] Hash code
|
|
104
113
|
def hash
|
|
105
|
-
[auto_upgrade].hash
|
|
114
|
+
[auto_upgrade, billing_alerts].hash
|
|
106
115
|
end
|
|
107
116
|
|
|
108
117
|
# Builds the object from hash
|