pingram 1.0.22 → 1.0.24

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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/pingram/api/accounts_api.rb +143 -0
  4. data/lib/pingram/api/user_api.rb +0 -133
  5. data/lib/pingram/api_client.rb +1 -1
  6. data/lib/pingram/client_wrapper.rb +10 -0
  7. data/lib/pingram/models/account_get_response.rb +25 -4
  8. data/lib/pingram/models/billing_post_response_body.rb +22 -1
  9. data/lib/pingram/models/create_account_request.rb +45 -9
  10. data/lib/pingram/models/create_account_request_plan.rb +216 -0
  11. data/lib/pingram/models/create_account_response.rb +103 -30
  12. data/lib/pingram/models/first_account_request.rb +150 -0
  13. data/lib/pingram/models/{slack_oauth_request.rb → first_account_response.rb} +34 -34
  14. data/lib/pingram/models/list_accounts_response.rb +167 -0
  15. data/lib/pingram/models/list_accounts_response_accounts_inner.rb +304 -0
  16. data/lib/pingram/models/phone_verify_confirm_response.rb +13 -4
  17. data/lib/pingram/version.rb +1 -1
  18. data/lib/pingram.rb +6 -1
  19. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  20. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  21. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/gem_make.out +5 -5
  22. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/mkmf.log +3 -3
  23. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  24. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.4.0/gem_make.out +5 -5
  25. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  26. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  27. metadata +8 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb108d4750254f5d0266c6996bf93ee20c96ba69a48f9c87b0b8cac105b7d34e
4
- data.tar.gz: 76b17f9e1d2457ef8d1fb21efedcb2be2024b80ee0c1e3de1079e72b115f444a
3
+ metadata.gz: 8342611fb252a9cbd5796951afccee8bb864214fed143b49ac8cd6df1007a424
4
+ data.tar.gz: eff6dd67d22316c77f7286a902128f61951a153d4ed0a6f48de5b46417428cd0
5
5
  SHA512:
