pingram 1.0.14 → 1.0.16

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/addresses_api.rb +67 -6
  4. data/lib/pingram/api/default_api.rb +2 -2
  5. data/lib/pingram/api/domains_api.rb +69 -8
  6. data/lib/pingram/api/email_api.rb +2 -2
  7. data/lib/pingram/api/logs_api.rb +10 -10
  8. data/lib/pingram/api/numbers_api.rb +6 -6
  9. data/lib/pingram/api/profile_api.rb +248 -0
  10. data/lib/pingram/api/sms_api.rb +2 -2
  11. data/lib/pingram/api_client.rb +1 -1
  12. data/lib/pingram/models/billing_post_response_body.rb +74 -203
  13. data/lib/pingram/models/domain_dns_check.rb +244 -0
  14. data/lib/pingram/models/domain_dns_check_records_inner.rb +357 -0
  15. data/lib/pingram/models/get_members_response_inner.rb +37 -4
  16. data/lib/pingram/models/mfa_setup_request.rb +189 -0
  17. data/lib/pingram/models/mfa_setup_response.rb +216 -0
  18. data/lib/pingram/models/mfa_status_response.rb +235 -0
  19. data/lib/pingram/models/mfa_verify_request.rb +241 -0
  20. data/lib/pingram/version.rb +1 -1
  21. data/lib/pingram.rb +6 -0
  22. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  23. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  24. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +5 -5
  25. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +3 -3
  26. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  27. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.4.0/gem_make.out +5 -5
  28. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  29. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  30. metadata +8 -2
