pingram 1.0.17 → 1.0.18

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/pingram/api/account_api.rb +95 -26
  4. data/lib/pingram/api/members_api.rb +10 -10
  5. data/lib/pingram/api_client.rb +1 -1
  6. data/lib/pingram/client_wrapper.rb +0 -10
  7. data/lib/pingram/models/account_get_response.rb +216 -29
  8. data/lib/pingram/models/auto_join_get_response.rb +16 -16
  9. data/lib/pingram/models/auto_join_post_response.rb +16 -16
  10. data/lib/pingram/models/billing_post_response_body.rb +35 -68
  11. data/lib/pingram/models/{create_organization_request.rb → brand_webhook_response.rb} +28 -13
  12. data/lib/pingram/models/get_members_response_inner.rb +1 -27
  13. data/lib/pingram/models/get_usage_history_query.rb +1 -1
  14. data/lib/pingram/models/{organization_usage_history.rb → get_usage_history_response.rb} +5 -5
  15. data/lib/pingram/models/{organization_usage_history_items_inner.rb → get_usage_history_response_items_inner.rb} +4 -4
  16. data/lib/pingram/models/{organization_usage_history_items_inner_counts.rb → get_usage_history_response_items_inner_counts.rb} +3 -3
  17. data/lib/pingram/models/{organization_usage.rb → get_usage_response.rb} +6 -6
  18. data/lib/pingram/models/{organization_usage_costs.rb → get_usage_response_costs.rb} +3 -3
  19. data/lib/pingram/models/{organization_usage_counts.rb → get_usage_response_counts.rb} +3 -3
  20. data/lib/pingram/models/sender_post_body_options_email.rb +4 -14
  21. data/lib/pingram/models/ten_dlc_brand_create_request.rb +19 -1
  22. data/lib/pingram/models/ten_dlc_brand_registration.rb +19 -1
  23. data/lib/pingram/models/ten_dlc_brand_registration_details.rb +599 -0
  24. data/lib/pingram/models/ten_dlc_brand_update_request.rb +92 -1
  25. data/lib/pingram/version.rb +1 -1
  26. data/lib/pingram.rb +8 -10
  27. metadata +10 -12
  28. data/lib/pingram/api/organization_api.rb +0 -212
  29. data/lib/pingram/models/create_organization_response.rb +0 -216
  30. data/lib/pingram/models/organization.rb +0 -463
@@ -14,23 +14,74 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- # GET /account response: basic account info (billing fields are on the organization).
17
+ # GET /account response: public plan fields for the authenticated account.
18
18
  class AccountGetResponse < ApiModelBase
19
19
  attr_accessor :account_id
20
20
 
21
- attr_accessor :organization_id
21
+ attr_accessor :account_type
22
+
23
+ attr_accessor :creator
22
24
 
23
25
  attr_accessor :name
24
26
 
27
+ attr_accessor :messages_cap
28
+
29
+ attr_accessor :cost_cap
30
+
31
+ attr_accessor :sms_cap
32
+
33
+ attr_accessor :call_cap
34
+
35
+ # When omitted, defaults to LATEST_BILLING_VERSION.
36
+ attr_accessor :billing_version
37
+
38
+ # ISO date (YYYY-MM-DD) when the billing cycle resets.
39
+ attr_accessor :anniversary_date
40
+
41
+ attr_accessor :allow_overage
42
+
25
43
  attr_accessor :created_at
26
44
 
45
+ attr_accessor :updated_at
46
+
47
+ class EnumAttributeValidator
48
+ attr_reader :datatype
49
+ attr_reader :allowable_values
50
+
51
+ def initialize(datatype, allowable_values)
52
+ @allowable_values = allowable_values.map do |value|
53
+ case datatype.to_s
54
+ when /Integer/i
55
+ value.to_i
56
+ when /Float/i
57
+ value.to_f
58
+ else
59
+ value
60
+ end
61
+ end
62
+ end
63
+
64
+ def valid?(value)
65
+ !value || allowable_values.include?(value)
66
+ end
67
+ end
68
+
27
69
  # Attribute mapping from ruby-style variable name to JSON key.
28
70
  def self.attribute_map