6
- metadata.gz: 68f9b19c250731d485cd4e0f91d7f50cb7be0c1d2d5c36ec93bdc359ae08f7f346c8060e6c49ae00bb9b980e59f09dd238e2abbab0bae530f36f3255d50bce5f
7
- data.tar.gz: 325135064572154dc797046c2b1f700a6763faf545b226c2932487ef67190fcf73edfaaee841975936921236eb4b761c21c114cebe86debeec8abeadd02a3a22
6
+ metadata.gz: f556eaf655a35284f1b0a2801d04371077d88c5425a2046e4f1568cdbe528e7ce8c148b9312843459aa693545a3f62fccd26a1fb3016041c057753720c88309f
7
+ data.tar.gz: 5415f73f74026920ff03ad3d92d1f2f9d742f93e7e9c4997d0241a0da85f74b8cf2c295cbb007872d80d2618246b66fdfe93d8b4b0bf40c3a8f2ba86c4efe11e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pingram (1.0.22)
4
+ pingram (1.0.24)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -0,0 +1,143 @@
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 'cgi'
14
+
15
+ module Pingram
16
+ class AccountsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create an additional account for the authenticated user
23
+ # @param create_account_request [CreateAccountRequest]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [CreateAccountResponse]
26
+ def accounts_create_account(create_account_request, opts = {})
27
+ data, _status_code, _headers = accounts_create_account_with_http_info(create_account_request, opts)
28
+ data
29
+ end
30
+
31
+ # Create an additional account for the authenticated user
32
+ # @param create_account_request [CreateAccountRequest]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(CreateAccountResponse, Integer, Hash)>] CreateAccountResponse data, response status code and response headers
35
+ def accounts_create_account_with_http_info(create_account_request, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: AccountsApi.accounts_create_account ...'
38
+ end
39
+ # verify the required parameter 'create_account_request' is set
40
+ if @api_client.config.client_side_validation && create_account_request.nil?
41
+ fail ArgumentError, "Missing the required parameter 'create_account_request' when calling AccountsApi.accounts_create_account"
42
+ end
43
+ # resource path
44
+ local_var_path = '/accounts'
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(create_account_request)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'CreateAccountResponse'
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 => :"AccountsApi.accounts_create_account",
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: AccountsApi#accounts_create_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # List accounts the authenticated user can access
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [ListAccountsResponse]
91
+ def accounts_list_accounts(opts = {})
92
+ data, _status_code, _headers = accounts_list_accounts_with_http_info(opts)
93
+ data
94
+ end
95
+
96
+ # List accounts the authenticated user can access
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(ListAccountsResponse, Integer, Hash)>] ListAccountsResponse data, response status code and response headers
99
+ def accounts_list_accounts_with_http_info(opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: AccountsApi.accounts_list_accounts ...'
102
+ end
103
+ # resource path
104
+ local_var_path = '/accounts'
105
+
106
+ # query parameters
107
+ query_params = opts[:query_params] || {}
108
+
109
+ # header parameters
110
+ header_params = opts[:header_params] || {}
111
+ # HTTP header 'Accept' (if needed)
112
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
113
+
114
+ # form parameters
115
+ form_params = opts[:form_params] || {}
116
+
117
+ # http body (model)
118
+ post_body = opts[:debug_body]
119
+
120
+ # return_type
121
+ return_type = opts[:debug_return_type] || 'ListAccountsResponse'
122
+
123
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
124
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
125
+
126
+ new_options = opts.merge(
127
+ :operation => :"AccountsApi.accounts_list_accounts",
128
+ :header_params => header_params,
129
+ :query_params => query_params,
130
+ :form_params => form_params,
131
+ :body => post_body,
132
+ :auth_names => auth_names,
133
+ :return_type => return_type
134
+ )
135
+
136
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug "API called: AccountsApi#accounts_list_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
139
+ end
140
+ return data, status_code, headers
141
+ end
142
+ end
143
+ end
@@ -19,78 +19,6 @@ module Pingram
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Complete Slack OAuth flow and store access token for user
23
- # @param user_id [String] User ID
24
- # @param slack_oauth_request [SlackOauthRequest]
25
- # @param [Hash] opts the optional parameters
26
- # @return [nil]
27
- def user_generate_slack_oauth_path(user_id, slack_oauth_request, opts = {})
28
- user_generate_slack_oauth_path_with_http_info(user_id, slack_oauth_request, opts)
29
- nil
30
- end
31
-
32
- # Complete Slack OAuth flow and store access token for user
33
- # @param user_id [String] User ID
34
- # @param slack_oauth_request [SlackOauthRequest]
35
- # @param [Hash] opts the optional parameters
36
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
- def user_generate_slack_oauth_path_with_http_info(user_id, slack_oauth_request, opts = {})
38
- if @api_client.config.debugging
39
- @api_client.config.logger.debug 'Calling API: UserApi.user_generate_slack_oauth_path ...'
40
- end
41
- # verify the required parameter 'user_id' is set
42
- if @api_client.config.client_side_validation && user_id.nil?
43
- fail ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.user_generate_slack_oauth_path"
44
- end
45
- # verify the required parameter 'slack_oauth_request' is set
46
- if @api_client.config.client_side_validation && slack_oauth_request.nil?
47
- fail ArgumentError, "Missing the required parameter 'slack_oauth_request' when calling UserApi.user_generate_slack_oauth_path"
48
- end
49
- # resource path
50
- local_var_path = '/users/{userId}/slack-oauth'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s))
51
-
52
- # query parameters
53
- query_params = opts[:query_params] || {}
54
-
55
- # header parameters
56
- header_params = opts[:header_params] || {}
57
- # HTTP header 'Accept' (if needed)
58
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
59
- # HTTP header 'Content-Type'
60
- content_type = @api_client.select_header_content_type(['application/json'])
61
- if !content_type.nil?
62
- header_params['Content-Type'] = content_type
63
- end
64
-
65
- # form parameters
66
- form_params = opts[:form_params] || {}
67
-
68
- # http body (model)
69
- post_body = opts[:debug_body] || @api_client.object_to_http_body(slack_oauth_request)
70
-
71
- # return_type
72
- return_type = opts[:debug_return_type]
73
-
74
- # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
75
- auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
76
-
77
- new_options = opts.merge(
78
- :operation => :"UserApi.user_generate_slack_oauth_path",
79
- :header_params => header_params,
80
- :query_params => query_params,
81
- :form_params => form_params,
82
- :body => post_body,
83
- :auth_names => auth_names,
84
- :return_type => return_type
85
- )
86
-
87
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
88
- if @api_client.config.debugging
89
- @api_client.config.logger.debug "API called: UserApi#user_generate_slack_oauth_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
- end
91
- return data, status_code, headers
92
- end
93
-
94
22
  # Get account-level metadata including logo, VAPID key, and web push status
