pingram 1.0.10 → 1.0.11

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.
@@ -0,0 +1,356 @@
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
+ # Request body for POST /registrations/a2p
18
+ class A2pRegistrationCreateRequest < ApiModelBase
19
+ attr_accessor :scenario_id
20
+
21
+ attr_accessor :business_type
22
+
23
+ attr_accessor :legal_name
24
+
25
+ attr_accessor :tax_id
26
+
27
+ attr_accessor :website
28
+
29
+ attr_accessor :country
30
+
31
+ attr_accessor :full_address
32
+
33
+ attr_accessor :compliance_contact_email
34
+
35
+ attr_accessor :compliance_contact_phone
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'scenario_id' => :'scenarioId',
41
+ :'business_type' => :'businessType',
42
+ :'legal_name' => :'legalName',
43
+ :'tax_id' => :'taxId',
44
+ :'website' => :'website',
45
+ :'country' => :'country',
46
+ :'full_address' => :'fullAddress',
47
+ :'compliance_contact_email' => :'complianceContactEmail',
48
+ :'compliance_contact_phone' => :'complianceContactPhone'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'scenario_id' => :'String',
66
+ :'business_type' => :'String',
67
+ :'legal_name' => :'String',
68
+ :'tax_id' => :'String',
69
+ :'website' => :'String',
70
+ :'country' => :'String',
71
+ :'full_address' => :'String',
72
+ :'compliance_contact_email' => :'String',
73
+ :'compliance_contact_phone' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::A2pRegistrationCreateRequest` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::A2pRegistrationCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'scenario_id')
100
+ self.scenario_id = attributes[:'scenario_id']
101
+ else
102
+ self.scenario_id = nil
103
+ end
104
+
105
+ if attributes.key?(:'business_type')
106
+ self.business_type = attributes[:'business_type']
107
+ else
108
+ self.business_type = nil
109
+ end
110
+
111
+ if attributes.key?(:'legal_name')
112
+ self.legal_name = attributes[:'legal_name']
113
+ else
114
+ self.legal_name = nil
115
+ end
116
+
117
+ if attributes.key?(:'tax_id')
118
+ self.tax_id = attributes[:'tax_id']
119
+ end
120
+
121
+ if attributes.key?(:'website')
122
+ self.website = attributes[:'website']
123
+ else
124
+ self.website = nil
125
+ end
126
+
127
+ if attributes.key?(:'country')
128
+ self.country = attributes[:'country']
129
+ else
130
+ self.country = nil
131
+ end
132
+
133
+ if attributes.key?(:'full_address')
134
+ self.full_address = attributes[:'full_address']
135
+ else
136
+ self.full_address = nil
137
+ end
138
+
139
+ if attributes.key?(:'compliance_contact_email')
140
+ self.compliance_contact_email = attributes[:'compliance_contact_email']
141
+ else
142
+ self.compliance_contact_email = nil
143
+ end
144
+
145
+ if attributes.key?(:'compliance_contact_phone')
146
+ self.compliance_contact_phone = attributes[:'compliance_contact_phone']
147
+ else
148
+ self.compliance_contact_phone = nil
149
+ end
150
+ end
151
+
152
+ # Show invalid properties with the reasons. Usually used together with valid?
153
+ # @return Array for valid properties with the reasons
154
+ def list_invalid_properties
155
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
156
+ invalid_properties = Array.new
157
+ if @scenario_id.nil?
158
+ invalid_properties.push('invalid value for "scenario_id", scenario_id cannot be nil.')
159
+ end
160
+
161
+ if @business_type.nil?
162
+ invalid_properties.push('invalid value for "business_type", business_type cannot be nil.')
163
+ end
164
+
165
+ if @legal_name.nil?
166
+ invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.')
167
+ end
168
+
169
+ if @website.nil?
170
+ invalid_properties.push('invalid value for "website", website cannot be nil.')
171
+ end
172
+
173
+ if @country.nil?
174
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
175
+ end
176
+
177
+ if @full_address.nil?
178
+ invalid_properties.push('invalid value for "full_address", full_address cannot be nil.')
179
+ end
180
+
181
+ if @compliance_contact_email.nil?
182
+ invalid_properties.push('invalid value for "compliance_contact_email", compliance_contact_email cannot be nil.')
183
+ end
184
+
185
+ if @compliance_contact_phone.nil?
186
+ invalid_properties.push('invalid value for "compliance_contact_phone", compliance_contact_phone cannot be nil.')
187
+ end
188
+
189
+ invalid_properties
190
+ end
191
+
192
+ # Check to see if the all the properties in the model are valid
193
+ # @return true if the model is valid
194
+ def valid?
195
+ warn '[DEPRECATED] the `valid?` method is obsolete'
196
+ return false if @scenario_id.nil?
197
+ return false if @business_type.nil?
198
+ return false if @legal_name.nil?
199
+ return false if @website.nil?
200
+ return false if @country.nil?
201
+ return false if @full_address.nil?
202
+ return false if @compliance_contact_email.nil?
203
+ return false if @compliance_contact_phone.nil?
204
+ true
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] scenario_id Value to be assigned
209
+ def scenario_id=(scenario_id)
210
+ if scenario_id.nil?
211
+ fail ArgumentError, 'scenario_id cannot be nil'
212
+ end
213
+
214
+ @scenario_id = scenario_id
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] business_type Value to be assigned
219
+ def business_type=(business_type)
220
+ if business_type.nil?
221
+ fail ArgumentError, 'business_type cannot be nil'
222
+ end
223
+
224
+ @business_type = business_type
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] legal_name Value to be assigned
229
+ def legal_name=(legal_name)
230
+ if legal_name.nil?
231
+ fail ArgumentError, 'legal_name cannot be nil'
232
+ end
233
+
234
+ @legal_name = legal_name
235
+ end
236
+
237
+ # Custom attribute writer method with validation
238
+ # @param [Object] website Value to be assigned
239
+ def website=(website)
240
+ if website.nil?
241
+ fail ArgumentError, 'website cannot be nil'
242
+ end
243
+
244
+ @website = website
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] country Value to be assigned
249
+ def country=(country)
250
+ if country.nil?
251
+ fail ArgumentError, 'country cannot be nil'
252
+ end
253
+
254
+ @country = country
255
+ end
256
+
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] full_address Value to be assigned
259
+ def full_address=(full_address)
260
+ if full_address.nil?
261
+ fail ArgumentError, 'full_address cannot be nil'
262
+ end
263
+
264
+ @full_address = full_address
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] compliance_contact_email Value to be assigned
269
+ def compliance_contact_email=(compliance_contact_email)
270
+ if compliance_contact_email.nil?
271
+ fail ArgumentError, 'compliance_contact_email cannot be nil'
272
+ end
273
+
274
+ @compliance_contact_email = compliance_contact_email
275
+ end
276
+
277
+ # Custom attribute writer method with validation
278
+ # @param [Object] compliance_contact_phone Value to be assigned
279
+ def compliance_contact_phone=(compliance_contact_phone)
280
+ if compliance_contact_phone.nil?
281
+ fail ArgumentError, 'compliance_contact_phone cannot be nil'
282
+ end
283
+
284
+ @compliance_contact_phone = compliance_contact_phone
285
+ end
286
+
287
+ # Checks equality by comparing each attribute.
288
+ # @param [Object] Object to be compared
289
+ def ==(o)
290
+ return true if self.equal?(o)
291
+ self.class == o.class &&
292
+ scenario_id == o.scenario_id &&
293
+ business_type == o.business_type &&
294
+ legal_name == o.legal_name &&
295
+ tax_id == o.tax_id &&
296
+ website == o.website &&
297
+ country == o.country &&
298
+ full_address == o.full_address &&
299
+ compliance_contact_email == o.compliance_contact_email &&
300
+ compliance_contact_phone == o.compliance_contact_phone
301
+ end
302
+
303
+ # @see the `==` method
304
+ # @param [Object] Object to be compared
305
+ def eql?(o)
306
+ self == o
307
+ end
308
+
309
+ # Calculates hash code according to all attributes.
310
+ # @return [Integer] Hash code
311
+ def hash
312
+ [scenario_id, business_type, legal_name, tax_id, website, country, full_address, compliance_contact_email, compliance_contact_phone].hash
313
+ end
314
+
315
+ # Builds the object from hash
316
+ # @param [Hash] attributes Model attributes in the form of hash
317
+ # @return [Object] Returns the model itself
318
+ def self.build_from_hash(attributes)
319
+ return nil unless attributes.is_a?(Hash)
320
+ attributes = attributes.transform_keys(&:to_sym)
321
+ transformed_hash = {}
322
+ openapi_types.each_pair do |key, type|
323
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
324
+ transformed_hash["#{key}"] = nil
325
+ elsif type =~ /\AArray<(.*)>/i
326
+ # check to ensure the input is an array given that the attribute
327
+ # is documented as an array but the input is not
328
+ if attributes[attribute_map[key]].is_a?(Array)
329
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
330
+ end
331
+ elsif !attributes[attribute_map[key]].nil?
332
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
333
+ end
334
+ end
335
+ new(transformed_hash)
336
+ end
337
+
338
+ # Returns the object in the form of hash
339
+ # @return [Hash] Returns the object in the form of hash
340
+ def to_hash
341
+ hash = {}
342
+ self.class.attribute_map.each_pair do |attr, param|
343
+ value = self.send(attr)
344
+ if value.nil?
345
+ is_nullable = self.class.openapi_nullable.include?(attr)
346
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
347
+ end
348
+
349
+ hash[param] = _to_hash(value)
350
+ end
351
+ hash
352
+ end
353
+
354
+ end
355
+
356
+ end
@@ -0,0 +1,220 @@
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
+ # Request body for PUT /registrations/a2p
18
+ class A2pRegistrationUpdateRequest < ApiModelBase
19
+ attr_accessor :scenario_id
20
+
21
+ attr_accessor :business_type
22
+
23
+ attr_accessor :legal_name
24
+
25
+ attr_accessor :tax_id
26
+
27
+ attr_accessor :website
28
+
29
+ attr_accessor :country
30
+
31
+ attr_accessor :full_address
32
+
33
+ attr_accessor :compliance_contact_email
34
+
35
+ attr_accessor :compliance_contact_phone
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'scenario_id' => :'scenarioId',
41
+ :'business_type' => :'businessType',
42
+ :'legal_name' => :'legalName',
43
+ :'tax_id' => :'taxId',
44
+ :'website' => :'website',
45
+ :'country' => :'country',
46
+ :'full_address' => :'fullAddress',
47
+ :'compliance_contact_email' => :'complianceContactEmail',
48
+ :'compliance_contact_phone' => :'complianceContactPhone'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'scenario_id' => :'String',
66
+ :'business_type' => :'String',
67
+ :'legal_name' => :'String',
68
+ :'tax_id' => :'String',
69
+ :'website' => :'String',
70
+ :'country' => :'String',
71
+ :'full_address' => :'String',
72
+ :'compliance_contact_email' => :'String',
73
+ :'compliance_contact_phone' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::A2pRegistrationUpdateRequest` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::A2pRegistrationUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'scenario_id')
100
+ self.scenario_id = attributes[:'scenario_id']
101
+ end
102
+
103
+ if attributes.key?(:'business_type')
104
+ self.business_type = attributes[:'business_type']
105
+ end
106
+
107
+ if attributes.key?(:'legal_name')
108
+ self.legal_name = attributes[:'legal_name']
109
+ end
110
+
111
+ if attributes.key?(:'tax_id')
112
+ self.tax_id = attributes[:'tax_id']
113
+ end
114
+
115
+ if attributes.key?(:'website')
116
+ self.website = attributes[:'website']
117
+ end
118
+
119
+ if attributes.key?(:'country')
120
+ self.country = attributes[:'country']
121
+ end
122
+
123
+ if attributes.key?(:'full_address')
124
+ self.full_address = attributes[:'full_address']
125
+ end
126
+
127
+ if attributes.key?(:'compliance_contact_email')
128
+ self.compliance_contact_email = attributes[:'compliance_contact_email']
129
+ end
130
+
131
+ if attributes.key?(:'compliance_contact_phone')
132
+ self.compliance_contact_phone = attributes[:'compliance_contact_phone']
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
140
+ invalid_properties = Array.new
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ warn '[DEPRECATED] the `valid?` method is obsolete'
148
+ true
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ scenario_id == o.scenario_id &&
157
+ business_type == o.business_type &&
158
+ legal_name == o.legal_name &&
159
+ tax_id == o.tax_id &&
160
+ website == o.website &&
161
+ country == o.country &&
162
+ full_address == o.full_address &&
163
+ compliance_contact_email == o.compliance_contact_email &&
164
+ compliance_contact_phone == o.compliance_contact_phone
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [scenario_id, business_type, legal_name, tax_id, website, country, full_address, compliance_contact_email, compliance_contact_phone].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -25,6 +25,9 @@ module Pingram
25
25
  # List of subscribed event types for this webhook configuration.
