late-sdk 0.0.92 → 0.0.93

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -0
  3. data/docs/CreateWhatsAppTemplateRequest.md +1 -1
  4. data/docs/UpdateWhatsAppTemplateRequest.md +1 -1
  5. data/docs/WhatsAppApi.md +1 -1
  6. data/docs/WhatsAppBodyComponent.md +24 -0
  7. data/docs/WhatsAppBodyComponentExample.md +18 -0
  8. data/docs/WhatsAppButtonsComponent.md +20 -0
  9. data/docs/WhatsAppFooterComponent.md +22 -0
  10. data/docs/WhatsAppHeaderComponent.md +24 -0
  11. data/docs/WhatsAppHeaderComponentExample.md +20 -0
  12. data/docs/WhatsAppTemplateButton.md +44 -0
  13. data/docs/WhatsAppTemplateComponent.md +85 -0
  14. data/lib/late-sdk/models/create_whats_app_template_request.rb +21 -2
  15. data/lib/late-sdk/models/update_whats_app_template_request.rb +10 -1
  16. data/lib/late-sdk/models/whats_app_body_component.rb +234 -0
  17. data/lib/late-sdk/models/whats_app_body_component_example.rb +150 -0
  18. data/lib/late-sdk/models/whats_app_buttons_component.rb +225 -0
  19. data/lib/late-sdk/models/whats_app_footer_component.rb +227 -0
  20. data/lib/late-sdk/models/whats_app_header_component.rb +235 -0
  21. data/lib/late-sdk/models/whats_app_header_component_example.rb +190 -0
  22. data/lib/late-sdk/models/whats_app_template_button.rb +345 -0
  23. data/lib/late-sdk/models/whats_app_template_component.rb +59 -0
  24. data/lib/late-sdk/version.rb +1 -1
  25. data/lib/late-sdk.rb +8 -0
  26. data/openapi.yaml +156 -5
  27. data/spec/models/whats_app_body_component_example_spec.rb +36 -0
  28. data/spec/models/whats_app_body_component_spec.rb +58 -0
  29. data/spec/models/whats_app_buttons_component_spec.rb +46 -0
  30. data/spec/models/whats_app_footer_component_spec.rb +52 -0
  31. data/spec/models/whats_app_header_component_example_spec.rb +42 -0
  32. data/spec/models/whats_app_header_component_spec.rb +62 -0
  33. data/spec/models/whats_app_template_button_spec.rb +122 -0
  34. data/spec/models/whats_app_template_component_spec.rb +44 -0
  35. data/zernio-sdk-0.0.93.gem +0 -0
  36. metadata +34 -2
  37. data/zernio-sdk-0.0.92.gem +0 -0
