pingram 1.0.7 → 1.0.9

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 (108) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/pingram/api/components_api.rb +2 -0
  4. data/lib/pingram/api/email_api.rb +88 -0
  5. data/lib/pingram/api/numbers_api.rb +4 -4
  6. data/lib/pingram/api/push_settings_api.rb +4 -0
  7. data/lib/pingram/api/sms_api.rb +88 -0
  8. data/lib/pingram/api/templates_api.rb +2 -0
  9. data/lib/pingram/api/types_api.rb +2 -0
  10. data/lib/pingram/api/user_api.rb +4 -0
  11. data/lib/pingram/api/webhooks_api.rb +2 -0
  12. data/lib/pingram/api_client.rb +1 -1
  13. data/lib/pingram/api_error.rb +40 -4
  14. data/lib/pingram/client_wrapper.rb +20 -0
  15. data/lib/pingram/models/api_error_body.rb +223 -0
  16. data/lib/pingram/models/api_error_response.rb +192 -0
  17. data/lib/pingram/models/change_phone_request.rb +164 -0
  18. data/lib/pingram/models/get_logs_response_messages_inner.rb +13 -1
  19. data/lib/pingram/models/get_logs_response_messages_inner_media_inner.rb +173 -0
  20. data/lib/pingram/models/get_templates_list_response_inner.rb +2 -1
  21. data/lib/pingram/models/get_templates_list_response_inner_any_of2.rb +16 -4
  22. data/lib/pingram/models/get_templates_list_response_inner_any_of3.rb +16 -42
  23. data/lib/pingram/models/get_templates_list_response_inner_any_of4.rb +4 -22
  24. data/lib/pingram/models/get_templates_list_response_inner_any_of5.rb +42 -111
  25. data/lib/pingram/models/get_templates_list_response_inner_any_of6.rb +440 -0
  26. data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata.rb → get_templates_list_response_inner_any_of6_metadata.rb} +4 -4
  27. data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata_entities_inner.rb → get_templates_list_response_inner_any_of6_metadata_entities_inner.rb} +4 -4
  28. data/lib/pingram/models/{get_templates_list_response_inner_any_of5_metadata_entities_inner_external_ref.rb → get_templates_list_response_inner_any_of6_metadata_entities_inner_external_ref.rb} +3 -3
  29. data/lib/pingram/models/logs_get_response_logs_inner.rb +52 -21
  30. data/lib/pingram/models/send_email_api_response.rb +104 -0
  31. data/lib/pingram/models/send_email_api_response_any_of.rb +193 -0
  32. data/lib/pingram/models/send_email_api_response_any_of1.rb +191 -0
  33. data/lib/pingram/models/send_email_api_response_any_of1_error.rb +223 -0
  34. data/lib/pingram/models/send_email_request.rb +335 -0
  35. data/lib/pingram/models/{sender_post_body_options_email_attachments_inner_any_of1.rb → send_email_request_attachments_inner.rb} +19 -28
  36. data/lib/pingram/models/send_sms_request.rb +249 -0
  37. data/lib/pingram/models/send_sms_response.rb +104 -0
  38. data/lib/pingram/models/send_sms_response_any_of.rb +193 -0
  39. data/lib/pingram/models/send_sms_response_any_of1.rb +191 -0
  40. data/lib/pingram/models/send_sms_response_any_of1_error.rb +223 -0
  41. data/lib/pingram/models/sender_post_body_options_email_attachments_inner.rb +2 -2
  42. data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of.rb +25 -16
  43. data/lib/pingram/models/sender_post_body_slack.rb +1 -1
  44. data/lib/pingram/models/sender_post_body_sms.rb +16 -4
  45. data/lib/pingram/version.rb +1 -1
  46. data/lib/pingram.rb +21 -4
  47. data/vendor/bundle/ruby/3.2.0/cache/psych-5.4.0.gem +0 -0
  48. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/gem_make.out +10 -10
  49. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/psych.so +0 -0
  50. data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/README.md +2 -2
  51. data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_parser.c +14 -3
  52. data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/versions.rb +1 -1
  53. data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych.so +0 -0
  54. data/vendor/bundle/ruby/3.2.0/specifications/{psych-5.3.1.gemspec → psych-5.4.0.gemspec} +2 -2
  55. metadata +83 -66
  56. data/vendor/bundle/ruby/3.2.0/cache/psych-5.3.1.gem +0 -0
  57. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/gem.build_complete +0 -0
  58. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{psych-5.3.1 → psych-5.4.0}/mkmf.log +0 -0
  59. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/CONTRIBUTING.md +0 -0
  60. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/LICENSE +0 -0
  61. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/Makefile +0 -0
  62. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/depend +0 -0
  63. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/extconf.rb +0 -0
  64. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych.c +0 -0
  65. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych.h +0 -0
  66. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_emitter.c +0 -0
  67. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_emitter.h +0 -0
  68. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_parser.h +0 -0
  69. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_to_ruby.c +0 -0
  70. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_to_ruby.h +0 -0
  71. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_yaml_tree.c +0 -0
  72. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/ext/psych/psych_yaml_tree.h +0 -0
  73. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/class_loader.rb +0 -0
  74. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/coder.rb +0 -0
  75. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/core_ext.rb +0 -0
  76. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/exception.rb +0 -0
  77. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handler.rb +0 -0
  78. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handlers/document_stream.rb +0 -0
  79. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/handlers/recorder.rb +0 -0
  80. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/ruby_events.rb +0 -0
  81. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/stream.rb +0 -0
  82. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/tree_builder.rb +0 -0
  83. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/json/yaml_events.rb +0 -0
  84. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/alias.rb +0 -0
  85. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/document.rb +0 -0
  86. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/mapping.rb +0 -0
  87. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/node.rb +0 -0
  88. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/scalar.rb +0 -0
  89. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/sequence.rb +0 -0
  90. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes/stream.rb +0 -0
  91. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/nodes.rb +0 -0
  92. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/omap.rb +0 -0
  93. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/parser.rb +0 -0
  94. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/scalar_scanner.rb +0 -0
  95. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/set.rb +0 -0
  96. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/stream.rb +0 -0
  97. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/streaming.rb +0 -0
  98. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/syntax_error.rb +0 -0
  99. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/tree_builder.rb +0 -0
  100. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/depth_first.rb +0 -0
  101. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/emitter.rb +0 -0
  102. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/json_tree.rb +0 -0
  103. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/to_ruby.rb +0 -0
  104. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/visitor.rb +0 -0
  105. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors/yaml_tree.rb +0 -0
  106. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/visitors.rb +0 -0
  107. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych/y.rb +0 -0
  108. /data/vendor/bundle/ruby/3.2.0/gems/{psych-5.3.1 → psych-5.4.0}/lib/psych.rb +0 -0
