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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/pingram/api/templates_api.rb +1 -74
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/models/get_templates_list_response_inner_any_of.rb +4 -13
- data/lib/pingram/models/template_patch_request.rb +283 -78
- data/lib/pingram/models/{template_post_request_batch.rb → template_patch_request_batch.rb} +3 -3
- data/lib/pingram/models/{template_post_request_instant.rb → template_patch_request_instant.rb} +3 -3
- data/lib/pingram/models/template_post_request.rb +3 -13
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +2 -6
- metadata +4 -8
- data/lib/pingram/models/template_patch_request_any_of.rb +0 -199
- data/lib/pingram/models/template_patch_request_any_of1.rb +0 -187
- data/lib/pingram/models/template_patch_request_any_of1_batch.rb +0 -217
- data/lib/pingram/models/template_patch_request_any_of1_instant.rb +0 -184
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8fa3e26c7e5afa45e1ca10b5db3146e17a8762c780b58ddd6faa12f46beff5dd
|
|
4
|
+
data.tar.gz: 40dd7c81e987dfd1bc6712e6efdc3966f4a55340a0bf249bc3c1492da6347acd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe0a51b6f97655ab7aae2d0ed4d82cea96186b945b1d2cf72dd4ff5df85f5f995c51966819c8d91eab6349b556a3d676545a3c13b7cbdcb24d25e2dde780c400
|
|
7
|
+
data.tar.gz: 348a7721e3e4b99dff472630ae6f9ba74ffb782f9ff93cfba62125ea4c747cb580adb6818ae9c08d90f7db01fd78ca463ec3a001eb68648ca8ed0e9f9948828b
|
data/Gemfile.lock
CHANGED
|
@@ -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] || {}
|
data/lib/pingram/api_client.rb
CHANGED
|
@@ -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
|
|
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
|
|
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.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
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::
|
|
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::
|
|
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
|
}
|
data/lib/pingram/models/{template_post_request_instant.rb → template_patch_request_instant.rb}
RENAMED
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Pingram
|
|
17
17
|
# Copy for instant (real-time) delivery.
|
|
18
|
-
class
|
|
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::
|
|
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::
|
|
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' => :'
|
|
124
|
-
:'batch' => :'
|
|
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,
|
|
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
|