29
71
  {
30
72
  :'account_id' => :'accountId',
31
- :'organization_id' => :'organizationId',
73
+ :'account_type' => :'accountType',
74
+ :'creator' => :'creator',
32
75
  :'name' => :'name',
33
- :'created_at' => :'createdAt'
76
+ :'messages_cap' => :'messagesCap',
77
+ :'cost_cap' => :'costCap',
78
+ :'sms_cap' => :'smsCap',
79
+ :'call_cap' => :'callCap',
80
+ :'billing_version' => :'billingVersion',
81
+ :'anniversary_date' => :'anniversaryDate',
82
+ :'allow_overage' => :'allowOverage',
83
+ :'created_at' => :'createdAt',
84
+ :'updated_at' => :'updatedAt'
34
85
  }
35
86
  end
36
87
 
@@ -48,9 +99,18 @@ module Pingram
48
99
  def self.openapi_types
49
100
  {
50
101
  :'account_id' => :'String',
51
- :'organization_id' => :'String',
102
+ :'account_type' => :'String',
103
+ :'creator' => :'String',
52
104
  :'name' => :'String',
53
- :'created_at' => :'String'
105
+ :'messages_cap' => :'Float',
106
+ :'cost_cap' => :'Float',
107
+ :'sms_cap' => :'Float',
108
+ :'call_cap' => :'Float',
109
+ :'billing_version' => :'Float',
110
+ :'anniversary_date' => :'String',
111
+ :'allow_overage' => :'Boolean',
112
+ :'created_at' => :'String',
113
+ :'updated_at' => :'String'
54
114
  }
55
115
  end
56
116
 
@@ -82,16 +142,54 @@ module Pingram
82
142
  self.account_id = nil
83
143
  end
84
144
 
85
- if attributes.key?(:'organization_id')
86
- self.organization_id = attributes[:'organization_id']
145
+ if attributes.key?(:'account_type')
146
+ self.account_type = attributes[:'account_type']
87
147
  else
88
- self.organization_id = nil
148
+ self.account_type = nil
149
+ end
150
+
151
+ if attributes.key?(:'creator')
152
+ self.creator = attributes[:'creator']
89
153
  end
90
154
 
91
155
  if attributes.key?(:'name')
92
156
  self.name = attributes[:'name']
157
+ end
158
+
159
+ if attributes.key?(:'messages_cap')
160
+ self.messages_cap = attributes[:'messages_cap']
161
+ else
162
+ self.messages_cap = nil
163
+ end
164
+
165
+ if attributes.key?(:'cost_cap')
166
+ self.cost_cap = attributes[:'cost_cap']
167
+ else
168
+ self.cost_cap = nil
169
+ end
170
+
171
+ if attributes.key?(:'sms_cap')
172
+ self.sms_cap = attributes[:'sms_cap']
173
+ end
174
+
175
+ if attributes.key?(:'call_cap')
176
+ self.call_cap = attributes[:'call_cap']
177
+ end
178
+
179
+ if attributes.key?(:'billing_version')
180
+ self.billing_version = attributes[:'billing_version']
181
+ end
182
+
183
+ if attributes.key?(:'anniversary_date')
184
+ self.anniversary_date = attributes[:'anniversary_date']
185
+ else
186
+ self.anniversary_date = nil
187
+ end
188
+
189
+ if attributes.key?(:'allow_overage')
190
+ self.allow_overage = attributes[:'allow_overage']
93
191
  else
94
- self.name = nil
192
+ self.allow_overage = nil
95
193
  end
96
194
 
97
195
  if attributes.key?(:'created_at')
@@ -99,6 +197,12 @@ module Pingram
99
197
  else
100
198
  self.created_at = nil
101
199
  end
200
+
201
+ if attributes.key?(:'updated_at')
202
+ self.updated_at = attributes[:'updated_at']
203
+ else
204
+ self.updated_at = nil
205
+ end
102
206
  end
103
207
 
104
208
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -110,18 +214,34 @@ module Pingram
110
214
  invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
111
215
  end
112
216
 
113
- if @organization_id.nil?
114
- invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
217
+ if @account_type.nil?
218
+ invalid_properties.push('invalid value for "account_type", account_type cannot be nil.')
115
219
  end
116
220
 