95
23
  # @param [Hash] opts the optional parameters
96
24
  # @return [GetAccountMetadataResponse]
@@ -146,67 +74,6 @@ module Pingram
146
74
  return data, status_code, headers
147
75
  end
148
76
 
149
- # Get list of Slack channels and users for the authenticated user
150
- # @param user_id [String] User ID
151
- # @param [Hash] opts the optional parameters
152
- # @return [nil]
153
- def user_get_available_slack_channels(user_id, opts = {})
154
- user_get_available_slack_channels_with_http_info(user_id, opts)
155
- nil
156
- end
157
-
158
- # Get list of Slack channels and users for the authenticated user
159
- # @param user_id [String] User ID
160
- # @param [Hash] opts the optional parameters
161
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
162
- def user_get_available_slack_channels_with_http_info(user_id, opts = {})
163
- if @api_client.config.debugging
164
- @api_client.config.logger.debug 'Calling API: UserApi.user_get_available_slack_channels ...'
165
- end
166
- # verify the required parameter 'user_id' is set
167
- if @api_client.config.client_side_validation && user_id.nil?
168
- fail ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.user_get_available_slack_channels"
169
- end
170
- # resource path
171
- local_var_path = '/users/{userId}/slack-channels'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s))
172
-
173
- # query parameters
174
- query_params = opts[:query_params] || {}
175
-
176
- # header parameters
177
- header_params = opts[:header_params] || {}
178
- # HTTP header 'Accept' (if needed)
179
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
180
-
181
- # form parameters
182
- form_params = opts[:form_params] || {}
183
-
184
- # http body (model)
185
- post_body = opts[:debug_body]
186
-
187
- # return_type
188
- return_type = opts[:debug_return_type]
189
-
190
- # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
191
- auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
192
-
193
- new_options = opts.merge(
194
- :operation => :"UserApi.user_get_available_slack_channels",
195
- :header_params => header_params,
196
- :query_params => query_params,
197
- :form_params => form_params,
198
- :body => post_body,
199
- :auth_names => auth_names,
200
- :return_type => return_type
201
- )
202
-
203
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
204
- if @api_client.config.debugging
205
- @api_client.config.logger.debug "API called: UserApi#user_get_available_slack_channels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
206
- end
207
- return data, status_code, headers
208
- end
209
-
210
77
  # Get in-app notifications for a user
211
78
  # @param [Hash] opts the optional parameters
212
79
  # @option opts [String] :before Timestamp or ISO date to fetch notifications before
@@ -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.22"
35
+ @user_agent = "pingram-ruby/1.0.24"
36
36
  @default_headers = {
37
37
  'Content-Type' => 'application/json',
38
38
  'User-Agent' => @user_agent
@@ -10,6 +10,8 @@ require_relative 'webhooks'
10
10
 
11
11
  require_relative 'api/account_api'
12
12
 
13
+ require_relative 'api/accounts_api'
14
+
13
15
  require_relative 'api/addresses_api'
14
16
 
15
17
  require_relative 'api/components_api'
@@ -84,6 +86,8 @@ module Pingram
84
86
 
85
87
  @account = Pingram::AccountApi.new(@api_client)
86
88
 
89
+ @accounts = Pingram::AccountsApi.new(@api_client)
90
+
87
91
  @addresses = Pingram::AddressesApi.new(@api_client)
88
92
 
89
93
  @components = Pingram::ComponentsApi.new(@api_client)
@@ -137,6 +141,12 @@ module Pingram
137
141
  end
138
142
 
139
143
 
144
+ # @return [Pingram::AccountsApi]
145
+ def accounts
146
+ @accounts
147
+ end
148
+
149
+
140
150
  # @return [Pingram::AddressesApi]
141
151
  def addresses
142
152
  @addresses
@@ -44,6 +44,8 @@ module Pingram
44
44
 
45
45
  attr_accessor :updated_at
46
46
 
47
+ attr_accessor :status
48
+
47
49
  class EnumAttributeValidator
48
50
  attr_reader :datatype
49
51
  attr_reader :allowable_values
@@ -81,7 +83,8 @@ module Pingram
81
83
  :'anniversary_date' => :'anniversaryDate',
82
84
  :'allow_overage' => :'allowOverage',
83
85
  :'created_at' => :'createdAt',
84
- :'updated_at' => :'updatedAt'
86
+ :'updated_at' => :'updatedAt',
87
+ :'status' => :'status'
85
88
  }