@@ -0,0 +1,335 @@
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 /email` (send email without a template).
18
+ class SendEmailRequest < ApiModelBase
19
+ # The notification type to send.
20
+ attr_accessor :type
21
+
22
+ # The email address of the recipient.
23
+ attr_accessor :to
24
+
25
+ # The subject of the email.
26
+ attr_accessor :subject
27
+
28
+ # The HTML body of the email.
29
+ attr_accessor :html
30
+
31
+ # The display name of the sender.
32
+ attr_accessor :from_name
33
+
34
+ # The email address of the sender.
35
+ attr_accessor :from_address
36
+
37
+ # The preview text of the email.
38
+ attr_accessor :preview_text
39
+
40
+ # The reply-to addresses of the email.
41
+ attr_accessor :reply_to_addresses
42
+
43
+ # The CC addresses of the email.
44
+ attr_accessor :cc_addresses
45
+
46
+ # The BCC addresses of the email.
47
+ attr_accessor :bcc_addresses
48
+
49
+ # The attachments of the email.
50
+ attr_accessor :attachments
51
+
52
+ # The ISO 8601 datetime to schedule the email.
53
+ attr_accessor :schedule
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'type' => :'type',
59
+ :'to' => :'to',
60
+ :'subject' => :'subject',
61
+ :'html' => :'html',
62
+ :'from_name' => :'fromName',
63
+ :'from_address' => :'fromAddress',
64
+ :'preview_text' => :'previewText',
65
+ :'reply_to_addresses' => :'replyToAddresses',
66
+ :'cc_addresses' => :'ccAddresses',
67
+ :'bcc_addresses' => :'bccAddresses',
68
+ :'attachments' => :'attachments',
69
+ :'schedule' => :'schedule'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'type' => :'String',
87
+ :'to' => :'String',
88
+ :'subject' => :'String',
89
+ :'html' => :'String',
90
+ :'from_name' => :'String',
91
+ :'from_address' => :'String',
92
+ :'preview_text' => :'String',
93
+ :'reply_to_addresses' => :'Array<String>',
94
+ :'cc_addresses' => :'Array<String>',
95
+ :'bcc_addresses' => :'Array<String>',
96
+ :'attachments' => :'Array<SendEmailRequestAttachmentsInner>',
97
+ :'schedule' => :'String'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SendEmailRequest` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ acceptable_attribute_map = self.class.acceptable_attribute_map
116
+ attributes = attributes.each_with_object({}) { |(k, v), h|
117
+ if (!acceptable_attribute_map.key?(k.to_sym))
118
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SendEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
119
+ end
120
+ h[k.to_sym] = v
121
+ }
122
+
123
+ if attributes.key?(:'type')
124
+ self.type = attributes[:'type']
125
+ else
126
+ self.type = nil
127
+ end
128
+
129
+ if attributes.key?(:'to')
130
+ self.to = attributes[:'to']
131
+ else
132
+ self.to = nil
133
+ end
134
+
135
+ if attributes.key?(:'subject')
136
+ self.subject = attributes[:'subject']
137
+ else
138
+ self.subject = nil
139
+ end
140
+
141
+ if attributes.key?(:'html')
142
+ self.html = attributes[:'html']
143
+ else
144
+ self.html = nil
145
+ end
146
+
147
+ if attributes.key?(:'from_name')
148
+ self.from_name = attributes[:'from_name']
149
+ end
150
+
151
+ if attributes.key?(:'from_address')
152
+ self.from_address = attributes[:'from_address']
153
+ end
154
+
155
+ if attributes.key?(:'preview_text')
156
+ self.preview_text = attributes[:'preview_text']
157
+ end
158
+
159
+ if attributes.key?(:'reply_to_addresses')
160
+ if (value = attributes[:'reply_to_addresses']).is_a?(Array)
161
+ self.reply_to_addresses = value
162
+ end
163
+ end
164
+
165
+ if attributes.key?(:'cc_addresses')
166
+ if (value = attributes[:'cc_addresses']).is_a?(Array)
167
+ self.cc_addresses = value
168
+ end
169
+ end
170
+
171
+ if attributes.key?(:'bcc_addresses')
172
+ if (value = attributes[:'bcc_addresses']).is_a?(Array)
173
+ self.bcc_addresses = value
174
+ end
175
+ end
176
+
177
+ if attributes.key?(:'attachments')
178
+ if (value = attributes[:'attachments']).is_a?(Array)
179
+ self.attachments = value
180
+ end
181
+ end
182
+
183
+ if attributes.key?(:'schedule')
184
+ self.schedule = attributes[:'schedule']
185
+ end
186
+ end
187
+
188
+ # Show invalid properties with the reasons. Usually used together with valid?
189
+ # @return Array for valid properties with the reasons
190
+ def list_invalid_properties
191
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
192
+ invalid_properties = Array.new
193
+ if @type.nil?
194
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
195
+ end
196
+
197
+ if @to.nil?
198
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
199
+ end
200
+
201
+ if @subject.nil?
202
+ invalid_properties.push('invalid value for "subject", subject cannot be nil.')
203
+ end
204
+
205
+ if @html.nil?
206
+ invalid_properties.push('invalid value for "html", html cannot be nil.')
207
+ end
208
+
209
+ invalid_properties
210
+ end
211
+
212
+ # Check to see if the all the properties in the model are valid
213
+ # @return true if the model is valid
214
+ def valid?
215
+ warn '[DEPRECATED] the `valid?` method is obsolete'
216
+ return false if @type.nil?
217
+ return false if @to.nil?
218
+ return false if @subject.nil?
219
+ return false if @html.nil?
220
+ true
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] type Value to be assigned
225
+ def type=(type)
226
+ if type.nil?
227
+ fail ArgumentError, 'type cannot be nil'
228
+ end
229
+
230
+ @type = type
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] to Value to be assigned
235
+ def to=(to)
236
+ if to.nil?
237
+ fail ArgumentError, 'to cannot be nil'
238
+ end
239
+
240
+ @to = to
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] subject Value to be assigned
245
+ def subject=(subject)
246
+ if subject.nil?
247
+ fail ArgumentError, 'subject cannot be nil'
248
+ end
249
+
250
+ @subject = subject
251
+ end
252
+
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] html Value to be assigned
255
+ def html=(html)
256
+ if html.nil?
257
+ fail ArgumentError, 'html cannot be nil'
258
+ end
259
+
260
+ @html = html
261
+ end
262
+
263
+ # Checks equality by comparing each attribute.
264
+ # @param [Object] Object to be compared
265
+ def ==(o)
266
+ return true if self.equal?(o)
267
+ self.class == o.class &&
268
+ type == o.type &&
269
+ to == o.to &&
270
+ subject == o.subject &&
271
+ html == o.html &&
272
+ from_name == o.from_name &&
273
+ from_address == o.from_address &&
274
+ preview_text == o.preview_text &&
275
+ reply_to_addresses == o.reply_to_addresses &&
276
+ cc_addresses == o.cc_addresses &&
277
+ bcc_addresses == o.bcc_addresses &&
278
+ attachments == o.attachments &&
279
+ schedule == o.schedule
280
+ end
281
+
282
+ # @see the `==` method
283
+ # @param [Object] Object to be compared
284
+ def eql?(o)
285
+ self == o
286
+ end
287
+
288
+ # Calculates hash code according to all attributes.
289
+ # @return [Integer] Hash code
290
+ def hash
291
+ [type, to, subject, html, from_name, from_address, preview_text, reply_to_addresses, cc_addresses, bcc_addresses, attachments, schedule].hash
292
+ end
293
+
294
+ # Builds the object from hash
295
+ # @param [Hash] attributes Model attributes in the form of hash
296
+ # @return [Object] Returns the model itself
297
+ def self.build_from_hash(attributes)
298
+ return nil unless attributes.is_a?(Hash)
299
+ attributes = attributes.transform_keys(&:to_sym)
300
+ transformed_hash = {}
301
+ openapi_types.each_pair do |key, type|
302
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
303
+ transformed_hash["#{key}"] = nil
304
+ elsif type =~ /\AArray<(.*)>/i
305
+ # check to ensure the input is an array given that the attribute
306
+ # is documented as an array but the input is not
307
+ if attributes[attribute_map[key]].is_a?(Array)
308
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
309
+ end
310
+ elsif !attributes[attribute_map[key]].nil?
311
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
312
+ end
313
+ end
314
+ new(transformed_hash)
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ if value.nil?
324
+ is_nullable = self.class.openapi_nullable.include?(attr)
325
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
326
+ end
327
+
328
+ hash[param] = _to_hash(value)
329
+ end
330
+ hash
331
+ end
332
+
333
+ end
334
+
335
+ end
@@ -14,19 +14,16 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- class SenderPostBodyOptionsEmailAttachmentsInnerAnyOf1 < ApiModelBase
17
+ class SendEmailRequestAttachmentsInner < ApiModelBase
18
18
  attr_accessor :filename
