pingram 0.1.5 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e0fb4c7eaff1d69b8c4a11b5274f4ceb6647ed04967ee23e1ba8a87e58c081e
4
- data.tar.gz: 4968c7bc0ced946caacde1a4c0414d303ea90467591d18ee546ca501f495a1c9
3
+ metadata.gz: 8fa3e26c7e5afa45e1ca10b5db3146e17a8762c780b58ddd6faa12f46beff5dd
4
+ data.tar.gz: 40dd7c81e987dfd1bc6712e6efdc3966f4a55340a0bf249bc3c1492da6347acd
5
5
  SHA512:
6
- metadata.gz: 972ab164c3fd3f815ddac368be8820a96f26a4a10345c2b1faf74835a38e90b74b56677fe4a031ce06a9274878e1ca01532f0a627c10f1fa227ed803957be46a
7
- data.tar.gz: 91aa1a017e6d8dd01deb2e4c97552ef7a93a73dd03de9aa868a56f4e9b25207a144878180f2f7b495d2d60a1e34e1697cd3f38be790e2fb1d41a7d0418bd380c
6
+ metadata.gz: fe0a51b6f97655ab7aae2d0ed4d82cea96186b945b1d2cf72dd4ff5df85f5f995c51966819c8d91eab6349b556a3d676545a3c13b7cbdcb24d25e2dde780c400
7
+ data.tar.gz: 348a7721e3e4b99dff472630ae6f9ba74ffb782f9ff93cfba62125ea4c747cb580adb6818ae9c08d90f7db01fd78ca463ec3a001eb68648ca8ed0e9f9948828b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pingram (0.1.5)
4
+ pingram (1.0.1)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -241,79 +241,6 @@ module Pingram
241
241
  return data, status_code, headers
242
242
  end
243
243
 
244
- # Initiate AI-powered template migration from complex to simple HTML
245
- # @param notification_id [String] Notification ID
246
- # @param channel [String] Channel type
247
- # @param template_id [String] Template ID
248
- # @param [Hash] opts the optional parameters
249
- # @return [Template]
250
- def templates_initiate_migration(notification_id, channel, template_id, opts = {})
251
- data, _status_code, _headers = templates_initiate_migration_with_http_info(notification_id, channel, template_id, opts)
252
- data
253
- end
254
-
255
- # Initiate AI-powered template migration from complex to simple HTML
256
- # @param notification_id [String] Notification ID
257
- # @param channel [String] Channel type
258
- # @param template_id [String] Template ID
259
- # @param [Hash] opts the optional parameters
260
- # @return [Array<(Template, Integer, Hash)>] Template data, response status code and response headers
261
- def templates_initiate_migration_with_http_info(notification_id, channel, template_id, opts = {})
262
- if @api_client.config.debugging
263
- @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_initiate_migration ...'
264
- end
265
- # verify the required parameter 'notification_id' is set
266
- if @api_client.config.client_side_validation && notification_id.nil?
267
- fail ArgumentError, "Missing the required parameter 'notification_id' when calling TemplatesApi.templates_initiate_migration"
268
- end
269
- # verify the required parameter 'channel' is set
270
- if @api_client.config.client_side_validation && channel.nil?
271
- fail ArgumentError, "Missing the required parameter 'channel' when calling TemplatesApi.templates_initiate_migration"
272
- end
273
- # verify the required parameter 'template_id' is set
274
- if @api_client.config.client_side_validation && template_id.nil?
275
- fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.templates_initiate_migration"
276
- end
277
- # resource path
278
- local_var_path = '/notifications/{notificationId}/{channel}/templates/{templateId}/migrate'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s)).sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
279
-
280
- # query parameters
281
- query_params = opts[:query_params] || {}
282
-
283
- # header parameters
284
- header_params = opts[:header_params] || {}
285
- # HTTP header 'Accept' (if needed)
286
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
287
-
288
- # form parameters
289
- form_params = opts[:form_params] || {}
290
-
291
- # http body (model)
292
- post_body = opts[:debug_body]
293
-
294
- # return_type
295
- return_type = opts[:debug_return_type] || 'Template'
296
-
297
- # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
298
- auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
299
-
300
- new_options = opts.merge(
301
- :operation => :"TemplatesApi.templates_initiate_migration",
302
- :header_params => header_params,
303
- :query_params => query_params,
304
- :form_params => form_params,
305
- :body => post_body,
306
- :auth_names => auth_names,
307
- :return_type => return_type
308
- )
309
-
310
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
311
- if @api_client.config.debugging
312
- @api_client.config.logger.debug "API called: TemplatesApi#templates_initiate_migration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
313
- end
314
- return data, status_code, headers
315
- end
316
-
317
244
  # List all templates for a notification and channel