86
89
  end
87
90
 
@@ -110,7 +113,8 @@ module Pingram
110
113
  :'anniversary_date' => :'String',
111
114
  :'allow_overage' => :'Boolean',
112
115
  :'created_at' => :'String',
113
- :'updated_at' => :'String'
116
+ :'updated_at' => :'String',
117
+ :'status' => :'String'
114
118
  }
115
119
  end
116
120
 
@@ -203,6 +207,10 @@ module Pingram
203
207
  else
204
208
  self.updated_at = nil
205
209
  end
210
+
211
+ if attributes.key?(:'status')
212
+ self.status = attributes[:'status']
213
+ end
206
214
  end
207
215
 
208
216
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -261,6 +269,8 @@ module Pingram
261
269
  return false if @allow_overage.nil?
262
270
  return false if @created_at.nil?
263
271
  return false if @updated_at.nil?
272
+ status_validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
273
+ return false unless status_validator.valid?(@status)
264
274
  true
265
275
  end
266
276
 
@@ -354,6 +364,16 @@ module Pingram
354
364
  @updated_at = updated_at
355
365
  end
356
366
 
367
+ # Custom attribute writer method checking allowed values (enum).
368
+ # @param [Object] status Object to be assigned
369
+ def status=(status)
370
+ validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
371
+ unless validator.valid?(status)
372
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
373
+ end
374
+ @status = status
375
+ end
376
+
357
377
  # Checks equality by comparing each attribute.
358
378
  # @param [Object] Object to be compared
359
379
  def ==(o)
@@ -371,7 +391,8 @@ module Pingram
371
391
  anniversary_date == o.anniversary_date &&
372
392
  allow_overage == o.allow_overage &&
373
393
  created_at == o.created_at &&
374
- updated_at == o.updated_at
394
+ updated_at == o.updated_at &&
395
+ status == o.status
375
396
  end
376
397
 
377
398
  # @see the `==` method
@@ -383,7 +404,7 @@ module Pingram
383
404
  # Calculates hash code according to all attributes.
384
405
  # @return [Integer] Hash code
385
406
  def hash
386
- [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, allow_overage, created_at, updated_at].hash
407
+ [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, allow_overage, created_at, updated_at, status].hash
387
408
  end
388
409
 
389
410
  # Builds the object from hash
@@ -44,6 +44,8 @@ module Pingram
44
44
 
45
45
  attr_accessor :updated_at
46
46
 
47
+ attr_accessor :status
48
+
47
49
  attr_accessor :session_id
48
50
 
49
51
  attr_accessor :url
@@ -86,6 +88,7 @@ module Pingram
86
88
  :'allow_overage' => :'allowOverage',
87
89
  :'created_at' => :'createdAt',
88
90
  :'updated_at' => :'updatedAt',
91
+ :'status' => :'status',
89
92
  :'session_id' => :'sessionId',
90
93
  :'url' => :'url'
91
94
  }
@@ -117,6 +120,7 @@ module Pingram
117
120
  :'allow_overage' => :'Boolean',
118
121
  :'created_at' => :'String',
119
122
  :'updated_at' => :'String',
123
+ :'status' => :'String',
120
124
  :'session_id' => :'String',
121
125
  :'url' => :'String'
122
126
  }
@@ -212,6 +216,10 @@ module Pingram
212
216
  self.updated_at = nil
213
217
  end
214
218
 
219
+ if attributes.key?(:'status')
220
+ self.status = attributes[:'status']
221
+ end
222
+
215
223
  if attributes.key?(:'session_id')
216
224
  self.session_id = attributes[:'session_id']
217
225
  end
@@ -277,6 +285,8 @@ module Pingram
277
285
  return false if @allow_overage.nil?
278
286
  return false if @created_at.nil?
279
287
  return false if @updated_at.nil?
288
+ status_validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
289
+ return false unless status_validator.valid?(@status)
280
290
  true
281
291
  end
282
292
 
@@ -370,6 +380,16 @@ module Pingram
370
380
  @updated_at = updated_at
371
381
  end
372
382
 
383
+ # Custom attribute writer method checking allowed values (enum).
384
+ # @param [Object] status Object to be assigned
385
+ def status=(status)
386
+ validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
387
+ unless validator.valid?(status)
388
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
389
+ end
390
+ @status = status
391
+ end
392
+
373
393
  # Checks equality by comparing each attribute.