19
19
 
20
- attr_accessor :content
21
-
22
- attr_accessor :content_type
20
+ attr_accessor :url
23
21
 
24
22
  # Attribute mapping from ruby-style variable name to JSON key.
25
23
  def self.attribute_map
26
24
  {
27
25
  :'filename' => :'filename',
28
- :'content' => :'content',
29
- :'content_type' => :'contentType'
26
+ :'url' => :'url'
30
27
  }
31
28
  end
32
29
 
@@ -44,8 +41,7 @@ module Pingram
44
41
  def self.openapi_types
45
42
  {
46
43
  :'filename' => :'String',
47
- :'content' => :'String',
48
- :'content_type' => :'String'
44
+ :'url' => :'String'
49
45
  }
50
46
  end
51
47
 
@@ -59,14 +55,14 @@ module Pingram
59
55
  # @param [Hash] attributes Model attributes in the form of hash
60
56
  def initialize(attributes = {})
61
57
  if (!attributes.is_a?(Hash))
62
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SenderPostBodyOptionsEmailAttachmentsInnerAnyOf1` initialize method"
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SendEmailRequestAttachmentsInner` initialize method"
63
59
  end
64
60
 
65
61
  # check to see if the attribute exists and convert string to symbol for hash key
66
62
  acceptable_attribute_map = self.class.acceptable_attribute_map