117
- if @name.nil?
118
- invalid_properties.push('invalid value for "name", name cannot be nil.')
221
+ if @messages_cap.nil?
222
+ invalid_properties.push('invalid value for "messages_cap", messages_cap cannot be nil.')
223
+ end
224
+
225
+ if @cost_cap.nil?
226
+ invalid_properties.push('invalid value for "cost_cap", cost_cap cannot be nil.')
227
+ end
228
+
229
+ if @anniversary_date.nil?
230
+ invalid_properties.push('invalid value for "anniversary_date", anniversary_date cannot be nil.')
231
+ end
232
+
233
+ if @allow_overage.nil?
234
+ invalid_properties.push('invalid value for "allow_overage", allow_overage cannot be nil.')
119
235
  end
120
236
 
121
237
  if @created_at.nil?
122
238
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
123
239
  end
124
240
 
241
+ if @updated_at.nil?
242
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
243
+ end
244
+
125
245
  invalid_properties
126
246
  end
127
247
 
@@ -130,9 +250,17 @@ module Pingram
130
250
  def valid?
131
251
  warn '[DEPRECATED] the `valid?` method is obsolete'
132
252
  return false if @account_id.nil?
133
- return false if @organization_id.nil?
134
- return false if @name.nil?
253
+ return false if @account_type.nil?
254
+ account_type_validator = EnumAttributeValidator.new('String', ["free", "paid"])
255
+ return false unless account_type_validator.valid?(@account_type)
256
+ return false if @messages_cap.nil?
257
+ return false if @cost_cap.nil?
258
+ billing_version_validator = EnumAttributeValidator.new('Float', [1, 3])
259
+ return false unless billing_version_validator.valid?(@billing_version)
260
+ return false if @anniversary_date.nil?
261
+ return false if @allow_overage.nil?
135
262
  return false if @created_at.nil?
263
+ return false if @updated_at.nil?
136
264
  true
137
265
  end
138
266
 
@@ -146,24 +274,64 @@ module Pingram
146
274
  @account_id = account_id
147
275
  end
148
276
 
277
+ # Custom attribute writer method checking allowed values (enum).
278
+ # @param [Object] account_type Object to be assigned
279
+ def account_type=(account_type)
280
+ validator = EnumAttributeValidator.new('String', ["free", "paid"])
281
+ unless validator.valid?(account_type)
282
+ fail ArgumentError, "invalid value for \"account_type\", must be one of #{validator.allowable_values}."
283
+ end
284
+ @account_type = account_type
285
+ end
286
+
149
287
  # Custom attribute writer method with validation
150
- # @param [Object] organization_id Value to be assigned
151
- def organization_id=(organization_id)
152
- if organization_id.nil?
153
- fail ArgumentError, 'organization_id cannot be nil'
288
+ # @param [Object] messages_cap Value to be assigned
289
+ def messages_cap=(messages_cap)
290
+ if messages_cap.nil?
291
+ fail ArgumentError, 'messages_cap cannot be nil'
154
292
  end
155
293
 
156
- @organization_id = organization_id
294
+ @messages_cap = messages_cap
157
295
  end
158
296
 
159
297
  # Custom attribute writer method with validation
160
- # @param [Object] name Value to be assigned
161
- def name=(name)
162
- if name.nil?
163
- fail ArgumentError, 'name cannot be nil'
298
+ # @param [Object] cost_cap Value to be assigned
299
+ def cost_cap=(cost_cap)
300
+ if cost_cap.nil?
301
+ fail ArgumentError, 'cost_cap cannot be nil'
164
302
  end
165
303
 
166
- @name = name
304
+ @cost_cap = cost_cap
305
+ end
306
+
307
+ # Custom attribute writer method checking allowed values (enum).
308
+ # @param [Object] billing_version Object to be assigned
309
+ def billing_version=(billing_version)
310
+ validator = EnumAttributeValidator.new('Float', [1, 3])
311
+ unless validator.valid?(billing_version)
312
+ fail ArgumentError, "invalid value for \"billing_version\", must be one of #{validator.allowable_values}."
313
+ end
314
+ @billing_version = billing_version
315
+ end
316
+
317
+ # Custom attribute writer method with validation
318
+ # @param [Object] anniversary_date Value to be assigned
319
+ def anniversary_date=(anniversary_date)
320
+ if anniversary_date.nil?
321
+ fail ArgumentError, 'anniversary_date cannot be nil'
322
+ end
323
+
324
+ @anniversary_date = anniversary_date
325
+ end
326
+
327
+ # Custom attribute writer method with validation
328
+ # @param [Object] allow_overage Value to be assigned
329
+ def allow_overage=(allow_overage)
330
+ if allow_overage.nil?
331
+ fail ArgumentError, 'allow_overage cannot be nil'
332
+ end
333
+
334
+ @allow_overage = allow_overage
167
335
  end
