zernio-sdk 0.0.548 → 0.0.549
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/README.md +5 -0
- data/docs/CreateWhatsAppTemplateRequest.md +1 -1
- data/docs/PurchasePhoneNumberRequest.md +2 -0
- data/docs/WhatsAppCarouselCardComponent.md +82 -0
- data/docs/WhatsAppCarouselComponent.md +20 -0
- data/docs/WhatsAppCarouselComponentCardsInner.md +18 -0
- data/docs/WhatsAppLimitedTimeOfferComponent.md +20 -0
- data/docs/WhatsAppLimitedTimeOfferComponentLimitedTimeOffer.md +20 -0
- data/docs/WhatsAppTemplateComponent.md +8 -2
- data/lib/zernio-sdk/models/create_whats_app_template_request.rb +1 -1
- data/lib/zernio-sdk/models/purchase_phone_number_request.rb +13 -1
- data/lib/zernio-sdk/models/whats_app_carousel_card_component.rb +57 -0
- data/lib/zernio-sdk/models/whats_app_carousel_component.rb +235 -0
- data/lib/zernio-sdk/models/whats_app_carousel_component_cards_inner.rb +176 -0
- data/lib/zernio-sdk/models/whats_app_limited_time_offer_component.rb +214 -0
- data/lib/zernio-sdk/models/whats_app_limited_time_offer_component_limited_time_offer.rb +193 -0
- data/lib/zernio-sdk/models/whats_app_template_component.rb +6 -2
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +5 -0
- data/openapi.yaml +69 -1
- data/spec/models/purchase_phone_number_request_spec.rb +6 -0
- data/spec/models/whats_app_carousel_card_component_spec.rb +44 -0
- data/spec/models/whats_app_carousel_component_cards_inner_spec.rb +36 -0
- data/spec/models/whats_app_carousel_component_spec.rb +46 -0
- data/spec/models/whats_app_limited_time_offer_component_limited_time_offer_spec.rb +42 -0
- data/spec/models/whats_app_limited_time_offer_component_spec.rb +46 -0
- metadata +21 -1
|
@@ -0,0 +1,176 @@
|
|
|
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.4
|
|
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 Zernio
|
|
17
|
+
class WhatsAppCarouselComponentCardsInner < ApiModelBase
|
|
18
|
+
# Per-card components. Each card carries its own media header + optional body + up to 2 buttons. Footer and nested carousel are not allowed inside cards.
|
|
19
|
+
attr_accessor :components
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'components' => :'components'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'components' => :'Array<WhatsAppCarouselCardComponent>'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WhatsAppCarouselComponentCardsInner` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WhatsAppCarouselComponentCardsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'components')
|
|
68
|
+
if (value = attributes[:'components']).is_a?(Array)
|
|
69
|
+
self.components = value
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
self.components = nil
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
80
|
+
invalid_properties = Array.new
|
|
81
|
+
if @components.nil?
|
|
82
|
+
invalid_properties.push('invalid value for "components", components cannot be nil.')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if @components.length < 1
|
|
86
|
+
invalid_properties.push('invalid value for "components", number of items must be greater than or equal to 1.')
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
invalid_properties
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Check to see if the all the properties in the model are valid
|
|
93
|
+
# @return true if the model is valid
|
|
94
|
+
def valid?
|
|
95
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
96
|
+
return false if @components.nil?
|
|
97
|
+
return false if @components.length < 1
|
|
98
|
+
true
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Custom attribute writer method with validation
|
|
102
|
+
# @param [Object] components Value to be assigned
|
|
103
|
+
def components=(components)
|
|
104
|
+
if components.nil?
|
|
105
|
+
fail ArgumentError, 'components cannot be nil'
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if components.length < 1
|
|
109
|
+
fail ArgumentError, 'invalid value for "components", number of items must be greater than or equal to 1.'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
@components = components
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Checks equality by comparing each attribute.
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def ==(o)
|
|
118
|
+
return true if self.equal?(o)
|
|
119
|
+
self.class == o.class &&
|
|
120
|
+
components == o.components
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# @see the `==` method
|
|
124
|
+
# @param [Object] Object to be compared
|
|
125
|
+
def eql?(o)
|
|
126
|
+
self == o
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Calculates hash code according to all attributes.
|
|
130
|
+
# @return [Integer] Hash code
|
|
131
|
+
def hash
|
|
132
|
+
[components].hash
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Builds the object from hash
|
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
137
|
+
# @return [Object] Returns the model itself
|
|
138
|
+
def self.build_from_hash(attributes)
|
|
139
|
+
return nil unless attributes.is_a?(Hash)
|
|
140
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
141
|
+
transformed_hash = {}
|
|
142
|
+
openapi_types.each_pair do |key, type|
|
|
143
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
144
|
+
transformed_hash["#{key}"] = nil
|
|
145
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
146
|
+
# check to ensure the input is an array given that the attribute
|
|
147
|
+
# is documented as an array but the input is not
|
|
148
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
149
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
150
|
+
end
|
|
151
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
152
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
new(transformed_hash)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Returns the object in the form of hash
|
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
|
160
|
+
def to_hash
|
|
161
|
+
hash = {}
|
|
162
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
163
|
+
value = self.send(attr)
|
|
164
|
+
if value.nil?
|
|
165
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
166
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
hash[param] = _to_hash(value)
|
|
170
|
+
end
|
|
171
|
+
hash
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
end
|
|
@@ -0,0 +1,214 @@
|
|
|
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.4
|
|
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 Zernio
|
|
17
|
+
class WhatsAppLimitedTimeOfferComponent < ApiModelBase
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
attr_accessor :limited_time_offer
|
|
21
|
+
|
|
22
|
+
class EnumAttributeValidator
|
|
23
|
+
attr_reader :datatype
|
|
24
|
+
attr_reader :allowable_values
|
|
25
|
+
|
|
26
|
+
def initialize(datatype, allowable_values)
|
|
27
|
+
@allowable_values = allowable_values.map do |value|
|
|
28
|
+
case datatype.to_s
|
|
29
|
+
when /Integer/i
|
|
30
|
+
value.to_i
|
|
31
|
+
when /Float/i
|
|
32
|
+
value.to_f
|
|
33
|
+
else
|
|
34
|
+
value
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def valid?(value)
|
|
40
|
+
!value || allowable_values.include?(value)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
45
|
+
def self.attribute_map
|
|
46
|
+
{
|
|
47
|
+
:'type' => :'type',
|
|
48
|
+
:'limited_time_offer' => :'limited_time_offer'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'type' => :'String',
|
|
66
|
+
:'limited_time_offer' => :'WhatsAppLimitedTimeOfferComponentLimitedTimeOffer'
|
|
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 `Zernio::WhatsAppLimitedTimeOfferComponent` 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 `Zernio::WhatsAppLimitedTimeOfferComponent`. 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?(:'limited_time_offer')
|
|
99
|
+
self.limited_time_offer = attributes[:'limited_time_offer']
|
|
100
|
+
else
|
|
101
|
+
self.limited_time_offer = nil
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
106
|
+
# @return Array for valid properties with the reasons
|
|
107
|
+
def list_invalid_properties
|
|
108
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
109
|
+
invalid_properties = Array.new
|
|
110
|
+
if @type.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @limited_time_offer.nil?
|
|
115
|
+
invalid_properties.push('invalid value for "limited_time_offer", limited_time_offer cannot be nil.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
invalid_properties
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Check to see if the all the properties in the model are valid
|
|
122
|
+
# @return true if the model is valid
|
|
123
|
+
def valid?
|
|
124
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
125
|
+
return false if @type.nil?
|
|
126
|
+
type_validator = EnumAttributeValidator.new('String', ["limited_time_offer"])
|
|
127
|
+
return false unless type_validator.valid?(@type)
|
|
128
|
+
return false if @limited_time_offer.nil?
|
|
129
|
+
true
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
133
|
+
# @param [Object] type Object to be assigned
|
|
134
|
+
def type=(type)
|
|
135
|
+
validator = EnumAttributeValidator.new('String', ["limited_time_offer"])
|
|
136
|
+
unless validator.valid?(type)
|
|
137
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
138
|
+
end
|
|
139
|
+
@type = type
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] limited_time_offer Value to be assigned
|
|
144
|
+
def limited_time_offer=(limited_time_offer)
|
|
145
|
+
if limited_time_offer.nil?
|
|
146
|
+
fail ArgumentError, 'limited_time_offer cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
@limited_time_offer = limited_time_offer
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Checks equality by comparing each attribute.
|
|
153
|
+
# @param [Object] Object to be compared
|
|
154
|
+
def ==(o)
|
|
155
|
+
return true if self.equal?(o)
|
|
156
|
+
self.class == o.class &&
|
|
157
|
+
type == o.type &&
|
|
158
|
+
limited_time_offer == o.limited_time_offer
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# @see the `==` method
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def eql?(o)
|
|
164
|
+
self == o
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Calculates hash code according to all attributes.
|
|
168
|
+
# @return [Integer] Hash code
|
|
169
|
+
def hash
|
|
170
|
+
[type, limited_time_offer].hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Builds the object from hash
|
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
175
|
+
# @return [Object] Returns the model itself
|
|
176
|
+
def self.build_from_hash(attributes)
|
|
177
|
+
return nil unless attributes.is_a?(Hash)
|
|
178
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
179
|
+
transformed_hash = {}
|
|
180
|
+
openapi_types.each_pair do |key, type|
|
|
181
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
182
|
+
transformed_hash["#{key}"] = nil
|
|
183
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
184
|
+
# check to ensure the input is an array given that the attribute
|
|
185
|
+
# is documented as an array but the input is not
|
|
186
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
187
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
188
|
+
end
|
|
189
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
new(transformed_hash)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Returns the object in the form of hash
|
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
|
198
|
+
def to_hash
|
|
199
|
+
hash = {}
|
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
201
|
+
value = self.send(attr)
|
|
202
|
+
if value.nil?
|
|
203
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
204
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
hash[param] = _to_hash(value)
|
|
208
|
+
end
|
|
209
|
+
hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
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.4
|
|
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 Zernio
|
|
17
|
+
class WhatsAppLimitedTimeOfferComponentLimitedTimeOffer < ApiModelBase
|
|
18
|
+
# Short offer label (<=16 chars). MARKETING only.
|
|
19
|
+
attr_accessor :text
|
|
20
|
+
|
|
21
|
+
# Toggles the countdown timer. The actual coupon code + expiry are bound at SEND time, not here.
|
|
22
|
+
attr_accessor :has_expiration
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'text' => :'text',
|
|
28
|
+
:'has_expiration' => :'has_expiration'
|
|
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
|
+
:'text' => :'String',
|
|
46
|
+
:'has_expiration' => :'Boolean'
|
|
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 `Zernio::WhatsAppLimitedTimeOfferComponentLimitedTimeOffer` 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 `Zernio::WhatsAppLimitedTimeOfferComponentLimitedTimeOffer`. 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?(:'text')
|
|
73
|
+
self.text = attributes[:'text']
|
|
74
|
+
else
|
|
75
|
+
self.text = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'has_expiration')
|
|
79
|
+
self.has_expiration = attributes[:'has_expiration']
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @text.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "text", text cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @text.to_s.length > 16
|
|
93
|
+
invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 16.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if @text.to_s.length < 1
|
|
97
|
+
invalid_properties.push('invalid value for "text", the character length must be greater than or equal to 1.')
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
invalid_properties
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Check to see if the all the properties in the model are valid
|
|
104
|
+
# @return true if the model is valid
|
|
105
|
+
def valid?
|
|
106
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
107
|
+
return false if @text.nil?
|
|
108
|
+
return false if @text.to_s.length > 16
|
|
109
|
+
return false if @text.to_s.length < 1
|
|
110
|
+
true
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Custom attribute writer method with validation
|
|
114
|
+
# @param [Object] text Value to be assigned
|
|
115
|
+
def text=(text)
|
|
116
|
+
if text.nil?
|
|
117
|
+
fail ArgumentError, 'text cannot be nil'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if text.to_s.length > 16
|
|
121
|
+
fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 16.'
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if text.to_s.length < 1
|
|
125
|
+
fail ArgumentError, 'invalid value for "text", the character length must be greater than or equal to 1.'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@text = text
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
text == o.text &&
|
|
137
|
+
has_expiration == o.has_expiration
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @see the `==` method
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def eql?(o)
|
|
143
|
+
self == o
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Calculates hash code according to all attributes.
|
|
147
|
+
# @return [Integer] Hash code
|
|
148
|
+
def hash
|
|
149
|
+
[text, has_expiration].hash
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def self.build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
158
|
+
transformed_hash = {}
|
|
159
|
+
openapi_types.each_pair do |key, type|
|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = nil
|
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
163
|
+
# check to ensure the input is an array given that the attribute
|
|
164
|
+
# is documented as an array but the input is not
|
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
167
|
+
end
|
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
new(transformed_hash)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
if value.nil?
|
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
hash[param] = _to_hash(value)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|
|
@@ -21,8 +21,10 @@ module Zernio
|
|
|
21
21
|
[
|
|
22
22
|
:'WhatsAppBodyComponent',
|
|
23
23
|
:'WhatsAppButtonsComponent',
|
|
24
|
+
:'WhatsAppCarouselComponent',
|
|
24
25
|
:'WhatsAppFooterComponent',
|
|
25
|
-
:'WhatsAppHeaderComponent'
|
|
26
|
+
:'WhatsAppHeaderComponent',
|
|
27
|
+
:'WhatsAppLimitedTimeOfferComponent'
|
|
26
28
|
]
|
|
27
29
|
end
|
|
28
30
|
|
|
@@ -36,8 +38,10 @@ module Zernio
|
|
|
36
38
|
{
|
|
37
39
|
:'body' => :'WhatsAppBodyComponent',
|
|
38
40
|
:'buttons' => :'WhatsAppButtonsComponent',
|
|
41
|
+
:'carousel' => :'WhatsAppCarouselComponent',
|
|
39
42
|
:'footer' => :'WhatsAppFooterComponent',
|
|
40
|
-
:'header' => :'WhatsAppHeaderComponent'
|
|
43
|
+
:'header' => :'WhatsAppHeaderComponent',
|
|
44
|
+
:'limited_time_offer' => :'WhatsAppLimitedTimeOfferComponent'
|
|
41
45
|
}
|
|
42
46
|
end
|
|
43
47
|
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -1473,9 +1473,14 @@ require 'zernio-sdk/models/webhook_payload_whats_app_template_status_updated_tem
|
|
|
1473
1473
|
require 'zernio-sdk/models/whats_app_body_component'
|
|
1474
1474
|
require 'zernio-sdk/models/whats_app_body_component_example'
|
|
1475
1475
|
require 'zernio-sdk/models/whats_app_buttons_component'
|
|
1476
|
+
require 'zernio-sdk/models/whats_app_carousel_card_component'
|
|
1477
|
+
require 'zernio-sdk/models/whats_app_carousel_component'
|
|
1478
|
+
require 'zernio-sdk/models/whats_app_carousel_component_cards_inner'
|
|
1476
1479
|
require 'zernio-sdk/models/whats_app_footer_component'
|
|
1477
1480
|
require 'zernio-sdk/models/whats_app_header_component'
|
|
1478
1481
|
require 'zernio-sdk/models/whats_app_header_component_example'
|
|
1482
|
+
require 'zernio-sdk/models/whats_app_limited_time_offer_component'
|
|
1483
|
+
require 'zernio-sdk/models/whats_app_limited_time_offer_component_limited_time_offer'
|
|
1479
1484
|
require 'zernio-sdk/models/whats_app_sandbox_session'
|
|
1480
1485
|
require 'zernio-sdk/models/whats_app_template_button'
|
|
1481
1486
|
require 'zernio-sdk/models/whats_app_template_component'
|