pingram 1.0.30 → 1.0.32

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/pingram/api/broadcasts_api.rb +912 -0
  4. data/lib/pingram/api/library_api.rb +161 -0
  5. data/lib/pingram/api/webhooks_api.rb +117 -39
  6. data/lib/pingram/api_client.rb +1 -1
  7. data/lib/pingram/client_wrapper.rb +20 -0
  8. data/lib/pingram/models/broadcast_metrics_response.rb +480 -0
  9. data/lib/pingram/models/broadcast_response.rb +525 -0
  10. data/lib/pingram/models/broadcast_response_audience.rb +161 -0
  11. data/lib/pingram/models/create_broadcast_request.rb +366 -0
  12. data/lib/pingram/models/create_library_request.rb +192 -0
  13. data/lib/pingram/models/create_library_response.rb +346 -0
  14. data/lib/pingram/models/get_users_response_users_inner.rb +13 -1
  15. data/lib/pingram/models/get_users_response_users_inner_properties_value.rb +104 -0
  16. data/lib/pingram/models/list_broadcast_recipients_response.rb +175 -0
  17. data/lib/pingram/models/list_broadcast_recipients_response_recipients_inner.rb +324 -0
  18. data/lib/pingram/models/list_broadcasts_response.rb +175 -0
  19. data/lib/pingram/models/list_broadcasts_response_broadcasts_inner.rb +487 -0
  20. data/lib/pingram/models/list_library_response.rb +175 -0
  21. data/lib/pingram/models/list_library_response_items_inner.rb +344 -0
  22. data/lib/pingram/models/logs_get_response_logs_inner.rb +4 -4
  23. data/lib/pingram/models/mfa_status_response.rb +1 -1
  24. data/lib/pingram/models/post_user_request.rb +16 -4
  25. data/lib/pingram/models/schedule_broadcast_request.rb +165 -0
  26. data/lib/pingram/models/sender_post_body_to.rb +13 -1
  27. data/lib/pingram/models/sender_post_body_user.rb +13 -1
  28. data/lib/pingram/models/update_broadcast_request.rb +264 -0
  29. data/lib/pingram/models/user.rb +13 -1
  30. data/lib/pingram/models/{events_webhook_response.rb → webhook_endpoint.rb} +22 -22
  31. data/lib/pingram/models/{events_webhook_upsert_request.rb → webhook_endpoint_upsert_request.rb} +4 -4
  32. data/lib/pingram/models/webhook_endpoints_response.rb +168 -0
  33. data/lib/pingram/models/webhook_endpoints_response_endpoints_inner.rb +261 -0
  34. data/lib/pingram/version.rb +1 -1
  35. data/lib/pingram.rb +21 -2
  36. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.3.gem +0 -0
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  38. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  39. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem_make.out +11 -10
  40. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.3/io/console.so +0 -0
  41. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/mkmf.log +10 -6
  42. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  43. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  44. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  45. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  46. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/Makefile +2 -2
  47. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/console.c +98 -13
  48. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/extconf.rb +15 -1
  49. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/lib/io/console/size.rb +4 -2
  50. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.3/lib/io/console.so +0 -0
  51. data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.2.gemspec → io-console-0.9.3.gemspec} +3 -3
  52. metadata +39 -20
  53. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.2.gem +0 -0
  54. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/io/console.so +0 -0
  55. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.2/lib/io/console.so +0 -0
  56. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem.build_complete +0 -0
  57. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/.document +0 -0
  58. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/BSDL +0 -0
  59. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/COPYING +0 -0
  60. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/README.md +0 -0
  61. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/win32_vk.inc +0 -0
@@ -38,6 +38,9 @@ module Pingram
38
38
 
39
39
  attr_accessor :slack_token
40
40
 
