late-sdk 0.0.949 → 0.0.951
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 +11 -0
- data/docs/AdCampaignsApi.md +154 -0
- data/docs/AdKeyword.md +3 -1
- data/docs/AdKeywordQuality.md +24 -0
- data/docs/AdScheduleWindow.md +32 -0
- data/docs/GetCampaignAdSchedule200Response.md +28 -0
- data/docs/GetCampaignAdSchedule200ResponsePerformance.md +22 -0
- data/docs/GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner.md +26 -0
- data/docs/GetCampaignAdSchedule200ResponsePerformanceByHourInner.md +26 -0
- data/docs/ListTikTokCommercialMusic200ResponseTracksInner.md +3 -1
- data/docs/ListTikTokCommercialMusic200ResponseTracksInnerClip.md +2 -0
- data/docs/TikTokPlatformDataMusicSoundInfo.md +1 -1
- data/docs/UpdateCampaignAdSchedule200Response.md +22 -0
- data/docs/UpdateCampaignAdScheduleRequest.md +18 -0
- data/docs/UpdateCampaignAdScheduleRequestScheduleInner.md +28 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +164 -0
- data/lib/zernio-sdk/models/ad_keyword.rb +11 -2
- data/lib/zernio-sdk/models/ad_keyword_quality.rb +241 -0
- data/lib/zernio-sdk/models/ad_schedule_window.rb +329 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response.rb +197 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance.rb +174 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner.rb +218 -0
- data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_hour_inner.rb +212 -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/tik_tok_platform_data_music_sound_info.rb +1 -1
- data/lib/zernio-sdk/models/update_campaign_ad_schedule200_response.rb +167 -0
- data/lib/zernio-sdk/models/update_campaign_ad_schedule_request.rb +176 -0
- data/lib/zernio-sdk/models/update_campaign_ad_schedule_request_schedule_inner.rb +362 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +9 -0
- data/openapi.yaml +205 -4
- data/spec/api/ad_campaigns_api_spec.rb +30 -0
- data/spec/models/ad_keyword_quality_spec.rb +66 -0
- data/spec/models/ad_keyword_spec.rb +6 -0
- data/spec/models/ad_schedule_window_spec.rb +90 -0
- data/spec/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner_spec.rb +64 -0
- data/spec/models/get_campaign_ad_schedule200_response_performance_by_hour_inner_spec.rb +60 -0
- data/spec/models/get_campaign_ad_schedule200_response_performance_spec.rb +48 -0
- data/spec/models/get_campaign_ad_schedule200_response_spec.rb +66 -0
- 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/update_campaign_ad_schedule200_response_spec.rb +48 -0
- data/spec/models/update_campaign_ad_schedule_request_schedule_inner_spec.rb +78 -0
- data/spec/models/update_campaign_ad_schedule_request_spec.rb +36 -0
- data/zernio-sdk-0.0.951.gem +0 -0
- metadata +38 -2
- data/zernio-sdk-0.0.949.gem +0 -0
data/lib/zernio-sdk/models/get_campaign_ad_schedule200_response_performance_by_day_of_week_inner.rb
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
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 GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner < ApiModelBase
|
|
18
|
+
attr_accessor :day_of_week
|
|
19
|
+
|
|
20
|
+
attr_accessor :impressions
|
|
21
|
+
|
|
22
|
+
attr_accessor :clicks
|
|
23
|
+
|
|
24
|
+
# Account currency, not USD-normalized.
|
|
25
|
+
attr_accessor :cost
|
|
26
|
+
|
|
27
|
+
attr_accessor :conversions
|
|
28
|
+
|
|
29
|
+
class EnumAttributeValidator
|
|
30
|
+
attr_reader :datatype
|
|
31
|
+
attr_reader :allowable_values
|
|
32
|
+
|
|
33
|
+
def initialize(datatype, allowable_values)
|
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
|
35
|
+
case datatype.to_s
|
|
36
|
+
when /Integer/i
|
|
37
|
+
value.to_i
|
|
38
|
+
when /Float/i
|
|
39
|
+
value.to_f
|
|
40
|
+
else
|
|
41
|
+
value
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def valid?(value)
|
|
47
|
+
!value || allowable_values.include?(value)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
|
+
def self.attribute_map
|
|
53
|
+
{
|
|
54
|
+
:'day_of_week' => :'dayOfWeek',
|
|
55
|
+
:'impressions' => :'impressions',
|
|
56
|
+
:'clicks' => :'clicks',
|
|
57
|
+
:'cost' => :'cost',
|
|
58
|
+
:'conversions' => :'conversions'
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Returns attribute mapping this model knows about
|
|
63
|
+
def self.acceptable_attribute_map
|
|
64
|
+
attribute_map
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Returns all the JSON keys this model knows about
|
|
68
|
+
def self.acceptable_attributes
|
|
69
|
+
acceptable_attribute_map.values
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Attribute type mapping.
|
|
73
|
+
def self.openapi_types
|
|
74
|
+
{
|
|
75
|
+
:'day_of_week' => :'String',
|
|
76
|
+
:'impressions' => :'Integer',
|
|
77
|
+
:'clicks' => :'Integer',
|
|
78
|
+
:'cost' => :'Float',
|
|
79
|
+
:'conversions' => :'Float'
|
|
80
|
+
}
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List of attributes with nullable: true
|
|
84
|
+
def self.openapi_nullable
|
|
85
|
+
Set.new([
|
|
86
|
+
])
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Initializes the object
|
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
91
|
+
def initialize(attributes = {})
|
|
92
|
+
if (!attributes.is_a?(Hash))
|
|
93
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner` initialize method"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
97
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
98
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
99
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetCampaignAdSchedule200ResponsePerformanceByDayOfWeekInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
101
|
+
end
|
|
102
|
+
h[k.to_sym] = v
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'day_of_week')
|
|
106
|
+
self.day_of_week = attributes[:'day_of_week']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'impressions')
|
|
110
|
+
self.impressions = attributes[:'impressions']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'clicks')
|
|
114
|
+
self.clicks = attributes[:'clicks']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'cost')
|
|
118
|
+
self.cost = attributes[:'cost']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'conversions')
|
|
122
|
+
self.conversions = attributes[:'conversions']
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
|
+
# @return Array for valid properties with the reasons
|
|
128
|
+
def list_invalid_properties
|
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
130
|
+
invalid_properties = Array.new
|
|
131
|
+
invalid_properties
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Check to see if the all the properties in the model are valid
|
|
135
|
+
# @return true if the model is valid
|
|
136
|
+
def valid?
|
|
137
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
138
|
+
day_of_week_validator = EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
|
|
139
|
+
return false unless day_of_week_validator.valid?(@day_of_week)
|
|
140
|
+
true
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
144
|
+
# @param [Object] day_of_week Object to be assigned
|
|
145
|
+
def day_of_week=(day_of_week)
|
|
146
|
+
validator = EnumAttributeValidator.new('String', ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"])
|
|
147
|
+
unless validator.valid?(day_of_week)
|
|
148
|
+
fail ArgumentError, "invalid value for \"day_of_week\", must be one of #{validator.allowable_values}."
|
|
149
|
+
end
|
|
150
|
+
@day_of_week = day_of_week
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Checks equality by comparing each attribute.
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def ==(o)
|
|
156
|
+
return true if self.equal?(o)
|
|
157
|
+
self.class == o.class &&
|
|
158
|
+
day_of_week == o.day_of_week &&
|
|
159
|
+
impressions == o.impressions &&
|
|
160
|
+
clicks == o.clicks &&
|
|
161
|
+
cost == o.cost &&
|
|
162
|
+
conversions == o.conversions
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# @see the `==` method
|
|
166
|
+
# @param [Object] Object to be compared
|
|
167
|
+
def eql?(o)
|
|
168
|
+
self == o
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Calculates hash code according to all attributes.
|
|
172
|
+
# @return [Integer] Hash code
|
|
173
|
+
def hash
|
|
174
|
+
[day_of_week, impressions, clicks, cost, conversions].hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Builds the object from hash
|
|
178
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
179
|
+
# @return [Object] Returns the model itself
|
|
180
|
+
def self.build_from_hash(attributes)
|
|
181
|
+
return nil unless attributes.is_a?(Hash)
|
|
182
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
183
|
+
transformed_hash = {}
|
|
184
|
+
openapi_types.each_pair do |key, type|
|
|
185
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = nil
|
|
187
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
188
|
+
# check to ensure the input is an array given that the attribute
|
|
189
|
+
# is documented as an array but the input is not
|
|
190
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
191
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
192
|
+
end
|
|
193
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
new(transformed_hash)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the object in the form of hash
|
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
|
202
|
+
def to_hash
|
|
203
|
+
hash = {}
|
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
205
|
+
value = self.send(attr)
|
|
206
|
+
if value.nil?
|
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
hash[param] = _to_hash(value)
|
|
212
|
+
end
|
|
213
|
+
hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
@@ -0,0 +1,212 @@
|
|
|
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 GetCampaignAdSchedule200ResponsePerformanceByHourInner < ApiModelBase
|
|
18
|
+
attr_accessor :hour
|
|
19
|
+
|
|
20
|
+
attr_accessor :impressions
|
|
21
|
+
|
|
22
|
+
attr_accessor :clicks
|
|
23
|
+
|
|
24
|
+
# Account currency, not USD-normalized.
|
|
25
|
+
attr_accessor :cost
|
|
26
|
+
|
|
27
|
+
attr_accessor :conversions
|
|
28
|
+
|
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
|
+
def self.attribute_map
|
|
31
|
+
{
|
|
32
|
+
:'hour' => :'hour',
|
|
33
|
+
:'impressions' => :'impressions',
|
|
34
|
+
:'clicks' => :'clicks',
|
|
35
|
+
:'cost' => :'cost',
|
|
36
|
+
:'conversions' => :'conversions'
|
|
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
|
+
:'hour' => :'Integer',
|
|
54
|
+
:'impressions' => :'Integer',
|
|
55
|
+
:'clicks' => :'Integer',
|
|
56
|
+
:'cost' => :'Float',
|
|
57
|
+
:'conversions' => :'Float'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetCampaignAdSchedule200ResponsePerformanceByHourInner` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetCampaignAdSchedule200ResponsePerformanceByHourInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'hour')
|
|
84
|
+
self.hour = attributes[:'hour']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'impressions')
|
|
88
|
+
self.impressions = attributes[:'impressions']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'clicks')
|
|
92
|
+
self.clicks = attributes[:'clicks']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'cost')
|
|
96
|
+
self.cost = attributes[:'cost']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'conversions')
|
|
100
|
+
self.conversions = attributes[:'conversions']
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
|
+
# @return Array for valid properties with the reasons
|
|
106
|
+
def list_invalid_properties
|
|
107
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
108
|
+
invalid_properties = Array.new
|
|
109
|
+
if !@hour.nil? && @hour > 23
|
|
110
|
+
invalid_properties.push('invalid value for "hour", must be smaller than or equal to 23.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if !@hour.nil? && @hour < 0
|
|
114
|
+
invalid_properties.push('invalid value for "hour", must be greater than or equal to 0.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
invalid_properties
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Check to see if the all the properties in the model are valid
|
|
121
|
+
# @return true if the model is valid
|
|
122
|
+
def valid?
|
|
123
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
124
|
+
return false if !@hour.nil? && @hour > 23
|
|
125
|
+
return false if !@hour.nil? && @hour < 0
|
|
126
|
+
true
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] hour Value to be assigned
|
|
131
|
+
def hour=(hour)
|
|
132
|
+
if hour.nil?
|
|
133
|
+
fail ArgumentError, 'hour cannot be nil'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if hour > 23
|
|
137
|
+
fail ArgumentError, 'invalid value for "hour", must be smaller than or equal to 23.'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if hour < 0
|
|
141
|
+
fail ArgumentError, 'invalid value for "hour", must be greater than or equal to 0.'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
@hour = hour
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Checks equality by comparing each attribute.
|
|
148
|
+
# @param [Object] Object to be compared
|
|
149
|
+
def ==(o)
|
|
150
|
+
return true if self.equal?(o)
|
|
151
|
+
self.class == o.class &&
|
|
152
|
+
hour == o.hour &&
|
|
153
|
+
impressions == o.impressions &&
|
|
154
|
+
clicks == o.clicks &&
|
|
155
|
+
cost == o.cost &&
|
|
156
|
+
conversions == o.conversions
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# @see the `==` method
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def eql?(o)
|
|
162
|
+
self == o
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Calculates hash code according to all attributes.
|
|
166
|
+
# @return [Integer] Hash code
|
|
167
|
+
def hash
|
|
168
|
+
[hour, impressions, clicks, cost, conversions].hash
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Builds the object from hash
|
|
172
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
173
|
+
# @return [Object] Returns the model itself
|
|
174
|
+
def self.build_from_hash(attributes)
|
|
175
|
+
return nil unless attributes.is_a?(Hash)
|
|
176
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
177
|
+
transformed_hash = {}
|
|
178
|
+
openapi_types.each_pair do |key, type|
|
|
179
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
180
|
+
transformed_hash["#{key}"] = nil
|
|
181
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
182
|
+
# check to ensure the input is an array given that the attribute
|
|
183
|
+
# is documented as an array but the input is not
|
|
184
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
185
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
186
|
+
end
|
|
187
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
188
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
new(transformed_hash)
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Returns the object in the form of hash
|
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
|
196
|
+
def to_hash
|
|
197
|
+
hash = {}
|
|
198
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
199
|
+
value = self.send(attr)
|
|
200
|
+
if value.nil?
|
|
201
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
202
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
hash[param] = _to_hash(value)
|
|
206
|
+
end
|
|
207
|
+
hash
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
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
|
|
@@ -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.
|