67
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
68
64
  if (!acceptable_attribute_map.key?(k.to_sym))
69
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SenderPostBodyOptionsEmailAttachmentsInnerAnyOf1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SendEmailRequestAttachmentsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
66
  end
71
67
  h[k.to_sym] = v
72
68
  }
@@ -77,14 +73,10 @@ module Pingram
77
73
  self.filename = nil
78
74
  end
79
75
 
80
- if attributes.key?(:'content')
81
- self.content = attributes[:'content']
76
+ if attributes.key?(:'url')
77
+ self.url = attributes[:'url']
82
78
  else
83
- self.content = nil
84
- end
85
-
86
- if attributes.key?(:'content_type')
87
- self.content_type = attributes[:'content_type']
79
+ self.url = nil
88
80
  end
89
81
  end
90
82
 
@@ -97,8 +89,8 @@ module Pingram
97
89
  invalid_properties.push('invalid value for "filename", filename cannot be nil.')
98
90
  end
99
91
 
100
- if @content.nil?
101
- invalid_properties.push('invalid value for "content", content cannot be nil.')
92
+ if @url.nil?
93
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
102
94
  end
103
95
 
104
96
  invalid_properties
@@ -109,7 +101,7 @@ module Pingram
109
101
  def valid?
110
102
  warn '[DEPRECATED] the `valid?` method is obsolete'