@@ -0,0 +1,357 @@
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
+ class DomainDnsCheckRecordsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :label
21
+
22
+ attr_accessor :required
23
+
24
+ attr_accessor :found
25
+
26
+ attr_accessor :host
27
+
28
+ attr_accessor :record_type
29
+
30
+ attr_accessor :expected
31
+
32
+ attr_accessor :observed
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'id' => :'id',
60
+ :'label' => :'label',
61
+ :'required' => :'required',
62
+ :'found' => :'found',
63
+ :'host' => :'host',
64
+ :'record_type' => :'recordType',
65
+ :'expected' => :'expected',
66
+ :'observed' => :'observed'
67
+ }
68
+ end
69
+
70
+ # Returns attribute mapping this model knows about
71
+ def self.acceptable_attribute_map
72
+ attribute_map
73
+ end
74
+
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ acceptable_attribute_map.values
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.openapi_types
82
+ {
83
+ :'id' => :'String',
84
+ :'label' => :'String',
85
+ :'required' => :'Boolean',
86
+ :'found' => :'Boolean',
87
+ :'host' => :'String',
88
+ :'record_type' => :'String',
89
+ :'expected' => :'String',
90
+ :'observed' => :'Array<String>'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::DomainDnsCheckRecordsInner` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::DomainDnsCheckRecordsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'id')
117
+ self.id = attributes[:'id']
118
+ else
119
+ self.id = nil
120
+ end
121
+
122
+ if attributes.key?(:'label')
123
+ self.label = attributes[:'label']
124
+ else
125
+ self.label = nil
126
+ end
127
+
128
+ if attributes.key?(:'required')
129
+ self.required = attributes[:'required']
130
+ else
131
+ self.required = nil
132
+ end
133
+
134
+ if attributes.key?(:'found')
135
+ self.found = attributes[:'found']
136
+ else
137
+ self.found = nil
138
+ end
139
+
140
+ if attributes.key?(:'host')
141
+ self.host = attributes[:'host']
142
+ else
143
+ self.host = nil
144
+ end
145
+
146
+ if attributes.key?(:'record_type')
147
+ self.record_type = attributes[:'record_type']
148
+ else
149
+ self.record_type = nil
150
+ end
151
+
152
+ if attributes.key?(:'expected')
153
+ self.expected = attributes[:'expected']
154
+ else
155
+ self.expected = nil
156
+ end
157
+
158
+ if attributes.key?(:'observed')
159
+ if (value = attributes[:'observed']).is_a?(Array)
160
+ self.observed = value
161
+ end
162
+ end
163
+ end
164
+
165
+ # Show invalid properties with the reasons. Usually used together with valid?
166
+ # @return Array for valid properties with the reasons
167
+ def list_invalid_properties
168
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
169
+ invalid_properties = Array.new
170
+ if @id.nil?
171
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
172
+ end
173
+
174
+ if @label.nil?
175
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
176
+ end
177
+
178
+ if @required.nil?
179
+ invalid_properties.push('invalid value for "required", required cannot be nil.')
180
+ end
181
+
182
+ if @found.nil?
183
+ invalid_properties.push('invalid value for "found", found cannot be nil.')
184
+ end
185
+
186
+ if @host.nil?
187
+ invalid_properties.push('invalid value for "host", host cannot be nil.')
188
+ end
189
+
190
+ if @record_type.nil?
191
+ invalid_properties.push('invalid value for "record_type", record_type cannot be nil.')
192
+ end
193
+
194
+ if @expected.nil?
195
+ invalid_properties.push('invalid value for "expected", expected cannot be nil.')
196
+ end
197
+
198
+ invalid_properties
199
+ end
200
+
201
+ # Check to see if the all the properties in the model are valid
202
+ # @return true if the model is valid
203
+ def valid?
204
+ warn '[DEPRECATED] the `valid?` method is obsolete'
205
+ return false if @id.nil?
206
+ id_validator = EnumAttributeValidator.new('String', ["dkim", "mail_from_spf", "mail_from_mx", "dmarc", "inbound_mx"])
207
+ return false unless id_validator.valid?(@id)
208
+ return false if @label.nil?
209
+ return false if @required.nil?
210
+ return false if @found.nil?
211
+ return false if @host.nil?
212
+ return false if @record_type.nil?
213
+ record_type_validator = EnumAttributeValidator.new('String', ["TXT", "MX", "CNAME"])
214
+ return false unless record_type_validator.valid?(@record_type)
215
+ return false if @expected.nil?
216
+ true
217
+ end
218
+
219
+ # Custom attribute writer method checking allowed values (enum).
220
+ # @param [Object] id Object to be assigned
221
+ def id=(id)
222
+ validator = EnumAttributeValidator.new('String', ["dkim", "mail_from_spf", "mail_from_mx", "dmarc", "inbound_mx"])
223
+ unless validator.valid?(id)
224
+ fail ArgumentError, "invalid value for \"id\", must be one of #{validator.allowable_values}."
225
+ end
226
+ @id = id
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] label Value to be assigned
231
+ def label=(label)
232
+ if label.nil?
233
+ fail ArgumentError, 'label cannot be nil'
234
+ end
235
+
236
+ @label = label
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] required Value to be assigned
241
+ def required=(required)
242
+ if required.nil?
243
+ fail ArgumentError, 'required cannot be nil'
244
+ end
245
+
246
+ @required = required
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] found Value to be assigned
251
+ def found=(found)
252
+ if found.nil?
253
+ fail ArgumentError, 'found cannot be nil'
254
+ end
255
+
256
+ @found = found
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] host Value to be assigned
261
+ def host=(host)
262
+ if host.nil?
263
+ fail ArgumentError, 'host cannot be nil'
264
+ end
265
+
266
+ @host = host
267
+ end
268
+
269
+ # Custom attribute writer method checking allowed values (enum).
270
+ # @param [Object] record_type Object to be assigned
271
+ def record_type=(record_type)
272
+ validator = EnumAttributeValidator.new('String', ["TXT", "MX", "CNAME"])
273
+ unless validator.valid?(record_type)
274
+ fail ArgumentError, "invalid value for \"record_type\", must be one of #{validator.allowable_values}."
275
+ end
276
+ @record_type = record_type
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] expected Value to be assigned
281
+ def expected=(expected)
282
+ if expected.nil?
283
+ fail ArgumentError, 'expected cannot be nil'
284
+ end
285
+
286
+ @expected = expected
287
+ end
288
+
289
+ # Checks equality by comparing each attribute.
290
+ # @param [Object] Object to be compared
291
+ def ==(o)
292
+ return true if self.equal?(o)
293
+ self.class == o.class &&
294
+ id == o.id &&
295
+ label == o.label &&
296
+ required == o.required &&
297
+ found == o.found &&
298
+ host == o.host &&
299
+ record_type == o.record_type &&
300
+ expected == o.expected &&
301
+ observed == o.observed
302
+ end
303
+
304
+ # @see the `==` method
305
+ # @param [Object] Object to be compared
306
+ def eql?(o)
307
+ self == o
308
+ end
309
+
310
+ # Calculates hash code according to all attributes.
311
+ # @return [Integer] Hash code
312
+ def hash
313
+ [id, label, required, found, host, record_type, expected, observed].hash
314
+ end
315
+
316
+ # Builds the object from hash
317
+ # @param [Hash] attributes Model attributes in the form of hash
318
+ # @return [Object] Returns the model itself
319
+ def self.build_from_hash(attributes)
320
+ return nil unless attributes.is_a?(Hash)
321
+ attributes = attributes.transform_keys(&:to_sym)
322
+ transformed_hash = {}
323
+ openapi_types.each_pair do |key, type|
324
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
325
+ transformed_hash["#{key}"] = nil
326
+ elsif type =~ /\AArray<(.*)>/i
327
+ # check to ensure the input is an array given that the attribute
328
+ # is documented as an array but the input is not
329
+ if attributes[attribute_map[key]].is_a?(Array)
330
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
331
+ end
332
+ elsif !attributes[attribute_map[key]].nil?
333
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
334
+ end
335
+ end
336
+ new(transformed_hash)
337
+ end
338
+
339
+ # Returns the object in the form of hash
340
+ # @return [Hash] Returns the object in the form of hash
341
+ def to_hash
342
+ hash = {}
343
+ self.class.attribute_map.each_pair do |attr, param|
344
+ value = self.send(attr)
345
+ if value.nil?
346
+ is_nullable = self.class.openapi_nullable.include?(attr)
347
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
348
+ end
349
+
350
+ hash[param] = _to_hash(value)
351
+ end
352
+ hash
353
+ end
354
+
355
+ end
356
+
357
+ end
@@ -27,6 +27,30 @@ module Pingram
27
27
 
28
28
  attr_accessor :groups
29
29
 
30
+ attr_accessor :enabled_mfas
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
30
54
  # Attribute mapping from ruby-style variable name to JSON key.
31
55
  def self.attribute_map
32
56
  {
@@ -35,7 +59,8 @@ module Pingram
35
59
  :'user_id' => :'userId',
36
60
  :'created_at' => :'createdAt',
37
61
  :'email' => :'email',
38
- :'groups' => :'groups'
62
+ :'groups' => :'groups',
63
+ :'enabled_mfas' => :'enabledMFAs'
39
64
  }
40
65
  end
41
66
 
@@ -57,7 +82,8 @@ module Pingram
57
82
  :'user_id' => :'String',
58
83
  :'created_at' => :'String',
59
84
  :'email' => :'String',
60
- :'groups' => :'Array<String>'
85
+ :'groups' => :'Array<String>',
86
+ :'enabled_mfas' => :'Array<String>'
61
87
  }
62
88
  end
63
89
 
@@ -116,6 +142,12 @@ module Pingram
116
142
  self.groups = value
117
143
  end
118
144
  end
145
+
146
+ if attributes.key?(:'enabled_mfas')
147
+ if (value = attributes[:'enabled_mfas']).is_a?(Array)
148
+ self.enabled_mfas = value
149
+ end
150
+ end
119
151
  end
120
152
 
121
153
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -203,7 +235,8 @@ module Pingram
203
235
  user_id == o.user_id &&
204
236
  created_at == o.created_at &&
205
237
  email == o.email &&
206
- groups == o.groups
238
+ groups == o.groups &&
239
+ enabled_mfas == o.enabled_mfas
207
240
  end
208
241
 
209
242
  # @see the `==` method
@@ -215,7 +248,7 @@ module Pingram
215
248
  # Calculates hash code according to all attributes.
216
249
  # @return [Integer] Hash code
217
250
  def hash
218
- [organization_id, account_id, user_id, created_at, email, groups].hash
251
+ [organization_id, account_id, user_id, created_at, email, groups, enabled_mfas].hash
219
252
  end
220
253
 
221
254
  # Builds the object from hash
@@ -0,0 +1,189 @@
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
+ class MFASetupRequest < ApiModelBase
18
+ # MFA methods supported by the profile MFA API.
19
+ attr_accessor :type
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'type' => :'type'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'type' => :'String'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::MFASetupRequest` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::MFASetupRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'type')
90
+ self.type = attributes[:'type']
91
+ else
92
+ self.type = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @type.nil?
102
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ warn '[DEPRECATED] the `valid?` method is obsolete'
112
+ return false if @type.nil?
113
+ type_validator = EnumAttributeValidator.new('String', ["SOFTWARE_TOKEN_MFA"])
114
+ return false unless type_validator.valid?(@type)
115
+ true
116
+ end
117
+
118
+ # Custom attribute writer method checking allowed values (enum).
119
+ # @param [Object] type Object to be assigned
120
+ def type=(type)
121
+ validator = EnumAttributeValidator.new('String', ["SOFTWARE_TOKEN_MFA"])
122
+ unless validator.valid?(type)
123
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
124
+ end
125
+ @type = type
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ type == o.type
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [type].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ attributes = attributes.transform_keys(&:to_sym)
154
+ transformed_hash = {}
155
+ openapi_types.each_pair do |key, type|
156
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = nil
158
+ elsif type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[attribute_map[key]].is_a?(Array)
162
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
163
+ end
164
+ elsif !attributes[attribute_map[key]].nil?
165
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
166
+ end
167
+ end
168
+ new(transformed_hash)
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ if value.nil?
178
+ is_nullable = self.class.openapi_nullable.include?(attr)
179
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
180
+ end
181
+
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ end
188
+
189
+ end