late-sdk 0.0.948 → 0.0.950
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 +10 -0
- data/docs/CreateInboxConversation400Response.md +11 -3
- data/docs/CreateInboxConversation400ResponseAnyOf.md +20 -0
- data/docs/CreateInboxConversation404Response.md +11 -3
- data/docs/CreateInboxConversation404ResponseAnyOf.md +20 -0
- data/docs/CreateInboxConversation422Response.md +11 -3
- data/docs/CreateInboxConversation422ResponseAnyOf.md +20 -0
- data/docs/CreateInboxConversation429Response.md +11 -3
- data/docs/CreateInboxConversation429ResponseAnyOf.md +20 -0
- data/docs/ListTikTokCommercialMusic200ResponseTracksInner.md +3 -1
- data/docs/ListTikTokCommercialMusic200ResponseTracksInnerClip.md +2 -0
- data/docs/MessagesApi.md +2 -2
- data/docs/SendInboxMessage400Response.md +1 -1
- data/docs/SendInboxMessage502Response.md +30 -0
- data/docs/TikTokPlatformDataMusicSoundInfo.md +1 -1
- data/docs/WhatsAppTemplateLookupError.md +28 -0
- data/docs/WhatsAppTemplateLookupErrorDetails.md +24 -0
- data/docs/WhatsAppTemplateLookupErrorDetailsProviderHeaders.md +22 -0
- data/docs/WhatsAppTemplateLookupErrorPlatformError.md +22 -0
- data/docs/WhatsAppTemplateLookupErrorPlatformErrorErrorData.md +18 -0
- data/lib/zernio-sdk/api/messages_api.rb +4 -4
- data/lib/zernio-sdk/models/create_inbox_conversation400_response.rb +73 -160
- data/lib/zernio-sdk/models/create_inbox_conversation400_response_any_of.rb +190 -0
- data/lib/zernio-sdk/models/create_inbox_conversation404_response.rb +73 -160
- data/lib/zernio-sdk/models/create_inbox_conversation404_response_any_of.rb +190 -0
- data/lib/zernio-sdk/models/create_inbox_conversation422_response.rb +73 -160
- data/lib/zernio-sdk/models/create_inbox_conversation422_response_any_of.rb +190 -0
- data/lib/zernio-sdk/models/create_inbox_conversation429_response.rb +73 -160
- data/lib/zernio-sdk/models/create_inbox_conversation429_response_any_of.rb +190 -0
- data/lib/zernio-sdk/models/list_tik_tok_commercial_music200_response_tracks_inner.rb +12 -2
- data/lib/zernio-sdk/models/list_tik_tok_commercial_music200_response_tracks_inner_clip.rb +11 -2
- data/lib/zernio-sdk/models/send_inbox_message400_response.rb +3 -3
- data/lib/zernio-sdk/models/send_inbox_message400_response_platform_error.rb +1 -1
- data/lib/zernio-sdk/models/send_inbox_message502_response.rb +103 -0
- data/lib/zernio-sdk/models/tik_tok_platform_data_music_sound_info.rb +1 -1
- data/lib/zernio-sdk/models/whats_app_template_lookup_error.rb +305 -0
- data/lib/zernio-sdk/models/whats_app_template_lookup_error_details.rb +233 -0
- data/lib/zernio-sdk/models/whats_app_template_lookup_error_details_provider_headers.rb +166 -0
- data/lib/zernio-sdk/models/whats_app_template_lookup_error_platform_error.rb +166 -0
- data/lib/zernio-sdk/models/whats_app_template_lookup_error_platform_error_error_data.rb +147 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +10 -0
- data/openapi.yaml +105 -25
- data/spec/api/messages_api_spec.rb +2 -2
- data/spec/models/create_inbox_conversation400_response_any_of_spec.rb +46 -0
- data/spec/models/create_inbox_conversation400_response_spec.rb +0 -25
- data/spec/models/create_inbox_conversation404_response_any_of_spec.rb +46 -0
- data/spec/models/create_inbox_conversation404_response_spec.rb +0 -25
- data/spec/models/create_inbox_conversation422_response_any_of_spec.rb +46 -0
- data/spec/models/create_inbox_conversation422_response_spec.rb +0 -25
- data/spec/models/create_inbox_conversation429_response_any_of_spec.rb +46 -0
- data/spec/models/create_inbox_conversation429_response_spec.rb +0 -25
- data/spec/models/list_tik_tok_commercial_music200_response_tracks_inner_clip_spec.rb +6 -0
- data/spec/models/list_tik_tok_commercial_music200_response_tracks_inner_spec.rb +6 -0
- data/spec/models/send_inbox_message400_response_spec.rb +1 -1
- data/spec/models/send_inbox_message502_response_spec.rb +21 -0
- data/spec/models/whats_app_template_lookup_error_details_provider_headers_spec.rb +48 -0
- data/spec/models/whats_app_template_lookup_error_details_spec.rb +58 -0
- data/spec/models/whats_app_template_lookup_error_platform_error_error_data_spec.rb +36 -0
- data/spec/models/whats_app_template_lookup_error_platform_error_spec.rb +48 -0
- data/spec/models/whats_app_template_lookup_error_spec.rb +78 -0
- data/zernio-sdk-0.0.950.gem +0 -0
- metadata +42 -2
- data/zernio-sdk-0.0.948.gem +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
module SendInboxMessage502Response
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
|
+
[
|
|
22
|
+
:'ErrorResponse',
|
|
23
|
+
:'WhatsAppTemplateLookupError'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_any_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
return find_and_cast_into_type(klass, data)
|
|
41
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
51
|
+
|
|
52
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
53
|
+
def find_and_cast_into_type(klass, data)
|
|
54
|
+
return if data.nil?
|
|
55
|
+
|
|
56
|
+
case klass.to_s
|
|
57
|
+
when 'Boolean'
|
|
58
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
59
|
+
when 'Float'
|
|
60
|
+
return data if data.instance_of?(Float)
|
|
61
|
+
when 'Integer'
|
|
62
|
+
return data if data.instance_of?(Integer)
|
|
63
|
+
when 'Time'
|
|
64
|
+
return Time.parse(data)
|
|
65
|
+
when 'Date'
|
|
66
|
+
return Date.iso8601(data)
|
|
67
|
+
when 'String'
|
|
68
|
+
return data if data.instance_of?(String)
|
|
69
|
+
when 'Object' # "type: object"
|
|
70
|
+
return data if data.instance_of?(Hash)
|
|
71
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
72
|
+
if data.instance_of?(Array)
|
|
73
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
74
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
75
|
+
end
|
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
+
end
|
|
81
|
+
else # model
|
|
82
|
+
const = Zernio.const_get(klass)
|
|
83
|
+
if const
|
|
84
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
85
|
+
model = const.build(data)
|
|
86
|
+
return model if model
|
|
87
|
+
else
|
|
88
|
+
# raise if data contains keys that are not known to the model
|
|
89
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
90
|
+
model = const.build_from_hash(data)
|
|
91
|
+
return model if model
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
raise # if no match by now, raise
|
|
97
|
+
rescue
|
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
|
16
16
|
module Zernio
|
|
17
17
|
# Commercial Music Library track to attach. Accounts connected through the TikTok for Business app only: a developer-app account rejects the post at publish time with a message that says so. Pick musicSoundId from GET /v1/accounts/{accountId}/tiktok/commercial-music. Ignored on drafts, where TikTok ignores every post_info field.
|
|
18
18
|
class TikTokPlatformDataMusicSoundInfo < ApiModelBase
|
|
19
|
-
# The
|
|
19
|
+
# The id field of a track from GET /v1/accounts/{accountId}/tiktok/commercial-music (a song clip id). TikTok fails the publish with a generic 51065 when given the commercial music id instead.
|
|
20
20
|
attr_accessor :music_sound_id
|
|
21
21
|
|
|
22
22
|
# Track volume. TikTok defaults an omitted volume to 0, which publishes the track silently, so we default to the app's 50. Video posts only.
|
|
@@ -0,0 +1,305 @@
|
|
|
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 WhatsAppTemplateLookupError < ApiModelBase
|
|
18
|
+
attr_accessor :error
|
|
19
|
+
|
|
20
|
+
attr_accessor :type
|
|
21
|
+
|
|
22
|
+
attr_accessor :code
|
|
23
|
+
|
|
24
|
+
attr_accessor :platform
|
|
25
|
+
|
|
26
|
+
attr_accessor :platform_error
|
|
27
|
+
|
|
28
|
+
attr_accessor :details
|
|
29
|
+
|
|
30
|
+
class EnumAttributeValidator
|
|
31
|
+
attr_reader :datatype
|
|
32
|
+
attr_reader :allowable_values
|
|
33
|
+
|
|
34
|
+
def initialize(datatype, allowable_values)
|
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
|
36
|
+
case datatype.to_s
|
|
37
|
+
when /Integer/i
|
|
38
|
+
value.to_i
|
|
39
|
+
when /Float/i
|
|
40
|
+
value.to_f
|
|
41
|
+
else
|
|
42
|
+
value
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def valid?(value)
|
|
48
|
+
!value || allowable_values.include?(value)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
|
+
def self.attribute_map
|
|
54
|
+
{
|
|
55
|
+
:'error' => :'error',
|
|
56
|
+
:'type' => :'type',
|
|
57
|
+
:'code' => :'code',
|
|
58
|
+
:'platform' => :'platform',
|
|
59
|
+
:'platform_error' => :'platformError',
|
|
60
|
+
:'details' => :'details'
|
|
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
|
+
:'error' => :'String',
|
|
78
|
+
:'type' => :'String',
|
|
79
|
+
:'code' => :'String',
|
|
80
|
+
:'platform' => :'String',
|
|
81
|
+
:'platform_error' => :'WhatsAppTemplateLookupErrorPlatformError',
|
|
82
|
+
:'details' => :'WhatsAppTemplateLookupErrorDetails'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# List of attributes with nullable: true
|
|
87
|
+
def self.openapi_nullable
|
|
88
|
+
Set.new([
|
|
89
|
+
])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Initializes the object
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
def initialize(attributes = {})
|
|
95
|
+
if (!attributes.is_a?(Hash))
|
|
96
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WhatsAppTemplateLookupError` initialize method"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
100
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WhatsAppTemplateLookupError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'error')
|
|
109
|
+
self.error = attributes[:'error']
|
|
110
|
+
else
|
|
111
|
+
self.error = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'type')
|
|
115
|
+
self.type = attributes[:'type']
|
|
116
|
+
else
|
|
117
|
+
self.type = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'code')
|
|
121
|
+
self.code = attributes[:'code']
|
|
122
|
+
else
|
|
123
|
+
self.code = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'platform')
|
|
127
|
+
self.platform = attributes[:'platform']
|
|
128
|
+
else
|
|
129
|
+
self.platform = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'platform_error')
|
|
133
|
+
self.platform_error = attributes[:'platform_error']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'details')
|
|
137
|
+
self.details = attributes[:'details']
|
|
138
|
+
else
|
|
139
|
+
self.details = nil
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
144
|
+
# @return Array for valid properties with the reasons
|
|
145
|
+
def list_invalid_properties
|
|
146
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
147
|
+
invalid_properties = Array.new
|
|
148
|
+
if @error.nil?
|
|
149
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if @type.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if @code.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @platform.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "platform", platform cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @details.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "details", details cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
invalid_properties
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Check to see if the all the properties in the model are valid
|
|
172
|
+
# @return true if the model is valid
|
|
173
|
+
def valid?
|
|
174
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
175
|
+
return false if @error.nil?
|
|
176
|
+
return false if @type.nil?
|
|
177
|
+
type_validator = EnumAttributeValidator.new('String', ["platform_error"])
|
|
178
|
+
return false unless type_validator.valid?(@type)
|
|
179
|
+
return false if @code.nil?
|
|
180
|
+
code_validator = EnumAttributeValidator.new('String', ["platform_api_error"])
|
|
181
|
+
return false unless code_validator.valid?(@code)
|
|
182
|
+
return false if @platform.nil?
|
|
183
|
+
platform_validator = EnumAttributeValidator.new('String', ["whatsapp"])
|
|
184
|
+
return false unless platform_validator.valid?(@platform)
|
|
185
|
+
return false if @details.nil?
|
|
186
|
+
true
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] error Value to be assigned
|
|
191
|
+
def error=(error)
|
|
192
|
+
if error.nil?
|
|
193
|
+
fail ArgumentError, 'error cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@error = error
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
200
|
+
# @param [Object] type Object to be assigned
|
|
201
|
+
def type=(type)
|
|
202
|
+
validator = EnumAttributeValidator.new('String', ["platform_error"])
|
|
203
|
+
unless validator.valid?(type)
|
|
204
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
205
|
+
end
|
|
206
|
+
@type = type
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
210
|
+
# @param [Object] code Object to be assigned
|
|
211
|
+
def code=(code)
|
|
212
|
+
validator = EnumAttributeValidator.new('String', ["platform_api_error"])
|
|
213
|
+
unless validator.valid?(code)
|
|
214
|
+
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
215
|
+
end
|
|
216
|
+
@code = code
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
220
|
+
# @param [Object] platform Object to be assigned
|
|
221
|
+
def platform=(platform)
|
|
222
|
+
validator = EnumAttributeValidator.new('String', ["whatsapp"])
|
|
223
|
+
unless validator.valid?(platform)
|
|
224
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
225
|
+
end
|
|
226
|
+
@platform = platform
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Custom attribute writer method with validation
|
|
230
|
+
# @param [Object] details Value to be assigned
|
|
231
|
+
def details=(details)
|
|
232
|
+
if details.nil?
|
|
233
|
+
fail ArgumentError, 'details cannot be nil'
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
@details = details
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Checks equality by comparing each attribute.
|
|
240
|
+
# @param [Object] Object to be compared
|
|
241
|
+
def ==(o)
|
|
242
|
+
return true if self.equal?(o)
|
|
243
|
+
self.class == o.class &&
|
|
244
|
+
error == o.error &&
|
|
245
|
+
type == o.type &&
|
|
246
|
+
code == o.code &&
|
|
247
|
+
platform == o.platform &&
|
|
248
|
+
platform_error == o.platform_error &&
|
|
249
|
+
details == o.details
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# @see the `==` method
|
|
253
|
+
# @param [Object] Object to be compared
|
|
254
|
+
def eql?(o)
|
|
255
|
+
self == o
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Calculates hash code according to all attributes.
|
|
259
|
+
# @return [Integer] Hash code
|
|
260
|
+
def hash
|
|
261
|
+
[error, type, code, platform, platform_error, details].hash
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Builds the object from hash
|
|
265
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
266
|
+
# @return [Object] Returns the model itself
|
|
267
|
+
def self.build_from_hash(attributes)
|
|
268
|
+
return nil unless attributes.is_a?(Hash)
|
|
269
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
270
|
+
transformed_hash = {}
|
|
271
|
+
openapi_types.each_pair do |key, type|
|
|
272
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
273
|
+
transformed_hash["#{key}"] = nil
|
|
274
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
275
|
+
# check to ensure the input is an array given that the attribute
|
|
276
|
+
# is documented as an array but the input is not
|
|
277
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
278
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
279
|
+
end
|
|
280
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
281
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
new(transformed_hash)
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Returns the object in the form of hash
|
|
288
|
+
# @return [Hash] Returns the object in the form of hash
|
|
289
|
+
def to_hash
|
|
290
|
+
hash = {}
|
|
291
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
292
|
+
value = self.send(attr)
|
|
293
|
+
if value.nil?
|
|
294
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
295
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
hash[param] = _to_hash(value)
|
|
299
|
+
end
|
|
300
|
+
hash
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
end
|
|
@@ -0,0 +1,233 @@
|
|
|
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 WhatsAppTemplateLookupErrorDetails < ApiModelBase
|
|
18
|
+
attr_accessor :phase
|
|
19
|
+
|
|
20
|
+
# Meta endpoint path without query parameters or access tokens
|
|
21
|
+
attr_accessor :endpoint
|
|
22
|
+
|
|
23
|
+
attr_accessor :upstream_status
|
|
24
|
+
|
|
25
|
+
attr_accessor :provider_headers
|
|
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
|
+
:'phase' => :'phase',
|
|
53
|
+
:'endpoint' => :'endpoint',
|
|
54
|
+
:'upstream_status' => :'upstreamStatus',
|
|
55
|
+
:'provider_headers' => :'providerHeaders'
|
|
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
|
+
:'phase' => :'String',
|
|
73
|
+
:'endpoint' => :'String',
|
|
74
|
+
:'upstream_status' => :'Integer',
|
|
75
|
+
:'provider_headers' => :'WhatsAppTemplateLookupErrorDetailsProviderHeaders'
|
|
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 `Zernio::WhatsAppTemplateLookupErrorDetails` 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 `Zernio::WhatsAppTemplateLookupErrorDetails`. 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?(:'phase')
|
|
102
|
+
self.phase = attributes[:'phase']
|
|
103
|
+
else
|
|
104
|
+
self.phase = nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'endpoint')
|
|
108
|
+
self.endpoint = attributes[:'endpoint']
|
|
109
|
+
else
|
|
110
|
+
self.endpoint = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'upstream_status')
|
|
114
|
+
self.upstream_status = attributes[:'upstream_status']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'provider_headers')
|
|
118
|
+
self.provider_headers = attributes[:'provider_headers']
|
|
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 @phase.nil?
|
|
128
|
+
invalid_properties.push('invalid value for "phase", phase cannot be nil.')
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if @endpoint.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "endpoint", endpoint 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 @phase.nil?
|
|
143
|
+
phase_validator = EnumAttributeValidator.new('String', ["template_lookup"])
|
|
144
|
+
return false unless phase_validator.valid?(@phase)
|
|
145
|
+
return false if @endpoint.nil?
|
|
146
|
+
true
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
150
|
+
# @param [Object] phase Object to be assigned
|
|
151
|
+
def phase=(phase)
|
|
152
|
+
validator = EnumAttributeValidator.new('String', ["template_lookup"])
|
|
153
|
+
unless validator.valid?(phase)
|
|
154
|
+
fail ArgumentError, "invalid value for \"phase\", must be one of #{validator.allowable_values}."
|
|
155
|
+
end
|
|
156
|
+
@phase = phase
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Custom attribute writer method with validation
|
|
160
|
+
# @param [Object] endpoint Value to be assigned
|
|
161
|
+
def endpoint=(endpoint)
|
|
162
|
+
if endpoint.nil?
|
|
163
|
+
fail ArgumentError, 'endpoint cannot be nil'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@endpoint = endpoint
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Checks equality by comparing each attribute.
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def ==(o)
|
|
172
|
+
return true if self.equal?(o)
|
|
173
|
+
self.class == o.class &&
|
|
174
|
+
phase == o.phase &&
|
|
175
|
+
endpoint == o.endpoint &&
|
|
176
|
+
upstream_status == o.upstream_status &&
|
|
177
|
+
provider_headers == o.provider_headers
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# @see the `==` method
|
|
181
|
+
# @param [Object] Object to be compared
|
|
182
|
+
def eql?(o)
|
|
183
|
+
self == o
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Calculates hash code according to all attributes.
|
|
187
|
+
# @return [Integer] Hash code
|
|
188
|
+
def hash
|
|
189
|
+
[phase, endpoint, upstream_status, provider_headers].hash
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Builds the object from hash
|
|
193
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
194
|
+
# @return [Object] Returns the model itself
|
|
195
|
+
def self.build_from_hash(attributes)
|
|
196
|
+
return nil unless attributes.is_a?(Hash)
|
|
197
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
198
|
+
transformed_hash = {}
|
|
199
|
+
openapi_types.each_pair do |key, type|
|
|
200
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
201
|
+
transformed_hash["#{key}"] = nil
|
|
202
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
203
|
+
# check to ensure the input is an array given that the attribute
|
|
204
|
+
# is documented as an array but the input is not
|
|
205
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
206
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
207
|
+
end
|
|
208
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
209
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
new(transformed_hash)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the object in the form of hash
|
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
|
217
|
+
def to_hash
|
|
218
|
+
hash = {}
|
|
219
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
220
|
+
value = self.send(attr)
|
|
221
|
+
if value.nil?
|
|
222
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
223
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
hash[param] = _to_hash(value)
|
|
227
|
+
end
|
|
228
|
+
hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
end
|