26
26
  attr_accessor :events
27
27
 
28
+ # HMAC secret for verifying webhook signatures. Use this with your X-Pingram-Signature verification.
29
+ attr_accessor :secret
30
+
28
31
  class EnumAttributeValidator
29
32
  attr_reader :datatype
30
33
  attr_reader :allowable_values
@@ -52,7 +55,8 @@ module Pingram
52
55
  {
53
56
  :'webhook_id' => :'webhookId',
54
57
  :'webhook' => :'webhook',
55
- :'events' => :'events'
58
+ :'events' => :'events',
59
+ :'secret' => :'secret'
56
60
  }
57
61
  end
58
62
 
@@ -71,7 +75,8 @@ module Pingram
71
75
  {
72
76
  :'webhook_id' => :'String',
73
77
  :'webhook' => :'String',
74
- :'events' => :'Array<String>'
78
+ :'events' => :'Array<String>',
79
+ :'secret' => :'String'
75
80
  }
76
81
  end
77
82
 
@@ -116,6 +121,12 @@ module Pingram
116
121
  else
117
122
  self.events = nil
118
123
  end
124
+
125
+ if attributes.key?(:'secret')
126
+ self.secret = attributes[:'secret']
127
+ else
128
+ self.secret = nil
129
+ end
119
130
  end
