late-sdk 0.0.781 → 0.0.783
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/ConnectApi.md +80 -0
- data/docs/GetYoutubeCaptions200Response.md +38 -0
- data/docs/GetYoutubeCaptions200ResponseAvailableTracksInner.md +24 -0
- data/docs/GetYoutubeCaptions200ResponseCuesInner.md +22 -0
- data/docs/UsageApi.md +8 -2
- data/docs/UsageAttributionGroup.md +22 -0
- data/docs/UsageAttributionSlice.md +20 -0
- data/docs/UsageAttributionSliceByProduct.md +34 -0
- data/docs/UsageMetering.md +5 -1
- data/docs/UsageMeteringAttribution.md +26 -0
- data/docs/UsageMeteringScope.md +49 -0
- data/docs/UsageMeteringScopeOneOf.md +18 -0
- data/lib/zernio-sdk/api/connect_api.rb +83 -0
- data/lib/zernio-sdk/api/usage_api.rb +15 -2
- data/lib/zernio-sdk/models/get_youtube_captions200_response.rb +296 -0
- data/lib/zernio-sdk/models/get_youtube_captions200_response_available_tracks_inner.rb +209 -0
- data/lib/zernio-sdk/models/get_youtube_captions200_response_cues_inner.rb +166 -0
- data/lib/zernio-sdk/models/usage_attribution_group.rb +190 -0
- data/lib/zernio-sdk/models/usage_attribution_slice.rb +156 -0
- data/lib/zernio-sdk/models/usage_attribution_slice_by_product.rb +220 -0
- data/lib/zernio-sdk/models/usage_metering.rb +22 -4
- data/lib/zernio-sdk/models/usage_metering_attribution.rb +223 -0
- data/lib/zernio-sdk/models/usage_metering_call_usage.rb +1 -1
- data/lib/zernio-sdk/models/usage_metering_peaks.rb +1 -1
- data/lib/zernio-sdk/models/usage_metering_scope.rb +105 -0
- data/lib/zernio-sdk/models/usage_metering_scope_one_of.rb +164 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +9 -0
- data/openapi.yaml +206 -4
- data/spec/api/connect_api_spec.rb +16 -0
- data/spec/api/usage_api_spec.rb +4 -1
- data/spec/models/get_youtube_captions200_response_available_tracks_inner_spec.rb +58 -0
- data/spec/models/get_youtube_captions200_response_cues_inner_spec.rb +48 -0
- data/spec/models/get_youtube_captions200_response_spec.rb +104 -0
- data/spec/models/usage_attribution_group_spec.rb +48 -0
- data/spec/models/usage_attribution_slice_by_product_spec.rb +84 -0
- data/spec/models/usage_attribution_slice_spec.rb +42 -0
- data/spec/models/usage_metering_attribution_spec.rb +64 -0
- data/spec/models/usage_metering_scope_one_of_spec.rb +36 -0
- data/spec/models/usage_metering_scope_spec.rb +32 -0
- data/spec/models/usage_metering_spec.rb +12 -0
- data/zernio-sdk-0.0.783.gem +0 -0
- metadata +39 -3
- data/zernio-sdk-0.0.781.gem +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
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 GetYoutubeCaptions200Response < ApiModelBase
|
|
18
|
+
attr_accessor :account_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :video_id
|
|
21
|
+
|
|
22
|
+
# The language of the returned track.
|
|
23
|
+
attr_accessor :language
|
|
24
|
+
|
|
25
|
+
# YouTube's own caption track id.
|
|
26
|
+
attr_accessor :track_id
|
|
27
|
+
|
|
28
|
+
# `asr` is YouTube's auto-generated track; `standard` was uploaded by the channel.
|
|
29
|
+
attr_accessor :track_kind
|
|
30
|
+
|
|
31
|
+
# `cache` when served from our stored copy, `youtube` when this call spent the quota units.
|
|
32
|
+
attr_accessor :source
|
|
33
|
+
|
|
34
|
+
# When the stored copy was downloaded from YouTube.
|
|
35
|
+
attr_accessor :fetched_at
|
|
36
|
+
|
|
37
|
+
# The whole transcript as one paragraph, no timings.
|
|
38
|
+
attr_accessor :text
|
|
39
|
+
|
|
40
|
+
# Timed cues. Present when format is json. Auto-generated cues overlap in time by design (captions roll), so `start` can precede the previous cue's `end`.
|
|
41
|
+
attr_accessor :cues
|
|
42
|
+
|
|
43
|
+
# Raw SubRip body. Present when format is srt.
|
|
44
|
+
attr_accessor :srt
|
|
45
|
+
|
|
46
|
+
# Every track on the video, so you can re-request another language. On a cached read this is the listing as it stood when we downloaded, so a language added to the video since then appears only after a `refresh=true` or when you request that language directly.
|
|
47
|
+
attr_accessor :available_tracks
|
|
48
|
+
|
|
49
|
+
class EnumAttributeValidator
|
|
50
|
+
attr_reader :datatype
|
|
51
|
+
attr_reader :allowable_values
|
|
52
|
+
|
|
53
|
+
def initialize(datatype, allowable_values)
|
|
54
|
+
@allowable_values = allowable_values.map do |value|
|
|
55
|
+
case datatype.to_s
|
|
56
|
+
when /Integer/i
|
|
57
|
+
value.to_i
|
|
58
|
+
when /Float/i
|
|
59
|
+
value.to_f
|
|
60
|
+
else
|
|
61
|
+
value
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def valid?(value)
|
|
67
|
+
!value || allowable_values.include?(value)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
72
|
+
def self.attribute_map
|
|
73
|
+
{
|
|
74
|
+
:'account_id' => :'accountId',
|
|
75
|
+
:'video_id' => :'videoId',
|
|
76
|
+
:'language' => :'language',
|
|
77
|
+
:'track_id' => :'trackId',
|
|
78
|
+
:'track_kind' => :'trackKind',
|
|
79
|
+
:'source' => :'source',
|
|
80
|
+
:'fetched_at' => :'fetchedAt',
|
|
81
|
+
:'text' => :'text',
|
|
82
|
+
:'cues' => :'cues',
|
|
83
|
+
:'srt' => :'srt',
|
|
84
|
+
:'available_tracks' => :'availableTracks'
|
|
85
|
+
}
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Returns attribute mapping this model knows about
|
|
89
|
+
def self.acceptable_attribute_map
|
|
90
|
+
attribute_map
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Returns all the JSON keys this model knows about
|
|
94
|
+
def self.acceptable_attributes
|
|
95
|
+
acceptable_attribute_map.values
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Attribute type mapping.
|
|
99
|
+
def self.openapi_types
|
|
100
|
+
{
|
|
101
|
+
:'account_id' => :'String',
|
|
102
|
+
:'video_id' => :'String',
|
|
103
|
+
:'language' => :'String',
|
|
104
|
+
:'track_id' => :'String',
|
|
105
|
+
:'track_kind' => :'String',
|
|
106
|
+
:'source' => :'String',
|
|
107
|
+
:'fetched_at' => :'Time',
|
|
108
|
+
:'text' => :'String',
|
|
109
|
+
:'cues' => :'Array<GetYoutubeCaptions200ResponseCuesInner>',
|
|
110
|
+
:'srt' => :'String',
|
|
111
|
+
:'available_tracks' => :'Array<GetYoutubeCaptions200ResponseAvailableTracksInner>'
|
|
112
|
+
}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# List of attributes with nullable: true
|
|
116
|
+
def self.openapi_nullable
|
|
117
|
+
Set.new([
|
|
118
|
+
])
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Initializes the object
|
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
|
+
def initialize(attributes = {})
|
|
124
|
+
if (!attributes.is_a?(Hash))
|
|
125
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetYoutubeCaptions200Response` initialize method"
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
129
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
130
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
131
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
132
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetYoutubeCaptions200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
133
|
+
end
|
|
134
|
+
h[k.to_sym] = v
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'account_id')
|
|
138
|
+
self.account_id = attributes[:'account_id']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'video_id')
|
|
142
|
+
self.video_id = attributes[:'video_id']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'language')
|
|
146
|
+
self.language = attributes[:'language']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'track_id')
|
|
150
|
+
self.track_id = attributes[:'track_id']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'track_kind')
|
|
154
|
+
self.track_kind = attributes[:'track_kind']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'source')
|
|
158
|
+
self.source = attributes[:'source']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'fetched_at')
|
|
162
|
+
self.fetched_at = attributes[:'fetched_at']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'text')
|
|
166
|
+
self.text = attributes[:'text']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'cues')
|
|
170
|
+
if (value = attributes[:'cues']).is_a?(Array)
|
|
171
|
+
self.cues = value
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'srt')
|
|
176
|
+
self.srt = attributes[:'srt']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'available_tracks')
|
|
180
|
+
if (value = attributes[:'available_tracks']).is_a?(Array)
|
|
181
|
+
self.available_tracks = value
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
187
|
+
# @return Array for valid properties with the reasons
|
|
188
|
+
def list_invalid_properties
|
|
189
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
190
|
+
invalid_properties = Array.new
|
|
191
|
+
invalid_properties
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Check to see if the all the properties in the model are valid
|
|
195
|
+
# @return true if the model is valid
|
|
196
|
+
def valid?
|
|
197
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
198
|
+
track_kind_validator = EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
199
|
+
return false unless track_kind_validator.valid?(@track_kind)
|
|
200
|
+
source_validator = EnumAttributeValidator.new('String', ["cache", "youtube"])
|
|
201
|
+
return false unless source_validator.valid?(@source)
|
|
202
|
+
true
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
206
|
+
# @param [Object] track_kind Object to be assigned
|
|
207
|
+
def track_kind=(track_kind)
|
|
208
|
+
validator = EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
209
|
+
unless validator.valid?(track_kind)
|
|
210
|
+
fail ArgumentError, "invalid value for \"track_kind\", must be one of #{validator.allowable_values}."
|
|
211
|
+
end
|
|
212
|
+
@track_kind = track_kind
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
216
|
+
# @param [Object] source Object to be assigned
|
|
217
|
+
def source=(source)
|
|
218
|
+
validator = EnumAttributeValidator.new('String', ["cache", "youtube"])
|
|
219
|
+
unless validator.valid?(source)
|
|
220
|
+
fail ArgumentError, "invalid value for \"source\", must be one of #{validator.allowable_values}."
|
|
221
|
+
end
|
|
222
|
+
@source = source
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Checks equality by comparing each attribute.
|
|
226
|
+
# @param [Object] Object to be compared
|
|
227
|
+
def ==(o)
|
|
228
|
+
return true if self.equal?(o)
|
|
229
|
+
self.class == o.class &&
|
|
230
|
+
account_id == o.account_id &&
|
|
231
|
+
video_id == o.video_id &&
|
|
232
|
+
language == o.language &&
|
|
233
|
+
track_id == o.track_id &&
|
|
234
|
+
track_kind == o.track_kind &&
|
|
235
|
+
source == o.source &&
|
|
236
|
+
fetched_at == o.fetched_at &&
|
|
237
|
+
text == o.text &&
|
|
238
|
+
cues == o.cues &&
|
|
239
|
+
srt == o.srt &&
|
|
240
|
+
available_tracks == o.available_tracks
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# @see the `==` method
|
|
244
|
+
# @param [Object] Object to be compared
|
|
245
|
+
def eql?(o)
|
|
246
|
+
self == o
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Calculates hash code according to all attributes.
|
|
250
|
+
# @return [Integer] Hash code
|
|
251
|
+
def hash
|
|
252
|
+
[account_id, video_id, language, track_id, track_kind, source, fetched_at, text, cues, srt, available_tracks].hash
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Builds the object from hash
|
|
256
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
257
|
+
# @return [Object] Returns the model itself
|
|
258
|
+
def self.build_from_hash(attributes)
|
|
259
|
+
return nil unless attributes.is_a?(Hash)
|
|
260
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
261
|
+
transformed_hash = {}
|
|
262
|
+
openapi_types.each_pair do |key, type|
|
|
263
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
264
|
+
transformed_hash["#{key}"] = nil
|
|
265
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
266
|
+
# check to ensure the input is an array given that the attribute
|
|
267
|
+
# is documented as an array but the input is not
|
|
268
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
269
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
270
|
+
end
|
|
271
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
272
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
new(transformed_hash)
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Returns the object in the form of hash
|
|
279
|
+
# @return [Hash] Returns the object in the form of hash
|
|
280
|
+
def to_hash
|
|
281
|
+
hash = {}
|
|
282
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
283
|
+
value = self.send(attr)
|
|
284
|
+
if value.nil?
|
|
285
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
286
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
hash[param] = _to_hash(value)
|
|
290
|
+
end
|
|
291
|
+
hash
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
end
|
|
@@ -0,0 +1,209 @@
|
|
|
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 GetYoutubeCaptions200ResponseAvailableTracksInner < ApiModelBase
|
|
18
|
+
attr_accessor :track_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :language
|
|
21
|
+
|
|
22
|
+
attr_accessor :track_kind
|
|
23
|
+
|
|
24
|
+
# The track's display name. Empty for auto-generated tracks.
|
|
25
|
+
attr_accessor :name
|
|
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
|
+
:'track_id' => :'trackId',
|
|
53
|
+
:'language' => :'language',
|
|
54
|
+
:'track_kind' => :'trackKind',
|
|
55
|
+
:'name' => :'name'
|
|
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
|
+
:'track_id' => :'String',
|
|
73
|
+
:'language' => :'String',
|
|
74
|
+
:'track_kind' => :'String',
|
|
75
|
+
:'name' => :'String'
|
|
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::GetYoutubeCaptions200ResponseAvailableTracksInner` 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::GetYoutubeCaptions200ResponseAvailableTracksInner`. 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?(:'track_id')
|
|
102
|
+
self.track_id = attributes[:'track_id']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'language')
|
|
106
|
+
self.language = attributes[:'language']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'track_kind')
|
|
110
|
+
self.track_kind = attributes[:'track_kind']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'name')
|
|
114
|
+
self.name = attributes[:'name']
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
120
|
+
def list_invalid_properties
|
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
122
|
+
invalid_properties = Array.new
|
|
123
|
+
invalid_properties
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Check to see if the all the properties in the model are valid
|
|
127
|
+
# @return true if the model is valid
|
|
128
|
+
def valid?
|
|
129
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
130
|
+
track_kind_validator = EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
131
|
+
return false unless track_kind_validator.valid?(@track_kind)
|
|
132
|
+
true
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
136
|
+
# @param [Object] track_kind Object to be assigned
|
|
137
|
+
def track_kind=(track_kind)
|
|
138
|
+
validator = EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
139
|
+
unless validator.valid?(track_kind)
|
|
140
|
+
fail ArgumentError, "invalid value for \"track_kind\", must be one of #{validator.allowable_values}."
|
|
141
|
+
end
|
|
142
|
+
@track_kind = track_kind
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Checks equality by comparing each attribute.
|
|
146
|
+
# @param [Object] Object to be compared
|
|
147
|
+
def ==(o)
|
|
148
|
+
return true if self.equal?(o)
|
|
149
|
+
self.class == o.class &&
|
|
150
|
+
track_id == o.track_id &&
|
|
151
|
+
language == o.language &&
|
|
152
|
+
track_kind == o.track_kind &&
|
|
153
|
+
name == o.name
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# @see the `==` method
|
|
157
|
+
# @param [Object] Object to be compared
|
|
158
|
+
def eql?(o)
|
|
159
|
+
self == o
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Calculates hash code according to all attributes.
|
|
163
|
+
# @return [Integer] Hash code
|
|
164
|
+
def hash
|
|
165
|
+
[track_id, language, track_kind, name].hash
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Builds the object from hash
|
|
169
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
170
|
+
# @return [Object] Returns the model itself
|
|
171
|
+
def self.build_from_hash(attributes)
|
|
172
|
+
return nil unless attributes.is_a?(Hash)
|
|
173
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
174
|
+
transformed_hash = {}
|
|
175
|
+
openapi_types.each_pair do |key, type|
|
|
176
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
177
|
+
transformed_hash["#{key}"] = nil
|
|
178
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
179
|
+
# check to ensure the input is an array given that the attribute
|
|
180
|
+
# is documented as an array but the input is not
|
|
181
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
182
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
183
|
+
end
|
|
184
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
185
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
new(transformed_hash)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Returns the object in the form of hash
|
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
|
193
|
+
def to_hash
|
|
194
|
+
hash = {}
|
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
196
|
+
value = self.send(attr)
|
|
197
|
+
if value.nil?
|
|
198
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
199
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
hash[param] = _to_hash(value)
|
|
203
|
+
end
|
|
204
|
+
hash
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
end
|
|
@@ -0,0 +1,166 @@
|
|
|
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 GetYoutubeCaptions200ResponseCuesInner < ApiModelBase
|
|
18
|
+
# Seconds from the start of the video.
|
|
19
|
+
attr_accessor :start
|
|
20
|
+
|
|
21
|
+
attr_accessor :_end
|
|
22
|
+
|
|
23
|
+
attr_accessor :text
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'start' => :'start',
|
|
29
|
+
:'_end' => :'end',
|
|
30
|
+
:'text' => :'text'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns attribute mapping this model knows about
|
|
35
|
+
def self.acceptable_attribute_map
|
|
36
|
+
attribute_map
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns all the JSON keys this model knows about
|
|
40
|
+
def self.acceptable_attributes
|
|
41
|
+
acceptable_attribute_map.values
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Attribute type mapping.
|
|
45
|
+
def self.openapi_types
|
|
46
|
+
{
|
|
47
|
+
:'start' => :'Float',
|
|
48
|
+
:'_end' => :'Float',
|
|
49
|
+
:'text' => :'String'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# List of attributes with nullable: true
|
|
54
|
+
def self.openapi_nullable
|
|
55
|
+
Set.new([
|
|
56
|
+
])
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Initializes the object
|
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
61
|
+
def initialize(attributes = {})
|
|
62
|
+
if (!attributes.is_a?(Hash))
|
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetYoutubeCaptions200ResponseCuesInner` initialize method"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
67
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
69
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetYoutubeCaptions200ResponseCuesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
71
|
+
end
|
|
72
|
+
h[k.to_sym] = v
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:'start')
|
|
76
|
+
self.start = attributes[:'start']
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'_end')
|
|
80
|
+
self._end = attributes[:'_end']
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'text')
|
|
84
|
+
self.text = attributes[:'text']
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
89
|
+
# @return Array for valid properties with the reasons
|
|
90
|
+
def list_invalid_properties
|
|
91
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
92
|
+
invalid_properties = Array.new
|
|
93
|
+
invalid_properties
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Check to see if the all the properties in the model are valid
|
|
97
|
+
# @return true if the model is valid
|
|
98
|
+
def valid?
|
|
99
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
start == o.start &&
|
|
109
|
+
_end == o._end &&
|
|
110
|
+
text == o.text
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see the `==` method
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def eql?(o)
|
|
116
|
+
self == o
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Calculates hash code according to all attributes.
|
|
120
|
+
# @return [Integer] Hash code
|
|
121
|
+
def hash
|
|
122
|
+
[start, _end, text].hash
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Builds the object from hash
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
# @return [Object] Returns the model itself
|
|
128
|
+
def self.build_from_hash(attributes)
|
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
131
|
+
transformed_hash = {}
|
|
132
|
+
openapi_types.each_pair do |key, type|
|
|
133
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = nil
|
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
136
|
+
# check to ensure the input is an array given that the attribute
|
|
137
|
+
# is documented as an array but the input is not
|
|
138
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
139
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
140
|
+
end
|
|
141
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
new(transformed_hash)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Returns the object in the form of hash
|
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
|
150
|
+
def to_hash
|
|
151
|
+
hash = {}
|
|
152
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
153
|
+
value = self.send(attr)
|
|
154
|
+
if value.nil?
|
|
155
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
156
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
hash[param] = _to_hash(value)
|
|
160
|
+
end
|
|
161
|
+
hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
end
|