168
336
 
169
337
  # Custom attribute writer method with validation
@@ -176,15 +344,34 @@ module Pingram
176
344
  @created_at = created_at
177
345
  end
178
346
 
347
+ # Custom attribute writer method with validation
348
+ # @param [Object] updated_at Value to be assigned
349
+ def updated_at=(updated_at)
350
+ if updated_at.nil?
351
+ fail ArgumentError, 'updated_at cannot be nil'
352
+ end
353
+
354
+ @updated_at = updated_at
355
+ end
356
+
179
357
  # Checks equality by comparing each attribute.
180
358
  # @param [Object] Object to be compared
181
359
  def ==(o)
182
360
  return true if self.equal?(o)
183
361
  self.class == o.class &&
184
362
  account_id == o.account_id &&
185
- organization_id == o.organization_id &&
363
+ account_type == o.account_type &&
364
+ creator == o.creator &&
186
365
  name == o.name &&
187
- created_at == o.created_at
366
+ messages_cap == o.messages_cap &&
367
+ cost_cap == o.cost_cap &&
368
+ sms_cap == o.sms_cap &&
369
+ call_cap == o.call_cap &&
370
+ billing_version == o.billing_version &&
371
+ anniversary_date == o.anniversary_date &&
372
+ allow_overage == o.allow_overage &&
373
+ created_at == o.created_at &&
374
+ updated_at == o.updated_at
188
375
  end
189
376
 
190
377
  # @see the `==` method
@@ -196,7 +383,7 @@ module Pingram
196
383
  # Calculates hash code according to all attributes.
197
384
  # @return [Integer] Hash code
198
385
  def hash
199
- [account_id, organization_id, name, created_at].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
200
387
  end
201
388
 
202
389
  # Builds the object from hash
@@ -15,14 +15,14 @@ require 'time'
15
15
 
16
16
  module Pingram
17
17
  class AutoJoinGetResponse < ApiModelBase
18
- attr_accessor :organization_id
18
+ attr_accessor :account_id
19
19
 
20
20
  attr_accessor :domains
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
23
23
  def self.attribute_map
24
24
  {
25
- :'organization_id' => :'organizationId',
25
+ :'account_id' => :'accountId',
26
26
  :'domains' => :'domains'
27
27
  }
28
28
  end
@@ -40,7 +40,7 @@ module Pingram
40
40
  # Attribute type mapping.
41
41
  def self.openapi_types
42
42
  {
43
- :'organization_id' => :'String',
43
+ :'account_id' => :'String',
44
44
  :'domains' => :'Array<String>'
45
45
  }
46
46
  end
@@ -67,10 +67,10 @@ module Pingram
67
67
  h[k.to_sym] = v
68
68
  }
69
69
 
70
- if attributes.key?(:'organization_id')
71
- self.organization_id = attributes[:'organization_id']
70
+ if attributes.key?(:'account_id')
71
+ self.account_id = attributes[:'account_id']
72
72
  else
73
- self.organization_id = nil
73
+ self.account_id = nil
74
74
  end
75
75
 
76
76
  if attributes.key?(:'domains')
@@ -87,8 +87,8 @@ module Pingram
87
87
  def list_invalid_properties
88
88
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
89
  invalid_properties = Array.new
90
- if @organization_id.nil?
91
- invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
90
+ if @account_id.nil?
91
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
92
92
  end
93
93
 
94
94
  if @domains.nil?
@@ -102,19 +102,19 @@ module Pingram
102
102
  # @return true if the model is valid
103
103
  def valid?
104
104
  warn '[DEPRECATED] the `valid?` method is obsolete'
105
- return false if @organization_id.nil?
105
+ return false if @account_id.nil?
106
106
  return false if @domains.nil?
107
107
  true
108
108
  end
109
109
 
110
110
  # Custom attribute writer method with validation