318
245
  # @param notification_id [String] Notification ID
319
246
  # @param channel [String] Channel type
@@ -415,7 +342,7 @@ module Pingram
415
342
  fail ArgumentError, "Missing the required parameter 'set_default_template_request' when calling TemplatesApi.templates_set_default_template"
416
343
  end
417
344
  # resource path
418
- local_var_path = '/notifications/{notificationId}/{channel}/templates/default'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s))
345
+ local_var_path = '/notifications/{notificationId}/{channel}/templates/default-selection'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s))
419
346
 
420
347
  # query parameters
421
348
  query_params = opts[:query_params] || {}
@@ -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/0.1.5"
35
+ @user_agent = "pingram-ruby/1.0.1"
36
36
  @default_headers = {
37
37
  'Content-Type' => 'application/json',
38
38
  'User-Agent' => @user_agent
@@ -39,8 +39,6 @@ module Pingram
39
39
 
40
40
  attr_accessor :sender_email
41
41
 
42
- attr_accessor :migration
43
-
44
42
  class EnumAttributeValidator
45
43
  attr_reader :datatype
46
44
  attr_reader :allowable_values
@@ -77,8 +75,7 @@ module Pingram
77
75
  :'internal' => :'internal',
78
76
  :'subject' => :'subject',
79
77
  :'sender_name' => :'senderName',
80
- :'sender_email' => :'senderEmail',
81
- :'migration' => :'migration'
78
+ :'sender_email' => :'senderEmail'
82
79
  }
83
80
  end
84
81
 
@@ -106,8 +103,7 @@ module Pingram
106
103
  :'internal' => :'String',
107
104
  :'subject' => :'String',
108
105
  :'sender_name' => :'String',
109
- :'sender_email' => :'String',
110
- :'migration' => :'String'
106
+ :'sender_email' => :'String'
111
107
  }
112
108
  end
113
109
 
@@ -202,10 +198,6 @@ module Pingram
202
198
  else
203
199
  self.sender_email = nil
204
200
  end
205
-
206
- if attributes.key?(:'migration')
207
- self.migration = attributes[:'migration']
208
- end
209
201
  end
210
202
 
211
203
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -389,8 +381,7 @@ module Pingram
389
381
  internal == o.internal &&
390
382
  subject == o.subject &&
391
383
  sender_name == o.sender_name &&
392
- sender_email == o.sender_email &&
393
- migration == o.migration
384
+ sender_email == o.sender_email
394
385
  end
395
386
 
396
387
  # @see the `==` method
@@ -402,7 +393,7 @@ module Pingram
402
393
  # Calculates hash code according to all attributes.
403
394
  # @return [Integer] Hash code
404
395
  def hash
405
- [env_id, notification_id, template_id, channel, default, is_default_for, html, preview_text, internal, subject, sender_name, sender_email, migration].hash
396
+ [env_id, notification_id, template_id, channel, default, is_default_for, html, preview_text, internal, subject, sender_name, sender_email].hash
406
397
  end
407
398
 
408
399
  # Builds the object from hash