111
103
  return false if @filename.nil?
112
- return false if @content.nil?
104
+ return false if @url.nil?
113
105
  true
114
106
  end
115
107
 
@@ -124,13 +116,13 @@ module Pingram
124
116
  end
125
117
 
126
118
  # Custom attribute writer method with validation
127
- # @param [Object] content Value to be assigned
128
- def content=(content)
129
- if content.nil?
130
- fail ArgumentError, 'content cannot be nil'
119
+ # @param [Object] url Value to be assigned
120
+ def url=(url)
121
+ if url.nil?
122
+ fail ArgumentError, 'url cannot be nil'
131
123
  end
132
124
 
133
- @content = content
125
+ @url = url
134
126
  end
135
127
 
136
128
  # Checks equality by comparing each attribute.
@@ -139,8 +131,7 @@ module Pingram
139
131
  return true if self.equal?(o)
140
132
  self.class == o.class &&
141
133
  filename == o.filename &&
142
- content == o.content &&
143
- content_type == o.content_type
134
+ url == o.url
144
135
  end
145
136
 
146
137
  # @see the `==` method
@@ -152,7 +143,7 @@ module Pingram
152
143
  # Calculates hash code according to all attributes.
153
144
  # @return [Integer] Hash code
154
145
  def hash
155
- [filename, content, content_type].hash
146
+ [filename, url].hash
156
147
  end
157
148
 
158
149
  # Builds the object from hash