374
394
  # @param [Object] Object to be compared
375
395
  def ==(o)
@@ -388,6 +408,7 @@ module Pingram
388
408
  allow_overage == o.allow_overage &&
389
409
  created_at == o.created_at &&
390
410
  updated_at == o.updated_at &&
411
+ status == o.status &&
391
412
  session_id == o.session_id &&
392
413
  url == o.url
393
414
  end
@@ -401,7 +422,7 @@ module Pingram
401
422
  # Calculates hash code according to all attributes.
402
423
  # @return [Integer] Hash code
403
424
  def hash
404
- [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, allow_overage, created_at, updated_at, session_id, url].hash
425
+ [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, allow_overage, created_at, updated_at, status, session_id, url].hash
405
426
  end
406
427
 
407
428
  # Builds the object from hash
@@ -14,14 +14,21 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
+ # Request body for POST /accounts (create additional account).
17
18
  class CreateAccountRequest < ApiModelBase
18
- # First-touch PostHog props from the client; attached to signup events.
19
- attr_accessor :attribution
19
+ attr_accessor :name
20
+
21
+ attr_accessor :plan
22
+
23
+ # Emails to add or invite to the new account. Existing members of any account the caller belongs to are added directly; everyone else is invited.
24
+ attr_accessor :member_emails
20
25
 
21
26
  # Attribute mapping from ruby-style variable name to JSON key.
22
27
  def self.attribute_map
23
28
  {
24
- :'attribution' => :'attribution'
29
+ :'name' => :'name',
30
+ :'plan' => :'plan',
31
+ :'member_emails' => :'memberEmails'
25
32
  }
26
33
  end
27
34
 
@@ -38,7 +45,9 @@ module Pingram
38
45
  # Attribute type mapping.
39
46
  def self.openapi_types
40
47
  {
41
- :'attribution' => :'Hash<String, String>'
48
+ :'name' => :'String',
49
+ :'plan' => :'CreateAccountRequestPlan',
50
+ :'member_emails' => :'Array<String>'
42
51
  }
43
52
  end
44
53
 
@@ -64,9 +73,19 @@ module Pingram
64
73
  h[k.to_sym] = v
65
74
  }
66
75
 
67
- if attributes.key?(:'attribution')
68
- if (value = attributes[:'attribution']).is_a?(Hash)
69
- self.attribution = value
76
+ if attributes.key?(:'name')
77
+ self.name = attributes[:'name']
78
+ else
79
+ self.name = nil
80
+ end
81
+
82
+ if attributes.key?(:'plan')
83
+ self.plan = attributes[:'plan']
84
+ end
85
+
86
+ if attributes.key?(:'member_emails')
87
+ if (value = attributes[:'member_emails']).is_a?(Array)
88
+ self.member_emails = value
70
89
  end
71
90
  end
72
91
  end
@@ -76,6 +95,10 @@ module Pingram
76
95
  def list_invalid_properties
77
96
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
97
  invalid_properties = Array.new
98
+ if @name.nil?
99
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
100
+ end
101
+
79
102
  invalid_properties
80
103
  end
81
104
 
@@ -83,15 +106,28 @@ module Pingram
83
106
  # @return true if the model is valid
84
107
  def valid?
85
108
  warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ return false if @name.nil?
86
110
  true
87
111
  end
88
112
 
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] name Value to be assigned
115
+ def name=(name)
116
+ if name.nil?
117
+ fail ArgumentError, 'name cannot be nil'
118
+ end
119
+
120
+ @name = name
121
+ end
122
+
89
123
  # Checks equality by comparing each attribute.
90
124
  # @param [Object] Object to be compared
91
125
  def ==(o)
92
126
  return true if self.equal?(o)
93
127
  self.class == o.class &&
94
- attribution == o.attribution
128
+ name == o.name &&
129
+ plan == o.plan &&
130
+ member_emails == o.member_emails
95
131
  end
96
132
 
97
133
  # @see the `==` method
@@ -103,7 +139,7 @@ module Pingram
103
139
  # Calculates hash code according to all attributes.
104
140
  # @return [Integer] Hash code
105
141
  def hash
106
- [attribution].hash
142
+ [name, plan, member_emails].hash
107
143
  end
108
144
 
109
145
  # Builds the object from hash