120
131
 
121
132
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -135,6 +146,10 @@ module Pingram
135
146
  invalid_properties.push('invalid value for "events", events cannot be nil.')
136
147
  end
137
148
 
149
+ if @secret.nil?
150
+ invalid_properties.push('invalid value for "secret", secret cannot be nil.')
151
+ end
152
+
138
153
  invalid_properties
139
154
  end
140
155
 
@@ -145,6 +160,7 @@ module Pingram
145
160
  return false if @webhook_id.nil?
146
161
  return false if @webhook.nil?
147
162
  return false if @events.nil?
163
+ return false if @secret.nil?
148
164
  true
149
165
  end
150
166
 
@@ -168,6 +184,16 @@ module Pingram
168
184
  @webhook = webhook
169
185
  end
170
186
 
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] secret Value to be assigned
189
+ def secret=(secret)
190
+ if secret.nil?
191
+ fail ArgumentError, 'secret cannot be nil'
192
+ end
193
+
194
+ @secret = secret
195
+ end
196
+
171
197
  # Checks equality by comparing each attribute.
172
198
  # @param [Object] Object to be compared
173
199
  def ==(o)
@@ -175,7 +201,8 @@ module Pingram
175
201
  self.class == o.class &&
176
202
  webhook_id == o.webhook_id &&
177
203
  webhook == o.webhook &&
178
- events == o.events
204
+ events == o.events &&
205
+ secret == o.secret
179
206
  end
180
207
 
181
208
  # @see the `==` method
@@ -187,7 +214,7 @@ module Pingram
187
214
  # Calculates hash code according to all attributes.
188
215
  # @return [Integer] Hash code
189
216
  def hash
190
- [webhook_id, webhook, events].hash
217
+ [webhook_id, webhook, events, secret].hash
191
218
  end
192
219
 
193
220
  # Builds the object from hash