late-sdk 0.0.744 → 0.0.746
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 +4 -0
- data/docs/SendInboxMessageRequestInteractiveAction.md +2 -0
- data/docs/SendInboxMessageRequestInteractiveActionOneOf10.md +20 -0
- data/docs/SendInboxMessageRequestInteractiveActionOneOf10Parameters.md +24 -0
- data/docs/WebhookEventsApi.md +69 -0
- data/docs/WebhookPayloadMessageMetadata.md +4 -2
- data/docs/WebhookPayloadWhatsAppAccountNameStatusUpdated.md +26 -0
- data/docs/WebhookPayloadWhatsAppAccountNameStatusUpdatedName.md +24 -0
- data/lib/zernio-sdk/api/webhook_events_api.rb +66 -0
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive.rb +3 -3
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action.rb +1 -0
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of10.rb +215 -0
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of10_parameters.rb +201 -0
- data/lib/zernio-sdk/models/webhook_payload_message_metadata.rb +13 -3
- data/lib/zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated.rb +295 -0
- data/lib/zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated_name.rb +228 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +4 -0
- data/openapi.yaml +124 -10
- data/spec/models/create_webhook_settings_request_spec.rb +1 -1
- data/spec/models/send_inbox_message_request_interactive_action_one_of10_parameters_spec.rb +54 -0
- data/spec/models/send_inbox_message_request_interactive_action_one_of10_spec.rb +46 -0
- data/spec/models/send_inbox_message_request_interactive_spec.rb +1 -1
- data/spec/models/update_webhook_settings_request_spec.rb +1 -1
- data/spec/models/webhook_payload_message_metadata_spec.rb +6 -0
- data/spec/models/webhook_payload_whats_app_account_name_status_updated_name_spec.rb +58 -0
- data/spec/models/webhook_payload_whats_app_account_name_status_updated_spec.rb +64 -0
- data/spec/models/webhook_spec.rb +1 -1
- data/zernio-sdk-0.0.746.gem +0 -0
- metadata +18 -2
- data/zernio-sdk-0.0.744.gem +0 -0
data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of10_parameters.rb
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
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 SendInboxMessageRequestInteractiveActionOneOf10Parameters < ApiModelBase
|
|
18
|
+
# ISO 3166-1 alpha-2 country code Meta should localize the address form for (e.g. IN). Required: Meta rejects the send without it.
|
|
19
|
+
attr_accessor :country
|
|
20
|
+
|
|
21
|
+
# Optional pre-filled address field values.
|
|
22
|
+
attr_accessor :values
|
|
23
|
+
|
|
24
|
+
# Optional list of the recipient's previously saved addresses to offer as quick picks.
|
|
25
|
+
attr_accessor :saved_addresses
|
|
26
|
+
|
|
27
|
+
# Optional per-field error messages to show when re-prompting after a failed validation.
|
|
28
|
+
attr_accessor :validation_errors
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'country' => :'country',
|
|
34
|
+
:'values' => :'values',
|
|
35
|
+
:'saved_addresses' => :'saved_addresses',
|
|
36
|
+
:'validation_errors' => :'validation_errors'
|
|
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
|
+
:'country' => :'String',
|
|
54
|
+
:'values' => :'Hash<String, Object>',
|
|
55
|
+
:'saved_addresses' => :'Array<Hash<String, Object>>',
|
|
56
|
+
:'validation_errors' => :'Hash<String, 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 `Zernio::SendInboxMessageRequestInteractiveActionOneOf10Parameters` 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 `Zernio::SendInboxMessageRequestInteractiveActionOneOf10Parameters`. 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?(:'country')
|
|
83
|
+
self.country = attributes[:'country']
|
|
84
|
+
else
|
|
85
|
+
self.country = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'values')
|
|
89
|
+
if (value = attributes[:'values']).is_a?(Hash)
|
|
90
|
+
self.values = value
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'saved_addresses')
|
|
95
|
+
if (value = attributes[:'saved_addresses']).is_a?(Array)
|
|
96
|
+
self.saved_addresses = value
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'validation_errors')
|
|
101
|
+
if (value = attributes[:'validation_errors']).is_a?(Hash)
|
|
102
|
+
self.validation_errors = value
|
|
103
|
+
end
|
|
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 @country.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "country", country cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
invalid_properties
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Check to see if the all the properties in the model are valid
|
|
120
|
+
# @return true if the model is valid
|
|
121
|
+
def valid?
|
|
122
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
123
|
+
return false if @country.nil?
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Custom attribute writer method with validation
|
|
128
|
+
# @param [Object] country Value to be assigned
|
|
129
|
+
def country=(country)
|
|
130
|
+
if country.nil?
|
|
131
|
+
fail ArgumentError, 'country cannot be nil'
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
@country = country
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Checks equality by comparing each attribute.
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def ==(o)
|
|
140
|
+
return true if self.equal?(o)
|
|
141
|
+
self.class == o.class &&
|
|
142
|
+
country == o.country &&
|
|
143
|
+
values == o.values &&
|
|
144
|
+
saved_addresses == o.saved_addresses &&
|
|
145
|
+
validation_errors == o.validation_errors
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# @see the `==` method
|
|
149
|
+
# @param [Object] Object to be compared
|
|
150
|
+
def eql?(o)
|
|
151
|
+
self == o
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Calculates hash code according to all attributes.
|
|
155
|
+
# @return [Integer] Hash code
|
|
156
|
+
def hash
|
|
157
|
+
[country, values, saved_addresses, validation_errors].hash
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Builds the object from hash
|
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
162
|
+
# @return [Object] Returns the model itself
|
|
163
|
+
def self.build_from_hash(attributes)
|
|
164
|
+
return nil unless attributes.is_a?(Hash)
|
|
165
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
166
|
+
transformed_hash = {}
|
|
167
|
+
openapi_types.each_pair do |key, type|
|
|
168
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = nil
|
|
170
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
171
|
+
# check to ensure the input is an array given that the attribute
|
|
172
|
+
# is documented as an array but the input is not
|
|
173
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
174
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
175
|
+
end
|
|
176
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
177
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
new(transformed_hash)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Returns the object in the form of hash
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_hash
|
|
186
|
+
hash = {}
|
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
188
|
+
value = self.send(attr)
|
|
189
|
+
if value.nil?
|
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
hash[param] = _to_hash(value)
|
|
195
|
+
end
|
|
196
|
+
hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|
|
@@ -31,7 +31,7 @@ module Zernio
|
|
|
31
31
|
# Callback data from an inline keyboard button tap (Telegram).
|
|
32
32
|
attr_accessor :callback_data
|
|
33
33
|
|
|
34
|
-
# WhatsApp only. Which kind of interactive reply the user sent: `button_reply` (tap on an interactive button), `list_reply` (tap on a list row), or `nfm_reply` (a WhatsApp Flow submission).
|
|
34
|
+
# WhatsApp only. Which kind of interactive reply the user sent: `button_reply` (tap on an interactive button), `list_reply` (tap on a list row), or `nfm_reply` (a WhatsApp Flow submission or an `address_message` submission, see `nfmReplyName`).
|
|
35
35
|
attr_accessor :interactive_type
|
|
36
36
|
|
|
37
37
|
# WhatsApp only. The `id` of the tapped button or list row, matching the `id` you supplied when the message was sent. Not set for Flow responses.
|
|
@@ -43,9 +43,12 @@ module Zernio
|
|
|
43
43
|
# WhatsApp only. Raw `nfm_reply.response_json` string returned by a Flow submission. Useful if you need the exact wire payload; for typed access use `flowResponseData` instead.
|
|
44
44
|
attr_accessor :flow_response_json
|
|
45
45
|
|
|
46
|
-
# WhatsApp only. Parsed Flow response JSON. Populated when `flowResponseJson` is valid JSON; otherwise omitted. Keys and value types depend on the specific Flow that was submitted.
|
|
46
|
+
# WhatsApp only. Parsed Flow response JSON. Populated when `flowResponseJson` is valid JSON; otherwise omitted. Keys and value types depend on the specific Flow that was submitted. An `address_message` submission (`nfmReplyName: address_message`) carries the address fields (`name`, `address`, `city`, `state`, `in_pin_code`, ...), either at the top level or nested under `values`; read both.
|
|
47
47
|
attr_accessor :flow_response_data
|
|
48
48
|
|
|
49
|
+
# WhatsApp only. `nfm_reply.name` as Meta sent it, e.g. `flow` or `address_message`. Address submissions share the `nfm_reply` envelope with Flow submissions and are otherwise indistinguishable in `flowResponseData`; use this field to tell them apart.
|
|
50
|
+
attr_accessor :nfm_reply_name
|
|
51
|
+
|
|
49
52
|
attr_accessor :order
|
|
50
53
|
|
|
51
54
|
attr_accessor :referred_product
|
|
@@ -103,6 +106,7 @@ module Zernio
|
|
|
103
106
|
:'button_payload' => :'buttonPayload',
|
|
104
107
|
:'flow_response_json' => :'flowResponseJson',
|
|
105
108
|
:'flow_response_data' => :'flowResponseData',
|
|
109
|
+
:'nfm_reply_name' => :'nfmReplyName',
|
|
106
110
|
:'order' => :'order',
|
|
107
111
|
:'referred_product' => :'referredProduct',
|
|
108
112
|
:'contacts' => :'contacts',
|
|
@@ -138,6 +142,7 @@ module Zernio
|
|
|
138
142
|
:'button_payload' => :'String',
|
|
139
143
|
:'flow_response_json' => :'String',
|
|
140
144
|
:'flow_response_data' => :'Hash<String, Object>',
|
|
145
|
+
:'nfm_reply_name' => :'String',
|
|
141
146
|
:'order' => :'WebhookPayloadMessageMetadataOrder',
|
|
142
147
|
:'referred_product' => :'WebhookPayloadMessageMetadataReferredProduct',
|
|
143
148
|
:'contacts' => :'Array<Hash<String, Object>>',
|
|
@@ -214,6 +219,10 @@ module Zernio
|
|
|
214
219
|
end
|
|
215
220
|
end
|
|
216
221
|
|
|
222
|
+
if attributes.key?(:'nfm_reply_name')
|
|
223
|
+
self.nfm_reply_name = attributes[:'nfm_reply_name']
|
|
224
|
+
end
|
|
225
|
+
|
|
217
226
|
if attributes.key?(:'order')
|
|
218
227
|
self.order = attributes[:'order']
|
|
219
228
|
end
|
|
@@ -307,6 +316,7 @@ module Zernio
|
|
|
307
316
|
button_payload == o.button_payload &&
|
|
308
317
|
flow_response_json == o.flow_response_json &&
|
|
309
318
|
flow_response_data == o.flow_response_data &&
|
|
319
|
+
nfm_reply_name == o.nfm_reply_name &&
|
|
310
320
|
order == o.order &&
|
|
311
321
|
referred_product == o.referred_product &&
|
|
312
322
|
contacts == o.contacts &&
|
|
@@ -327,7 +337,7 @@ module Zernio
|
|
|
327
337
|
# Calculates hash code according to all attributes.
|
|
328
338
|
# @return [Integer] Hash code
|
|
329
339
|
def hash
|
|
330
|
-
[quoted_message_id, quick_reply_payload, postback_payload, postback_title, callback_data, interactive_type, interactive_id, button_payload, flow_response_json, flow_response_data, order, referred_product, contacts, contacts_origin, story_reply, is_story_mention, referral, unsupported, no_renderable_content].hash
|
|
340
|
+
[quoted_message_id, quick_reply_payload, postback_payload, postback_title, callback_data, interactive_type, interactive_id, button_payload, flow_response_json, flow_response_data, nfm_reply_name, order, referred_product, contacts, contacts_origin, story_reply, is_story_mention, referral, unsupported, no_renderable_content].hash
|
|
331
341
|
end
|
|
332
342
|
|
|
333
343
|
# Builds the object from hash
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
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
|
+
# Webhook payload for the `whatsapp.account.name_status_updated` event. Fired when Meta finishes reviewing a WhatsApp display-name change on a connected number. Maps Meta's `phone_number_name_update` WABA webhook field onto our event envelope. Fires only for a review outcome (APPROVED, DECLINED, PENDING_REVIEW); a name applied without review reports `name_status: AVAILABLE_WITHOUT_REVIEW` on the phone node instead, and Meta never sends this webhook field for that case.
|
|
18
|
+
class WebhookPayloadWhatsAppAccountNameStatusUpdated < ApiModelBase
|
|
19
|
+
# Stable webhook event ID
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
attr_accessor :event
|
|
23
|
+
|
|
24
|
+
attr_accessor :account
|
|
25
|
+
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
# UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.
|
|
29
|
+
attr_accessor :timestamp
|
|
30
|
+
|
|
31
|
+
class EnumAttributeValidator
|
|
32
|
+
attr_reader :datatype
|
|
33
|
+
attr_reader :allowable_values
|
|
34
|
+
|
|
35
|
+
def initialize(datatype, allowable_values)
|
|
36
|
+
@allowable_values = allowable_values.map do |value|
|
|
37
|
+
case datatype.to_s
|
|
38
|
+
when /Integer/i
|
|
39
|
+
value.to_i
|
|
40
|
+
when /Float/i
|
|
41
|
+
value.to_f
|
|
42
|
+
else
|
|
43
|
+
value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def valid?(value)
|
|
49
|
+
!value || allowable_values.include?(value)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
54
|
+
def self.attribute_map
|
|
55
|
+
{
|
|
56
|
+
:'id' => :'id',
|
|
57
|
+
:'event' => :'event',
|
|
58
|
+
:'account' => :'account',
|
|
59
|
+
:'name' => :'name',
|
|
60
|
+
:'timestamp' => :'timestamp'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns attribute mapping this model knows about
|
|
65
|
+
def self.acceptable_attribute_map
|
|
66
|
+
attribute_map
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns all the JSON keys this model knows about
|
|
70
|
+
def self.acceptable_attributes
|
|
71
|
+
acceptable_attribute_map.values
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Attribute type mapping.
|
|
75
|
+
def self.openapi_types
|
|
76
|
+
{
|
|
77
|
+
:'id' => :'String',
|
|
78
|
+
:'event' => :'String',
|
|
79
|
+
:'account' => :'WebhookPayloadWhatsAppTemplateStatusUpdatedAccount',
|
|
80
|
+
:'name' => :'WebhookPayloadWhatsAppAccountNameStatusUpdatedName',
|
|
81
|
+
:'timestamp' => :'Time'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List of attributes with nullable: true
|
|
86
|
+
def self.openapi_nullable
|
|
87
|
+
Set.new([
|
|
88
|
+
])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Initializes the object
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
def initialize(attributes = {})
|
|
94
|
+
if (!attributes.is_a?(Hash))
|
|
95
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated` initialize method"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
99
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
100
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
101
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
102
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
103
|
+
end
|
|
104
|
+
h[k.to_sym] = v
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'id')
|
|
108
|
+
self.id = attributes[:'id']
|
|
109
|
+
else
|
|
110
|
+
self.id = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'event')
|
|
114
|
+
self.event = attributes[:'event']
|
|
115
|
+
else
|
|
116
|
+
self.event = nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'account')
|
|
120
|
+
self.account = attributes[:'account']
|
|
121
|
+
else
|
|
122
|
+
self.account = nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'name')
|
|
126
|
+
self.name = attributes[:'name']
|
|
127
|
+
else
|
|
128
|
+
self.name = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'timestamp')
|
|
132
|
+
self.timestamp = attributes[:'timestamp']
|
|
133
|
+
else
|
|
134
|
+
self.timestamp = nil
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
139
|
+
# @return Array for valid properties with the reasons
|
|
140
|
+
def list_invalid_properties
|
|
141
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
142
|
+
invalid_properties = Array.new
|
|
143
|
+
if @id.nil?
|
|
144
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if @event.nil?
|
|
148
|
+
invalid_properties.push('invalid value for "event", event cannot be nil.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if @account.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "account", account cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @name.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @timestamp.nil?
|
|
160
|
+
invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
invalid_properties
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Check to see if the all the properties in the model are valid
|
|
167
|
+
# @return true if the model is valid
|
|
168
|
+
def valid?
|
|
169
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
170
|
+
return false if @id.nil?
|
|
171
|
+
return false if @event.nil?
|
|
172
|
+
event_validator = EnumAttributeValidator.new('String', ["whatsapp.account.name_status_updated"])
|
|
173
|
+
return false unless event_validator.valid?(@event)
|
|
174
|
+
return false if @account.nil?
|
|
175
|
+
return false if @name.nil?
|
|
176
|
+
return false if @timestamp.nil?
|
|
177
|
+
true
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Custom attribute writer method with validation
|
|
181
|
+
# @param [Object] id Value to be assigned
|
|
182
|
+
def id=(id)
|
|
183
|
+
if id.nil?
|
|
184
|
+
fail ArgumentError, 'id cannot be nil'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@id = id
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
191
|
+
# @param [Object] event Object to be assigned
|
|
192
|
+
def event=(event)
|
|
193
|
+
validator = EnumAttributeValidator.new('String', ["whatsapp.account.name_status_updated"])
|
|
194
|
+
unless validator.valid?(event)
|
|
195
|
+
fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
|
|
196
|
+
end
|
|
197
|
+
@event = event
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Custom attribute writer method with validation
|
|
201
|
+
# @param [Object] account Value to be assigned
|
|
202
|
+
def account=(account)
|
|
203
|
+
if account.nil?
|
|
204
|
+
fail ArgumentError, 'account cannot be nil'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
@account = account
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Custom attribute writer method with validation
|
|
211
|
+
# @param [Object] name Value to be assigned
|
|
212
|
+
def name=(name)
|
|
213
|
+
if name.nil?
|
|
214
|
+
fail ArgumentError, 'name cannot be nil'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@name = name
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Custom attribute writer method with validation
|
|
221
|
+
# @param [Object] timestamp Value to be assigned
|
|
222
|
+
def timestamp=(timestamp)
|
|
223
|
+
if timestamp.nil?
|
|
224
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
@timestamp = timestamp
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Checks equality by comparing each attribute.
|
|
231
|
+
# @param [Object] Object to be compared
|
|
232
|
+
def ==(o)
|
|
233
|
+
return true if self.equal?(o)
|
|
234
|
+
self.class == o.class &&
|
|
235
|
+
id == o.id &&
|
|
236
|
+
event == o.event &&
|
|
237
|
+
account == o.account &&
|
|
238
|
+
name == o.name &&
|
|
239
|
+
timestamp == o.timestamp
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# @see the `==` method
|
|
243
|
+
# @param [Object] Object to be compared
|
|
244
|
+
def eql?(o)
|
|
245
|
+
self == o
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Calculates hash code according to all attributes.
|
|
249
|
+
# @return [Integer] Hash code
|
|
250
|
+
def hash
|
|
251
|
+
[id, event, account, name, timestamp].hash
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Builds the object from hash
|
|
255
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
256
|
+
# @return [Object] Returns the model itself
|
|
257
|
+
def self.build_from_hash(attributes)
|
|
258
|
+
return nil unless attributes.is_a?(Hash)
|
|
259
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
260
|
+
transformed_hash = {}
|
|
261
|
+
openapi_types.each_pair do |key, type|
|
|
262
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
263
|
+
transformed_hash["#{key}"] = nil
|
|
264
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
265
|
+
# check to ensure the input is an array given that the attribute
|
|
266
|
+
# is documented as an array but the input is not
|
|
267
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
268
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
269
|
+
end
|
|
270
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
271
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
new(transformed_hash)
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Returns the object in the form of hash
|
|
278
|
+
# @return [Hash] Returns the object in the form of hash
|
|
279
|
+
def to_hash
|
|
280
|
+
hash = {}
|
|
281
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
282
|
+
value = self.send(attr)
|
|
283
|
+
if value.nil?
|
|
284
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
285
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
hash[param] = _to_hash(value)
|
|
289
|
+
end
|
|
290
|
+
hash
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
end
|