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
|
@@ -14,177 +14,90 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
:'error' => :'error',
|
|
48
|
-
:'code' => :'code'
|
|
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
|
-
:'error' => :'String',
|
|
66
|
-
:'code' => :'String'
|
|
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::CreateInboxConversation429Response` initialize method"
|
|
17
|
+
module CreateInboxConversation429Response
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
|
+
[
|
|
22
|
+
:'CreateInboxConversation429ResponseAnyOf',
|
|
23
|
+
:'WhatsAppTemplateLookupError'
|
|
24
|
+
]
|
|
81
25
|
end
|
|
82
26
|
|
|
83
|
-
#
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
|
88
43
|
end
|
|
89
|
-
h[k.to_sym] = v
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if attributes.key?(:'error')
|
|
93
|
-
self.error = attributes[:'error']
|
|
94
|
-
end
|
|
95
44
|
|
|
96
|
-
|
|
97
|
-
self.code = attributes[:'code']
|
|
45
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
98
46
|
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
-
# @return Array for valid properties with the reasons
|
|
103
|
-
def list_invalid_properties
|
|
104
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
-
invalid_properties = Array.new
|
|
106
|
-
invalid_properties
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# Check to see if the all the properties in the model are valid
|
|
110
|
-
# @return true if the model is valid
|
|
111
|
-
def valid?
|
|
112
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
-
code_validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
114
|
-
return false unless code_validator.valid?(@code)
|
|
115
|
-
true
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
119
|
-
# @param [Object] code Object to be assigned
|
|
120
|
-
def code=(code)
|
|
121
|
-
validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
122
|
-
unless validator.valid?(code)
|
|
123
|
-
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
124
|
-
end
|
|
125
|
-
@code = code
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
# Checks equality by comparing each attribute.
|
|
129
|
-
# @param [Object] Object to be compared
|
|
130
|
-
def ==(o)
|
|
131
|
-
return true if self.equal?(o)
|
|
132
|
-
self.class == o.class &&
|
|
133
|
-
error == o.error &&
|
|
134
|
-
code == o.code
|
|
135
|
-
end
|
|
136
47
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
|
164
93
|
end
|
|
165
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
new(transformed_hash)
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Returns the object in the form of hash
|
|
173
|
-
# @return [Hash] Returns the object in the form of hash
|
|
174
|
-
def to_hash
|
|
175
|
-
hash = {}
|
|
176
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
-
value = self.send(attr)
|
|
178
|
-
if value.nil?
|
|
179
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
94
|
end
|
|
182
95
|
|
|
183
|
-
|
|
96
|
+
raise # if no match by now, raise
|
|
97
|
+
rescue
|
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
184
99
|
end
|
|
185
|
-
hash
|
|
186
100
|
end
|
|
187
|
-
|
|
188
101
|
end
|
|
189
102
|
|
|
190
103
|
end
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api 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 CreateInboxConversation429ResponseAnyOf < ApiModelBase
|
|
18
|
+
attr_accessor :error
|
|
19
|
+
|
|
20
|
+
attr_accessor :code
|
|
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
|
+
:'error' => :'error',
|
|
48
|
+
:'code' => :'code'
|
|
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
|
+
:'error' => :'String',
|
|
66
|
+
:'code' => :'String'
|
|
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::CreateInboxConversation429ResponseAnyOf` 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::CreateInboxConversation429ResponseAnyOf`. 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?(:'error')
|
|
93
|
+
self.error = attributes[:'error']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'code')
|
|
97
|
+
self.code = attributes[:'code']
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
code_validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
114
|
+
return false unless code_validator.valid?(@code)
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
119
|
+
# @param [Object] code Object to be assigned
|
|
120
|
+
def code=(code)
|
|
121
|
+
validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
122
|
+
unless validator.valid?(code)
|
|
123
|
+
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
124
|
+
end
|
|
125
|
+
@code = code
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
error == o.error &&
|
|
134
|
+
code == o.code
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[error, code].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -15,9 +15,12 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
17
|
class ListTikTokCommercialMusic200ResponseTracksInner < ApiModelBase
|
|
18
|
-
# The
|
|
18
|
+
# The id to send as musicSoundId (the full track's song clip id). TikTok rejects the commercial music id itself at publish time.
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
|
+
# TikTok's commercial_music_id, for reference only
|
|
22
|
+
attr_accessor :commercial_music_id
|
|
23
|
+
|
|
21
24
|
attr_accessor :name
|
|
22
25
|
|
|
23
26
|
attr_accessor :artist
|
|
@@ -40,6 +43,7 @@ module Zernio
|
|
|
40
43
|
def self.attribute_map
|
|
41
44
|
{
|
|
42
45
|
:'id' => :'id',
|
|
46
|
+
:'commercial_music_id' => :'commercialMusicId',
|
|
43
47
|
:'name' => :'name',
|
|
44
48
|
:'artist' => :'artist',
|
|
45
49
|
:'duration_sec' => :'durationSec',
|
|
@@ -65,6 +69,7 @@ module Zernio
|
|
|
65
69
|
def self.openapi_types
|
|
66
70
|
{
|
|
67
71
|
:'id' => :'String',
|
|
72
|
+
:'commercial_music_id' => :'String',
|
|
68
73
|
:'name' => :'String',
|
|
69
74
|
:'artist' => :'String',
|
|
70
75
|
:'duration_sec' => :'Integer',
|
|
@@ -102,6 +107,10 @@ module Zernio
|
|
|
102
107
|
self.id = attributes[:'id']
|
|
103
108
|
end
|
|
104
109
|
|
|
110
|
+
if attributes.key?(:'commercial_music_id')
|
|
111
|
+
self.commercial_music_id = attributes[:'commercial_music_id']
|
|
112
|
+
end
|
|
113
|
+
|
|
105
114
|
if attributes.key?(:'name')
|
|
106
115
|
self.name = attributes[:'name']
|
|
107
116
|
end
|
|
@@ -158,6 +167,7 @@ module Zernio
|
|
|
158
167
|
return true if self.equal?(o)
|
|
159
168
|
self.class == o.class &&
|
|
160
169
|
id == o.id &&
|
|
170
|
+
commercial_music_id == o.commercial_music_id &&
|
|
161
171
|
name == o.name &&
|
|
162
172
|
artist == o.artist &&
|
|
163
173
|
duration_sec == o.duration_sec &&
|
|
@@ -177,7 +187,7 @@ module Zernio
|
|
|
177
187
|
# Calculates hash code according to all attributes.
|
|
178
188
|
# @return [Integer] Hash code
|
|
179
189
|
def hash
|
|
180
|
-
[id, name, artist, duration_sec, genres, preview_url, thumbnail_url, rank, clip].hash
|
|
190
|
+
[id, commercial_music_id, name, artist, duration_sec, genres, preview_url, thumbnail_url, rank, clip].hash
|
|
181
191
|
end
|
|
182
192
|
|
|
183
193
|
# Builds the object from hash
|
|
@@ -14,8 +14,10 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# The trending excerpt of the track, when TikTok provides one
|
|
17
|
+
# The trending excerpt of the track, when TikTok provides one. Its id is also accepted as musicSoundId.
|
|
18
18
|
class ListTikTokCommercialMusic200ResponseTracksInnerClip < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
19
21
|
attr_accessor :duration_sec
|
|
20
22
|
|
|
21
23
|
attr_accessor :preview_url
|
|
@@ -23,6 +25,7 @@ module Zernio
|
|
|
23
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
26
|
def self.attribute_map
|
|
25
27
|
{
|
|
28
|
+
:'id' => :'id',
|
|
26
29
|
:'duration_sec' => :'durationSec',
|
|
27
30
|
:'preview_url' => :'previewUrl'
|
|
28
31
|
}
|
|
@@ -41,6 +44,7 @@ module Zernio
|
|
|
41
44
|
# Attribute type mapping.
|
|
42
45
|
def self.openapi_types
|
|
43
46
|
{
|
|
47
|
+
:'id' => :'String',
|
|
44
48
|
:'duration_sec' => :'Integer',
|
|
45
49
|
:'preview_url' => :'String'
|
|
46
50
|
}
|
|
@@ -68,6 +72,10 @@ module Zernio
|
|
|
68
72
|
h[k.to_sym] = v
|
|
69
73
|
}
|
|
70
74
|
|
|
75
|
+
if attributes.key?(:'id')
|
|
76
|
+
self.id = attributes[:'id']
|
|
77
|
+
end
|
|
78
|
+
|
|
71
79
|
if attributes.key?(:'duration_sec')
|
|
72
80
|
self.duration_sec = attributes[:'duration_sec']
|
|
73
81
|
end
|
|
@@ -97,6 +105,7 @@ module Zernio
|
|
|
97
105
|
def ==(o)
|
|
98
106
|
return true if self.equal?(o)
|
|
99
107
|
self.class == o.class &&
|
|
108
|
+
id == o.id &&
|
|
100
109
|
duration_sec == o.duration_sec &&
|
|
101
110
|
preview_url == o.preview_url
|
|
102
111
|
end
|
|
@@ -110,7 +119,7 @@ module Zernio
|
|
|
110
119
|
# Calculates hash code according to all attributes.
|
|
111
120
|
# @return [Integer] Hash code
|
|
112
121
|
def hash
|
|
113
|
-
[duration_sec, preview_url].hash
|
|
122
|
+
[id, duration_sec, preview_url].hash
|
|
114
123
|
end
|
|
115
124
|
|
|
116
125
|
# Builds the object from hash
|
|
@@ -23,7 +23,7 @@ module Zernio
|
|
|
23
23
|
# Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to; DIRECT_SEND_NOT_ELIGIBLE and DIRECT_SEND_BLOCKED mean the WhatsApp Business Account needs Meta to grant or restore Direct Send access; DIRECT_SEND_LIMITED is temporary, Meta lifts it on its own; platform_api_error means Meta itself rejected the send (see platformError).
|
|
24
24
|
attr_accessor :code
|
|
25
25
|
|
|
26
|
-
# Present alongside code platform_api_error. The platform that rejected the send (e.g. instagram, facebook).
|
|
26
|
+
# Present alongside code platform_api_error. The platform that rejected the send (e.g. instagram, facebook, whatsapp).
|
|
27
27
|
attr_accessor :platform
|
|
28
28
|
|
|
29
29
|
attr_accessor :platform_error
|
|
@@ -139,7 +139,7 @@ module Zernio
|
|
|
139
139
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
140
140
|
type_validator = EnumAttributeValidator.new('String', ["platform_error", "invalid_request_error"])
|
|
141
141
|
return false unless type_validator.valid?(@type)
|
|
142
|
-
code_validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED", "platform_api_error"])
|
|
142
|
+
code_validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT", "INVALID_TEMPLATE_HEADER", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED", "platform_api_error"])
|
|
143
143
|
return false unless code_validator.valid?(@code)
|
|
144
144
|
true
|
|
145
145
|
end
|
|
@@ -157,7 +157,7 @@ module Zernio
|
|
|
157
157
|
# Custom attribute writer method checking allowed values (enum).
|
|
158
158
|
# @param [Object] code Object to be assigned
|
|
159
159
|
def code=(code)
|
|
160
|
-
validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED", "platform_api_error"])
|
|
160
|
+
validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT", "INVALID_TEMPLATE_HEADER", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED", "platform_api_error"])
|
|
161
161
|
unless validator.valid?(code)
|
|
162
162
|
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
163
163
|
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# Instagram
|
|
17
|
+
# Instagram, Facebook, or WhatsApp. Meta's diagnostic fields for the rejected send or template lookup. WhatsApp lookup errors retain only code, message, and error_data.details. Absent when the failure did not come from Meta.
|
|
18
18
|
class SendInboxMessage400ResponsePlatformError < ApiModelBase
|
|
19
19
|
# Meta error code
|
|
20
20
|
attr_accessor :code
|