@@ -0,0 +1,235 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
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 Late
17
+ class WhatsAppHeaderComponent < ApiModelBase
18
+ attr_accessor :type
19
+
20
+ attr_accessor :format
21
+
22
+ # Header text (may include {{1}} variable). Used when format is TEXT.
23
+ attr_accessor :text
24
+
25
+ attr_accessor :example
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'type' => :'type',
53
+ :'format' => :'format',
54
+ :'text' => :'text',
55
+ :'example' => :'example'
56
+ }
57
+ end
58
+
59
+ # Returns attribute mapping this model knows about
60
+ def self.acceptable_attribute_map
61
+ attribute_map
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ acceptable_attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'type' => :'String',
73
+ :'format' => :'String',
74
+ :'text' => :'String',
75
+ :'example' => :'WhatsAppHeaderComponentExample'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppHeaderComponent` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ acceptable_attribute_map = self.class.acceptable_attribute_map
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!acceptable_attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppHeaderComponent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'type')
102
+ self.type = attributes[:'type']
103
+ else
104
+ self.type = nil
105
+ end
106
+
107
+ if attributes.key?(:'format')
108
+ self.format = attributes[:'format']
109
+ else
110
+ self.format = nil
111
+ end
112
+
113
+ if attributes.key?(:'text')
114
+ self.text = attributes[:'text']
115
+ end
116
+
117
+ if attributes.key?(:'example')
118
+ self.example = attributes[:'example']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
126
+ invalid_properties = Array.new
127
+ if @type.nil?
128
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
129
+ end
130
+
131
+ if @format.nil?
132
+ invalid_properties.push('invalid value for "format", format cannot be nil.')
133
+ end
134
+
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ return false if @type.nil?
143
+ type_validator = EnumAttributeValidator.new('String', ["HEADER"])
144
+ return false unless type_validator.valid?(@type)
145
+ return false if @format.nil?
146
+ format_validator = EnumAttributeValidator.new('String', ["TEXT", "IMAGE", "VIDEO", "GIF", "DOCUMENT", "LOCATION"])
147
+ return false unless format_validator.valid?(@format)
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method checking allowed values (enum).
152
+ # @param [Object] type Object to be assigned
153
+ def type=(type)
154
+ validator = EnumAttributeValidator.new('String', ["HEADER"])
155
+ unless validator.valid?(type)
156
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
157
+ end
158
+ @type = type
159
+ end
160
+
161
+ # Custom attribute writer method checking allowed values (enum).
162
+ # @param [Object] format Object to be assigned
163
+ def format=(format)
164
+ validator = EnumAttributeValidator.new('String', ["TEXT", "IMAGE", "VIDEO", "GIF", "DOCUMENT", "LOCATION"])
165
+ unless validator.valid?(format)
166
+ fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
167
+ end
168
+ @format = format
169
+ end
170
+
171
+ # Checks equality by comparing each attribute.
172
+ # @param [Object] Object to be compared
173
+ def ==(o)
174
+ return true if self.equal?(o)
175
+ self.class == o.class &&
176
+ type == o.type &&
177
+ format == o.format &&
178
+ text == o.text &&
179
+ example == o.example
180
+ end
181
+
182
+ # @see the `==` method
183
+ # @param [Object] Object to be compared
184
+ def eql?(o)
185
+ self == o
186
+ end
187
+
188
+ # Calculates hash code according to all attributes.
189
+ # @return [Integer] Hash code
190
+ def hash
191
+ [type, format, text, example].hash
192
+ end
193
+
194
+ # Builds the object from hash
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ # @return [Object] Returns the model itself
197
+ def self.build_from_hash(attributes)
198
+ return nil unless attributes.is_a?(Hash)
199
+ attributes = attributes.transform_keys(&:to_sym)
200
+ transformed_hash = {}
201
+ openapi_types.each_pair do |key, type|
202
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = nil
204
+ elsif type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the attribute
206
+ # is documented as an array but the input is not
207
+ if attributes[attribute_map[key]].is_a?(Array)
208
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
209
+ end
210
+ elsif !attributes[attribute_map[key]].nil?
211
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
212
+ end
213
+ end
214
+ new(transformed_hash)
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ end
234
+
235
+ end
@@ -0,0 +1,190 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
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 Late
17
+ class WhatsAppHeaderComponentExample < ApiModelBase
18
+ # Sample values for header text variables
19
+ attr_accessor :header_text
20
+
21
+ # When the header format is a media type (IMAGE, VIDEO, GIF, DOCUMENT), provide a public URL here. Zernio will download and upload it to WhatsApp on your behalf, replacing it with the internal file handle before creating the template.
22
+ attr_accessor :header_handle
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'header_text' => :'header_text',
28
+ :'header_handle' => :'header_handle'
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
+ :'header_text' => :'Array<String>',
46
+ :'header_handle' => :'Array<String>'
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 `Late::WhatsAppHeaderComponentExample` 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 `Late::WhatsAppHeaderComponentExample`. 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?(:'header_text')
73
+ if (value = attributes[:'header_text']).is_a?(Array)
74
+ self.header_text = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'header_handle')
79
+ if (value = attributes[:'header_handle']).is_a?(Array)
80
+ self.header_handle = value
81
+ end
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 !@header_handle.nil? && @header_handle.length > 1
91
+ invalid_properties.push('invalid value for "header_handle", number of items must be less than or equal to 1.')
92
+ end
93
+
94
+ if !@header_handle.nil? && @header_handle.length < 1
95
+ invalid_properties.push('invalid value for "header_handle", number of items must be greater than or equal to 1.')
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 !@header_handle.nil? && @header_handle.length > 1
106
+ return false if !@header_handle.nil? && @header_handle.length < 1
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] header_handle Value to be assigned
112
+ def header_handle=(header_handle)
113
+ if header_handle.nil?
114
+ fail ArgumentError, 'header_handle cannot be nil'
115
+ end
116
+
117
+ if header_handle.length > 1
118
+ fail ArgumentError, 'invalid value for "header_handle", number of items must be less than or equal to 1.'
119
+ end
120
+
121
+ if header_handle.length < 1
122
+ fail ArgumentError, 'invalid value for "header_handle", number of items must be greater than or equal to 1.'
123
+ end
124
+
125
+ @header_handle = header_handle
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ header_text == o.header_text &&
134
+ header_handle == o.header_handle
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [header_text, header_handle].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end