41
+ # Custom key-value properties synced by the developer, used for audience segmentation (e.g. broadcast filters on user.properties.plan). Incremental identify calls shallow-merge keys (unset keys are preserved). Limits: max 25 keys, key length <= 64, string values <= 256 chars, serialized size <= 1KB.
42
+ attr_accessor :properties
43
+
41
44
  # Last activity timestamp. Updated automatically. Read-only.
42
45
  attr_accessor :last_seen_time
43
46
 
@@ -60,6 +63,7 @@ module Pingram
60
63
  :'timezone' => :'timezone',
61
64
  :'slack_channel' => :'slackChannel',
62
65
  :'slack_token' => :'slackToken',
66
+ :'properties' => :'properties',
63
67
  :'last_seen_time' => :'lastSeenTime',
64
68
  :'updated_at' => :'updatedAt',
65
69
  :'created_at' => :'createdAt',
@@ -88,6 +92,7 @@ module Pingram
88
92
  :'timezone' => :'String',
89
93
  :'slack_channel' => :'String',
90
94
  :'slack_token' => :'GetUsersResponseUsersInnerSlackToken',
95
+ :'properties' => :'Hash<String, GetUsersResponseUsersInnerPropertiesValue>',
91
96
  :'last_seen_time' => :'String',
92
97
  :'updated_at' => :'String',
93
98
  :'created_at' => :'String',
@@ -155,6 +160,12 @@ module Pingram
155
160
  self.slack_token = attributes[:'slack_token']
156
161
  end
157
162
 
163
+ if attributes.key?(:'properties')
164
+ if (value = attributes[:'properties']).is_a?(Hash)
165
+ self.properties = value
166
+ end
167
+ end
168
+
158
169
  if attributes.key?(:'last_seen_time')
159
170
  self.last_seen_time = attributes[:'last_seen_time']
160
171
  end
@@ -215,6 +226,7 @@ module Pingram
215
226
  timezone == o.timezone &&
216
227
  slack_channel == o.slack_channel &&
217
228
  slack_token == o.slack_token &&
229
+ properties == o.properties &&
218
230
  last_seen_time == o.last_seen_time &&
219
231
  updated_at == o.updated_at &&
220
232
  created_at == o.created_at &&
@@ -230,7 +242,7 @@ module Pingram
230
242
  # Calculates hash code according to all attributes.
231
243
  # @return [Integer] Hash code
232
244
  def hash
233
- [id, email, number, push_tokens, web_push_tokens, timezone, slack_channel, slack_token, last_seen_time, updated_at, created_at, email_suppression_status].hash
245
+ [id, email, number, push_tokens, web_push_tokens, timezone, slack_channel, slack_token, properties, last_seen_time, updated_at, created_at, email_suppression_status].hash
234
246
  end
235
247
 
236
248
  # Builds the object from hash