@@ -14,91 +14,296 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- # Request body for updating a template. Use EMAIL fields (html, subject, senderName, etc.) when channel is EMAIL. Use INAPP_WEB fields (title, redirectURL, imageURL, instant, batch) when channel is INAPP_WEB. Other channels have their own shapes; only include properties that apply to the channel.
18
- module TemplatePatchRequest
19
- class << self
20
- # List of class defined in anyOf (OpenAPI v3)
21
- def openapi_any_of
22
- [
23
- :'TemplatePatchRequestAnyOf',
24
- :'TemplatePatchRequestAnyOf1'
25
- ]
26
- end
27
-
28
- # Builds the object
29
- # @param [Mixed] Data to be matched against the list of anyOf items
30
- # @return [Object] Returns the model or the data itself
31
- def build(data)
32
- # Go through the list of anyOf items and attempt to identify the appropriate one.
33
- # Note:
34
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
- # - TODO: scalar values are de facto behaving as if they were nullable.
37
- # - TODO: logging when debugging is set.
38
- openapi_any_of.each do |klass|
39
- begin
40
- next if klass == :AnyType # "nullable: true"
41
- return find_and_cast_into_type(klass, data)
42
- rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
- end
17
+ # Request body for updating a template. Include only properties that apply to the channel in the path. EMAIL: html, subject, senderName, etc. | INAPP_WEB: title, redirectURL, instant, batch | SMS/CALL: text | PUSH/WEB_PUSH: title, message, icon, url | SLACK: text, blocks, username, icon
18
+ class TemplatePatchRequest < ApiModelBase
19
+ # HTML body of the email.
20
+ attr_accessor :html
21
+
22
+ # Preview text (e.g. for inbox).
23
+ attr_accessor :preview_text
24
+
25
+ # Internal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field.
26
+ attr_accessor :internal
27
+
28
+ # Email subject line.
29
+ attr_accessor :subject
30
+
31
+ # Sender display name.
32
+ attr_accessor :sender_name
33
+
34
+ # Sender email address.
35
+ attr_accessor :sender_email
36
+
37
+ # Notification title (in-app).
38
+ attr_accessor :title
39
+
40
+ # URL to open when the user taps the notification.
41
+ attr_accessor :redirect_url
42
+
43
+ # Image URL shown in the in-app notification.
44
+ attr_accessor :image_url
45
+
46
+ attr_accessor :instant
47
+
48
+ attr_accessor :batch
49
+
50
+ # Message text (SMS or call).
51
+ attr_accessor :text
52
+
53
+ # Push notification body text. (title is shared with INAPP_WEB above.)
54
+ attr_accessor :message
55
+
56
+ # Web push: icon URL. Slack: bot icon (emoji or URL).
57
+ attr_accessor :icon
58
+
59
+ # Web push: URL to open when the notification is clicked.
60
+ attr_accessor :url
61
+
62
+ # Slack message blocks (optional).
63
+ attr_accessor :blocks
64
+
65
+ # Slack bot username.
66
+ attr_accessor :username
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'html' => :'html',
72
+ :'preview_text' => :'previewText',
73
+ :'internal' => :'internal',
74
+ :'subject' => :'subject',
75
+ :'sender_name' => :'senderName',
76
+ :'sender_email' => :'senderEmail',
77
+ :'title' => :'title',
78
+ :'redirect_url' => :'redirectURL',
79
+ :'image_url' => :'imageURL',
80
+ :'instant' => :'instant',
81
+ :'batch' => :'batch',
82
+ :'text' => :'text',
83
+ :'message' => :'message',
84
+ :'icon' => :'icon',
85
+ :'url' => :'url',
86
+ :'blocks' => :'blocks',
87
+ :'username' => :'username'
88
+ }
89
+ end
90
+
91
+ # Returns attribute mapping this model knows about
92
+ def self.acceptable_attribute_map
93
+ attribute_map
94
+ end
95
+
96
+ # Returns all the JSON keys this model knows about
97
+ def self.acceptable_attributes
98
+ acceptable_attribute_map.values
99
+ end
100
+
101
+ # Attribute type mapping.
102
+ def self.openapi_types
103
+ {
104
+ :'html' => :'String',
105
+ :'preview_text' => :'String',
106
+ :'internal' => :'String',
107
+ :'subject' => :'String',
108
+ :'sender_name' => :'String',
109
+ :'sender_email' => :'String',
110
+ :'title' => :'String',
111
+ :'redirect_url' => :'String',
112
+ :'image_url' => :'String',
113
+ :'instant' => :'TemplatePatchRequestInstant',
114
+ :'batch' => :'TemplatePatchRequestBatch',
115
+ :'text' => :'String',
116
+ :'message' => :'String',
117
+ :'icon' => :'String',
118
+ :'url' => :'String',
119
+ :'blocks' => :'Array<Hash<String, Object>>',
120
+ :'username' => :'String'
121
+ }
122
+ end
123
+
124
+ # List of attributes with nullable: true
125
+ def self.openapi_nullable
126
+ Set.new([
127
+ ])
128
+ end
129
+
130
+ # Initializes the object
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ def initialize(attributes = {})
133
+ if (!attributes.is_a?(Hash))
134
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequest` initialize method"
135
+ end
136
+
137
+ # check to see if the attribute exists and convert string to symbol for hash key
138
+ acceptable_attribute_map = self.class.acceptable_attribute_map
139
+ attributes = attributes.each_with_object({}) { |(k, v), h|
140
+ if (!acceptable_attribute_map.key?(k.to_sym))
141
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
44
142
  end
143
+ h[k.to_sym] = v
144
+ }
45
145
 
46
- openapi_any_of.include?(:AnyType) ? data : nil
47
- end
48
-
49
- private
50
-
51
- SchemaMismatchError = Class.new(StandardError)
52
-
53
- # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
- def find_and_cast_into_type(klass, data)
55
- return if data.nil?
56
-
57
- case klass.to_s
58
- when 'Boolean'
59
- return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
- when 'Float'
61
- return data if data.instance_of?(Float)
62
- when 'Integer'
63
- return data if data.instance_of?(Integer)
64
- when 'Time'
65
- return Time.parse(data)
66
- when 'Date'
67
- return Date.iso8601(data)
68
- when 'String'
69
- return data if data.instance_of?(String)
70
- when 'Object' # "type: object"
71
- return data if data.instance_of?(Hash)
72
- when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
- if data.instance_of?(Array)
74
- sub_type = Regexp.last_match[:sub_type]
75
- return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
- end
77
- when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
- if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
- sub_type = Regexp.last_match[:sub_type]
80
- return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
- end
82
- else # model
83
- const = Pingram.const_get(klass)
84
- if const
85
- if const.respond_to?(:openapi_any_of) # nested anyOf model
86
- model = const.build(data)
87
- return model if model
88
- else
89
- # raise if data contains keys that are not known to the model
90
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
- model = const.build_from_hash(data)
92
- return model if model
93
- end
146
+ if attributes.key?(:'html')
147
+ self.html = attributes[:'html']
148
+ end
149
+
150
+ if attributes.key?(:'preview_text')
151
+ self.preview_text = attributes[:'preview_text']
152
+ end
153
+
154
+ if attributes.key?(:'internal')
155
+ self.internal = attributes[:'internal']
156
+ end
157
+
158
+ if attributes.key?(:'subject')
159
+ self.subject = attributes[:'subject']
160
+ end
161
+
162
+ if attributes.key?(:'sender_name')
163
+ self.sender_name = attributes[:'sender_name']
164
+ end
165
+
166
+ if attributes.key?(:'sender_email')
167
+ self.sender_email = attributes[:'sender_email']
168
+ end
169
+
170
+ if attributes.key?(:'title')
171
+ self.title = attributes[:'title']
172
+ end
173
+
174
+ if attributes.key?(:'redirect_url')
175
+ self.redirect_url = attributes[:'redirect_url']
176
+ end
177
+
178
+ if attributes.key?(:'image_url')
179
+ self.image_url = attributes[:'image_url']
180
+ end
181
+
182
+ if attributes.key?(:'instant')
183
+ self.instant = attributes[:'instant']
184
+ end
185
+
186
+ if attributes.key?(:'batch')
187
+ self.batch = attributes[:'batch']
188
+ end
189
+
190
+ if attributes.key?(:'text')
191
+ self.text = attributes[:'text']
192
+ end
193
+
194
+ if attributes.key?(:'message')
195
+ self.message = attributes[:'message']
196
+ end
197
+
198
+ if attributes.key?(:'icon')
199
+ self.icon = attributes[:'icon']
200
+ end
201
+
202
+ if attributes.key?(:'url')
203
+ self.url = attributes[:'url']
204
+ end
205
+
206
+ if attributes.key?(:'blocks')
207
+ if (value = attributes[:'blocks']).is_a?(Array)
208
+ self.blocks = value
209
+ end
210
+ end
211
+
212
+ if attributes.key?(:'username')
213
+ self.username = attributes[:'username']
214
+ end
215
+ end
216
+
217
+ # Show invalid properties with the reasons. Usually used together with valid?
218
+ # @return Array for valid properties with the reasons
219
+ def list_invalid_properties
220
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
221
+ invalid_properties = Array.new
222
+ invalid_properties
223
+ end
224
+
225
+ # Check to see if the all the properties in the model are valid
226
+ # @return true if the model is valid
227
+ def valid?
228
+ warn '[DEPRECATED] the `valid?` method is obsolete'
229
+ true
230
+ end
231
+
232
+ # Checks equality by comparing each attribute.
233
+ # @param [Object] Object to be compared
234
+ def ==(o)
235
+ return true if self.equal?(o)
236
+ self.class == o.class &&
237
+ html == o.html &&
238
+ preview_text == o.preview_text &&
239
+ internal == o.internal &&
240
+ subject == o.subject &&
241
+ sender_name == o.sender_name &&
242
+ sender_email == o.sender_email &&
243
+ title == o.title &&
244
+ redirect_url == o.redirect_url &&
245
+ image_url == o.image_url &&
246
+ instant == o.instant &&
247
+ batch == o.batch &&
248
+ text == o.text &&
249
+ message == o.message &&
250
+ icon == o.icon &&
251
+ url == o.url &&
252
+ blocks == o.blocks &&
253
+ username == o.username
254
+ end
255
+
256
+ # @see the `==` method
257
+ # @param [Object] Object to be compared
258
+ def eql?(o)
259
+ self == o
260
+ end
261
+
262
+ # Calculates hash code according to all attributes.
263
+ # @return [Integer] Hash code
264
+ def hash
265
+ [html, preview_text, internal, subject, sender_name, sender_email, title, redirect_url, image_url, instant, batch, text, message, icon, url, blocks, username].hash
266
+ end
267
+
268
+ # Builds the object from hash
269
+ # @param [Hash] attributes Model attributes in the form of hash
270
+ # @return [Object] Returns the model itself
271
+ def self.build_from_hash(attributes)
272
+ return nil unless attributes.is_a?(Hash)
273
+ attributes = attributes.transform_keys(&:to_sym)
274
+ transformed_hash = {}
275
+ openapi_types.each_pair do |key, type|
276
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = nil
278
+ elsif type =~ /\AArray<(.*)>/i
279
+ # check to ensure the input is an array given that the attribute
280
+ # is documented as an array but the input is not
281
+ if attributes[attribute_map[key]].is_a?(Array)
282
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
94
283
  end
284
+ elsif !attributes[attribute_map[key]].nil?
285
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
95
286
  end
287
+ end
288
+ new(transformed_hash)
289
+ end
96
290
 
97
- raise # if no match by now, raise
98
- rescue
99
- raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
291
+ # Returns the object in the form of hash
292
+ # @return [Hash] Returns the object in the form of hash
293
+ def to_hash
294
+ hash = {}
295
+ self.class.attribute_map.each_pair do |attr, param|
296
+ value = self.send(attr)
297
+ if value.nil?
298
+ is_nullable = self.class.openapi_nullable.include?(attr)
299
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
300
+ end
301
+
302
+ hash[param] = _to_hash(value)
100
303
  end
304
+ hash
101
305
  end
306
+
102
307
  end
103
308
 
104
309
  end
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Pingram
17
17
  # Copy for batch delivery.
18
- class TemplatePostRequestBatch < ApiModelBase
18
+ class TemplatePatchRequestBatch < ApiModelBase
19
19
  attr_accessor :title
20
20
 
21
21
  attr_accessor :redirect_url
@@ -60,14 +60,14 @@ module Pingram
60
60
  # @param [Hash] attributes Model attributes in the form of hash
61
61
  def initialize(attributes = {})
62
62
  if (!attributes.is_a?(Hash))
63
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePostRequestBatch` initialize method"
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestBatch` initialize method"
64
64
  end
65
65
 
66
66
  # check to see if the attribute exists and convert string to symbol for hash key
67
67
  acceptable_attribute_map = self.class.acceptable_attribute_map
68
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
69
69
  if (!acceptable_attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePostRequestBatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestBatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
71
  end
72
72
  h[k.to_sym] = v
73
73
  }
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Pingram
17
17
  # Copy for instant (real-time) delivery.
18
- class TemplatePostRequestInstant < ApiModelBase
18
+ class TemplatePatchRequestInstant < ApiModelBase
19
19
  attr_accessor :title
20
20
 
21
21
  attr_accessor :redirect_url
@@ -60,14 +60,14 @@ module Pingram
60
60
  # @param [Hash] attributes Model attributes in the form of hash
61
61
  def initialize(attributes = {})
62
62
  if (!attributes.is_a?(Hash))
63
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePostRequestInstant` initialize method"
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestInstant` initialize method"
64
64
  end
65
65
 
66
66
  # check to see if the attribute exists and convert string to symbol for hash key
67
67
  acceptable_attribute_map = self.class.acceptable_attribute_map
68
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
69
69
  if (!acceptable_attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePostRequestInstant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestInstant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
71
  end
72
72
  h[k.to_sym] = v
73
73
  }
@@ -37,9 +37,6 @@ module Pingram
37
37
  # Sender email address.
38
38
  attr_accessor :sender_email
39
39
 
40
- # Migration metadata (e.g. from template migration).
41
- attr_accessor :migration
42
-
43
40
  # Notification title (in-app).
44
41
  attr_accessor :title
45
42
 
@@ -81,7 +78,6 @@ module Pingram
81
78
  :'subject' => :'subject',
82
79
  :'sender_name' => :'senderName',
83
80
  :'sender_email' => :'senderEmail',
84
- :'migration' => :'migration',
85
81
  :'title' => :'title',
86
82
  :'redirect_url' => :'redirectURL',
87
83
  :'image_url' => :'imageURL',
@@ -116,12 +112,11 @@ module Pingram
116
112
  :'subject' => :'String',
117
113
  :'sender_name' => :'String',
118
114
  :'sender_email' => :'String',
119
- :'migration' => :'String',
120
115
  :'title' => :'String',
121
116
  :'redirect_url' => :'String',
122
117
  :'image_url' => :'String',
123
- :'instant' => :'TemplatePostRequestInstant',
124
- :'batch' => :'TemplatePostRequestBatch',
118
+ :'instant' => :'TemplatePatchRequestInstant',
119
+ :'batch' => :'TemplatePatchRequestBatch',
125
120
  :'text' => :'String',
126
121
  :'message' => :'String',
127
122
  :'icon' => :'String',
@@ -183,10 +178,6 @@ module Pingram
183
178
  self.sender_email = attributes[:'sender_email']
184
179
  end
185
180
 
186
- if attributes.key?(:'migration')
187
- self.migration = attributes[:'migration']
188
- end
189
-
190
181
  if attributes.key?(:'title')
191
182
  self.title = attributes[:'title']
192
183
  end
@@ -276,7 +267,6 @@ module Pingram
276
267
  subject == o.subject &&
277
268
  sender_name == o.sender_name &&
278
269
  sender_email == o.sender_email &&
279
- migration == o.migration &&
280
270
  title == o.title &&
281
271
  redirect_url == o.redirect_url &&
282
272
  image_url == o.image_url &&
@@ -299,7 +289,7 @@ module Pingram
299
289
  # Calculates hash code according to all attributes.
300
290
  # @return [Integer] Hash code
301
291
  def hash
302
- [template_id, html, preview_text, internal, subject, sender_name, sender_email, migration, title, redirect_url, image_url, instant, batch, text, message, icon, url, blocks, username].hash
292
+ [template_id, html, preview_text, internal, subject, sender_name, sender_email, title, redirect_url, image_url, instant, batch, text, message, icon, url, blocks, username].hash
303
293
  end
304
294
 
305
295
  # Builds the object from hash