@@ -0,0 +1,249 @@
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 /sms` (send SMS without a template).
18
+ class SendSmsRequest < ApiModelBase
19
+ # The notification type to send.
20
+ attr_accessor :type
21
+
22
+ # The phone number of the recipient.
23
+ attr_accessor :to
24
+
25
+ # The message of the SMS notification.
26
+ attr_accessor :message
27
+
28
+ # The ISO 8601 datetime to schedule the SMS notification.
29
+ attr_accessor :schedule
30
+
31
+ # Override the sender phone number. Must be a verified number in your Telnyx account.
32
+ attr_accessor :from
33
+
34
+ attr_accessor :auto_reply
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'type' => :'type',
40
+ :'to' => :'to',
41
+ :'message' => :'message',
42
+ :'schedule' => :'schedule',
43
+ :'from' => :'from',
44
+ :'auto_reply' => :'autoReply'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'type' => :'String',
62
+ :'to' => :'String',
63
+ :'message' => :'String',
64
+ :'schedule' => :'String',
65
+ :'from' => :'String',
66
+ :'auto_reply' => :'SenderPostBodySmsAutoReply'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SendSmsRequest` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SendSmsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'type')
93
+ self.type = attributes[:'type']
94
+ else
95
+ self.type = nil
96
+ end
97
+
98
+ if attributes.key?(:'to')
99
+ self.to = attributes[:'to']
100
+ else
101
+ self.to = nil
102
+ end
103
+
104
+ if attributes.key?(:'message')
105
+ self.message = attributes[:'message']
106
+ else
107
+ self.message = nil
108
+ end
109
+
110
+ if attributes.key?(:'schedule')
111
+ self.schedule = attributes[:'schedule']
112
+ end
113
+
114
+ if attributes.key?(:'from')
115
+ self.from = attributes[:'from']
116
+ end
117
+
118
+ if attributes.key?(:'auto_reply')
119
+ self.auto_reply = attributes[:'auto_reply']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @type.nil?
129
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
130
+ end
131
+
132
+ if @to.nil?
133
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
134
+ end
135
+
136
+ if @message.nil?
137
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @type.nil?
148
+ return false if @to.nil?
149
+ return false if @message.nil?
150
+ true
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] type Value to be assigned
155
+ def type=(type)
156
+ if type.nil?
157
+ fail ArgumentError, 'type cannot be nil'
158
+ end
159
+
160
+ @type = type
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] to Value to be assigned
165
+ def to=(to)
166
+ if to.nil?
167
+ fail ArgumentError, 'to cannot be nil'
168
+ end
169
+
170
+ @to = to
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] message Value to be assigned
175
+ def message=(message)
176
+ if message.nil?
177
+ fail ArgumentError, 'message cannot be nil'
178
+ end
179
+
180
+ @message = message
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(o)
186
+ return true if self.equal?(o)
187
+ self.class == o.class &&
188
+ type == o.type &&
189
+ to == o.to &&
190
+ message == o.message &&
191
+ schedule == o.schedule &&
192
+ from == o.from &&
193
+ auto_reply == o.auto_reply
194
+ end
195
+
196
+ # @see the `==` method
197
+ # @param [Object] Object to be compared
198
+ def eql?(o)
199
+ self == o
200
+ end
201
+
202
+ # Calculates hash code according to all attributes.
203
+ # @return [Integer] Hash code
204
+ def hash
205
+ [type, to, message, schedule, from, auto_reply].hash
206
+ end
207
+
208
+ # Builds the object from hash
209
+ # @param [Hash] attributes Model attributes in the form of hash
210
+ # @return [Object] Returns the model itself
211
+ def self.build_from_hash(attributes)
212
+ return nil unless attributes.is_a?(Hash)
213
+ attributes = attributes.transform_keys(&:to_sym)
214
+ transformed_hash = {}
215
+ openapi_types.each_pair do |key, type|
216
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = nil
218
+ elsif type =~ /\AArray<(.*)>/i
219
+ # check to ensure the input is an array given that the attribute
220
+ # is documented as an array but the input is not
221
+ if attributes[attribute_map[key]].is_a?(Array)
222
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
223
+ end
224
+ elsif !attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
226
+ end
227
+ end
228
+ new(transformed_hash)
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ end
248
+
249
+ end