@@ -0,0 +1,264 @@
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 UpdateBroadcastRequest < ApiModelBase
18
+ attr_accessor :name
19
+
20
+ attr_accessor :type
21
+
22
+ attr_accessor :channel
23
+
24
+ attr_accessor :audience
25
+
26
+ attr_accessor :from_name
27
+
28
+ attr_accessor :from_address
29
+
30
+ # Omit to leave unchanged. Empty string clears Reply-To.
31
+ attr_accessor :reply_to_address
32
+
33
+ attr_accessor :subject
34
+
35
+ attr_accessor :html
36
+
37
+ # Optional visual-editor source. Can be updated only when the broadcast was created with it; cannot be added to an html-only broadcast. Pair with html.
38
+ attr_accessor :internal_template
39
+
40
+ class EnumAttributeValidator
41
+ attr_reader :datatype
42
+ attr_reader :allowable_values
43
+
44
+ def initialize(datatype, allowable_values)
45
+ @allowable_values = allowable_values.map do |value|
46
+ case datatype.to_s
47
+ when /Integer/i
48
+ value.to_i
49
+ when /Float/i
50
+ value.to_f
51
+ else
52
+ value
53
+ end
54
+ end
55
+ end
56
+
57
+ def valid?(value)
58
+ !value || allowable_values.include?(value)
59
+ end
60
+ end
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'name' => :'name',
66
+ :'type' => :'type',
67
+ :'channel' => :'channel',
68
+ :'audience' => :'audience',
69
+ :'from_name' => :'fromName',
70
+ :'from_address' => :'fromAddress',
71
+ :'reply_to_address' => :'replyToAddress',
72
+ :'subject' => :'subject',
73
+ :'html' => :'html',
74
+ :'internal_template' => :'internalTemplate'
75
+ }
76
+ end
77
+
78
+ # Returns attribute mapping this model knows about
79
+ def self.acceptable_attribute_map
80
+ attribute_map
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ acceptable_attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'name' => :'String',
92
+ :'type' => :'String',
93
+ :'channel' => :'String',
94
+ :'audience' => :'BroadcastResponseAudience',
95
+ :'from_name' => :'String',
96
+ :'from_address' => :'String',
97
+ :'reply_to_address' => :'String',
98
+ :'subject' => :'String',
99
+ :'html' => :'String',
100
+ :'internal_template' => :'String'
101
+ }
102
+ end
103
+
104
+ # List of attributes with nullable: true
105
+ def self.openapi_nullable
106
+ Set.new([
107
+ ])
108
+ end
109
+
110
+ # Initializes the object
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ def initialize(attributes = {})
113
+ if (!attributes.is_a?(Hash))
114
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::UpdateBroadcastRequest` initialize method"
115
+ end
116
+
117
+ # check to see if the attribute exists and convert string to symbol for hash key
118
+ acceptable_attribute_map = self.class.acceptable_attribute_map
119
+ attributes = attributes.each_with_object({}) { |(k, v), h|
120
+ if (!acceptable_attribute_map.key?(k.to_sym))
121
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::UpdateBroadcastRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
122
+ end
123
+ h[k.to_sym] = v
124
+ }
125
+
126
+ if attributes.key?(:'name')
127
+ self.name = attributes[:'name']
128
+ end
129
+
130
+ if attributes.key?(:'type')
131
+ self.type = attributes[:'type']
132
+ end
133
+
134
+ if attributes.key?(:'channel')
135
+ self.channel = attributes[:'channel']
136
+ end
137
+
138
+ if attributes.key?(:'audience')
139
+ self.audience = attributes[:'audience']
140
+ end
141
+
142
+ if attributes.key?(:'from_name')
143
+ self.from_name = attributes[:'from_name']
144
+ end
145
+
146
+ if attributes.key?(:'from_address')
147
+ self.from_address = attributes[:'from_address']
148
+ end
149
+
150
+ if attributes.key?(:'reply_to_address')
151
+ self.reply_to_address = attributes[:'reply_to_address']
152
+ end
153
+
154
+ if attributes.key?(:'subject')
155
+ self.subject = attributes[:'subject']
156
+ end
157
+
158
+ if attributes.key?(:'html')
159
+ self.html = attributes[:'html']
160
+ end
161
+
162
+ if attributes.key?(:'internal_template')
163
+ self.internal_template = attributes[:'internal_template']
164
+ end
165
+ end
166
+
167
+ # Show invalid properties with the reasons. Usually used together with valid?
168
+ # @return Array for valid properties with the reasons
169
+ def list_invalid_properties
170
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
171
+ invalid_properties = Array.new
172
+ invalid_properties
173
+ end
174
+
175
+ # Check to see if the all the properties in the model are valid
176
+ # @return true if the model is valid
177
+ def valid?
178
+ warn '[DEPRECATED] the `valid?` method is obsolete'
179
+ channel_validator = EnumAttributeValidator.new('String', ["email"])
180
+ return false unless channel_validator.valid?(@channel)
181
+ true
182
+ end
183
+
184
+ # Custom attribute writer method checking allowed values (enum).
185
+ # @param [Object] channel Object to be assigned
186
+ def channel=(channel)
187
+ validator = EnumAttributeValidator.new('String', ["email"])
188
+ unless validator.valid?(channel)
189
+ fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
190
+ end
191
+ @channel = channel
192
+ end
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] Object to be compared
196
+ def ==(o)
197
+ return true if self.equal?(o)
198
+ self.class == o.class &&
199
+ name == o.name &&
200
+ type == o.type &&
201
+ channel == o.channel &&
202
+ audience == o.audience &&
203
+ from_name == o.from_name &&
204
+ from_address == o.from_address &&
205
+ reply_to_address == o.reply_to_address &&
206
+ subject == o.subject &&
207
+ html == o.html &&
208
+ internal_template == o.internal_template
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Integer] Hash code
219
+ def hash
220
+ [name, type, channel, audience, from_name, from_address, reply_to_address, subject, html, internal_template].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ return nil unless attributes.is_a?(Hash)
228
+ attributes = attributes.transform_keys(&:to_sym)
229
+ transformed_hash = {}
230
+ openapi_types.each_pair do |key, type|
231
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
232
+ transformed_hash["#{key}"] = nil
233
+ elsif type =~ /\AArray<(.*)>/i
234
+ # check to ensure the input is an array given that the attribute
235
+ # is documented as an array but the input is not
236
+ if attributes[attribute_map[key]].is_a?(Array)
237
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
238
+ end
239
+ elsif !attributes[attribute_map[key]].nil?
240
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
241
+ end
242
+ end
243
+ new(transformed_hash)
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ end
263
+
264
+ end
@@ -38,6 +38,9 @@ module Pingram
38
38
 
39
39
  attr_accessor :slack_token
40
40
 
41
+ # Custom key-value properties synced by the developer, used for audience segmentation (e.g. broadcast filters on user.properties.plan). Incremental identify calls shallow-merge keys (unset keys are preserved). Limits: max 25 keys, key length <= 64, string values <= 256 chars, serialized size <= 1KB.
42
+ attr_accessor :properties
43
+
41
44
  # Last activity timestamp. Updated automatically. Read-only.
42
45
  attr_accessor :last_seen_time
43
46
 
@@ -60,6 +63,7 @@ module Pingram
60
63
  :'timezone' => :'timezone',
61
64
  :'slack_channel' => :'slackChannel',
62
65
  :'slack_token' => :'slackToken',
66
+ :'properties' => :'properties',
63
67
  :'last_seen_time' => :'lastSeenTime',
64
68
  :'updated_at' => :'updatedAt',
65
69
  :'created_at' => :'createdAt',
@@ -88,6 +92,7 @@ module Pingram
88
92
  :'timezone' => :'String',
89
93
  :'slack_channel' => :'String',
90
94
  :'slack_token' => :'GetUsersResponseUsersInnerSlackToken',
95
+ :'properties' => :'Hash<String, GetUsersResponseUsersInnerPropertiesValue>',
91
96
  :'last_seen_time' => :'String',
92
97
  :'updated_at' => :'String',
93
98
  :'created_at' => :'String',
@@ -155,6 +160,12 @@ module Pingram
155
160
  self.slack_token = attributes[:'slack_token']
156
161
  end
157
162
 
163
+ if attributes.key?(:'properties')
164
+ if (value = attributes[:'properties']).is_a?(Hash)
165
+ self.properties = value
166
+ end
167
+ end
168
+
158
169
  if attributes.key?(:'last_seen_time')
159
170
  self.last_seen_time = attributes[:'last_seen_time']
160
171
  end
@@ -215,6 +226,7 @@ module Pingram
215
226
  timezone == o.timezone &&
216
227
  slack_channel == o.slack_channel &&
217
228
  slack_token == o.slack_token &&
229
+ properties == o.properties &&
218
230
  last_seen_time == o.last_seen_time &&
219
231
  updated_at == o.updated_at &&
220
232
  created_at == o.created_at &&
@@ -230,7 +242,7 @@ module Pingram
230
242
  # Calculates hash code according to all attributes.
231
243
  # @return [Integer] Hash code
232
244
  def hash
233
- [id, email, number, push_tokens, web_push_tokens, timezone, slack_channel, slack_token, last_seen_time, updated_at, created_at, email_suppression_status].hash
245
+ [id, email, number, push_tokens, web_push_tokens, timezone, slack_channel, slack_token, properties, last_seen_time, updated_at, created_at, email_suppression_status].hash
234
246
  end
235
247
 
236
248
  # Builds the object from hash
@@ -14,15 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- # Events webhook configuration returned by the API.
18
- class EventsWebhookResponse < ApiModelBase
19
- # Storage key in the format accountId:envId (currently accountId:accountId for account-scoped usage).
20
- attr_accessor :webhook_id
17
+ # Destination URL that receives signed event payloads for a set of subscribed events.
18
+ class WebhookEndpoint < ApiModelBase
19
+ # Unique identifier for this endpoint within the account.
20
+ attr_accessor :id
21
21
 
22
22
  # Destination URL that receives webhook event payloads.
23
23
  attr_accessor :webhook
24
24
 
25
- # List of subscribed event types for this webhook configuration.
25
+ # List of subscribed event types for this endpoint.
26
26
  attr_accessor :events
27
27
 
28
28
  # HMAC secret for verifying webhook signatures. Use this with your X-Pingram-Signature verification.
@@ -53,7 +53,7 @@ module Pingram
53
53
  # Attribute mapping from ruby-style variable name to JSON key.
54
54
  def self.attribute_map
55
55
  {
56
- :'webhook_id' => :'webhookId',
56
+ :'id' => :'id',
57
57
  :'webhook' => :'webhook',
58
58
  :'events' => :'events',
59
59
  :'secret' => :'secret'
@@ -73,7 +73,7 @@ module Pingram
73
73
  # Attribute type mapping.
74
74
  def self.openapi_types
75
75
  {
76
- :'webhook_id' => :'String',
76
+ :'id' => :'String',
77
77
  :'webhook' => :'String',
78
78
  :'events' => :'Array<String>',
79
79
  :'secret' => :'String'
@@ -90,22 +90,22 @@ module Pingram
90
90
  # @param [Hash] attributes Model attributes in the form of hash
91
91
  def initialize(attributes = {})
92
92
  if (!attributes.is_a?(Hash))
93
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::EventsWebhookResponse` initialize method"
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::WebhookEndpoint` initialize method"
94
94
  end
95
95
 
96
96
  # check to see if the attribute exists and convert string to symbol for hash key
97
97
  acceptable_attribute_map = self.class.acceptable_attribute_map
98
98
  attributes = attributes.each_with_object({}) { |(k, v), h|
99
99
  if (!acceptable_attribute_map.key?(k.to_sym))
100
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::EventsWebhookResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::WebhookEndpoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
101
101
  end
102
102
  h[k.to_sym] = v
103
103
  }
104
104
 
105
- if attributes.key?(:'webhook_id')
106
- self.webhook_id = attributes[:'webhook_id']
105
+ if attributes.key?(:'id')
106
+ self.id = attributes[:'id']
107
107
  else
108
- self.webhook_id = nil
108
+ self.id = nil
109
109
  end
110
110
 
111
111
  if attributes.key?(:'webhook')
@@ -134,8 +134,8 @@ module Pingram
134
134
  def list_invalid_properties
135
135
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
136
  invalid_properties = Array.new
137
- if @webhook_id.nil?
138
- invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
137
+ if @id.nil?
138
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
139
139
  end
140
140
 
141
141
  if @webhook.nil?
@@ -157,7 +157,7 @@ module Pingram
157
157
  # @return true if the model is valid
158
158
  def valid?
159
159
  warn '[DEPRECATED] the `valid?` method is obsolete'
160
- return false if @webhook_id.nil?
160
+ return false if @id.nil?
161
161
  return false if @webhook.nil?
162
162
  return false if @events.nil?
163
163
  return false if @secret.nil?
@@ -165,13 +165,13 @@ module Pingram
165
165
  end
166
166
 
167
167
  # Custom attribute writer method with validation
168
- # @param [Object] webhook_id Value to be assigned
169
- def webhook_id=(webhook_id)
170
- if webhook_id.nil?
171
- fail ArgumentError, 'webhook_id cannot be nil'
168
+ # @param [Object] id Value to be assigned
169
+ def id=(id)
170
+ if id.nil?
171
+ fail ArgumentError, 'id cannot be nil'
172
172
  end
173
173
 
174
- @webhook_id = webhook_id
174
+ @id = id
175
175
  end
176
176
 
177
177
  # Custom attribute writer method with validation
@@ -199,7 +199,7 @@ module Pingram
199
199
  def ==(o)
200
200
  return true if self.equal?(o)
201
201
  self.class == o.class &&
202
- webhook_id == o.webhook_id &&
202
+ id == o.id &&
203
203
  webhook == o.webhook &&
204
204
  events == o.events &&
205
205
  secret == o.secret
@@ -214,7 +214,7 @@ module Pingram
214
214
  # Calculates hash code according to all attributes.
215
215
  # @return [Integer] Hash code
216
216
  def hash
217
- [webhook_id, webhook, events, secret].hash
217
+ [id, webhook, events, secret].hash
218
218
  end
219
219
 
220
220
  # Builds the object from hash
@@ -14,8 +14,8 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- # Request body for creating or updating the events webhook configuration.
18
- class EventsWebhookUpsertRequest < ApiModelBase
17
+ # Request body for creating or updating an events webhook endpoint.
18
+ class WebhookEndpointUpsertRequest < ApiModelBase
19
19
  # Destination URL that receives webhook event payloads. Must be a valid http(s) URL.
20
20
  attr_accessor :webhook
21
21
 
@@ -80,14 +80,14 @@ module Pingram
80
80
  # @param [Hash] attributes Model attributes in the form of hash
81
81
  def initialize(attributes = {})
82
82
  if (!attributes.is_a?(Hash))
83
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::EventsWebhookUpsertRequest` initialize method"
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::WebhookEndpointUpsertRequest` initialize method"
84
84
  end
85
85
 
86
86
  # check to see if the attribute exists and convert string to symbol for hash key
87
87
  acceptable_attribute_map = self.class.acceptable_attribute_map
88
88
  attributes = attributes.each_with_object({}) { |(k, v), h|
89
89
  if (!acceptable_attribute_map.key?(k.to_sym))
90
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::EventsWebhookUpsertRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::WebhookEndpointUpsertRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
91
  end
92
92
  h[k.to_sym] = v
93
93
  }
@@ -0,0 +1,168 @@
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
+ # Events webhook endpoints configured for the current account.
18
+ class WebhookEndpointsResponse < ApiModelBase
19
+ # Configured webhook endpoints. Empty when none exist.
20
+ attr_accessor :endpoints
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'endpoints' => :'endpoints'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'endpoints' => :'Array<WebhookEndpointsResponseEndpointsInner>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::WebhookEndpointsResponse` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::WebhookEndpointsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'endpoints')
69
+ if (value = attributes[:'endpoints']).is_a?(Array)
70
+ self.endpoints = value
71
+ end
72
+ else
73
+ self.endpoints = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @endpoints.nil?
83
+ invalid_properties.push('invalid value for "endpoints", endpoints cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @endpoints.nil?
94
+ true
95
+ end
96
+
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] endpoints Value to be assigned
99
+ def endpoints=(endpoints)
100
+ if endpoints.nil?
101
+ fail ArgumentError, 'endpoints cannot be nil'
102
+ end
103
+
104
+ @endpoints = endpoints
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ endpoints == o.endpoints
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [endpoints].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end