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,192 @@
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
+ # Standard error response for API errors.
18
+ class ApiErrorResponse < ApiModelBase
19
+ # Unique tracking ID for the request.
20
+ attr_accessor :tracking_id
21
+
22
+ attr_accessor :error
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'tracking_id' => :'trackingId',
28
+ :'error' => :'error'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'tracking_id' => :'String',
46
+ :'error' => :'ApiErrorBody'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::ApiErrorResponse` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::ApiErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'tracking_id')
73
+ self.tracking_id = attributes[:'tracking_id']
74
+ else
75
+ self.tracking_id = nil
76
+ end
77
+
78
+ if attributes.key?(:'error')
79
+ self.error = attributes[:'error']
80
+ else
81
+ self.error = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @tracking_id.nil?
91
+ invalid_properties.push('invalid value for "tracking_id", tracking_id cannot be nil.')
92
+ end
93
+
94
+ if @error.nil?
95
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if @tracking_id.nil?
106
+ return false if @error.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] tracking_id Value to be assigned
112
+ def tracking_id=(tracking_id)
113
+ if tracking_id.nil?
114
+ fail ArgumentError, 'tracking_id cannot be nil'
115
+ end
116
+
117
+ @tracking_id = tracking_id
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] error Value to be assigned
122
+ def error=(error)
123
+ if error.nil?
124
+ fail ArgumentError, 'error cannot be nil'
125
+ end
126
+
127
+ @error = error
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ tracking_id == o.tracking_id &&
136
+ error == o.error
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [tracking_id, error].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ end
191
+
192
+ end
@@ -0,0 +1,164 @@
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 ChangePhoneRequest < ApiModelBase
18
+ attr_accessor :phone_number
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'phone_number' => :'phoneNumber'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'phone_number' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::ChangePhoneRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::ChangePhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'phone_number')
67
+ self.phone_number = attributes[:'phone_number']
68
+ else
69
+ self.phone_number = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @phone_number.nil?
79
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @phone_number.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] phone_number Value to be assigned
95
+ def phone_number=(phone_number)
96
+ if phone_number.nil?
97
+ fail ArgumentError, 'phone_number cannot be nil'
98
+ end
99
+
100
+ @phone_number = phone_number
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ phone_number == o.phone_number
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [phone_number].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -45,6 +45,9 @@ module Pingram
45
45
 
46
46
  attr_accessor :attachments
47
47
 
48
+ # Inbound MMS attachments (includes contentType when available).
49
+ attr_accessor :media
50
+
48
51
  attr_accessor :message_id
49
52
 
50
53
  attr_accessor :in_reply_to
@@ -93,6 +96,7 @@ module Pingram
93
96
  :'body_text' => :'bodyText',
94
97
  :'body_html' => :'bodyHtml',
95
98
  :'attachments' => :'attachments',
99
+ :'media' => :'media',
96
100
  :'message_id' => :'messageId',
97
101
  :'in_reply_to' => :'inReplyTo',
98
102
  :'references' => :'references',
@@ -128,6 +132,7 @@ module Pingram
128
132
  :'body_text' => :'String',
129
133
  :'body_html' => :'String',
130
134
  :'attachments' => :'Array<GetLogsResponseMessagesInnerAttachmentsInner>',
135
+ :'media' => :'Array<GetLogsResponseMessagesInnerMediaInner>',
131
136
  :'message_id' => :'String',
132
137
  :'in_reply_to' => :'String',
133
138
  :'references' => :'String',
@@ -233,6 +238,12 @@ module Pingram
233
238
  end
234
239
  end
235
240
 
241
+ if attributes.key?(:'media')
242
+ if (value = attributes[:'media']).is_a?(Array)
243
+ self.media = value
244
+ end
245
+ end
246
+
236
247
  if attributes.key?(:'message_id')
237
248
  self.message_id = attributes[:'message_id']
238
249
  end
@@ -357,6 +368,7 @@ module Pingram
357
368
  body_text == o.body_text &&
358
369
  body_html == o.body_html &&
359
370
  attachments == o.attachments &&
371
+ media == o.media &&
360
372
  message_id == o.message_id &&
361
373
  in_reply_to == o.in_reply_to &&
362
374
  references == o.references &&
@@ -372,7 +384,7 @@ module Pingram
372
384
  # Calculates hash code according to all attributes.
373
385
  # @return [Integer] Hash code
374
386
  def hash
375
- [tracking_id, event_type, timestamp, epoch_ms, inbox, from, from_name, subject, to, cc, bcc, reply_to, body_text, body_html, attachments, message_id, in_reply_to, references, resolution_type].hash
387
+ [tracking_id, event_type, timestamp, epoch_ms, inbox, from, from_name, subject, to, cc, bcc, reply_to, body_text, body_html, attachments, media, message_id, in_reply_to, references, resolution_type].hash
376
388
  end
377
389
 
378
390
  # Builds the object from hash
@@ -0,0 +1,173 @@
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 GetLogsResponseMessagesInnerMediaInner < ApiModelBase
18
+ attr_accessor :url
19
+
20
+ attr_accessor :content_type
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'url' => :'url',
26
+ :'content_type' => :'contentType'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'url' => :'String',
44
+ :'content_type' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::GetLogsResponseMessagesInnerMediaInner` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::GetLogsResponseMessagesInnerMediaInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'url')
71
+ self.url = attributes[:'url']
72
+ else
73
+ self.url = nil
74
+ end
75
+
76
+ if attributes.key?(:'content_type')
77
+ self.content_type = attributes[:'content_type']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ if @url.nil?
87
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @url.nil?
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] url Value to be assigned
103
+ def url=(url)
104
+ if url.nil?
105
+ fail ArgumentError, 'url cannot be nil'
106
+ end
107
+
108
+ @url = url
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ url == o.url &&
117
+ content_type == o.content_type
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [url, content_type].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end
@@ -25,7 +25,8 @@ module Pingram
25
25
  :'GetTemplatesListResponseInnerAnyOf2',
