late-sdk 0.0.47 → 0.0.49
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 +6 -0
- data/docs/ConnectApi.md +70 -0
- data/docs/ConnectWhatsAppCredentials200Response.md +20 -0
- data/docs/ConnectWhatsAppCredentials200ResponseAccount.md +32 -0
- data/docs/ConnectWhatsAppCredentialsRequest.md +24 -0
- data/docs/CreateWhatsAppTemplate200ResponseTemplate.md +1 -1
- data/docs/CreateWhatsAppTemplateRequest.md +8 -2
- data/docs/CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner.md +22 -0
- data/docs/CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInnerUrl.md +18 -0
- data/docs/MediaItem.md +1 -1
- data/docs/WhatsAppApi.md +2 -2
- data/lib/late-sdk/api/connect_api.rb +68 -0
- data/lib/late-sdk/api/whats_app_api.rb +2 -2
- data/lib/late-sdk/models/connect_whats_app_credentials200_response.rb +156 -0
- data/lib/late-sdk/models/connect_whats_app_credentials200_response_account.rb +247 -0
- data/lib/late-sdk/models/connect_whats_app_credentials_request.rb +246 -0
- data/lib/late-sdk/models/create_whats_app_template200_response_template.rb +1 -0
- data/lib/late-sdk/models/create_whats_app_template_request.rb +37 -22
- data/lib/late-sdk/models/create_whats_app_template_request_library_template_button_inputs_inner.rb +199 -0
- data/lib/late-sdk/models/create_whats_app_template_request_library_template_button_inputs_inner_url.rb +147 -0
- data/lib/late-sdk/models/media_item.rb +1 -1
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +5 -0
- data/openapi.yaml +150 -15
- data/spec/api/connect_api_spec.rb +12 -0
- data/spec/api/whats_app_api_spec.rb +1 -1
- data/spec/models/connect_whats_app_credentials200_response_account_spec.rb +82 -0
- data/spec/models/connect_whats_app_credentials200_response_spec.rb +42 -0
- data/spec/models/connect_whats_app_credentials_request_spec.rb +54 -0
- data/spec/models/create_whats_app_template_request_library_template_button_inputs_inner_spec.rb +52 -0
- data/spec/models/create_whats_app_template_request_library_template_button_inputs_inner_url_spec.rb +36 -0
- data/spec/models/create_whats_app_template_request_spec.rb +18 -0
- metadata +22 -2
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Late API
|
|
3
|
+
|
|
4
|
+
#API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@getlate.dev
|
|
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 ConnectWhatsAppCredentials200ResponseAccount < ApiModelBase
|
|
18
|
+
attr_accessor :account_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :platform
|
|
21
|
+
|
|
22
|
+
# Display phone number
|
|
23
|
+
attr_accessor :username
|
|
24
|
+
|
|
25
|
+
# Meta-verified business name
|
|
26
|
+
attr_accessor :display_name
|
|
27
|
+
|
|
28
|
+
attr_accessor :is_active
|
|
29
|
+
|
|
30
|
+
attr_accessor :phone_number
|
|
31
|
+
|
|
32
|
+
attr_accessor :verified_name
|
|
33
|
+
|
|
34
|
+
# GREEN, YELLOW, or RED
|
|
35
|
+
attr_accessor :quality_rating
|
|
36
|
+
|
|
37
|
+
class EnumAttributeValidator
|
|
38
|
+
attr_reader :datatype
|
|
39
|
+
attr_reader :allowable_values
|
|
40
|
+
|
|
41
|
+
def initialize(datatype, allowable_values)
|
|
42
|
+
@allowable_values = allowable_values.map do |value|
|
|
43
|
+
case datatype.to_s
|
|
44
|
+
when /Integer/i
|
|
45
|
+
value.to_i
|
|
46
|
+
when /Float/i
|
|
47
|
+
value.to_f
|
|
48
|
+
else
|
|
49
|
+
value
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def valid?(value)
|
|
55
|
+
!value || allowable_values.include?(value)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
60
|
+
def self.attribute_map
|
|
61
|
+
{
|
|
62
|
+
:'account_id' => :'accountId',
|
|
63
|
+
:'platform' => :'platform',
|
|
64
|
+
:'username' => :'username',
|
|
65
|
+
:'display_name' => :'displayName',
|
|
66
|
+
:'is_active' => :'isActive',
|
|
67
|
+
:'phone_number' => :'phoneNumber',
|
|
68
|
+
:'verified_name' => :'verifiedName',
|
|
69
|
+
:'quality_rating' => :'qualityRating'
|
|
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
|
+
:'account_id' => :'String',
|
|
87
|
+
:'platform' => :'String',
|
|
88
|
+
:'username' => :'String',
|
|
89
|
+
:'display_name' => :'String',
|
|
90
|
+
:'is_active' => :'Boolean',
|
|
91
|
+
:'phone_number' => :'String',
|
|
92
|
+
:'verified_name' => :'String',
|
|
93
|
+
:'quality_rating' => :'String'
|
|
94
|
+
}
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# List of attributes with nullable: true
|
|
98
|
+
def self.openapi_nullable
|
|
99
|
+
Set.new([
|
|
100
|
+
])
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Initializes the object
|
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
+
def initialize(attributes = {})
|
|
106
|
+
if (!attributes.is_a?(Hash))
|
|
107
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ConnectWhatsAppCredentials200ResponseAccount` initialize method"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
111
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
112
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
113
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
114
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ConnectWhatsAppCredentials200ResponseAccount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
115
|
+
end
|
|
116
|
+
h[k.to_sym] = v
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'account_id')
|
|
120
|
+
self.account_id = attributes[:'account_id']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'platform')
|
|
124
|
+
self.platform = attributes[:'platform']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'username')
|
|
128
|
+
self.username = attributes[:'username']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'display_name')
|
|
132
|
+
self.display_name = attributes[:'display_name']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'is_active')
|
|
136
|
+
self.is_active = attributes[:'is_active']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'phone_number')
|
|
140
|
+
self.phone_number = attributes[:'phone_number']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'verified_name')
|
|
144
|
+
self.verified_name = attributes[:'verified_name']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'quality_rating')
|
|
148
|
+
self.quality_rating = attributes[:'quality_rating']
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
153
|
+
# @return Array for valid properties with the reasons
|
|
154
|
+
def list_invalid_properties
|
|
155
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
156
|
+
invalid_properties = Array.new
|
|
157
|
+
invalid_properties
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Check to see if the all the properties in the model are valid
|
|
161
|
+
# @return true if the model is valid
|
|
162
|
+
def valid?
|
|
163
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
164
|
+
platform_validator = EnumAttributeValidator.new('String', ["whatsapp"])
|
|
165
|
+
return false unless platform_validator.valid?(@platform)
|
|
166
|
+
true
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
170
|
+
# @param [Object] platform Object to be assigned
|
|
171
|
+
def platform=(platform)
|
|
172
|
+
validator = EnumAttributeValidator.new('String', ["whatsapp"])
|
|
173
|
+
unless validator.valid?(platform)
|
|
174
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
175
|
+
end
|
|
176
|
+
@platform = platform
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Checks equality by comparing each attribute.
|
|
180
|
+
# @param [Object] Object to be compared
|
|
181
|
+
def ==(o)
|
|
182
|
+
return true if self.equal?(o)
|
|
183
|
+
self.class == o.class &&
|
|
184
|
+
account_id == o.account_id &&
|
|
185
|
+
platform == o.platform &&
|
|
186
|
+
username == o.username &&
|
|
187
|
+
display_name == o.display_name &&
|
|
188
|
+
is_active == o.is_active &&
|
|
189
|
+
phone_number == o.phone_number &&
|
|
190
|
+
verified_name == o.verified_name &&
|
|
191
|
+
quality_rating == o.quality_rating
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# @see the `==` method
|
|
195
|
+
# @param [Object] Object to be compared
|
|
196
|
+
def eql?(o)
|
|
197
|
+
self == o
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Calculates hash code according to all attributes.
|
|
201
|
+
# @return [Integer] Hash code
|
|
202
|
+
def hash
|
|
203
|
+
[account_id, platform, username, display_name, is_active, phone_number, verified_name, quality_rating].hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Builds the object from hash
|
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
208
|
+
# @return [Object] Returns the model itself
|
|
209
|
+
def self.build_from_hash(attributes)
|
|
210
|
+
return nil unless attributes.is_a?(Hash)
|
|
211
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
212
|
+
transformed_hash = {}
|
|
213
|
+
openapi_types.each_pair do |key, type|
|
|
214
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
215
|
+
transformed_hash["#{key}"] = nil
|
|
216
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
217
|
+
# check to ensure the input is an array given that the attribute
|
|
218
|
+
# is documented as an array but the input is not
|
|
219
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
220
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
221
|
+
end
|
|
222
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
223
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
new(transformed_hash)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Returns the object in the form of hash
|
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
|
231
|
+
def to_hash
|
|
232
|
+
hash = {}
|
|
233
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
234
|
+
value = self.send(attr)
|
|
235
|
+
if value.nil?
|
|
236
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
237
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
hash[param] = _to_hash(value)
|
|
241
|
+
end
|
|
242
|
+
hash
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
end
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Late API
|
|
3
|
+
|
|
4
|
+
#API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@getlate.dev
|
|
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 ConnectWhatsAppCredentialsRequest < ApiModelBase
|
|
18
|
+
# Your Late profile ID
|
|
19
|
+
attr_accessor :profile_id
|
|
20
|
+
|
|
21
|
+
# Permanent System User access token from Meta Business Suite
|
|
22
|
+
attr_accessor :access_token
|
|
23
|
+
|
|
24
|
+
# WhatsApp Business Account ID from Meta
|
|
25
|
+
attr_accessor :waba_id
|
|
26
|
+
|
|
27
|
+
# Phone Number ID from Meta WhatsApp Manager
|
|
28
|
+
attr_accessor :phone_number_id
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'profile_id' => :'profileId',
|
|
34
|
+
:'access_token' => :'accessToken',
|
|
35
|
+
:'waba_id' => :'wabaId',
|
|
36
|
+
:'phone_number_id' => :'phoneNumberId'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'profile_id' => :'String',
|
|
54
|
+
:'access_token' => :'String',
|
|
55
|
+
:'waba_id' => :'String',
|
|
56
|
+
:'phone_number_id' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ConnectWhatsAppCredentialsRequest` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ConnectWhatsAppCredentialsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'profile_id')
|
|
83
|
+
self.profile_id = attributes[:'profile_id']
|
|
84
|
+
else
|
|
85
|
+
self.profile_id = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'access_token')
|
|
89
|
+
self.access_token = attributes[:'access_token']
|
|
90
|
+
else
|
|
91
|
+
self.access_token = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'waba_id')
|
|
95
|
+
self.waba_id = attributes[:'waba_id']
|
|
96
|
+
else
|
|
97
|
+
self.waba_id = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'phone_number_id')
|
|
101
|
+
self.phone_number_id = attributes[:'phone_number_id']
|
|
102
|
+
else
|
|
103
|
+
self.phone_number_id = nil
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
+
# @return Array for valid properties with the reasons
|
|
109
|
+
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
+
invalid_properties = Array.new
|
|
112
|
+
if @profile_id.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @access_token.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @waba_id.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "waba_id", waba_id cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if @phone_number_id.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "phone_number_id", phone_number_id cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
invalid_properties
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Check to see if the all the properties in the model are valid
|
|
132
|
+
# @return true if the model is valid
|
|
133
|
+
def valid?
|
|
134
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
135
|
+
return false if @profile_id.nil?
|
|
136
|
+
return false if @access_token.nil?
|
|
137
|
+
return false if @waba_id.nil?
|
|
138
|
+
return false if @phone_number_id.nil?
|
|
139
|
+
true
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] profile_id Value to be assigned
|
|
144
|
+
def profile_id=(profile_id)
|
|
145
|
+
if profile_id.nil?
|
|
146
|
+
fail ArgumentError, 'profile_id cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
@profile_id = profile_id
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Custom attribute writer method with validation
|
|
153
|
+
# @param [Object] access_token Value to be assigned
|
|
154
|
+
def access_token=(access_token)
|
|
155
|
+
if access_token.nil?
|
|
156
|
+
fail ArgumentError, 'access_token cannot be nil'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
@access_token = access_token
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Custom attribute writer method with validation
|
|
163
|
+
# @param [Object] waba_id Value to be assigned
|
|
164
|
+
def waba_id=(waba_id)
|
|
165
|
+
if waba_id.nil?
|
|
166
|
+
fail ArgumentError, 'waba_id cannot be nil'
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
@waba_id = waba_id
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method with validation
|
|
173
|
+
# @param [Object] phone_number_id Value to be assigned
|
|
174
|
+
def phone_number_id=(phone_number_id)
|
|
175
|
+
if phone_number_id.nil?
|
|
176
|
+
fail ArgumentError, 'phone_number_id cannot be nil'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
@phone_number_id = phone_number_id
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Checks equality by comparing each attribute.
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def ==(o)
|
|
185
|
+
return true if self.equal?(o)
|
|
186
|
+
self.class == o.class &&
|
|
187
|
+
profile_id == o.profile_id &&
|
|
188
|
+
access_token == o.access_token &&
|
|
189
|
+
waba_id == o.waba_id &&
|
|
190
|
+
phone_number_id == o.phone_number_id
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# @see the `==` method
|
|
194
|
+
# @param [Object] Object to be compared
|
|
195
|
+
def eql?(o)
|
|
196
|
+
self == o
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Calculates hash code according to all attributes.
|
|
200
|
+
# @return [Integer] Hash code
|
|
201
|
+
def hash
|
|
202
|
+
[profile_id, access_token, waba_id, phone_number_id].hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Builds the object from hash
|
|
206
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
207
|
+
# @return [Object] Returns the model itself
|
|
208
|
+
def self.build_from_hash(attributes)
|
|
209
|
+
return nil unless attributes.is_a?(Hash)
|
|
210
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
211
|
+
transformed_hash = {}
|
|
212
|
+
openapi_types.each_pair do |key, type|
|
|
213
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
214
|
+
transformed_hash["#{key}"] = nil
|
|
215
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
216
|
+
# check to ensure the input is an array given that the attribute
|
|
217
|
+
# is documented as an array but the input is not
|
|
218
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
219
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
220
|
+
end
|
|
221
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
222
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
new(transformed_hash)
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Returns the object in the form of hash
|
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
|
230
|
+
def to_hash
|
|
231
|
+
hash = {}
|
|
232
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
233
|
+
value = self.send(attr)
|
|
234
|
+
if value.nil?
|
|
235
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
236
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
hash[param] = _to_hash(value)
|
|
240
|
+
end
|
|
241
|
+
hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
end
|
|
@@ -27,9 +27,18 @@ module Late
|
|
|
27
27
|
# Template language code (e.g., en_US)
|
|
28
28
|
attr_accessor :language
|
|
29
29
|
|
|
30
|
-
# Template components (header, body, footer, buttons)
|
|
30
|
+
# Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name.
|
|
31
31
|
attr_accessor :components
|
|
32
32
|
|
|
33
|
+
# Name of a pre-built template from Meta's template library (e.g., \"appointment_reminder\", \"auto_pay_reminder_1\", \"address_update\"). When provided, the template is pre-approved by Meta with no review wait. Omit `components` when using this field.
|
|
34
|
+
attr_accessor :library_template_name
|
|
35
|
+
|
|
36
|
+
# Optional body customizations for library templates. Available options depend on the template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation, add_track_package_link, code_expiration_minutes).
|
|
37
|
+
attr_accessor :library_template_body_inputs
|
|
38
|
+
|
|
39
|
+
# Optional button customizations for library templates. Each item specifies button type and configuration (e.g., URL, phone number, quick reply).
|
|
40
|
+
attr_accessor :library_template_button_inputs
|
|
41
|
+
|
|
33
42
|
class EnumAttributeValidator
|
|
34
43
|
attr_reader :datatype
|
|
35
44
|
attr_reader :allowable_values
|
|
@@ -59,7 +68,10 @@ module Late
|
|
|
59
68
|
:'name' => :'name',
|
|
60
69
|
:'category' => :'category',
|
|
61
70
|
:'language' => :'language',
|
|
62
|
-
:'components' => :'components'
|
|
71
|
+
:'components' => :'components',
|
|
72
|
+
:'library_template_name' => :'library_template_name',
|
|
73
|
+
:'library_template_body_inputs' => :'library_template_body_inputs',
|
|
74
|
+
:'library_template_button_inputs' => :'library_template_button_inputs'
|
|
63
75
|
}
|
|
64
76
|
end
|
|
65
77
|
|
|
@@ -80,7 +92,10 @@ module Late
|
|
|
80
92
|
:'name' => :'String',
|
|
81
93
|
:'category' => :'String',
|
|
82
94
|
:'language' => :'String',
|
|
83
|
-
:'components' => :'Array<Object>'
|
|
95
|
+
:'components' => :'Array<Object>',
|
|
96
|
+
:'library_template_name' => :'String',
|
|
97
|
+
:'library_template_body_inputs' => :'Object',
|
|
98
|
+
:'library_template_button_inputs' => :'Array<CreateWhatsAppTemplateRequestLibraryTemplateButtonInputsInner>'
|
|
84
99
|
}
|
|
85
100
|
end
|
|
86
101
|
|
|
@@ -134,8 +149,20 @@ module Late
|
|
|
134
149
|
if (value = attributes[:'components']).is_a?(Array)
|
|
135
150
|
self.components = value
|
|
136
151
|
end
|
|
137
|
-
|
|
138
|
-
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'library_template_name')
|
|
155
|
+
self.library_template_name = attributes[:'library_template_name']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'library_template_body_inputs')
|
|
159
|
+
self.library_template_body_inputs = attributes[:'library_template_body_inputs']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'library_template_button_inputs')
|
|
163
|
+
if (value = attributes[:'library_template_button_inputs']).is_a?(Array)
|
|
164
|
+
self.library_template_button_inputs = value
|
|
165
|
+
end
|
|
139
166
|
end
|
|
140
167
|
end
|
|
141
168
|
|
|
@@ -165,10 +192,6 @@ module Late
|
|
|
165
192
|
invalid_properties.push('invalid value for "language", language cannot be nil.')
|
|
166
193
|
end
|
|
167
194
|
|
|
168
|
-
if @components.nil?
|
|
169
|
-
invalid_properties.push('invalid value for "components", components cannot be nil.')
|
|
170
|
-
end
|
|
171
|
-
|
|
172
195
|
invalid_properties
|
|
173
196
|
end
|
|
174
197
|
|
|
@@ -183,7 +206,6 @@ module Late
|
|
|
183
206
|
category_validator = EnumAttributeValidator.new('String', ["AUTHENTICATION", "MARKETING", "UTILITY"])
|
|
184
207
|
return false unless category_validator.valid?(@category)
|
|
185
208
|
return false if @language.nil?
|
|
186
|
-
return false if @components.nil?
|
|
187
209
|
true
|
|
188
210
|
end
|
|
189
211
|
|
|
@@ -232,16 +254,6 @@ module Late
|
|
|
232
254
|
@language = language
|
|
233
255
|
end
|
|
234
256
|
|
|
235
|
-
# Custom attribute writer method with validation
|
|
236
|
-
# @param [Object] components Value to be assigned
|
|
237
|
-
def components=(components)
|
|
238
|
-
if components.nil?
|
|
239
|
-
fail ArgumentError, 'components cannot be nil'
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
@components = components
|
|
243
|
-
end
|
|
244
|
-
|
|
245
257
|
# Checks equality by comparing each attribute.
|
|
246
258
|
# @param [Object] Object to be compared
|
|
247
259
|
def ==(o)
|
|
@@ -251,7 +263,10 @@ module Late
|
|
|
251
263
|
name == o.name &&
|
|
252
264
|
category == o.category &&
|
|
253
265
|
language == o.language &&
|
|
254
|
-
components == o.components
|
|
266
|
+
components == o.components &&
|
|
267
|
+
library_template_name == o.library_template_name &&
|
|
268
|
+
library_template_body_inputs == o.library_template_body_inputs &&
|
|
269
|
+
library_template_button_inputs == o.library_template_button_inputs
|
|
255
270
|
end
|
|
256
271
|
|
|
257
272
|
# @see the `==` method
|
|
@@ -263,7 +278,7 @@ module Late
|
|
|
263
278
|
# Calculates hash code according to all attributes.
|
|
264
279
|
# @return [Integer] Hash code
|
|
265
280
|
def hash
|
|
266
|
-
[account_id, name, category, language, components].hash
|
|
281
|
+
[account_id, name, category, language, components, library_template_name, library_template_body_inputs, library_template_button_inputs].hash
|
|
267
282
|
end
|
|
268
283
|
|
|
269
284
|
# Builds the object from hash
|