111
- # @param [Object] organization_id Value to be assigned
112
- def organization_id=(organization_id)
113
- if organization_id.nil?
114
- fail ArgumentError, 'organization_id cannot be nil'
111
+ # @param [Object] account_id Value to be assigned
112
+ def account_id=(account_id)
113
+ if account_id.nil?
114
+ fail ArgumentError, 'account_id cannot be nil'
115
115
  end
116
116
 
117
- @organization_id = organization_id
117
+ @account_id = account_id
118
118
  end
119
119
 
120
120
  # Custom attribute writer method with validation
@@ -132,7 +132,7 @@ module Pingram
132
132
  def ==(o)
133
133
  return true if self.equal?(o)
134
134
  self.class == o.class &&
135
- organization_id == o.organization_id &&
135
+ account_id == o.account_id &&
136
136
  domains == o.domains
137
137
  end
138
138
 
@@ -145,7 +145,7 @@ module Pingram
145
145
  # Calculates hash code according to all attributes.
146
146
  # @return [Integer] Hash code
147
147
  def hash
148
- [organization_id, domains].hash
148
+ [account_id, domains].hash
149
149
  end
150
150
 
151
151
  # Builds the object from hash
@@ -15,14 +15,14 @@ require 'time'
15
15
 
16
16
  module Pingram
17
17
  class AutoJoinPostResponse < ApiModelBase
18
- attr_accessor :organization_id
18
+ attr_accessor :account_id
19
19
 
20
20
  attr_accessor :domains
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
23
23
  def self.attribute_map
24
24
  {
25
- :'organization_id' => :'organizationId',
25
+ :'account_id' => :'accountId',
26
26
  :'domains' => :'domains'
27
27
  }
28
28
  end
@@ -40,7 +40,7 @@ module Pingram
40
40
  # Attribute type mapping.
41
41
  def self.openapi_types
42
42
  {
43
- :'organization_id' => :'String',
43
+ :'account_id' => :'String',
44
44
  :'domains' => :'Array<String>'
45
45
  }
46
46
  end
@@ -67,10 +67,10 @@ module Pingram
67
67
  h[k.to_sym] = v
68
68
  }
69
69
 
70
- if attributes.key?(:'organization_id')
71
- self.organization_id = attributes[:'organization_id']
70
+ if attributes.key?(:'account_id')
71
+ self.account_id = attributes[:'account_id']
72
72
  else
73
- self.organization_id = nil
73
+ self.account_id = nil
74
74
  end
75
75
 
76
76
  if attributes.key?(:'domains')
@@ -87,8 +87,8 @@ module Pingram
87
87
  def list_invalid_properties
88
88
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
89
  invalid_properties = Array.new
90
- if @organization_id.nil?
91
- invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
90
+ if @account_id.nil?
91
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
92
92
  end
93
93
 
94
94
  if @domains.nil?
@@ -102,19 +102,19 @@ module Pingram
102
102
  # @return true if the model is valid
103
103
  def valid?
104
104
  warn '[DEPRECATED] the `valid?` method is obsolete'
105
- return false if @organization_id.nil?
105
+ return false if @account_id.nil?
106
106
  return false if @domains.nil?
107
107
  true
108
108
  end
109
109
 
110
110
  # Custom attribute writer method with validation
111
- # @param [Object] organization_id Value to be assigned
112
- def organization_id=(organization_id)
113
- if organization_id.nil?
114
- fail ArgumentError, 'organization_id cannot be nil'
111
+ # @param [Object] account_id Value to be assigned
112
+ def account_id=(account_id)
113
+ if account_id.nil?
114
+ fail ArgumentError, 'account_id cannot be nil'
115
115
  end
116
116
 
117
- @organization_id = organization_id
117
+ @account_id = account_id
118
118
  end
119
119
 
120
120
  # Custom attribute writer method with validation
@@ -132,7 +132,7 @@ module Pingram
132
132
  def ==(o)
133
133
  return true if self.equal?(o)
134
134
  self.class == o.class &&
135
- organization_id == o.organization_id &&
135
+ account_id == o.account_id &&
136
136
  domains == o.domains
137
137
  end
138
138
 
@@ -145,7 +145,7 @@ module Pingram
145
145
  # Calculates hash code according to all attributes.
146
146
  # @return [Integer] Hash code
147
147
  def hash
148
- [organization_id, domains].hash
148
+ [account_id, domains].hash
149
149
  end
150
150
 
151
151
  # Builds the object from hash