26
26
  :'GetTemplatesListResponseInnerAnyOf3',
27
27
  :'GetTemplatesListResponseInnerAnyOf4',
28
- :'GetTemplatesListResponseInnerAnyOf5'
28
+ :'GetTemplatesListResponseInnerAnyOf5',
29
+ :'GetTemplatesListResponseInnerAnyOf6'
29
30
  ]
30
31
  end
31
32
 
@@ -29,6 +29,9 @@ module Pingram
29
29
 
30
30
  attr_accessor :text
31
31
 
32
+ # Set when sending MMS (outbound).
33
+ attr_accessor :media_urls
34
+
32
35
  class EnumAttributeValidator
33
36
  attr_reader :datatype
34
37
  attr_reader :allowable_values
@@ -60,7 +63,8 @@ module Pingram
60
63
  :'channel' => :'channel',
61
64
  :'default' => :'default',
62
65
  :'is_default_for' => :'isDefaultFor',
63
- :'text' => :'text'
66
+ :'text' => :'text',
67
+ :'media_urls' => :'mediaUrls'
64
68
  }
65
69
  end
66
70
 
@@ -83,7 +87,8 @@ module Pingram
83
87
  :'channel' => :'ChannelsEnum',
84
88
  :'default' => :'Boolean',
85
89
  :'is_default_for' => :'Hash<String, Boolean>',
86
- :'text' => :'String'
90
+ :'text' => :'String',
91
+ :'media_urls' => :'Array<String>'
87
92
  }
88
93
  end
89
94
 
@@ -150,6 +155,12 @@ module Pingram
150
155
  else
151
156
  self.text = nil
152
157
  end
158
+
159
+ if attributes.key?(:'media_urls')
160
+ if (value = attributes[:'media_urls']).is_a?(Array)
161
+ self.media_urls = value
162
+ end
163
+ end
153
164
  end
154
165
 
155
166
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -268,7 +279,8 @@ module Pingram
268
279
  channel == o.channel &&
269
280
  default == o.default &&
270
281
  is_default_for == o.is_default_for &&
271
- text == o.text
282
+ text == o.text &&
283
+ media_urls == o.media_urls
272
284
  end
273
285
 
274
286
  # @see the `==` method
@@ -280,7 +292,7 @@ module Pingram
280
292
  # Calculates hash code according to all attributes.
281
293
  # @return [Integer] Hash code
282
294
  def hash
283
- [env_id, notification_id, template_id, channel, default, is_default_for, text].hash
295
+ [env_id, notification_id, template_id, channel, default, is_default_for, text, media_urls].hash
284
296
  end
285
297
 
286
298
  # Builds the object from hash