google-apis-youtube_v3 0.1.0

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.
@@ -0,0 +1,3896 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module YoutubeV3
23
+ # YouTube Data API v3
24
+ #
25
+ # The YouTube Data API v3 is an API that provides access to YouTube data, such
26
+ # as videos, playlists, and channels.
27
+ #
28
+ # @example
29
+ # require 'google/apis/youtube_v3'
30
+ #
31
+ # Youtube = Google::Apis::YoutubeV3 # Alias the module
32
+ # service = Youtube::YouTubeService.new
33
+ #
34
+ # @see https://developers.google.com/youtube/
35
+ class YouTubeService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://youtube.googleapis.com/', '',
48
+ client_name: 'google-apis-youtube_v3',
49
+ client_version: Google::Apis::YoutubeV3::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Inserts a new resource into this collection.
54
+ # @param [Array<String>, String] part
55
+ # The *part* parameter serves two purposes in this operation. It identifies the
56
+ # properties that the write operation will set as well as the properties that
57
+ # the API response will include.
58
+ # @param [Google::Apis::YoutubeV3::AbuseReport] abuse_report_object
59
+ # @param [String] fields
60
+ # Selector specifying which fields to include in a partial response.
61
+ # @param [String] quota_user
62
+ # Available to use for quota purposes for server-side applications. Can be any
63
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
64
+ # @param [Google::Apis::RequestOptions] options
65
+ # Request-specific options
66
+ #
67
+ # @yield [result, err] Result & error if block supplied
68
+ # @yieldparam result [Google::Apis::YoutubeV3::AbuseReport] parsed result object
69
+ # @yieldparam err [StandardError] error object if request failed
70
+ #
71
+ # @return [Google::Apis::YoutubeV3::AbuseReport]
72
+ #
73
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
74
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
75
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
76
+ def insert_abuse_report(part, abuse_report_object = nil, fields: nil, quota_user: nil, options: nil, &block)
77
+ command = make_simple_command(:post, 'youtube/v3/abuseReports', options)
78
+ command.request_representation = Google::Apis::YoutubeV3::AbuseReport::Representation
79
+ command.request_object = abuse_report_object
80
+ command.response_representation = Google::Apis::YoutubeV3::AbuseReport::Representation
81
+ command.response_class = Google::Apis::YoutubeV3::AbuseReport
82
+ command.query['part'] = part unless part.nil?
83
+ command.query['fields'] = fields unless fields.nil?
84
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ execute_or_queue_command(command, &block)
86
+ end
87
+
88
+ # Retrieves a list of resources, possibly filtered.
89
+ # @param [Array<String>, String] part
90
+ # The *part* parameter specifies a comma-separated list of one or more activity
91
+ # resource properties that the API response will include. If the parameter
92
+ # identifies a property that contains child properties, the child properties
93
+ # will be included in the response. For example, in an activity resource, the
94
+ # snippet property contains other properties that identify the type of activity,
95
+ # a display title for the activity, and so forth. If you set *part=snippet*, the
96
+ # API response will also contain all of those nested properties.
97
+ # @param [String] channel_id
98
+ # @param [Boolean] home
99
+ # @param [Fixnum] max_results
100
+ # The *maxResults* parameter specifies the maximum number of items that should
101
+ # be returned in the result set.
102
+ # @param [Boolean] mine
103
+ # @param [String] page_token
104
+ # The *pageToken* parameter identifies a specific page in the result set that
105
+ # should be returned. In an API response, the nextPageToken and prevPageToken
106
+ # properties identify other pages that could be retrieved.
107
+ # @param [String] published_after
108
+ # @param [String] published_before
109
+ # @param [String] region_code
110
+ # @param [String] fields
111
+ # Selector specifying which fields to include in a partial response.
112
+ # @param [String] quota_user
113
+ # Available to use for quota purposes for server-side applications. Can be any
114
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
115
+ # @param [Google::Apis::RequestOptions] options
116
+ # Request-specific options
117
+ #
118
+ # @yield [result, err] Result & error if block supplied
119
+ # @yieldparam result [Google::Apis::YoutubeV3::ListActivitiesResponse] parsed result object
120
+ # @yieldparam err [StandardError] error object if request failed
121
+ #
122
+ # @return [Google::Apis::YoutubeV3::ListActivitiesResponse]
123
+ #
124
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
125
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
126
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
127
+ def list_activities(part, channel_id: nil, home: nil, max_results: nil, mine: nil, page_token: nil, published_after: nil, published_before: nil, region_code: nil, fields: nil, quota_user: nil, options: nil, &block)
128
+ command = make_simple_command(:get, 'youtube/v3/activities', options)
129
+ command.response_representation = Google::Apis::YoutubeV3::ListActivitiesResponse::Representation
130
+ command.response_class = Google::Apis::YoutubeV3::ListActivitiesResponse
131
+ command.query['channelId'] = channel_id unless channel_id.nil?
132
+ command.query['home'] = home unless home.nil?
133
+ command.query['maxResults'] = max_results unless max_results.nil?
134
+ command.query['mine'] = mine unless mine.nil?
135
+ command.query['pageToken'] = page_token unless page_token.nil?
136
+ command.query['part'] = part unless part.nil?
137
+ command.query['publishedAfter'] = published_after unless published_after.nil?
138
+ command.query['publishedBefore'] = published_before unless published_before.nil?
139
+ command.query['regionCode'] = region_code unless region_code.nil?
140
+ command.query['fields'] = fields unless fields.nil?
141
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
142
+ execute_or_queue_command(command, &block)
143
+ end
144
+
145
+ # Deletes a resource.
146
+ # @param [String] id
147
+ # @param [String] on_behalf_of
148
+ # ID of the Google+ Page for the channel that the request is be on behalf of
149
+ # @param [String] on_behalf_of_content_owner
150
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
151
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
152
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
153
+ # of the content owner specified in the parameter value. This parameter is
154
+ # intended for YouTube content partners that own and manage many different
155
+ # YouTube channels. It allows content owners to authenticate once and get access
156
+ # to all their video and channel data, without having to provide authentication
157
+ # credentials for each individual channel. The actual CMS account that the user
158
+ # authenticates with must be linked to the specified YouTube content owner.
159
+ # @param [String] fields
160
+ # Selector specifying which fields to include in a partial response.
161
+ # @param [String] quota_user
162
+ # Available to use for quota purposes for server-side applications. Can be any
163
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
164
+ # @param [Google::Apis::RequestOptions] options
165
+ # Request-specific options
166
+ #
167
+ # @yield [result, err] Result & error if block supplied
168
+ # @yieldparam result [NilClass] No result returned for this method
169
+ # @yieldparam err [StandardError] error object if request failed
170
+ #
171
+ # @return [void]
172
+ #
173
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
174
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
175
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
176
+ def delete_caption(id, on_behalf_of: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
177
+ command = make_simple_command(:delete, 'youtube/v3/captions', options)
178
+ command.query['id'] = id unless id.nil?
179
+ command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
180
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
181
+ command.query['fields'] = fields unless fields.nil?
182
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
183
+ execute_or_queue_command(command, &block)
184
+ end
185
+
186
+ # Downloads a caption track.
187
+ # @param [String] id
188
+ # The ID of the caption track to download, required for One Platform.
189
+ # @param [String] on_behalf_of
190
+ # ID of the Google+ Page for the channel that the request is be on behalf of
191
+ # @param [String] on_behalf_of_content_owner
192
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
193
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
194
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
195
+ # of the content owner specified in the parameter value. This parameter is
196
+ # intended for YouTube content partners that own and manage many different
197
+ # YouTube channels. It allows content owners to authenticate once and get access
198
+ # to all their video and channel data, without having to provide authentication
199
+ # credentials for each individual channel. The actual CMS account that the user
200
+ # authenticates with must be linked to the specified YouTube content owner.
201
+ # @param [String] tfmt
202
+ # Convert the captions into this format. Supported options are sbv, srt, and vtt.
203
+ # @param [String] tlang
204
+ # tlang is the language code; machine translate the captions into this language.
205
+ # @param [String] fields
206
+ # Selector specifying which fields to include in a partial response.
207
+ # @param [String] quota_user
208
+ # Available to use for quota purposes for server-side applications. Can be any
209
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
210
+ # @param [IO, String] download_dest
211
+ # IO stream or filename to receive content download
212
+ # @param [Google::Apis::RequestOptions] options
213
+ # Request-specific options
214
+ #
215
+ # @yield [result, err] Result & error if block supplied
216
+ # @yieldparam result [NilClass] No result returned for this method
217
+ # @yieldparam err [StandardError] error object if request failed
218
+ #
219
+ # @return [void]
220
+ #
221
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
222
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
223
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
224
+ def download_caption(id, on_behalf_of: nil, on_behalf_of_content_owner: nil, tfmt: nil, tlang: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
225
+ if download_dest.nil?
226
+ command = make_simple_command(:get, 'youtube/v3/captions/{id}', options)
227
+ else
228
+ command = make_download_command(:get, 'youtube/v3/captions/{id}', options)
229
+ command.download_dest = download_dest
230
+ end
231
+ command.params['id'] = id unless id.nil?
232
+ command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
233
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
234
+ command.query['tfmt'] = tfmt unless tfmt.nil?
235
+ command.query['tlang'] = tlang unless tlang.nil?
236
+ command.query['fields'] = fields unless fields.nil?
237
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
238
+ execute_or_queue_command(command, &block)
239
+ end
240
+
241
+ # Inserts a new resource into this collection.
242
+ # @param [Array<String>, String] part
243
+ # The *part* parameter specifies the caption resource parts that the API
244
+ # response will include. Set the parameter value to snippet.
245
+ # @param [Google::Apis::YoutubeV3::Caption] caption_object
246
+ # @param [String] on_behalf_of
247
+ # ID of the Google+ Page for the channel that the request is be on behalf of
248
+ # @param [String] on_behalf_of_content_owner
249
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
250
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
251
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
252
+ # of the content owner specified in the parameter value. This parameter is
253
+ # intended for YouTube content partners that own and manage many different
254
+ # YouTube channels. It allows content owners to authenticate once and get access
255
+ # to all their video and channel data, without having to provide authentication
256
+ # credentials for each individual channel. The actual CMS account that the user
257
+ # authenticates with must be linked to the specified YouTube content owner.
258
+ # @param [Boolean] sync
259
+ # Extra parameter to allow automatically syncing the uploaded caption/transcript
260
+ # with the audio.
261
+ # @param [String] fields
262
+ # Selector specifying which fields to include in a partial response.
263
+ # @param [String] quota_user
264
+ # Available to use for quota purposes for server-side applications. Can be any
265
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
266
+ # @param [IO, String] upload_source
267
+ # IO stream or filename containing content to upload
268
+ # @param [String] content_type
269
+ # Content type of the uploaded content.
270
+ # @param [Google::Apis::RequestOptions] options
271
+ # Request-specific options
272
+ #
273
+ # @yield [result, err] Result & error if block supplied
274
+ # @yieldparam result [Google::Apis::YoutubeV3::Caption] parsed result object
275
+ # @yieldparam err [StandardError] error object if request failed
276
+ #
277
+ # @return [Google::Apis::YoutubeV3::Caption]
278
+ #
279
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
280
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
281
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
282
+ def insert_caption(part, caption_object = nil, on_behalf_of: nil, on_behalf_of_content_owner: nil, sync: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
283
+ if upload_source.nil?
284
+ command = make_simple_command(:post, 'youtube/v3/captions', options)
285
+ else
286
+ command = make_upload_command(:post, 'youtube/v3/captions', options)
287
+ command.upload_source = upload_source
288
+ command.upload_content_type = content_type
289
+ end
290
+ command.request_representation = Google::Apis::YoutubeV3::Caption::Representation
291
+ command.request_object = caption_object
292
+ command.response_representation = Google::Apis::YoutubeV3::Caption::Representation
293
+ command.response_class = Google::Apis::YoutubeV3::Caption
294
+ command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
295
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
296
+ command.query['part'] = part unless part.nil?
297
+ command.query['sync'] = sync unless sync.nil?
298
+ command.query['fields'] = fields unless fields.nil?
299
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
300
+ execute_or_queue_command(command, &block)
301
+ end
302
+
303
+ # Retrieves a list of resources, possibly filtered.
304
+ # @param [Array<String>, String] part
305
+ # The *part* parameter specifies a comma-separated list of one or more caption
306
+ # resource parts that the API response will include. The part names that you can
307
+ # include in the parameter value are id and snippet.
308
+ # @param [String] video_id
309
+ # Returns the captions for the specified video.
310
+ # @param [Array<String>, String] id
311
+ # Returns the captions with the given IDs for Stubby or Apiary.
312
+ # @param [String] on_behalf_of
313
+ # ID of the Google+ Page for the channel that the request is on behalf of.
314
+ # @param [String] on_behalf_of_content_owner
315
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
316
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
317
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
318
+ # of the content owner specified in the parameter value. This parameter is
319
+ # intended for YouTube content partners that own and manage many different
320
+ # YouTube channels. It allows content owners to authenticate once and get access
321
+ # to all their video and channel data, without having to provide authentication
322
+ # credentials for each individual channel. The actual CMS account that the user
323
+ # authenticates with must be linked to the specified YouTube content owner.
324
+ # @param [String] fields
325
+ # Selector specifying which fields to include in a partial response.
326
+ # @param [String] quota_user
327
+ # Available to use for quota purposes for server-side applications. Can be any
328
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
329
+ # @param [Google::Apis::RequestOptions] options
330
+ # Request-specific options
331
+ #
332
+ # @yield [result, err] Result & error if block supplied
333
+ # @yieldparam result [Google::Apis::YoutubeV3::ListCaptionsResponse] parsed result object
334
+ # @yieldparam err [StandardError] error object if request failed
335
+ #
336
+ # @return [Google::Apis::YoutubeV3::ListCaptionsResponse]
337
+ #
338
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
339
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
340
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
341
+ def list_captions(part, video_id, id: nil, on_behalf_of: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
342
+ command = make_simple_command(:get, 'youtube/v3/captions', options)
343
+ command.response_representation = Google::Apis::YoutubeV3::ListCaptionsResponse::Representation
344
+ command.response_class = Google::Apis::YoutubeV3::ListCaptionsResponse
345
+ command.query['id'] = id unless id.nil?
346
+ command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
347
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
348
+ command.query['part'] = part unless part.nil?
349
+ command.query['videoId'] = video_id unless video_id.nil?
350
+ command.query['fields'] = fields unless fields.nil?
351
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
352
+ execute_or_queue_command(command, &block)
353
+ end
354
+
355
+ # Updates an existing resource.
356
+ # @param [Array<String>, String] part
357
+ # The *part* parameter specifies a comma-separated list of one or more caption
358
+ # resource parts that the API response will include. The part names that you can
359
+ # include in the parameter value are id and snippet.
360
+ # @param [Google::Apis::YoutubeV3::Caption] caption_object
361
+ # @param [String] on_behalf_of
362
+ # ID of the Google+ Page for the channel that the request is on behalf of.
363
+ # @param [String] on_behalf_of_content_owner
364
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
365
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
366
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
367
+ # of the content owner specified in the parameter value. This parameter is
368
+ # intended for YouTube content partners that own and manage many different
369
+ # YouTube channels. It allows content owners to authenticate once and get access
370
+ # to all their video and channel data, without having to provide authentication
371
+ # credentials for each individual channel. The actual CMS account that the user
372
+ # authenticates with must be linked to the specified YouTube content owner.
373
+ # @param [Boolean] sync
374
+ # Extra parameter to allow automatically syncing the uploaded caption/transcript
375
+ # with the audio.
376
+ # @param [String] fields
377
+ # Selector specifying which fields to include in a partial response.
378
+ # @param [String] quota_user
379
+ # Available to use for quota purposes for server-side applications. Can be any
380
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
381
+ # @param [IO, String] upload_source
382
+ # IO stream or filename containing content to upload
383
+ # @param [String] content_type
384
+ # Content type of the uploaded content.
385
+ # @param [Google::Apis::RequestOptions] options
386
+ # Request-specific options
387
+ #
388
+ # @yield [result, err] Result & error if block supplied
389
+ # @yieldparam result [Google::Apis::YoutubeV3::Caption] parsed result object
390
+ # @yieldparam err [StandardError] error object if request failed
391
+ #
392
+ # @return [Google::Apis::YoutubeV3::Caption]
393
+ #
394
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
395
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
396
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
397
+ def update_caption(part, caption_object = nil, on_behalf_of: nil, on_behalf_of_content_owner: nil, sync: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
398
+ if upload_source.nil?
399
+ command = make_simple_command(:put, 'youtube/v3/captions', options)
400
+ else
401
+ command = make_upload_command(:put, 'youtube/v3/captions', options)
402
+ command.upload_source = upload_source
403
+ command.upload_content_type = content_type
404
+ end
405
+ command.request_representation = Google::Apis::YoutubeV3::Caption::Representation
406
+ command.request_object = caption_object
407
+ command.response_representation = Google::Apis::YoutubeV3::Caption::Representation
408
+ command.response_class = Google::Apis::YoutubeV3::Caption
409
+ command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
410
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
411
+ command.query['part'] = part unless part.nil?
412
+ command.query['sync'] = sync unless sync.nil?
413
+ command.query['fields'] = fields unless fields.nil?
414
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
415
+ execute_or_queue_command(command, &block)
416
+ end
417
+
418
+ # Inserts a new resource into this collection.
419
+ # @param [Google::Apis::YoutubeV3::ChannelBannerResource] channel_banner_resource_object
420
+ # @param [String] channel_id
421
+ # Unused, channel_id is currently derived from the security context of the
422
+ # requestor.
423
+ # @param [String] on_behalf_of_content_owner
424
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
425
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
426
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
427
+ # of the content owner specified in the parameter value. This parameter is
428
+ # intended for YouTube content partners that own and manage many different
429
+ # YouTube channels. It allows content owners to authenticate once and get access
430
+ # to all their video and channel data, without having to provide authentication
431
+ # credentials for each individual channel. The actual CMS account that the user
432
+ # authenticates with must be linked to the specified YouTube content owner.
433
+ # @param [String] on_behalf_of_content_owner_channel
434
+ # This parameter can only be used in a properly authorized request. *Note:* This
435
+ # parameter is intended exclusively for YouTube content partners. The *
436
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
437
+ # the channel to which a video is being added. This parameter is required when a
438
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
439
+ # only be used in conjunction with that parameter. In addition, the request must
440
+ # be authorized using a CMS account that is linked to the content owner that the
441
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
442
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
443
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
444
+ # parameter is intended for YouTube content partners that own and manage many
445
+ # different YouTube channels. It allows content owners to authenticate once and
446
+ # perform actions on behalf of the channel specified in the parameter value,
447
+ # without having to provide authentication credentials for each separate channel.
448
+ # @param [String] fields
449
+ # Selector specifying which fields to include in a partial response.
450
+ # @param [String] quota_user
451
+ # Available to use for quota purposes for server-side applications. Can be any
452
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
453
+ # @param [IO, String] upload_source
454
+ # IO stream or filename containing content to upload
455
+ # @param [String] content_type
456
+ # Content type of the uploaded content.
457
+ # @param [Google::Apis::RequestOptions] options
458
+ # Request-specific options
459
+ #
460
+ # @yield [result, err] Result & error if block supplied
461
+ # @yieldparam result [Google::Apis::YoutubeV3::ChannelBannerResource] parsed result object
462
+ # @yieldparam err [StandardError] error object if request failed
463
+ #
464
+ # @return [Google::Apis::YoutubeV3::ChannelBannerResource]
465
+ #
466
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
467
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
468
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
469
+ def insert_channel_banner(channel_banner_resource_object = nil, channel_id: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
470
+ if upload_source.nil?
471
+ command = make_simple_command(:post, 'youtube/v3/channelBanners/insert', options)
472
+ else
473
+ command = make_upload_command(:post, 'youtube/v3/channelBanners/insert', options)
474
+ command.upload_source = upload_source
475
+ command.upload_content_type = content_type
476
+ end
477
+ command.request_representation = Google::Apis::YoutubeV3::ChannelBannerResource::Representation
478
+ command.request_object = channel_banner_resource_object
479
+ command.response_representation = Google::Apis::YoutubeV3::ChannelBannerResource::Representation
480
+ command.response_class = Google::Apis::YoutubeV3::ChannelBannerResource
481
+ command.query['channelId'] = channel_id unless channel_id.nil?
482
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
483
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
484
+ command.query['fields'] = fields unless fields.nil?
485
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
486
+ execute_or_queue_command(command, &block)
487
+ end
488
+
489
+ # Deletes a resource.
490
+ # @param [String] id
491
+ # @param [String] on_behalf_of_content_owner
492
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
493
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
494
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
495
+ # of the content owner specified in the parameter value. This parameter is
496
+ # intended for YouTube content partners that own and manage many different
497
+ # YouTube channels. It allows content owners to authenticate once and get access
498
+ # to all their video and channel data, without having to provide authentication
499
+ # credentials for each individual channel. The CMS account that the user
500
+ # authenticates with must be linked to the specified YouTube content owner.
501
+ # @param [String] fields
502
+ # Selector specifying which fields to include in a partial response.
503
+ # @param [String] quota_user
504
+ # Available to use for quota purposes for server-side applications. Can be any
505
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
506
+ # @param [Google::Apis::RequestOptions] options
507
+ # Request-specific options
508
+ #
509
+ # @yield [result, err] Result & error if block supplied
510
+ # @yieldparam result [NilClass] No result returned for this method
511
+ # @yieldparam err [StandardError] error object if request failed
512
+ #
513
+ # @return [void]
514
+ #
515
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
516
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
517
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
518
+ def delete_channel_section(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
519
+ command = make_simple_command(:delete, 'youtube/v3/channelSections', options)
520
+ command.query['id'] = id unless id.nil?
521
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
522
+ command.query['fields'] = fields unless fields.nil?
523
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
524
+ execute_or_queue_command(command, &block)
525
+ end
526
+
527
+ # Inserts a new resource into this collection.
528
+ # @param [Array<String>, String] part
529
+ # The *part* parameter serves two purposes in this operation. It identifies the
530
+ # properties that the write operation will set as well as the properties that
531
+ # the API response will include. The part names that you can include in the
532
+ # parameter value are snippet and contentDetails.
533
+ # @param [Google::Apis::YoutubeV3::ChannelSection] channel_section_object
534
+ # @param [String] on_behalf_of_content_owner
535
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
536
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
537
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
538
+ # of the content owner specified in the parameter value. This parameter is
539
+ # intended for YouTube content partners that own and manage many different
540
+ # YouTube channels. It allows content owners to authenticate once and get access
541
+ # to all their video and channel data, without having to provide authentication
542
+ # credentials for each individual channel. The CMS account that the user
543
+ # authenticates with must be linked to the specified YouTube content owner.
544
+ # @param [String] on_behalf_of_content_owner_channel
545
+ # This parameter can only be used in a properly authorized request. *Note:* This
546
+ # parameter is intended exclusively for YouTube content partners. The *
547
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
548
+ # the channel to which a video is being added. This parameter is required when a
549
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
550
+ # only be used in conjunction with that parameter. In addition, the request must
551
+ # be authorized using a CMS account that is linked to the content owner that the
552
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
553
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
554
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
555
+ # parameter is intended for YouTube content partners that own and manage many
556
+ # different YouTube channels. It allows content owners to authenticate once and
557
+ # perform actions on behalf of the channel specified in the parameter value,
558
+ # without having to provide authentication credentials for each separate channel.
559
+ # @param [String] fields
560
+ # Selector specifying which fields to include in a partial response.
561
+ # @param [String] quota_user
562
+ # Available to use for quota purposes for server-side applications. Can be any
563
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
564
+ # @param [Google::Apis::RequestOptions] options
565
+ # Request-specific options
566
+ #
567
+ # @yield [result, err] Result & error if block supplied
568
+ # @yieldparam result [Google::Apis::YoutubeV3::ChannelSection] parsed result object
569
+ # @yieldparam err [StandardError] error object if request failed
570
+ #
571
+ # @return [Google::Apis::YoutubeV3::ChannelSection]
572
+ #
573
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
574
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
575
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
576
+ def insert_channel_section(part, channel_section_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
577
+ command = make_simple_command(:post, 'youtube/v3/channelSections', options)
578
+ command.request_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
579
+ command.request_object = channel_section_object
580
+ command.response_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
581
+ command.response_class = Google::Apis::YoutubeV3::ChannelSection
582
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
583
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
584
+ command.query['part'] = part unless part.nil?
585
+ command.query['fields'] = fields unless fields.nil?
586
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
587
+ execute_or_queue_command(command, &block)
588
+ end
589
+
590
+ # Retrieves a list of resources, possibly filtered.
591
+ # @param [Array<String>, String] part
592
+ # The *part* parameter specifies a comma-separated list of one or more
593
+ # channelSection resource properties that the API response will include. The
594
+ # part names that you can include in the parameter value are id, snippet, and
595
+ # contentDetails. If the parameter identifies a property that contains child
596
+ # properties, the child properties will be included in the response. For example,
597
+ # in a channelSection resource, the snippet property contains other properties,
598
+ # such as a display title for the channelSection. If you set *part=snippet*, the
599
+ # API response will also contain all of those nested properties.
600
+ # @param [String] channel_id
601
+ # Return the ChannelSections owned by the specified channel ID.
602
+ # @param [String] hl
603
+ # Return content in specified language
604
+ # @param [Array<String>, String] id
605
+ # Return the ChannelSections with the given IDs for Stubby or Apiary.
606
+ # @param [Boolean] mine
607
+ # Return the ChannelSections owned by the authenticated user.
608
+ # @param [String] on_behalf_of_content_owner
609
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
610
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
611
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
612
+ # of the content owner specified in the parameter value. This parameter is
613
+ # intended for YouTube content partners that own and manage many different
614
+ # YouTube channels. It allows content owners to authenticate once and get access
615
+ # to all their video and channel data, without having to provide authentication
616
+ # credentials for each individual channel. The CMS account that the user
617
+ # authenticates with must be linked to the specified YouTube content owner.
618
+ # @param [String] fields
619
+ # Selector specifying which fields to include in a partial response.
620
+ # @param [String] quota_user
621
+ # Available to use for quota purposes for server-side applications. Can be any
622
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
623
+ # @param [Google::Apis::RequestOptions] options
624
+ # Request-specific options
625
+ #
626
+ # @yield [result, err] Result & error if block supplied
627
+ # @yieldparam result [Google::Apis::YoutubeV3::ListChannelSectionsResponse] parsed result object
628
+ # @yieldparam err [StandardError] error object if request failed
629
+ #
630
+ # @return [Google::Apis::YoutubeV3::ListChannelSectionsResponse]
631
+ #
632
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
633
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
634
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
635
+ def list_channel_sections(part, channel_id: nil, hl: nil, id: nil, mine: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
636
+ command = make_simple_command(:get, 'youtube/v3/channelSections', options)
637
+ command.response_representation = Google::Apis::YoutubeV3::ListChannelSectionsResponse::Representation
638
+ command.response_class = Google::Apis::YoutubeV3::ListChannelSectionsResponse
639
+ command.query['channelId'] = channel_id unless channel_id.nil?
640
+ command.query['hl'] = hl unless hl.nil?
641
+ command.query['id'] = id unless id.nil?
642
+ command.query['mine'] = mine unless mine.nil?
643
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
644
+ command.query['part'] = part unless part.nil?
645
+ command.query['fields'] = fields unless fields.nil?
646
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
647
+ execute_or_queue_command(command, &block)
648
+ end
649
+
650
+ # Updates an existing resource.
651
+ # @param [Array<String>, String] part
652
+ # The *part* parameter serves two purposes in this operation. It identifies the
653
+ # properties that the write operation will set as well as the properties that
654
+ # the API response will include. The part names that you can include in the
655
+ # parameter value are snippet and contentDetails.
656
+ # @param [Google::Apis::YoutubeV3::ChannelSection] channel_section_object
657
+ # @param [String] on_behalf_of_content_owner
658
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
659
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
660
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
661
+ # of the content owner specified in the parameter value. This parameter is
662
+ # intended for YouTube content partners that own and manage many different
663
+ # YouTube channels. It allows content owners to authenticate once and get access
664
+ # to all their video and channel data, without having to provide authentication
665
+ # credentials for each individual channel. The CMS account that the user
666
+ # authenticates with must be linked to the specified YouTube content owner.
667
+ # @param [String] fields
668
+ # Selector specifying which fields to include in a partial response.
669
+ # @param [String] quota_user
670
+ # Available to use for quota purposes for server-side applications. Can be any
671
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
672
+ # @param [Google::Apis::RequestOptions] options
673
+ # Request-specific options
674
+ #
675
+ # @yield [result, err] Result & error if block supplied
676
+ # @yieldparam result [Google::Apis::YoutubeV3::ChannelSection] parsed result object
677
+ # @yieldparam err [StandardError] error object if request failed
678
+ #
679
+ # @return [Google::Apis::YoutubeV3::ChannelSection]
680
+ #
681
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
682
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
683
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
684
+ def update_channel_section(part, channel_section_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
685
+ command = make_simple_command(:put, 'youtube/v3/channelSections', options)
686
+ command.request_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
687
+ command.request_object = channel_section_object
688
+ command.response_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
689
+ command.response_class = Google::Apis::YoutubeV3::ChannelSection
690
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
691
+ command.query['part'] = part unless part.nil?
692
+ command.query['fields'] = fields unless fields.nil?
693
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
694
+ execute_or_queue_command(command, &block)
695
+ end
696
+
697
+ # Retrieves a list of resources, possibly filtered.
698
+ # @param [Array<String>, String] part
699
+ # The *part* parameter specifies a comma-separated list of one or more channel
700
+ # resource properties that the API response will include. If the parameter
701
+ # identifies a property that contains child properties, the child properties
702
+ # will be included in the response. For example, in a channel resource, the
703
+ # contentDetails property contains other properties, such as the uploads
704
+ # properties. As such, if you set *part=contentDetails*, the API response will
705
+ # also contain all of those nested properties.
706
+ # @param [String] category_id
707
+ # Return the channels within the specified guide category ID.
708
+ # @param [String] for_username
709
+ # Return the channel associated with a YouTube username.
710
+ # @param [String] hl
711
+ # Stands for "host language". Specifies the localization language of the
712
+ # metadata to be filled into snippet.localized. The field is filled with the
713
+ # default metadata if there is no localization in the specified language. The
714
+ # parameter value must be a language code included in the list returned by the
715
+ # i18nLanguages.list method (e.g. en_US, es_MX).
716
+ # @param [Array<String>, String] id
717
+ # Return the channels with the specified IDs.
718
+ # @param [Boolean] managed_by_me
719
+ # Return the channels managed by the authenticated user.
720
+ # @param [Fixnum] max_results
721
+ # The *maxResults* parameter specifies the maximum number of items that should
722
+ # be returned in the result set.
723
+ # @param [Boolean] mine
724
+ # Return the ids of channels owned by the authenticated user.
725
+ # @param [Boolean] my_subscribers
726
+ # Return the channels subscribed to the authenticated user
727
+ # @param [String] on_behalf_of_content_owner
728
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
729
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
730
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
731
+ # of the content owner specified in the parameter value. This parameter is
732
+ # intended for YouTube content partners that own and manage many different
733
+ # YouTube channels. It allows content owners to authenticate once and get access
734
+ # to all their video and channel data, without having to provide authentication
735
+ # credentials for each individual channel. The CMS account that the user
736
+ # authenticates with must be linked to the specified YouTube content owner.
737
+ # @param [String] page_token
738
+ # The *pageToken* parameter identifies a specific page in the result set that
739
+ # should be returned. In an API response, the nextPageToken and prevPageToken
740
+ # properties identify other pages that could be retrieved.
741
+ # @param [String] fields
742
+ # Selector specifying which fields to include in a partial response.
743
+ # @param [String] quota_user
744
+ # Available to use for quota purposes for server-side applications. Can be any
745
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
746
+ # @param [Google::Apis::RequestOptions] options
747
+ # Request-specific options
748
+ #
749
+ # @yield [result, err] Result & error if block supplied
750
+ # @yieldparam result [Google::Apis::YoutubeV3::ListChannelsResponse] parsed result object
751
+ # @yieldparam err [StandardError] error object if request failed
752
+ #
753
+ # @return [Google::Apis::YoutubeV3::ListChannelsResponse]
754
+ #
755
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
756
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
757
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
758
+ def list_channels(part, category_id: nil, for_username: nil, hl: nil, id: nil, managed_by_me: nil, max_results: nil, mine: nil, my_subscribers: nil, on_behalf_of_content_owner: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
759
+ command = make_simple_command(:get, 'youtube/v3/channels', options)
760
+ command.response_representation = Google::Apis::YoutubeV3::ListChannelsResponse::Representation
761
+ command.response_class = Google::Apis::YoutubeV3::ListChannelsResponse
762
+ command.query['categoryId'] = category_id unless category_id.nil?
763
+ command.query['forUsername'] = for_username unless for_username.nil?
764
+ command.query['hl'] = hl unless hl.nil?
765
+ command.query['id'] = id unless id.nil?
766
+ command.query['managedByMe'] = managed_by_me unless managed_by_me.nil?
767
+ command.query['maxResults'] = max_results unless max_results.nil?
768
+ command.query['mine'] = mine unless mine.nil?
769
+ command.query['mySubscribers'] = my_subscribers unless my_subscribers.nil?
770
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
771
+ command.query['pageToken'] = page_token unless page_token.nil?
772
+ command.query['part'] = part unless part.nil?
773
+ command.query['fields'] = fields unless fields.nil?
774
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
775
+ execute_or_queue_command(command, &block)
776
+ end
777
+
778
+ # Updates an existing resource.
779
+ # @param [Array<String>, String] part
780
+ # The *part* parameter serves two purposes in this operation. It identifies the
781
+ # properties that the write operation will set as well as the properties that
782
+ # the API response will include. The API currently only allows the parameter
783
+ # value to be set to either brandingSettings or invideoPromotion. (You cannot
784
+ # update both of those parts with a single request.) Note that this method
785
+ # overrides the existing values for all of the mutable properties that are
786
+ # contained in any parts that the parameter value specifies.
787
+ # @param [Google::Apis::YoutubeV3::Channel] channel_object
788
+ # @param [String] on_behalf_of_content_owner
789
+ # The *onBehalfOfContentOwner* parameter indicates that the authenticated user
790
+ # is acting on behalf of the content owner specified in the parameter value.
791
+ # This parameter is intended for YouTube content partners that own and manage
792
+ # many different YouTube channels. It allows content owners to authenticate once
793
+ # and get access to all their video and channel data, without having to provide
794
+ # authentication credentials for each individual channel. The actual CMS account
795
+ # that the user authenticates with needs to be linked to the specified YouTube
796
+ # content owner.
797
+ # @param [String] fields
798
+ # Selector specifying which fields to include in a partial response.
799
+ # @param [String] quota_user
800
+ # Available to use for quota purposes for server-side applications. Can be any
801
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
802
+ # @param [Google::Apis::RequestOptions] options
803
+ # Request-specific options
804
+ #
805
+ # @yield [result, err] Result & error if block supplied
806
+ # @yieldparam result [Google::Apis::YoutubeV3::Channel] parsed result object
807
+ # @yieldparam err [StandardError] error object if request failed
808
+ #
809
+ # @return [Google::Apis::YoutubeV3::Channel]
810
+ #
811
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
812
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
813
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
814
+ def update_channel(part, channel_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
815
+ command = make_simple_command(:put, 'youtube/v3/channels', options)
816
+ command.request_representation = Google::Apis::YoutubeV3::Channel::Representation
817
+ command.request_object = channel_object
818
+ command.response_representation = Google::Apis::YoutubeV3::Channel::Representation
819
+ command.response_class = Google::Apis::YoutubeV3::Channel
820
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
821
+ command.query['part'] = part unless part.nil?
822
+ command.query['fields'] = fields unless fields.nil?
823
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
824
+ execute_or_queue_command(command, &block)
825
+ end
826
+
827
+ # Inserts a new resource into this collection.
828
+ # @param [Array<String>, String] part
829
+ # The *part* parameter identifies the properties that the API response will
830
+ # include. Set the parameter value to snippet. The snippet part has a quota cost
831
+ # of 2 units.
832
+ # @param [Google::Apis::YoutubeV3::CommentThread] comment_thread_object
833
+ # @param [String] fields
834
+ # Selector specifying which fields to include in a partial response.
835
+ # @param [String] quota_user
836
+ # Available to use for quota purposes for server-side applications. Can be any
837
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
838
+ # @param [Google::Apis::RequestOptions] options
839
+ # Request-specific options
840
+ #
841
+ # @yield [result, err] Result & error if block supplied
842
+ # @yieldparam result [Google::Apis::YoutubeV3::CommentThread] parsed result object
843
+ # @yieldparam err [StandardError] error object if request failed
844
+ #
845
+ # @return [Google::Apis::YoutubeV3::CommentThread]
846
+ #
847
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
848
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
849
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
850
+ def insert_comment_thread(part, comment_thread_object = nil, fields: nil, quota_user: nil, options: nil, &block)
851
+ command = make_simple_command(:post, 'youtube/v3/commentThreads', options)
852
+ command.request_representation = Google::Apis::YoutubeV3::CommentThread::Representation
853
+ command.request_object = comment_thread_object
854
+ command.response_representation = Google::Apis::YoutubeV3::CommentThread::Representation
855
+ command.response_class = Google::Apis::YoutubeV3::CommentThread
856
+ command.query['part'] = part unless part.nil?
857
+ command.query['fields'] = fields unless fields.nil?
858
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
859
+ execute_or_queue_command(command, &block)
860
+ end
861
+
862
+ # Retrieves a list of resources, possibly filtered.
863
+ # @param [Array<String>, String] part
864
+ # The *part* parameter specifies a comma-separated list of one or more
865
+ # commentThread resource properties that the API response will include.
866
+ # @param [String] all_threads_related_to_channel_id
867
+ # Returns the comment threads of all videos of the channel and the channel
868
+ # comments as well.
869
+ # @param [String] channel_id
870
+ # Returns the comment threads for all the channel comments (ie does not include
871
+ # comments left on videos).
872
+ # @param [Array<String>, String] id
873
+ # Returns the comment threads with the given IDs for Stubby or Apiary.
874
+ # @param [Fixnum] max_results
875
+ # The *maxResults* parameter specifies the maximum number of items that should
876
+ # be returned in the result set.
877
+ # @param [String] moderation_status
878
+ # Limits the returned comment threads to those with the specified moderation
879
+ # status. Not compatible with the 'id' filter. Valid values: published,
880
+ # heldForReview, likelySpam.
881
+ # @param [String] order
882
+ # @param [String] page_token
883
+ # The *pageToken* parameter identifies a specific page in the result set that
884
+ # should be returned. In an API response, the nextPageToken and prevPageToken
885
+ # properties identify other pages that could be retrieved.
886
+ # @param [String] search_terms
887
+ # Limits the returned comment threads to those matching the specified key words.
888
+ # Not compatible with the 'id' filter.
889
+ # @param [String] text_format
890
+ # The requested text format for the returned comments.
891
+ # @param [String] video_id
892
+ # Returns the comment threads of the specified video.
893
+ # @param [String] fields
894
+ # Selector specifying which fields to include in a partial response.
895
+ # @param [String] quota_user
896
+ # Available to use for quota purposes for server-side applications. Can be any
897
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
898
+ # @param [Google::Apis::RequestOptions] options
899
+ # Request-specific options
900
+ #
901
+ # @yield [result, err] Result & error if block supplied
902
+ # @yieldparam result [Google::Apis::YoutubeV3::ListCommentThreadsResponse] parsed result object
903
+ # @yieldparam err [StandardError] error object if request failed
904
+ #
905
+ # @return [Google::Apis::YoutubeV3::ListCommentThreadsResponse]
906
+ #
907
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
908
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
909
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
910
+ def list_comment_threads(part, all_threads_related_to_channel_id: nil, channel_id: nil, id: nil, max_results: nil, moderation_status: nil, order: nil, page_token: nil, search_terms: nil, text_format: nil, video_id: nil, fields: nil, quota_user: nil, options: nil, &block)
911
+ command = make_simple_command(:get, 'youtube/v3/commentThreads', options)
912
+ command.response_representation = Google::Apis::YoutubeV3::ListCommentThreadsResponse::Representation
913
+ command.response_class = Google::Apis::YoutubeV3::ListCommentThreadsResponse
914
+ command.query['allThreadsRelatedToChannelId'] = all_threads_related_to_channel_id unless all_threads_related_to_channel_id.nil?
915
+ command.query['channelId'] = channel_id unless channel_id.nil?
916
+ command.query['id'] = id unless id.nil?
917
+ command.query['maxResults'] = max_results unless max_results.nil?
918
+ command.query['moderationStatus'] = moderation_status unless moderation_status.nil?
919
+ command.query['order'] = order unless order.nil?
920
+ command.query['pageToken'] = page_token unless page_token.nil?
921
+ command.query['part'] = part unless part.nil?
922
+ command.query['searchTerms'] = search_terms unless search_terms.nil?
923
+ command.query['textFormat'] = text_format unless text_format.nil?
924
+ command.query['videoId'] = video_id unless video_id.nil?
925
+ command.query['fields'] = fields unless fields.nil?
926
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
927
+ execute_or_queue_command(command, &block)
928
+ end
929
+
930
+ # Updates an existing resource.
931
+ # @param [Array<String>, String] part
932
+ # The *part* parameter specifies a comma-separated list of commentThread
933
+ # resource properties that the API response will include. You must at least
934
+ # include the snippet part in the parameter value since that part contains all
935
+ # of the properties that the API request can update.
936
+ # @param [Google::Apis::YoutubeV3::CommentThread] comment_thread_object
937
+ # @param [String] fields
938
+ # Selector specifying which fields to include in a partial response.
939
+ # @param [String] quota_user
940
+ # Available to use for quota purposes for server-side applications. Can be any
941
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
942
+ # @param [Google::Apis::RequestOptions] options
943
+ # Request-specific options
944
+ #
945
+ # @yield [result, err] Result & error if block supplied
946
+ # @yieldparam result [Google::Apis::YoutubeV3::CommentThread] parsed result object
947
+ # @yieldparam err [StandardError] error object if request failed
948
+ #
949
+ # @return [Google::Apis::YoutubeV3::CommentThread]
950
+ #
951
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
952
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
953
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
954
+ def update_comment_thread(part, comment_thread_object = nil, fields: nil, quota_user: nil, options: nil, &block)
955
+ command = make_simple_command(:put, 'youtube/v3/commentThreads', options)
956
+ command.request_representation = Google::Apis::YoutubeV3::CommentThread::Representation
957
+ command.request_object = comment_thread_object
958
+ command.response_representation = Google::Apis::YoutubeV3::CommentThread::Representation
959
+ command.response_class = Google::Apis::YoutubeV3::CommentThread
960
+ command.query['part'] = part unless part.nil?
961
+ command.query['fields'] = fields unless fields.nil?
962
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
963
+ execute_or_queue_command(command, &block)
964
+ end
965
+
966
+ # Deletes a resource.
967
+ # @param [String] id
968
+ # @param [String] fields
969
+ # Selector specifying which fields to include in a partial response.
970
+ # @param [String] quota_user
971
+ # Available to use for quota purposes for server-side applications. Can be any
972
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
973
+ # @param [Google::Apis::RequestOptions] options
974
+ # Request-specific options
975
+ #
976
+ # @yield [result, err] Result & error if block supplied
977
+ # @yieldparam result [NilClass] No result returned for this method
978
+ # @yieldparam err [StandardError] error object if request failed
979
+ #
980
+ # @return [void]
981
+ #
982
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
983
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
984
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
985
+ def delete_comment(id, fields: nil, quota_user: nil, options: nil, &block)
986
+ command = make_simple_command(:delete, 'youtube/v3/comments', options)
987
+ command.query['id'] = id unless id.nil?
988
+ command.query['fields'] = fields unless fields.nil?
989
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
990
+ execute_or_queue_command(command, &block)
991
+ end
992
+
993
+ # Inserts a new resource into this collection.
994
+ # @param [Array<String>, String] part
995
+ # The *part* parameter identifies the properties that the API response will
996
+ # include. Set the parameter value to snippet. The snippet part has a quota cost
997
+ # of 2 units.
998
+ # @param [Google::Apis::YoutubeV3::Comment] comment_object
999
+ # @param [String] fields
1000
+ # Selector specifying which fields to include in a partial response.
1001
+ # @param [String] quota_user
1002
+ # Available to use for quota purposes for server-side applications. Can be any
1003
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1004
+ # @param [Google::Apis::RequestOptions] options
1005
+ # Request-specific options
1006
+ #
1007
+ # @yield [result, err] Result & error if block supplied
1008
+ # @yieldparam result [Google::Apis::YoutubeV3::Comment] parsed result object
1009
+ # @yieldparam err [StandardError] error object if request failed
1010
+ #
1011
+ # @return [Google::Apis::YoutubeV3::Comment]
1012
+ #
1013
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1014
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1015
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1016
+ def insert_comment(part, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1017
+ command = make_simple_command(:post, 'youtube/v3/comments', options)
1018
+ command.request_representation = Google::Apis::YoutubeV3::Comment::Representation
1019
+ command.request_object = comment_object
1020
+ command.response_representation = Google::Apis::YoutubeV3::Comment::Representation
1021
+ command.response_class = Google::Apis::YoutubeV3::Comment
1022
+ command.query['part'] = part unless part.nil?
1023
+ command.query['fields'] = fields unless fields.nil?
1024
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1025
+ execute_or_queue_command(command, &block)
1026
+ end
1027
+
1028
+ # Retrieves a list of resources, possibly filtered.
1029
+ # @param [Array<String>, String] part
1030
+ # The *part* parameter specifies a comma-separated list of one or more comment
1031
+ # resource properties that the API response will include.
1032
+ # @param [Array<String>, String] id
1033
+ # Returns the comments with the given IDs for One Platform.
1034
+ # @param [Fixnum] max_results
1035
+ # The *maxResults* parameter specifies the maximum number of items that should
1036
+ # be returned in the result set.
1037
+ # @param [String] page_token
1038
+ # The *pageToken* parameter identifies a specific page in the result set that
1039
+ # should be returned. In an API response, the nextPageToken and prevPageToken
1040
+ # properties identify other pages that could be retrieved.
1041
+ # @param [String] parent_id
1042
+ # Returns replies to the specified comment. Note, currently YouTube features
1043
+ # only one level of replies (ie replies to top level comments). However replies
1044
+ # to replies may be supported in the future.
1045
+ # @param [String] text_format
1046
+ # The requested text format for the returned comments.
1047
+ # @param [String] fields
1048
+ # Selector specifying which fields to include in a partial response.
1049
+ # @param [String] quota_user
1050
+ # Available to use for quota purposes for server-side applications. Can be any
1051
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1052
+ # @param [Google::Apis::RequestOptions] options
1053
+ # Request-specific options
1054
+ #
1055
+ # @yield [result, err] Result & error if block supplied
1056
+ # @yieldparam result [Google::Apis::YoutubeV3::ListCommentsResponse] parsed result object
1057
+ # @yieldparam err [StandardError] error object if request failed
1058
+ #
1059
+ # @return [Google::Apis::YoutubeV3::ListCommentsResponse]
1060
+ #
1061
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1062
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1063
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1064
+ def list_comments(part, id: nil, max_results: nil, page_token: nil, parent_id: nil, text_format: nil, fields: nil, quota_user: nil, options: nil, &block)
1065
+ command = make_simple_command(:get, 'youtube/v3/comments', options)
1066
+ command.response_representation = Google::Apis::YoutubeV3::ListCommentsResponse::Representation
1067
+ command.response_class = Google::Apis::YoutubeV3::ListCommentsResponse
1068
+ command.query['id'] = id unless id.nil?
1069
+ command.query['maxResults'] = max_results unless max_results.nil?
1070
+ command.query['pageToken'] = page_token unless page_token.nil?
1071
+ command.query['parentId'] = parent_id unless parent_id.nil?
1072
+ command.query['part'] = part unless part.nil?
1073
+ command.query['textFormat'] = text_format unless text_format.nil?
1074
+ command.query['fields'] = fields unless fields.nil?
1075
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1076
+ execute_or_queue_command(command, &block)
1077
+ end
1078
+
1079
+ # Expresses the caller's opinion that one or more comments should be flagged as
1080
+ # spam.
1081
+ # @param [Array<String>, String] id
1082
+ # Flags the comments with the given IDs as spam in the caller's opinion.
1083
+ # @param [String] fields
1084
+ # Selector specifying which fields to include in a partial response.
1085
+ # @param [String] quota_user
1086
+ # Available to use for quota purposes for server-side applications. Can be any
1087
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1088
+ # @param [Google::Apis::RequestOptions] options
1089
+ # Request-specific options
1090
+ #
1091
+ # @yield [result, err] Result & error if block supplied
1092
+ # @yieldparam result [NilClass] No result returned for this method
1093
+ # @yieldparam err [StandardError] error object if request failed
1094
+ #
1095
+ # @return [void]
1096
+ #
1097
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1098
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1099
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1100
+ def mark_comment_as_spam(id, fields: nil, quota_user: nil, options: nil, &block)
1101
+ command = make_simple_command(:post, 'youtube/v3/comments/markAsSpam', options)
1102
+ command.query['id'] = id unless id.nil?
1103
+ command.query['fields'] = fields unless fields.nil?
1104
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1105
+ execute_or_queue_command(command, &block)
1106
+ end
1107
+
1108
+ # Sets the moderation status of one or more comments.
1109
+ # @param [Array<String>, String] id
1110
+ # Modifies the moderation status of the comments with the given IDs
1111
+ # @param [String] moderation_status
1112
+ # Specifies the requested moderation status. Note, comments can be in statuses,
1113
+ # which are not available through this call. For example, this call does not
1114
+ # allow to mark a comment as 'likely spam'. Valid values:
1115
+ # MODERATION_STATUS_PUBLISHED, MODERATION_STATUS_HELD_FOR_REVIEW,
1116
+ # MODERATION_STATUS_REJECTED.
1117
+ # @param [Boolean] ban_author
1118
+ # If set to true the author of the comment gets added to the ban list. This
1119
+ # means all future comments of the author will autmomatically be rejected. Only
1120
+ # valid in combination with STATUS_REJECTED.
1121
+ # @param [String] fields
1122
+ # Selector specifying which fields to include in a partial response.
1123
+ # @param [String] quota_user
1124
+ # Available to use for quota purposes for server-side applications. Can be any
1125
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1126
+ # @param [Google::Apis::RequestOptions] options
1127
+ # Request-specific options
1128
+ #
1129
+ # @yield [result, err] Result & error if block supplied
1130
+ # @yieldparam result [NilClass] No result returned for this method
1131
+ # @yieldparam err [StandardError] error object if request failed
1132
+ #
1133
+ # @return [void]
1134
+ #
1135
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1136
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1137
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1138
+ def set_comment_moderation_status(id, moderation_status, ban_author: nil, fields: nil, quota_user: nil, options: nil, &block)
1139
+ command = make_simple_command(:post, 'youtube/v3/comments/setModerationStatus', options)
1140
+ command.query['banAuthor'] = ban_author unless ban_author.nil?
1141
+ command.query['id'] = id unless id.nil?
1142
+ command.query['moderationStatus'] = moderation_status unless moderation_status.nil?
1143
+ command.query['fields'] = fields unless fields.nil?
1144
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1145
+ execute_or_queue_command(command, &block)
1146
+ end
1147
+
1148
+ # Updates an existing resource.
1149
+ # @param [Array<String>, String] part
1150
+ # The *part* parameter identifies the properties that the API response will
1151
+ # include. You must at least include the snippet part in the parameter value
1152
+ # since that part contains all of the properties that the API request can update.
1153
+ # @param [Google::Apis::YoutubeV3::Comment] comment_object
1154
+ # @param [String] fields
1155
+ # Selector specifying which fields to include in a partial response.
1156
+ # @param [String] quota_user
1157
+ # Available to use for quota purposes for server-side applications. Can be any
1158
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1159
+ # @param [Google::Apis::RequestOptions] options
1160
+ # Request-specific options
1161
+ #
1162
+ # @yield [result, err] Result & error if block supplied
1163
+ # @yieldparam result [Google::Apis::YoutubeV3::Comment] parsed result object
1164
+ # @yieldparam err [StandardError] error object if request failed
1165
+ #
1166
+ # @return [Google::Apis::YoutubeV3::Comment]
1167
+ #
1168
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1169
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1170
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1171
+ def update_comment(part, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1172
+ command = make_simple_command(:put, 'youtube/v3/comments', options)
1173
+ command.request_representation = Google::Apis::YoutubeV3::Comment::Representation
1174
+ command.request_object = comment_object
1175
+ command.response_representation = Google::Apis::YoutubeV3::Comment::Representation
1176
+ command.response_class = Google::Apis::YoutubeV3::Comment
1177
+ command.query['part'] = part unless part.nil?
1178
+ command.query['fields'] = fields unless fields.nil?
1179
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1180
+ execute_or_queue_command(command, &block)
1181
+ end
1182
+
1183
+ # Retrieves a list of resources, possibly filtered.
1184
+ # @param [Array<String>, String] part
1185
+ # The *part* parameter specifies the i18nLanguage resource properties that the
1186
+ # API response will include. Set the parameter value to snippet.
1187
+ # @param [String] hl
1188
+ # @param [String] fields
1189
+ # Selector specifying which fields to include in a partial response.
1190
+ # @param [String] quota_user
1191
+ # Available to use for quota purposes for server-side applications. Can be any
1192
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1193
+ # @param [Google::Apis::RequestOptions] options
1194
+ # Request-specific options
1195
+ #
1196
+ # @yield [result, err] Result & error if block supplied
1197
+ # @yieldparam result [Google::Apis::YoutubeV3::ListI18nLanguagesResponse] parsed result object
1198
+ # @yieldparam err [StandardError] error object if request failed
1199
+ #
1200
+ # @return [Google::Apis::YoutubeV3::ListI18nLanguagesResponse]
1201
+ #
1202
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1203
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1204
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1205
+ def list_i18n_languages(part, hl: nil, fields: nil, quota_user: nil, options: nil, &block)
1206
+ command = make_simple_command(:get, 'youtube/v3/i18nLanguages', options)
1207
+ command.response_representation = Google::Apis::YoutubeV3::ListI18nLanguagesResponse::Representation
1208
+ command.response_class = Google::Apis::YoutubeV3::ListI18nLanguagesResponse
1209
+ command.query['hl'] = hl unless hl.nil?
1210
+ command.query['part'] = part unless part.nil?
1211
+ command.query['fields'] = fields unless fields.nil?
1212
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1213
+ execute_or_queue_command(command, &block)
1214
+ end
1215
+
1216
+ # Retrieves a list of resources, possibly filtered.
1217
+ # @param [Array<String>, String] part
1218
+ # The *part* parameter specifies the i18nRegion resource properties that the API
1219
+ # response will include. Set the parameter value to snippet.
1220
+ # @param [String] hl
1221
+ # @param [String] fields
1222
+ # Selector specifying which fields to include in a partial response.
1223
+ # @param [String] quota_user
1224
+ # Available to use for quota purposes for server-side applications. Can be any
1225
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1226
+ # @param [Google::Apis::RequestOptions] options
1227
+ # Request-specific options
1228
+ #
1229
+ # @yield [result, err] Result & error if block supplied
1230
+ # @yieldparam result [Google::Apis::YoutubeV3::ListI18nRegionsResponse] parsed result object
1231
+ # @yieldparam err [StandardError] error object if request failed
1232
+ #
1233
+ # @return [Google::Apis::YoutubeV3::ListI18nRegionsResponse]
1234
+ #
1235
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1236
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1237
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1238
+ def list_i18n_regions(part, hl: nil, fields: nil, quota_user: nil, options: nil, &block)
1239
+ command = make_simple_command(:get, 'youtube/v3/i18nRegions', options)
1240
+ command.response_representation = Google::Apis::YoutubeV3::ListI18nRegionsResponse::Representation
1241
+ command.response_class = Google::Apis::YoutubeV3::ListI18nRegionsResponse
1242
+ command.query['hl'] = hl unless hl.nil?
1243
+ command.query['part'] = part unless part.nil?
1244
+ command.query['fields'] = fields unless fields.nil?
1245
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1246
+ execute_or_queue_command(command, &block)
1247
+ end
1248
+
1249
+ # Bind a broadcast to a stream.
1250
+ # @param [String] id
1251
+ # Broadcast to bind to the stream
1252
+ # @param [Array<String>, String] part
1253
+ # The *part* parameter specifies a comma-separated list of one or more
1254
+ # liveBroadcast resource properties that the API response will include. The part
1255
+ # names that you can include in the parameter value are id, snippet,
1256
+ # contentDetails, and status.
1257
+ # @param [String] on_behalf_of_content_owner
1258
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
1259
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
1260
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
1261
+ # of the content owner specified in the parameter value. This parameter is
1262
+ # intended for YouTube content partners that own and manage many different
1263
+ # YouTube channels. It allows content owners to authenticate once and get access
1264
+ # to all their video and channel data, without having to provide authentication
1265
+ # credentials for each individual channel. The CMS account that the user
1266
+ # authenticates with must be linked to the specified YouTube content owner.
1267
+ # @param [String] on_behalf_of_content_owner_channel
1268
+ # This parameter can only be used in a properly authorized request. *Note:* This
1269
+ # parameter is intended exclusively for YouTube content partners. The *
1270
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
1271
+ # the channel to which a video is being added. This parameter is required when a
1272
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
1273
+ # only be used in conjunction with that parameter. In addition, the request must
1274
+ # be authorized using a CMS account that is linked to the content owner that the
1275
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
1276
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
1277
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
1278
+ # parameter is intended for YouTube content partners that own and manage many
1279
+ # different YouTube channels. It allows content owners to authenticate once and
1280
+ # perform actions on behalf of the channel specified in the parameter value,
1281
+ # without having to provide authentication credentials for each separate channel.
1282
+ # @param [String] stream_id
1283
+ # Stream to bind, if not set unbind the current one.
1284
+ # @param [String] fields
1285
+ # Selector specifying which fields to include in a partial response.
1286
+ # @param [String] quota_user
1287
+ # Available to use for quota purposes for server-side applications. Can be any
1288
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1289
+ # @param [Google::Apis::RequestOptions] options
1290
+ # Request-specific options
1291
+ #
1292
+ # @yield [result, err] Result & error if block supplied
1293
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
1294
+ # @yieldparam err [StandardError] error object if request failed
1295
+ #
1296
+ # @return [Google::Apis::YoutubeV3::LiveBroadcast]
1297
+ #
1298
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1299
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1300
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1301
+ def bind_live_broadcast(id, part, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, stream_id: nil, fields: nil, quota_user: nil, options: nil, &block)
1302
+ command = make_simple_command(:post, 'youtube/v3/liveBroadcasts/bind', options)
1303
+ command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
1304
+ command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
1305
+ command.query['id'] = id unless id.nil?
1306
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
1307
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
1308
+ command.query['part'] = part unless part.nil?
1309
+ command.query['streamId'] = stream_id unless stream_id.nil?
1310
+ command.query['fields'] = fields unless fields.nil?
1311
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1312
+ execute_or_queue_command(command, &block)
1313
+ end
1314
+
1315
+ # Slate and recording control of the live broadcast. Support actions: slate on/
1316
+ # off, recording start/stop/pause/resume. Design doc: goto/yt-api-liveBroadcast-
1317
+ # control
1318
+ # @param [String] id
1319
+ # Broadcast to operate.
1320
+ # @param [Array<String>, String] part
1321
+ # The *part* parameter specifies a comma-separated list of one or more
1322
+ # liveBroadcast resource properties that the API response will include. The part
1323
+ # names that you can include in the parameter value are id, snippet,
1324
+ # contentDetails, and status.
1325
+ # @param [Boolean] display_slate
1326
+ # Whether display or hide slate.
1327
+ # @param [Fixnum] offset_time_ms
1328
+ # The exact time when the actions (e.g. slate on) are executed. It is an offset
1329
+ # from the first frame of the monitor stream. If not set, it means "now" or ASAP.
1330
+ # This field should not be set if the monitor stream is disabled, otherwise an
1331
+ # error will be returned.
1332
+ # @param [String] on_behalf_of_content_owner
1333
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
1334
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
1335
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
1336
+ # of the content owner specified in the parameter value. This parameter is
1337
+ # intended for YouTube content partners that own and manage many different
1338
+ # YouTube channels. It allows content owners to authenticate once and get access
1339
+ # to all their video and channel data, without having to provide authentication
1340
+ # credentials for each individual channel. The CMS account that the user
1341
+ # authenticates with must be linked to the specified YouTube content owner.
1342
+ # @param [String] on_behalf_of_content_owner_channel
1343
+ # This parameter can only be used in a properly authorized request. *Note:* This
1344
+ # parameter is intended exclusively for YouTube content partners. The *
1345
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
1346
+ # the channel to which a video is being added. This parameter is required when a
1347
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
1348
+ # only be used in conjunction with that parameter. In addition, the request must
1349
+ # be authorized using a CMS account that is linked to the content owner that the
1350
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
1351
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
1352
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
1353
+ # parameter is intended for YouTube content partners that own and manage many
1354
+ # different YouTube channels. It allows content owners to authenticate once and
1355
+ # perform actions on behalf of the channel specified in the parameter value,
1356
+ # without having to provide authentication credentials for each separate channel.
1357
+ # @param [String] walltime
1358
+ # The wall clock time at which the action should be executed. Only one of
1359
+ # offset_time_ms and walltime may be set at a time.
1360
+ # @param [String] fields
1361
+ # Selector specifying which fields to include in a partial response.
1362
+ # @param [String] quota_user
1363
+ # Available to use for quota purposes for server-side applications. Can be any
1364
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1365
+ # @param [Google::Apis::RequestOptions] options
1366
+ # Request-specific options
1367
+ #
1368
+ # @yield [result, err] Result & error if block supplied
1369
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
1370
+ # @yieldparam err [StandardError] error object if request failed
1371
+ #
1372
+ # @return [Google::Apis::YoutubeV3::LiveBroadcast]
1373
+ #
1374
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1375
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1376
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1377
+ def control_live_broadcast(id, part, display_slate: nil, offset_time_ms: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, walltime: nil, fields: nil, quota_user: nil, options: nil, &block)
1378
+ command = make_simple_command(:post, 'youtube/v3/liveBroadcasts/control', options)
1379
+ command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
1380
+ command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
1381
+ command.query['displaySlate'] = display_slate unless display_slate.nil?
1382
+ command.query['id'] = id unless id.nil?
1383
+ command.query['offsetTimeMs'] = offset_time_ms unless offset_time_ms.nil?
1384
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
1385
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
1386
+ command.query['part'] = part unless part.nil?
1387
+ command.query['walltime'] = walltime unless walltime.nil?
1388
+ command.query['fields'] = fields unless fields.nil?
1389
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1390
+ execute_or_queue_command(command, &block)
1391
+ end
1392
+
1393
+ # Delete a given broadcast.
1394
+ # @param [String] id
1395
+ # Broadcast to delete.
1396
+ # @param [String] on_behalf_of_content_owner
1397
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
1398
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
1399
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
1400
+ # of the content owner specified in the parameter value. This parameter is
1401
+ # intended for YouTube content partners that own and manage many different
1402
+ # YouTube channels. It allows content owners to authenticate once and get access
1403
+ # to all their video and channel data, without having to provide authentication
1404
+ # credentials for each individual channel. The CMS account that the user
1405
+ # authenticates with must be linked to the specified YouTube content owner.
1406
+ # @param [String] on_behalf_of_content_owner_channel
1407
+ # This parameter can only be used in a properly authorized request. *Note:* This
1408
+ # parameter is intended exclusively for YouTube content partners. The *
1409
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
1410
+ # the channel to which a video is being added. This parameter is required when a
1411
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
1412
+ # only be used in conjunction with that parameter. In addition, the request must
1413
+ # be authorized using a CMS account that is linked to the content owner that the
1414
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
1415
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
1416
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
1417
+ # parameter is intended for YouTube content partners that own and manage many
1418
+ # different YouTube channels. It allows content owners to authenticate once and
1419
+ # perform actions on behalf of the channel specified in the parameter value,
1420
+ # without having to provide authentication credentials for each separate channel.
1421
+ # @param [String] fields
1422
+ # Selector specifying which fields to include in a partial response.
1423
+ # @param [String] quota_user
1424
+ # Available to use for quota purposes for server-side applications. Can be any
1425
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1426
+ # @param [Google::Apis::RequestOptions] options
1427
+ # Request-specific options
1428
+ #
1429
+ # @yield [result, err] Result & error if block supplied
1430
+ # @yieldparam result [NilClass] No result returned for this method
1431
+ # @yieldparam err [StandardError] error object if request failed
1432
+ #
1433
+ # @return [void]
1434
+ #
1435
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1436
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1437
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1438
+ def delete_live_broadcast(id, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
1439
+ command = make_simple_command(:delete, 'youtube/v3/liveBroadcasts', options)
1440
+ command.query['id'] = id unless id.nil?
1441
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
1442
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
1443
+ command.query['fields'] = fields unless fields.nil?
1444
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1445
+ execute_or_queue_command(command, &block)
1446
+ end
1447
+
1448
+ # Inserts a new stream for the authenticated user.
1449
+ # @param [Array<String>, String] part
1450
+ # The *part* parameter serves two purposes in this operation. It identifies the
1451
+ # properties that the write operation will set as well as the properties that
1452
+ # the API response will include. The part properties that you can include in the
1453
+ # parameter value are id, snippet, contentDetails, and status.
1454
+ # @param [Google::Apis::YoutubeV3::LiveBroadcast] live_broadcast_object
1455
+ # @param [String] on_behalf_of_content_owner
1456
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
1457
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
1458
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
1459
+ # of the content owner specified in the parameter value. This parameter is
1460
+ # intended for YouTube content partners that own and manage many different
1461
+ # YouTube channels. It allows content owners to authenticate once and get access
1462
+ # to all their video and channel data, without having to provide authentication
1463
+ # credentials for each individual channel. The CMS account that the user
1464
+ # authenticates with must be linked to the specified YouTube content owner.
1465
+ # @param [String] on_behalf_of_content_owner_channel
1466
+ # This parameter can only be used in a properly authorized request. *Note:* This
1467
+ # parameter is intended exclusively for YouTube content partners. The *
1468
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
1469
+ # the channel to which a video is being added. This parameter is required when a
1470
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
1471
+ # only be used in conjunction with that parameter. In addition, the request must
1472
+ # be authorized using a CMS account that is linked to the content owner that the
1473
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
1474
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
1475
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
1476
+ # parameter is intended for YouTube content partners that own and manage many
1477
+ # different YouTube channels. It allows content owners to authenticate once and
1478
+ # perform actions on behalf of the channel specified in the parameter value,
1479
+ # without having to provide authentication credentials for each separate channel.
1480
+ # @param [String] fields
1481
+ # Selector specifying which fields to include in a partial response.
1482
+ # @param [String] quota_user
1483
+ # Available to use for quota purposes for server-side applications. Can be any
1484
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1485
+ # @param [Google::Apis::RequestOptions] options
1486
+ # Request-specific options
1487
+ #
1488
+ # @yield [result, err] Result & error if block supplied
1489
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
1490
+ # @yieldparam err [StandardError] error object if request failed
1491
+ #
1492
+ # @return [Google::Apis::YoutubeV3::LiveBroadcast]
1493
+ #
1494
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1495
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1496
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1497
+ def insert_live_broadcast(part, live_broadcast_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
1498
+ command = make_simple_command(:post, 'youtube/v3/liveBroadcasts', options)
1499
+ command.request_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
1500
+ command.request_object = live_broadcast_object
1501
+ command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
1502
+ command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
1503
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
1504
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
1505
+ command.query['part'] = part unless part.nil?
1506
+ command.query['fields'] = fields unless fields.nil?
1507
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1508
+ execute_or_queue_command(command, &block)
1509
+ end
1510
+
1511
+ # Retrieve the list of broadcasts associated with the given channel.
1512
+ # @param [Array<String>, String] part
1513
+ # The *part* parameter specifies a comma-separated list of one or more
1514
+ # liveBroadcast resource properties that the API response will include. The part
1515
+ # names that you can include in the parameter value are id, snippet,
1516
+ # contentDetails, status and statistics.
1517
+ # @param [String] broadcast_status
1518
+ # Return broadcasts with a certain status, e.g. active broadcasts.
1519
+ # @param [String] broadcast_type
1520
+ # Return only broadcasts with the selected type.
1521
+ # @param [Array<String>, String] id
1522
+ # Return broadcasts with the given ids from Stubby or Apiary.
1523
+ # @param [Fixnum] max_results
1524
+ # The *maxResults* parameter specifies the maximum number of items that should
1525
+ # be returned in the result set.
1526
+ # @param [Boolean] mine
1527
+ # @param [String] on_behalf_of_content_owner
1528
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
1529
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
1530
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
1531
+ # of the content owner specified in the parameter value. This parameter is
1532
+ # intended for YouTube content partners that own and manage many different
1533
+ # YouTube channels. It allows content owners to authenticate once and get access
1534
+ # to all their video and channel data, without having to provide authentication
1535
+ # credentials for each individual channel. The CMS account that the user
1536
+ # authenticates with must be linked to the specified YouTube content owner.
1537
+ # @param [String] on_behalf_of_content_owner_channel
1538
+ # This parameter can only be used in a properly authorized request. *Note:* This
1539
+ # parameter is intended exclusively for YouTube content partners. The *
1540
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
1541
+ # the channel to which a video is being added. This parameter is required when a
1542
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
1543
+ # only be used in conjunction with that parameter. In addition, the request must
1544
+ # be authorized using a CMS account that is linked to the content owner that the
1545
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
1546
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
1547
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
1548
+ # parameter is intended for YouTube content partners that own and manage many
1549
+ # different YouTube channels. It allows content owners to authenticate once and
1550
+ # perform actions on behalf of the channel specified in the parameter value,
1551
+ # without having to provide authentication credentials for each separate channel.
1552
+ # @param [String] page_token
1553
+ # The *pageToken* parameter identifies a specific page in the result set that
1554
+ # should be returned. In an API response, the nextPageToken and prevPageToken
1555
+ # properties identify other pages that could be retrieved.
1556
+ # @param [String] fields
1557
+ # Selector specifying which fields to include in a partial response.
1558
+ # @param [String] quota_user
1559
+ # Available to use for quota purposes for server-side applications. Can be any
1560
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1561
+ # @param [Google::Apis::RequestOptions] options
1562
+ # Request-specific options
1563
+ #
1564
+ # @yield [result, err] Result & error if block supplied
1565
+ # @yieldparam result [Google::Apis::YoutubeV3::ListLiveBroadcastsResponse] parsed result object
1566
+ # @yieldparam err [StandardError] error object if request failed
1567
+ #
1568
+ # @return [Google::Apis::YoutubeV3::ListLiveBroadcastsResponse]
1569
+ #
1570
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1571
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1572
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1573
+ def list_live_broadcasts(part, broadcast_status: nil, broadcast_type: nil, id: nil, max_results: nil, mine: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1574
+ command = make_simple_command(:get, 'youtube/v3/liveBroadcasts', options)
1575
+ command.response_representation = Google::Apis::YoutubeV3::ListLiveBroadcastsResponse::Representation
1576
+ command.response_class = Google::Apis::YoutubeV3::ListLiveBroadcastsResponse
1577
+ command.query['broadcastStatus'] = broadcast_status unless broadcast_status.nil?
1578
+ command.query['broadcastType'] = broadcast_type unless broadcast_type.nil?
1579
+ command.query['id'] = id unless id.nil?
1580
+ command.query['maxResults'] = max_results unless max_results.nil?
1581
+ command.query['mine'] = mine unless mine.nil?
1582
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
1583
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
1584
+ command.query['pageToken'] = page_token unless page_token.nil?
1585
+ command.query['part'] = part unless part.nil?
1586
+ command.query['fields'] = fields unless fields.nil?
1587
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1588
+ execute_or_queue_command(command, &block)
1589
+ end
1590
+
1591
+ # Transition a broadcast to a given status.
1592
+ # @param [String] broadcast_status
1593
+ # The status to which the broadcast is going to transition.
1594
+ # @param [String] id
1595
+ # Broadcast to transition.
1596
+ # @param [Array<String>, String] part
1597
+ # The *part* parameter specifies a comma-separated list of one or more
1598
+ # liveBroadcast resource properties that the API response will include. The part
1599
+ # names that you can include in the parameter value are id, snippet,
1600
+ # contentDetails, and status.
1601
+ # @param [String] on_behalf_of_content_owner
1602
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
1603
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
1604
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
1605
+ # of the content owner specified in the parameter value. This parameter is
1606
+ # intended for YouTube content partners that own and manage many different
1607
+ # YouTube channels. It allows content owners to authenticate once and get access
1608
+ # to all their video and channel data, without having to provide authentication
1609
+ # credentials for each individual channel. The CMS account that the user
1610
+ # authenticates with must be linked to the specified YouTube content owner.
1611
+ # @param [String] on_behalf_of_content_owner_channel
1612
+ # This parameter can only be used in a properly authorized request. *Note:* This
1613
+ # parameter is intended exclusively for YouTube content partners. The *
1614
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
1615
+ # the channel to which a video is being added. This parameter is required when a
1616
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
1617
+ # only be used in conjunction with that parameter. In addition, the request must
1618
+ # be authorized using a CMS account that is linked to the content owner that the
1619
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
1620
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
1621
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
1622
+ # parameter is intended for YouTube content partners that own and manage many
1623
+ # different YouTube channels. It allows content owners to authenticate once and
1624
+ # perform actions on behalf of the channel specified in the parameter value,
1625
+ # without having to provide authentication credentials for each separate channel.
1626
+ # @param [String] fields
1627
+ # Selector specifying which fields to include in a partial response.
1628
+ # @param [String] quota_user
1629
+ # Available to use for quota purposes for server-side applications. Can be any
1630
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1631
+ # @param [Google::Apis::RequestOptions] options
1632
+ # Request-specific options
1633
+ #
1634
+ # @yield [result, err] Result & error if block supplied
1635
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
1636
+ # @yieldparam err [StandardError] error object if request failed
1637
+ #
1638
+ # @return [Google::Apis::YoutubeV3::LiveBroadcast]
1639
+ #
1640
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1641
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1642
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1643
+ def transition_live_broadcast(broadcast_status, id, part, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
1644
+ command = make_simple_command(:post, 'youtube/v3/liveBroadcasts/transition', options)
1645
+ command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
1646
+ command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
1647
+ command.query['broadcastStatus'] = broadcast_status unless broadcast_status.nil?
1648
+ command.query['id'] = id unless id.nil?
1649
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
1650
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
1651
+ command.query['part'] = part unless part.nil?
1652
+ command.query['fields'] = fields unless fields.nil?
1653
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1654
+ execute_or_queue_command(command, &block)
1655
+ end
1656
+
1657
+ # Updates an existing broadcast for the authenticated user.
1658
+ # @param [Array<String>, String] part
1659
+ # The *part* parameter serves two purposes in this operation. It identifies the
1660
+ # properties that the write operation will set as well as the properties that
1661
+ # the API response will include. The part properties that you can include in the
1662
+ # parameter value are id, snippet, contentDetails, and status. Note that this
1663
+ # method will override the existing values for all of the mutable properties
1664
+ # that are contained in any parts that the parameter value specifies. For
1665
+ # example, a broadcast's privacy status is defined in the status part. As such,
1666
+ # if your request is updating a private or unlisted broadcast, and the request's
1667
+ # part parameter value includes the status part, the broadcast's privacy setting
1668
+ # will be updated to whatever value the request body specifies. If the request
1669
+ # body does not specify a value, the existing privacy setting will be removed
1670
+ # and the broadcast will revert to the default privacy setting.
1671
+ # @param [Google::Apis::YoutubeV3::LiveBroadcast] live_broadcast_object
1672
+ # @param [String] on_behalf_of_content_owner
1673
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
1674
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
1675
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
1676
+ # of the content owner specified in the parameter value. This parameter is
1677
+ # intended for YouTube content partners that own and manage many different
1678
+ # YouTube channels. It allows content owners to authenticate once and get access
1679
+ # to all their video and channel data, without having to provide authentication
1680
+ # credentials for each individual channel. The CMS account that the user
1681
+ # authenticates with must be linked to the specified YouTube content owner.
1682
+ # @param [String] on_behalf_of_content_owner_channel
1683
+ # This parameter can only be used in a properly authorized request. *Note:* This
1684
+ # parameter is intended exclusively for YouTube content partners. The *
1685
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
1686
+ # the channel to which a video is being added. This parameter is required when a
1687
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
1688
+ # only be used in conjunction with that parameter. In addition, the request must
1689
+ # be authorized using a CMS account that is linked to the content owner that the
1690
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
1691
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
1692
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
1693
+ # parameter is intended for YouTube content partners that own and manage many
1694
+ # different YouTube channels. It allows content owners to authenticate once and
1695
+ # perform actions on behalf of the channel specified in the parameter value,
1696
+ # without having to provide authentication credentials for each separate channel.
1697
+ # @param [String] fields
1698
+ # Selector specifying which fields to include in a partial response.
1699
+ # @param [String] quota_user
1700
+ # Available to use for quota purposes for server-side applications. Can be any
1701
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1702
+ # @param [Google::Apis::RequestOptions] options
1703
+ # Request-specific options
1704
+ #
1705
+ # @yield [result, err] Result & error if block supplied
1706
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
1707
+ # @yieldparam err [StandardError] error object if request failed
1708
+ #
1709
+ # @return [Google::Apis::YoutubeV3::LiveBroadcast]
1710
+ #
1711
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1712
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1713
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1714
+ def update_live_broadcast(part, live_broadcast_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
1715
+ command = make_simple_command(:put, 'youtube/v3/liveBroadcasts', options)
1716
+ command.request_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
1717
+ command.request_object = live_broadcast_object
1718
+ command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
1719
+ command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
1720
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
1721
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
1722
+ command.query['part'] = part unless part.nil?
1723
+ command.query['fields'] = fields unless fields.nil?
1724
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1725
+ execute_or_queue_command(command, &block)
1726
+ end
1727
+
1728
+ # Deletes a chat ban.
1729
+ # @param [String] id
1730
+ # @param [String] fields
1731
+ # Selector specifying which fields to include in a partial response.
1732
+ # @param [String] quota_user
1733
+ # Available to use for quota purposes for server-side applications. Can be any
1734
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1735
+ # @param [Google::Apis::RequestOptions] options
1736
+ # Request-specific options
1737
+ #
1738
+ # @yield [result, err] Result & error if block supplied
1739
+ # @yieldparam result [NilClass] No result returned for this method
1740
+ # @yieldparam err [StandardError] error object if request failed
1741
+ #
1742
+ # @return [void]
1743
+ #
1744
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1745
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1746
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1747
+ def delete_live_chat_ban(id, fields: nil, quota_user: nil, options: nil, &block)
1748
+ command = make_simple_command(:delete, 'youtube/v3/liveChat/bans', options)
1749
+ command.query['id'] = id unless id.nil?
1750
+ command.query['fields'] = fields unless fields.nil?
1751
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1752
+ execute_or_queue_command(command, &block)
1753
+ end
1754
+
1755
+ # Inserts a new resource into this collection.
1756
+ # @param [Array<String>, String] part
1757
+ # The *part* parameter serves two purposes in this operation. It identifies the
1758
+ # properties that the write operation will set as well as the properties that
1759
+ # the API response returns. Set the parameter value to snippet.
1760
+ # @param [Google::Apis::YoutubeV3::LiveChatBan] live_chat_ban_object
1761
+ # @param [String] fields
1762
+ # Selector specifying which fields to include in a partial response.
1763
+ # @param [String] quota_user
1764
+ # Available to use for quota purposes for server-side applications. Can be any
1765
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1766
+ # @param [Google::Apis::RequestOptions] options
1767
+ # Request-specific options
1768
+ #
1769
+ # @yield [result, err] Result & error if block supplied
1770
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveChatBan] parsed result object
1771
+ # @yieldparam err [StandardError] error object if request failed
1772
+ #
1773
+ # @return [Google::Apis::YoutubeV3::LiveChatBan]
1774
+ #
1775
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1776
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1777
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1778
+ def insert_live_chat_ban(part, live_chat_ban_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1779
+ command = make_simple_command(:post, 'youtube/v3/liveChat/bans', options)
1780
+ command.request_representation = Google::Apis::YoutubeV3::LiveChatBan::Representation
1781
+ command.request_object = live_chat_ban_object
1782
+ command.response_representation = Google::Apis::YoutubeV3::LiveChatBan::Representation
1783
+ command.response_class = Google::Apis::YoutubeV3::LiveChatBan
1784
+ command.query['part'] = part unless part.nil?
1785
+ command.query['fields'] = fields unless fields.nil?
1786
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1787
+ execute_or_queue_command(command, &block)
1788
+ end
1789
+
1790
+ # Deletes a chat message.
1791
+ # @param [String] id
1792
+ # @param [String] fields
1793
+ # Selector specifying which fields to include in a partial response.
1794
+ # @param [String] quota_user
1795
+ # Available to use for quota purposes for server-side applications. Can be any
1796
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1797
+ # @param [Google::Apis::RequestOptions] options
1798
+ # Request-specific options
1799
+ #
1800
+ # @yield [result, err] Result & error if block supplied
1801
+ # @yieldparam result [NilClass] No result returned for this method
1802
+ # @yieldparam err [StandardError] error object if request failed
1803
+ #
1804
+ # @return [void]
1805
+ #
1806
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1807
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1808
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1809
+ def delete_live_chat_message(id, fields: nil, quota_user: nil, options: nil, &block)
1810
+ command = make_simple_command(:delete, 'youtube/v3/liveChat/messages', options)
1811
+ command.query['id'] = id unless id.nil?
1812
+ command.query['fields'] = fields unless fields.nil?
1813
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1814
+ execute_or_queue_command(command, &block)
1815
+ end
1816
+
1817
+ # Inserts a new resource into this collection.
1818
+ # @param [Array<String>, String] part
1819
+ # The *part* parameter serves two purposes. It identifies the properties that
1820
+ # the write operation will set as well as the properties that the API response
1821
+ # will include. Set the parameter value to snippet.
1822
+ # @param [Google::Apis::YoutubeV3::LiveChatMessage] live_chat_message_object
1823
+ # @param [String] fields
1824
+ # Selector specifying which fields to include in a partial response.
1825
+ # @param [String] quota_user
1826
+ # Available to use for quota purposes for server-side applications. Can be any
1827
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1828
+ # @param [Google::Apis::RequestOptions] options
1829
+ # Request-specific options
1830
+ #
1831
+ # @yield [result, err] Result & error if block supplied
1832
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveChatMessage] parsed result object
1833
+ # @yieldparam err [StandardError] error object if request failed
1834
+ #
1835
+ # @return [Google::Apis::YoutubeV3::LiveChatMessage]
1836
+ #
1837
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1838
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1839
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1840
+ def insert_live_chat_message(part, live_chat_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1841
+ command = make_simple_command(:post, 'youtube/v3/liveChat/messages', options)
1842
+ command.request_representation = Google::Apis::YoutubeV3::LiveChatMessage::Representation
1843
+ command.request_object = live_chat_message_object
1844
+ command.response_representation = Google::Apis::YoutubeV3::LiveChatMessage::Representation
1845
+ command.response_class = Google::Apis::YoutubeV3::LiveChatMessage
1846
+ command.query['part'] = part unless part.nil?
1847
+ command.query['fields'] = fields unless fields.nil?
1848
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1849
+ execute_or_queue_command(command, &block)
1850
+ end
1851
+
1852
+ # Retrieves a list of resources, possibly filtered.
1853
+ # @param [String] live_chat_id
1854
+ # The id of the live chat for which comments should be returned.
1855
+ # @param [Array<String>, String] part
1856
+ # The *part* parameter specifies the liveChatComment resource parts that the API
1857
+ # response will include. Supported values are id and snippet.
1858
+ # @param [String] hl
1859
+ # Specifies the localization language in which the system messages should be
1860
+ # returned.
1861
+ # @param [Fixnum] max_results
1862
+ # The *maxResults* parameter specifies the maximum number of items that should
1863
+ # be returned in the result set.
1864
+ # @param [String] page_token
1865
+ # The *pageToken* parameter identifies a specific page in the result set that
1866
+ # should be returned. In an API response, the nextPageToken property identify
1867
+ # other pages that could be retrieved.
1868
+ # @param [Fixnum] profile_image_size
1869
+ # Specifies the size of the profile image that should be returned for each user.
1870
+ # @param [String] fields
1871
+ # Selector specifying which fields to include in a partial response.
1872
+ # @param [String] quota_user
1873
+ # Available to use for quota purposes for server-side applications. Can be any
1874
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1875
+ # @param [Google::Apis::RequestOptions] options
1876
+ # Request-specific options
1877
+ #
1878
+ # @yield [result, err] Result & error if block supplied
1879
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveChatMessageListResponse] parsed result object
1880
+ # @yieldparam err [StandardError] error object if request failed
1881
+ #
1882
+ # @return [Google::Apis::YoutubeV3::LiveChatMessageListResponse]
1883
+ #
1884
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1885
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1886
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1887
+ def list_live_chat_messages(live_chat_id, part, hl: nil, max_results: nil, page_token: nil, profile_image_size: nil, fields: nil, quota_user: nil, options: nil, &block)
1888
+ command = make_simple_command(:get, 'youtube/v3/liveChat/messages', options)
1889
+ command.response_representation = Google::Apis::YoutubeV3::LiveChatMessageListResponse::Representation
1890
+ command.response_class = Google::Apis::YoutubeV3::LiveChatMessageListResponse
1891
+ command.query['hl'] = hl unless hl.nil?
1892
+ command.query['liveChatId'] = live_chat_id unless live_chat_id.nil?
1893
+ command.query['maxResults'] = max_results unless max_results.nil?
1894
+ command.query['pageToken'] = page_token unless page_token.nil?
1895
+ command.query['part'] = part unless part.nil?
1896
+ command.query['profileImageSize'] = profile_image_size unless profile_image_size.nil?
1897
+ command.query['fields'] = fields unless fields.nil?
1898
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1899
+ execute_or_queue_command(command, &block)
1900
+ end
1901
+
1902
+ # Deletes a chat moderator.
1903
+ # @param [String] id
1904
+ # @param [String] fields
1905
+ # Selector specifying which fields to include in a partial response.
1906
+ # @param [String] quota_user
1907
+ # Available to use for quota purposes for server-side applications. Can be any
1908
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1909
+ # @param [Google::Apis::RequestOptions] options
1910
+ # Request-specific options
1911
+ #
1912
+ # @yield [result, err] Result & error if block supplied
1913
+ # @yieldparam result [NilClass] No result returned for this method
1914
+ # @yieldparam err [StandardError] error object if request failed
1915
+ #
1916
+ # @return [void]
1917
+ #
1918
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1919
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1920
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1921
+ def delete_live_chat_moderator(id, fields: nil, quota_user: nil, options: nil, &block)
1922
+ command = make_simple_command(:delete, 'youtube/v3/liveChat/moderators', options)
1923
+ command.query['id'] = id unless id.nil?
1924
+ command.query['fields'] = fields unless fields.nil?
1925
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1926
+ execute_or_queue_command(command, &block)
1927
+ end
1928
+
1929
+ # Inserts a new resource into this collection.
1930
+ # @param [Array<String>, String] part
1931
+ # The *part* parameter serves two purposes in this operation. It identifies the
1932
+ # properties that the write operation will set as well as the properties that
1933
+ # the API response returns. Set the parameter value to snippet.
1934
+ # @param [Google::Apis::YoutubeV3::LiveChatModerator] live_chat_moderator_object
1935
+ # @param [String] fields
1936
+ # Selector specifying which fields to include in a partial response.
1937
+ # @param [String] quota_user
1938
+ # Available to use for quota purposes for server-side applications. Can be any
1939
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1940
+ # @param [Google::Apis::RequestOptions] options
1941
+ # Request-specific options
1942
+ #
1943
+ # @yield [result, err] Result & error if block supplied
1944
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveChatModerator] parsed result object
1945
+ # @yieldparam err [StandardError] error object if request failed
1946
+ #
1947
+ # @return [Google::Apis::YoutubeV3::LiveChatModerator]
1948
+ #
1949
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1950
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1951
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1952
+ def insert_live_chat_moderator(part, live_chat_moderator_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1953
+ command = make_simple_command(:post, 'youtube/v3/liveChat/moderators', options)
1954
+ command.request_representation = Google::Apis::YoutubeV3::LiveChatModerator::Representation
1955
+ command.request_object = live_chat_moderator_object
1956
+ command.response_representation = Google::Apis::YoutubeV3::LiveChatModerator::Representation
1957
+ command.response_class = Google::Apis::YoutubeV3::LiveChatModerator
1958
+ command.query['part'] = part unless part.nil?
1959
+ command.query['fields'] = fields unless fields.nil?
1960
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1961
+ execute_or_queue_command(command, &block)
1962
+ end
1963
+
1964
+ # Retrieves a list of resources, possibly filtered.
1965
+ # @param [String] live_chat_id
1966
+ # The id of the live chat for which moderators should be returned.
1967
+ # @param [Array<String>, String] part
1968
+ # The *part* parameter specifies the liveChatModerator resource parts that the
1969
+ # API response will include. Supported values are id and snippet.
1970
+ # @param [Fixnum] max_results
1971
+ # The *maxResults* parameter specifies the maximum number of items that should
1972
+ # be returned in the result set.
1973
+ # @param [String] page_token
1974
+ # The *pageToken* parameter identifies a specific page in the result set that
1975
+ # should be returned. In an API response, the nextPageToken and prevPageToken
1976
+ # properties identify other pages that could be retrieved.
1977
+ # @param [String] fields
1978
+ # Selector specifying which fields to include in a partial response.
1979
+ # @param [String] quota_user
1980
+ # Available to use for quota purposes for server-side applications. Can be any
1981
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1982
+ # @param [Google::Apis::RequestOptions] options
1983
+ # Request-specific options
1984
+ #
1985
+ # @yield [result, err] Result & error if block supplied
1986
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveChatModeratorListResponse] parsed result object
1987
+ # @yieldparam err [StandardError] error object if request failed
1988
+ #
1989
+ # @return [Google::Apis::YoutubeV3::LiveChatModeratorListResponse]
1990
+ #
1991
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1992
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1993
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1994
+ def list_live_chat_moderators(live_chat_id, part, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1995
+ command = make_simple_command(:get, 'youtube/v3/liveChat/moderators', options)
1996
+ command.response_representation = Google::Apis::YoutubeV3::LiveChatModeratorListResponse::Representation
1997
+ command.response_class = Google::Apis::YoutubeV3::LiveChatModeratorListResponse
1998
+ command.query['liveChatId'] = live_chat_id unless live_chat_id.nil?
1999
+ command.query['maxResults'] = max_results unless max_results.nil?
2000
+ command.query['pageToken'] = page_token unless page_token.nil?
2001
+ command.query['part'] = part unless part.nil?
2002
+ command.query['fields'] = fields unless fields.nil?
2003
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2004
+ execute_or_queue_command(command, &block)
2005
+ end
2006
+
2007
+ # Deletes an existing stream for the authenticated user.
2008
+ # @param [String] id
2009
+ # @param [String] on_behalf_of_content_owner
2010
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2011
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2012
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2013
+ # of the content owner specified in the parameter value. This parameter is
2014
+ # intended for YouTube content partners that own and manage many different
2015
+ # YouTube channels. It allows content owners to authenticate once and get access
2016
+ # to all their video and channel data, without having to provide authentication
2017
+ # credentials for each individual channel. The CMS account that the user
2018
+ # authenticates with must be linked to the specified YouTube content owner.
2019
+ # @param [String] on_behalf_of_content_owner_channel
2020
+ # This parameter can only be used in a properly authorized request. *Note:* This
2021
+ # parameter is intended exclusively for YouTube content partners. The *
2022
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
2023
+ # the channel to which a video is being added. This parameter is required when a
2024
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
2025
+ # only be used in conjunction with that parameter. In addition, the request must
2026
+ # be authorized using a CMS account that is linked to the content owner that the
2027
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
2028
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
2029
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
2030
+ # parameter is intended for YouTube content partners that own and manage many
2031
+ # different YouTube channels. It allows content owners to authenticate once and
2032
+ # perform actions on behalf of the channel specified in the parameter value,
2033
+ # without having to provide authentication credentials for each separate channel.
2034
+ # @param [String] fields
2035
+ # Selector specifying which fields to include in a partial response.
2036
+ # @param [String] quota_user
2037
+ # Available to use for quota purposes for server-side applications. Can be any
2038
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2039
+ # @param [Google::Apis::RequestOptions] options
2040
+ # Request-specific options
2041
+ #
2042
+ # @yield [result, err] Result & error if block supplied
2043
+ # @yieldparam result [NilClass] No result returned for this method
2044
+ # @yieldparam err [StandardError] error object if request failed
2045
+ #
2046
+ # @return [void]
2047
+ #
2048
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2049
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2050
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2051
+ def delete_live_stream(id, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
2052
+ command = make_simple_command(:delete, 'youtube/v3/liveStreams', options)
2053
+ command.query['id'] = id unless id.nil?
2054
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2055
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
2056
+ command.query['fields'] = fields unless fields.nil?
2057
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2058
+ execute_or_queue_command(command, &block)
2059
+ end
2060
+
2061
+ # Inserts a new stream for the authenticated user.
2062
+ # @param [Array<String>, String] part
2063
+ # The *part* parameter serves two purposes in this operation. It identifies the
2064
+ # properties that the write operation will set as well as the properties that
2065
+ # the API response will include. The part properties that you can include in the
2066
+ # parameter value are id, snippet, cdn, content_details, and status.
2067
+ # @param [Google::Apis::YoutubeV3::LiveStream] live_stream_object
2068
+ # @param [String] on_behalf_of_content_owner
2069
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2070
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2071
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2072
+ # of the content owner specified in the parameter value. This parameter is
2073
+ # intended for YouTube content partners that own and manage many different
2074
+ # YouTube channels. It allows content owners to authenticate once and get access
2075
+ # to all their video and channel data, without having to provide authentication
2076
+ # credentials for each individual channel. The CMS account that the user
2077
+ # authenticates with must be linked to the specified YouTube content owner.
2078
+ # @param [String] on_behalf_of_content_owner_channel
2079
+ # This parameter can only be used in a properly authorized request. *Note:* This
2080
+ # parameter is intended exclusively for YouTube content partners. The *
2081
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
2082
+ # the channel to which a video is being added. This parameter is required when a
2083
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
2084
+ # only be used in conjunction with that parameter. In addition, the request must
2085
+ # be authorized using a CMS account that is linked to the content owner that the
2086
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
2087
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
2088
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
2089
+ # parameter is intended for YouTube content partners that own and manage many
2090
+ # different YouTube channels. It allows content owners to authenticate once and
2091
+ # perform actions on behalf of the channel specified in the parameter value,
2092
+ # without having to provide authentication credentials for each separate channel.
2093
+ # @param [String] fields
2094
+ # Selector specifying which fields to include in a partial response.
2095
+ # @param [String] quota_user
2096
+ # Available to use for quota purposes for server-side applications. Can be any
2097
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2098
+ # @param [Google::Apis::RequestOptions] options
2099
+ # Request-specific options
2100
+ #
2101
+ # @yield [result, err] Result & error if block supplied
2102
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveStream] parsed result object
2103
+ # @yieldparam err [StandardError] error object if request failed
2104
+ #
2105
+ # @return [Google::Apis::YoutubeV3::LiveStream]
2106
+ #
2107
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2108
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2109
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2110
+ def insert_live_stream(part, live_stream_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
2111
+ command = make_simple_command(:post, 'youtube/v3/liveStreams', options)
2112
+ command.request_representation = Google::Apis::YoutubeV3::LiveStream::Representation
2113
+ command.request_object = live_stream_object
2114
+ command.response_representation = Google::Apis::YoutubeV3::LiveStream::Representation
2115
+ command.response_class = Google::Apis::YoutubeV3::LiveStream
2116
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2117
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
2118
+ command.query['part'] = part unless part.nil?
2119
+ command.query['fields'] = fields unless fields.nil?
2120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2121
+ execute_or_queue_command(command, &block)
2122
+ end
2123
+
2124
+ # Retrieve the list of streams associated with the given channel. --
2125
+ # @param [Array<String>, String] part
2126
+ # The *part* parameter specifies a comma-separated list of one or more
2127
+ # liveStream resource properties that the API response will include. The part
2128
+ # names that you can include in the parameter value are id, snippet, cdn, and
2129
+ # status.
2130
+ # @param [Array<String>, String] id
2131
+ # Return LiveStreams with the given ids from Stubby or Apiary.
2132
+ # @param [Fixnum] max_results
2133
+ # The *maxResults* parameter specifies the maximum number of items that should
2134
+ # be returned in the result set.
2135
+ # @param [Boolean] mine
2136
+ # @param [String] on_behalf_of_content_owner
2137
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2138
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2139
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2140
+ # of the content owner specified in the parameter value. This parameter is
2141
+ # intended for YouTube content partners that own and manage many different
2142
+ # YouTube channels. It allows content owners to authenticate once and get access
2143
+ # to all their video and channel data, without having to provide authentication
2144
+ # credentials for each individual channel. The CMS account that the user
2145
+ # authenticates with must be linked to the specified YouTube content owner.
2146
+ # @param [String] on_behalf_of_content_owner_channel
2147
+ # This parameter can only be used in a properly authorized request. *Note:* This
2148
+ # parameter is intended exclusively for YouTube content partners. The *
2149
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
2150
+ # the channel to which a video is being added. This parameter is required when a
2151
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
2152
+ # only be used in conjunction with that parameter. In addition, the request must
2153
+ # be authorized using a CMS account that is linked to the content owner that the
2154
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
2155
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
2156
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
2157
+ # parameter is intended for YouTube content partners that own and manage many
2158
+ # different YouTube channels. It allows content owners to authenticate once and
2159
+ # perform actions on behalf of the channel specified in the parameter value,
2160
+ # without having to provide authentication credentials for each separate channel.
2161
+ # @param [String] page_token
2162
+ # The *pageToken* parameter identifies a specific page in the result set that
2163
+ # should be returned. In an API response, the nextPageToken and prevPageToken
2164
+ # properties identify other pages that could be retrieved.
2165
+ # @param [String] fields
2166
+ # Selector specifying which fields to include in a partial response.
2167
+ # @param [String] quota_user
2168
+ # Available to use for quota purposes for server-side applications. Can be any
2169
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2170
+ # @param [Google::Apis::RequestOptions] options
2171
+ # Request-specific options
2172
+ #
2173
+ # @yield [result, err] Result & error if block supplied
2174
+ # @yieldparam result [Google::Apis::YoutubeV3::ListLiveStreamsResponse] parsed result object
2175
+ # @yieldparam err [StandardError] error object if request failed
2176
+ #
2177
+ # @return [Google::Apis::YoutubeV3::ListLiveStreamsResponse]
2178
+ #
2179
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2180
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2181
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2182
+ def list_live_streams(part, id: nil, max_results: nil, mine: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2183
+ command = make_simple_command(:get, 'youtube/v3/liveStreams', options)
2184
+ command.response_representation = Google::Apis::YoutubeV3::ListLiveStreamsResponse::Representation
2185
+ command.response_class = Google::Apis::YoutubeV3::ListLiveStreamsResponse
2186
+ command.query['id'] = id unless id.nil?
2187
+ command.query['maxResults'] = max_results unless max_results.nil?
2188
+ command.query['mine'] = mine unless mine.nil?
2189
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2190
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
2191
+ command.query['pageToken'] = page_token unless page_token.nil?
2192
+ command.query['part'] = part unless part.nil?
2193
+ command.query['fields'] = fields unless fields.nil?
2194
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2195
+ execute_or_queue_command(command, &block)
2196
+ end
2197
+
2198
+ # Updates an existing stream for the authenticated user.
2199
+ # @param [Array<String>, String] part
2200
+ # The *part* parameter serves two purposes in this operation. It identifies the
2201
+ # properties that the write operation will set as well as the properties that
2202
+ # the API response will include. The part properties that you can include in the
2203
+ # parameter value are id, snippet, cdn, and status. Note that this method will
2204
+ # override the existing values for all of the mutable properties that are
2205
+ # contained in any parts that the parameter value specifies. If the request body
2206
+ # does not specify a value for a mutable property, the existing value for that
2207
+ # property will be removed.
2208
+ # @param [Google::Apis::YoutubeV3::LiveStream] live_stream_object
2209
+ # @param [String] on_behalf_of_content_owner
2210
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2211
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2212
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2213
+ # of the content owner specified in the parameter value. This parameter is
2214
+ # intended for YouTube content partners that own and manage many different
2215
+ # YouTube channels. It allows content owners to authenticate once and get access
2216
+ # to all their video and channel data, without having to provide authentication
2217
+ # credentials for each individual channel. The CMS account that the user
2218
+ # authenticates with must be linked to the specified YouTube content owner.
2219
+ # @param [String] on_behalf_of_content_owner_channel
2220
+ # This parameter can only be used in a properly authorized request. *Note:* This
2221
+ # parameter is intended exclusively for YouTube content partners. The *
2222
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
2223
+ # the channel to which a video is being added. This parameter is required when a
2224
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
2225
+ # only be used in conjunction with that parameter. In addition, the request must
2226
+ # be authorized using a CMS account that is linked to the content owner that the
2227
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
2228
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
2229
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
2230
+ # parameter is intended for YouTube content partners that own and manage many
2231
+ # different YouTube channels. It allows content owners to authenticate once and
2232
+ # perform actions on behalf of the channel specified in the parameter value,
2233
+ # without having to provide authentication credentials for each separate channel.
2234
+ # @param [String] fields
2235
+ # Selector specifying which fields to include in a partial response.
2236
+ # @param [String] quota_user
2237
+ # Available to use for quota purposes for server-side applications. Can be any
2238
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2239
+ # @param [Google::Apis::RequestOptions] options
2240
+ # Request-specific options
2241
+ #
2242
+ # @yield [result, err] Result & error if block supplied
2243
+ # @yieldparam result [Google::Apis::YoutubeV3::LiveStream] parsed result object
2244
+ # @yieldparam err [StandardError] error object if request failed
2245
+ #
2246
+ # @return [Google::Apis::YoutubeV3::LiveStream]
2247
+ #
2248
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2249
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2250
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2251
+ def update_live_stream(part, live_stream_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
2252
+ command = make_simple_command(:put, 'youtube/v3/liveStreams', options)
2253
+ command.request_representation = Google::Apis::YoutubeV3::LiveStream::Representation
2254
+ command.request_object = live_stream_object
2255
+ command.response_representation = Google::Apis::YoutubeV3::LiveStream::Representation
2256
+ command.response_class = Google::Apis::YoutubeV3::LiveStream
2257
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2258
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
2259
+ command.query['part'] = part unless part.nil?
2260
+ command.query['fields'] = fields unless fields.nil?
2261
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2262
+ execute_or_queue_command(command, &block)
2263
+ end
2264
+
2265
+ # Retrieves a list of members that match the request criteria for a channel.
2266
+ # @param [Array<String>, String] part
2267
+ # The *part* parameter specifies the member resource parts that the API response
2268
+ # will include. Set the parameter value to snippet.
2269
+ # @param [String] filter_by_member_channel_id
2270
+ # Comma separated list of channel IDs. Only data about members that are part of
2271
+ # this list will be included in the response.
2272
+ # @param [String] has_access_to_level
2273
+ # Filter members in the results set to the ones that have access to a level.
2274
+ # @param [Fixnum] max_results
2275
+ # The *maxResults* parameter specifies the maximum number of items that should
2276
+ # be returned in the result set.
2277
+ # @param [String] mode
2278
+ # Parameter that specifies which channel members to return.
2279
+ # @param [String] page_token
2280
+ # The *pageToken* parameter identifies a specific page in the result set that
2281
+ # should be returned. In an API response, the nextPageToken and prevPageToken
2282
+ # properties identify other pages that could be retrieved.
2283
+ # @param [String] fields
2284
+ # Selector specifying which fields to include in a partial response.
2285
+ # @param [String] quota_user
2286
+ # Available to use for quota purposes for server-side applications. Can be any
2287
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2288
+ # @param [Google::Apis::RequestOptions] options
2289
+ # Request-specific options
2290
+ #
2291
+ # @yield [result, err] Result & error if block supplied
2292
+ # @yieldparam result [Google::Apis::YoutubeV3::MemberListResponse] parsed result object
2293
+ # @yieldparam err [StandardError] error object if request failed
2294
+ #
2295
+ # @return [Google::Apis::YoutubeV3::MemberListResponse]
2296
+ #
2297
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2298
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2299
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2300
+ def list_members(part, filter_by_member_channel_id: nil, has_access_to_level: nil, max_results: nil, mode: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2301
+ command = make_simple_command(:get, 'youtube/v3/members', options)
2302
+ command.response_representation = Google::Apis::YoutubeV3::MemberListResponse::Representation
2303
+ command.response_class = Google::Apis::YoutubeV3::MemberListResponse
2304
+ command.query['filterByMemberChannelId'] = filter_by_member_channel_id unless filter_by_member_channel_id.nil?
2305
+ command.query['hasAccessToLevel'] = has_access_to_level unless has_access_to_level.nil?
2306
+ command.query['maxResults'] = max_results unless max_results.nil?
2307
+ command.query['mode'] = mode unless mode.nil?
2308
+ command.query['pageToken'] = page_token unless page_token.nil?
2309
+ command.query['part'] = part unless part.nil?
2310
+ command.query['fields'] = fields unless fields.nil?
2311
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2312
+ execute_or_queue_command(command, &block)
2313
+ end
2314
+
2315
+ # Retrieves a list of all pricing levels offered by a creator to the fans.
2316
+ # @param [Array<String>, String] part
2317
+ # The *part* parameter specifies the membershipsLevel resource parts that the
2318
+ # API response will include. Supported values are id and snippet.
2319
+ # @param [String] fields
2320
+ # Selector specifying which fields to include in a partial response.
2321
+ # @param [String] quota_user
2322
+ # Available to use for quota purposes for server-side applications. Can be any
2323
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2324
+ # @param [Google::Apis::RequestOptions] options
2325
+ # Request-specific options
2326
+ #
2327
+ # @yield [result, err] Result & error if block supplied
2328
+ # @yieldparam result [Google::Apis::YoutubeV3::MembershipsLevelListResponse] parsed result object
2329
+ # @yieldparam err [StandardError] error object if request failed
2330
+ #
2331
+ # @return [Google::Apis::YoutubeV3::MembershipsLevelListResponse]
2332
+ #
2333
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2334
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2335
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2336
+ def list_memberships_levels(part, fields: nil, quota_user: nil, options: nil, &block)
2337
+ command = make_simple_command(:get, 'youtube/v3/membershipsLevels', options)
2338
+ command.response_representation = Google::Apis::YoutubeV3::MembershipsLevelListResponse::Representation
2339
+ command.response_class = Google::Apis::YoutubeV3::MembershipsLevelListResponse
2340
+ command.query['part'] = part unless part.nil?
2341
+ command.query['fields'] = fields unless fields.nil?
2342
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2343
+ execute_or_queue_command(command, &block)
2344
+ end
2345
+
2346
+ # Deletes a resource.
2347
+ # @param [String] id
2348
+ # @param [String] on_behalf_of_content_owner
2349
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2350
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2351
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2352
+ # of the content owner specified in the parameter value. This parameter is
2353
+ # intended for YouTube content partners that own and manage many different
2354
+ # YouTube channels. It allows content owners to authenticate once and get access
2355
+ # to all their video and channel data, without having to provide authentication
2356
+ # credentials for each individual channel. The CMS account that the user
2357
+ # authenticates with must be linked to the specified YouTube content owner.
2358
+ # @param [String] fields
2359
+ # Selector specifying which fields to include in a partial response.
2360
+ # @param [String] quota_user
2361
+ # Available to use for quota purposes for server-side applications. Can be any
2362
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2363
+ # @param [Google::Apis::RequestOptions] options
2364
+ # Request-specific options
2365
+ #
2366
+ # @yield [result, err] Result & error if block supplied
2367
+ # @yieldparam result [NilClass] No result returned for this method
2368
+ # @yieldparam err [StandardError] error object if request failed
2369
+ #
2370
+ # @return [void]
2371
+ #
2372
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2373
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2374
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2375
+ def delete_playlist_item(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
2376
+ command = make_simple_command(:delete, 'youtube/v3/playlistItems', options)
2377
+ command.query['id'] = id unless id.nil?
2378
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2379
+ command.query['fields'] = fields unless fields.nil?
2380
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2381
+ execute_or_queue_command(command, &block)
2382
+ end
2383
+
2384
+ # Inserts a new resource into this collection.
2385
+ # @param [Array<String>, String] part
2386
+ # The *part* parameter serves two purposes in this operation. It identifies the
2387
+ # properties that the write operation will set as well as the properties that
2388
+ # the API response will include.
2389
+ # @param [Google::Apis::YoutubeV3::PlaylistItem] playlist_item_object
2390
+ # @param [String] on_behalf_of_content_owner
2391
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2392
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2393
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2394
+ # of the content owner specified in the parameter value. This parameter is
2395
+ # intended for YouTube content partners that own and manage many different
2396
+ # YouTube channels. It allows content owners to authenticate once and get access
2397
+ # to all their video and channel data, without having to provide authentication
2398
+ # credentials for each individual channel. The CMS account that the user
2399
+ # authenticates with must be linked to the specified YouTube content owner.
2400
+ # @param [String] fields
2401
+ # Selector specifying which fields to include in a partial response.
2402
+ # @param [String] quota_user
2403
+ # Available to use for quota purposes for server-side applications. Can be any
2404
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2405
+ # @param [Google::Apis::RequestOptions] options
2406
+ # Request-specific options
2407
+ #
2408
+ # @yield [result, err] Result & error if block supplied
2409
+ # @yieldparam result [Google::Apis::YoutubeV3::PlaylistItem] parsed result object
2410
+ # @yieldparam err [StandardError] error object if request failed
2411
+ #
2412
+ # @return [Google::Apis::YoutubeV3::PlaylistItem]
2413
+ #
2414
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2415
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2416
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2417
+ def insert_playlist_item(part, playlist_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
2418
+ command = make_simple_command(:post, 'youtube/v3/playlistItems', options)
2419
+ command.request_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
2420
+ command.request_object = playlist_item_object
2421
+ command.response_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
2422
+ command.response_class = Google::Apis::YoutubeV3::PlaylistItem
2423
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2424
+ command.query['part'] = part unless part.nil?
2425
+ command.query['fields'] = fields unless fields.nil?
2426
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2427
+ execute_or_queue_command(command, &block)
2428
+ end
2429
+
2430
+ # Retrieves a list of resources, possibly filtered.
2431
+ # @param [Array<String>, String] part
2432
+ # The *part* parameter specifies a comma-separated list of one or more
2433
+ # playlistItem resource properties that the API response will include. If the
2434
+ # parameter identifies a property that contains child properties, the child
2435
+ # properties will be included in the response. For example, in a playlistItem
2436
+ # resource, the snippet property contains numerous fields, including the title,
2437
+ # description, position, and resourceId properties. As such, if you set *part=
2438
+ # snippet*, the API response will contain all of those properties.
2439
+ # @param [Array<String>, String] id
2440
+ # @param [Fixnum] max_results
2441
+ # The *maxResults* parameter specifies the maximum number of items that should
2442
+ # be returned in the result set.
2443
+ # @param [String] on_behalf_of_content_owner
2444
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2445
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2446
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2447
+ # of the content owner specified in the parameter value. This parameter is
2448
+ # intended for YouTube content partners that own and manage many different
2449
+ # YouTube channels. It allows content owners to authenticate once and get access
2450
+ # to all their video and channel data, without having to provide authentication
2451
+ # credentials for each individual channel. The CMS account that the user
2452
+ # authenticates with must be linked to the specified YouTube content owner.
2453
+ # @param [String] page_token
2454
+ # The *pageToken* parameter identifies a specific page in the result set that
2455
+ # should be returned. In an API response, the nextPageToken and prevPageToken
2456
+ # properties identify other pages that could be retrieved.
2457
+ # @param [String] playlist_id
2458
+ # Return the playlist items within the given playlist.
2459
+ # @param [String] video_id
2460
+ # Return the playlist items associated with the given video ID.
2461
+ # @param [String] fields
2462
+ # Selector specifying which fields to include in a partial response.
2463
+ # @param [String] quota_user
2464
+ # Available to use for quota purposes for server-side applications. Can be any
2465
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2466
+ # @param [Google::Apis::RequestOptions] options
2467
+ # Request-specific options
2468
+ #
2469
+ # @yield [result, err] Result & error if block supplied
2470
+ # @yieldparam result [Google::Apis::YoutubeV3::ListPlaylistItemsResponse] parsed result object
2471
+ # @yieldparam err [StandardError] error object if request failed
2472
+ #
2473
+ # @return [Google::Apis::YoutubeV3::ListPlaylistItemsResponse]
2474
+ #
2475
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2476
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2477
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2478
+ def list_playlist_items(part, id: nil, max_results: nil, on_behalf_of_content_owner: nil, page_token: nil, playlist_id: nil, video_id: nil, fields: nil, quota_user: nil, options: nil, &block)
2479
+ command = make_simple_command(:get, 'youtube/v3/playlistItems', options)
2480
+ command.response_representation = Google::Apis::YoutubeV3::ListPlaylistItemsResponse::Representation
2481
+ command.response_class = Google::Apis::YoutubeV3::ListPlaylistItemsResponse
2482
+ command.query['id'] = id unless id.nil?
2483
+ command.query['maxResults'] = max_results unless max_results.nil?
2484
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2485
+ command.query['pageToken'] = page_token unless page_token.nil?
2486
+ command.query['part'] = part unless part.nil?
2487
+ command.query['playlistId'] = playlist_id unless playlist_id.nil?
2488
+ command.query['videoId'] = video_id unless video_id.nil?
2489
+ command.query['fields'] = fields unless fields.nil?
2490
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2491
+ execute_or_queue_command(command, &block)
2492
+ end
2493
+
2494
+ # Updates an existing resource.
2495
+ # @param [Array<String>, String] part
2496
+ # The *part* parameter serves two purposes in this operation. It identifies the
2497
+ # properties that the write operation will set as well as the properties that
2498
+ # the API response will include. Note that this method will override the
2499
+ # existing values for all of the mutable properties that are contained in any
2500
+ # parts that the parameter value specifies. For example, a playlist item can
2501
+ # specify a start time and end time, which identify the times portion of the
2502
+ # video that should play when users watch the video in the playlist. If your
2503
+ # request is updating a playlist item that sets these values, and the request's
2504
+ # part parameter value includes the contentDetails part, the playlist item's
2505
+ # start and end times will be updated to whatever value the request body
2506
+ # specifies. If the request body does not specify values, the existing start and
2507
+ # end times will be removed and replaced with the default settings.
2508
+ # @param [Google::Apis::YoutubeV3::PlaylistItem] playlist_item_object
2509
+ # @param [String] on_behalf_of_content_owner
2510
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2511
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2512
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2513
+ # of the content owner specified in the parameter value. This parameter is
2514
+ # intended for YouTube content partners that own and manage many different
2515
+ # YouTube channels. It allows content owners to authenticate once and get access
2516
+ # to all their video and channel data, without having to provide authentication
2517
+ # credentials for each individual channel. The CMS account that the user
2518
+ # authenticates with must be linked to the specified YouTube content owner.
2519
+ # @param [String] fields
2520
+ # Selector specifying which fields to include in a partial response.
2521
+ # @param [String] quota_user
2522
+ # Available to use for quota purposes for server-side applications. Can be any
2523
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2524
+ # @param [Google::Apis::RequestOptions] options
2525
+ # Request-specific options
2526
+ #
2527
+ # @yield [result, err] Result & error if block supplied
2528
+ # @yieldparam result [Google::Apis::YoutubeV3::PlaylistItem] parsed result object
2529
+ # @yieldparam err [StandardError] error object if request failed
2530
+ #
2531
+ # @return [Google::Apis::YoutubeV3::PlaylistItem]
2532
+ #
2533
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2534
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2535
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2536
+ def update_playlist_item(part, playlist_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
2537
+ command = make_simple_command(:put, 'youtube/v3/playlistItems', options)
2538
+ command.request_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
2539
+ command.request_object = playlist_item_object
2540
+ command.response_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
2541
+ command.response_class = Google::Apis::YoutubeV3::PlaylistItem
2542
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2543
+ command.query['part'] = part unless part.nil?
2544
+ command.query['fields'] = fields unless fields.nil?
2545
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2546
+ execute_or_queue_command(command, &block)
2547
+ end
2548
+
2549
+ # Deletes a resource.
2550
+ # @param [String] id
2551
+ # @param [String] on_behalf_of_content_owner
2552
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2553
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2554
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2555
+ # of the content owner specified in the parameter value. This parameter is
2556
+ # intended for YouTube content partners that own and manage many different
2557
+ # YouTube channels. It allows content owners to authenticate once and get access
2558
+ # to all their video and channel data, without having to provide authentication
2559
+ # credentials for each individual channel. The CMS account that the user
2560
+ # authenticates with must be linked to the specified YouTube content owner.
2561
+ # @param [String] fields
2562
+ # Selector specifying which fields to include in a partial response.
2563
+ # @param [String] quota_user
2564
+ # Available to use for quota purposes for server-side applications. Can be any
2565
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2566
+ # @param [Google::Apis::RequestOptions] options
2567
+ # Request-specific options
2568
+ #
2569
+ # @yield [result, err] Result & error if block supplied
2570
+ # @yieldparam result [NilClass] No result returned for this method
2571
+ # @yieldparam err [StandardError] error object if request failed
2572
+ #
2573
+ # @return [void]
2574
+ #
2575
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2576
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2577
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2578
+ def delete_playlist(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
2579
+ command = make_simple_command(:delete, 'youtube/v3/playlists', options)
2580
+ command.query['id'] = id unless id.nil?
2581
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2582
+ command.query['fields'] = fields unless fields.nil?
2583
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2584
+ execute_or_queue_command(command, &block)
2585
+ end
2586
+
2587
+ # Inserts a new resource into this collection.
2588
+ # @param [Array<String>, String] part
2589
+ # The *part* parameter serves two purposes in this operation. It identifies the
2590
+ # properties that the write operation will set as well as the properties that
2591
+ # the API response will include.
2592
+ # @param [Google::Apis::YoutubeV3::Playlist] playlist_object
2593
+ # @param [String] on_behalf_of_content_owner
2594
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2595
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2596
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2597
+ # of the content owner specified in the parameter value. This parameter is
2598
+ # intended for YouTube content partners that own and manage many different
2599
+ # YouTube channels. It allows content owners to authenticate once and get access
2600
+ # to all their video and channel data, without having to provide authentication
2601
+ # credentials for each individual channel. The CMS account that the user
2602
+ # authenticates with must be linked to the specified YouTube content owner.
2603
+ # @param [String] on_behalf_of_content_owner_channel
2604
+ # This parameter can only be used in a properly authorized request. *Note:* This
2605
+ # parameter is intended exclusively for YouTube content partners. The *
2606
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
2607
+ # the channel to which a video is being added. This parameter is required when a
2608
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
2609
+ # only be used in conjunction with that parameter. In addition, the request must
2610
+ # be authorized using a CMS account that is linked to the content owner that the
2611
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
2612
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
2613
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
2614
+ # parameter is intended for YouTube content partners that own and manage many
2615
+ # different YouTube channels. It allows content owners to authenticate once and
2616
+ # perform actions on behalf of the channel specified in the parameter value,
2617
+ # without having to provide authentication credentials for each separate channel.
2618
+ # @param [String] fields
2619
+ # Selector specifying which fields to include in a partial response.
2620
+ # @param [String] quota_user
2621
+ # Available to use for quota purposes for server-side applications. Can be any
2622
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2623
+ # @param [Google::Apis::RequestOptions] options
2624
+ # Request-specific options
2625
+ #
2626
+ # @yield [result, err] Result & error if block supplied
2627
+ # @yieldparam result [Google::Apis::YoutubeV3::Playlist] parsed result object
2628
+ # @yieldparam err [StandardError] error object if request failed
2629
+ #
2630
+ # @return [Google::Apis::YoutubeV3::Playlist]
2631
+ #
2632
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2633
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2634
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2635
+ def insert_playlist(part, playlist_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, options: nil, &block)
2636
+ command = make_simple_command(:post, 'youtube/v3/playlists', options)
2637
+ command.request_representation = Google::Apis::YoutubeV3::Playlist::Representation
2638
+ command.request_object = playlist_object
2639
+ command.response_representation = Google::Apis::YoutubeV3::Playlist::Representation
2640
+ command.response_class = Google::Apis::YoutubeV3::Playlist
2641
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2642
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
2643
+ command.query['part'] = part unless part.nil?
2644
+ command.query['fields'] = fields unless fields.nil?
2645
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2646
+ execute_or_queue_command(command, &block)
2647
+ end
2648
+
2649
+ # Retrieves a list of resources, possibly filtered.
2650
+ # @param [Array<String>, String] part
2651
+ # The *part* parameter specifies a comma-separated list of one or more playlist
2652
+ # resource properties that the API response will include. If the parameter
2653
+ # identifies a property that contains child properties, the child properties
2654
+ # will be included in the response. For example, in a playlist resource, the
2655
+ # snippet property contains properties like author, title, description, tags,
2656
+ # and timeCreated. As such, if you set *part=snippet*, the API response will
2657
+ # contain all of those properties.
2658
+ # @param [String] channel_id
2659
+ # Return the playlists owned by the specified channel ID.
2660
+ # @param [String] hl
2661
+ # Returen content in specified language
2662
+ # @param [Array<String>, String] id
2663
+ # Return the playlists with the given IDs for Stubby or Apiary.
2664
+ # @param [Fixnum] max_results
2665
+ # The *maxResults* parameter specifies the maximum number of items that should
2666
+ # be returned in the result set.
2667
+ # @param [Boolean] mine
2668
+ # Return the playlists owned by the authenticated user.
2669
+ # @param [String] on_behalf_of_content_owner
2670
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2671
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2672
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2673
+ # of the content owner specified in the parameter value. This parameter is
2674
+ # intended for YouTube content partners that own and manage many different
2675
+ # YouTube channels. It allows content owners to authenticate once and get access
2676
+ # to all their video and channel data, without having to provide authentication
2677
+ # credentials for each individual channel. The CMS account that the user
2678
+ # authenticates with must be linked to the specified YouTube content owner.
2679
+ # @param [String] on_behalf_of_content_owner_channel
2680
+ # This parameter can only be used in a properly authorized request. *Note:* This
2681
+ # parameter is intended exclusively for YouTube content partners. The *
2682
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
2683
+ # the channel to which a video is being added. This parameter is required when a
2684
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
2685
+ # only be used in conjunction with that parameter. In addition, the request must
2686
+ # be authorized using a CMS account that is linked to the content owner that the
2687
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
2688
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
2689
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
2690
+ # parameter is intended for YouTube content partners that own and manage many
2691
+ # different YouTube channels. It allows content owners to authenticate once and
2692
+ # perform actions on behalf of the channel specified in the parameter value,
2693
+ # without having to provide authentication credentials for each separate channel.
2694
+ # @param [String] page_token
2695
+ # The *pageToken* parameter identifies a specific page in the result set that
2696
+ # should be returned. In an API response, the nextPageToken and prevPageToken
2697
+ # properties identify other pages that could be retrieved.
2698
+ # @param [String] fields
2699
+ # Selector specifying which fields to include in a partial response.
2700
+ # @param [String] quota_user
2701
+ # Available to use for quota purposes for server-side applications. Can be any
2702
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2703
+ # @param [Google::Apis::RequestOptions] options
2704
+ # Request-specific options
2705
+ #
2706
+ # @yield [result, err] Result & error if block supplied
2707
+ # @yieldparam result [Google::Apis::YoutubeV3::ListPlaylistResponse] parsed result object
2708
+ # @yieldparam err [StandardError] error object if request failed
2709
+ #
2710
+ # @return [Google::Apis::YoutubeV3::ListPlaylistResponse]
2711
+ #
2712
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2713
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2714
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2715
+ def list_playlists(part, channel_id: nil, hl: nil, id: nil, max_results: nil, mine: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2716
+ command = make_simple_command(:get, 'youtube/v3/playlists', options)
2717
+ command.response_representation = Google::Apis::YoutubeV3::ListPlaylistResponse::Representation
2718
+ command.response_class = Google::Apis::YoutubeV3::ListPlaylistResponse
2719
+ command.query['channelId'] = channel_id unless channel_id.nil?
2720
+ command.query['hl'] = hl unless hl.nil?
2721
+ command.query['id'] = id unless id.nil?
2722
+ command.query['maxResults'] = max_results unless max_results.nil?
2723
+ command.query['mine'] = mine unless mine.nil?
2724
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2725
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
2726
+ command.query['pageToken'] = page_token unless page_token.nil?
2727
+ command.query['part'] = part unless part.nil?
2728
+ command.query['fields'] = fields unless fields.nil?
2729
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2730
+ execute_or_queue_command(command, &block)
2731
+ end
2732
+
2733
+ # Updates an existing resource.
2734
+ # @param [Array<String>, String] part
2735
+ # The *part* parameter serves two purposes in this operation. It identifies the
2736
+ # properties that the write operation will set as well as the properties that
2737
+ # the API response will include. Note that this method will override the
2738
+ # existing values for mutable properties that are contained in any parts that
2739
+ # the request body specifies. For example, a playlist's description is contained
2740
+ # in the snippet part, which must be included in the request body. If the
2741
+ # request does not specify a value for the snippet.description property, the
2742
+ # playlist's existing description will be deleted.
2743
+ # @param [Google::Apis::YoutubeV3::Playlist] playlist_object
2744
+ # @param [String] on_behalf_of_content_owner
2745
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2746
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2747
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2748
+ # of the content owner specified in the parameter value. This parameter is
2749
+ # intended for YouTube content partners that own and manage many different
2750
+ # YouTube channels. It allows content owners to authenticate once and get access
2751
+ # to all their video and channel data, without having to provide authentication
2752
+ # credentials for each individual channel. The CMS account that the user
2753
+ # authenticates with must be linked to the specified YouTube content owner.
2754
+ # @param [String] fields
2755
+ # Selector specifying which fields to include in a partial response.
2756
+ # @param [String] quota_user
2757
+ # Available to use for quota purposes for server-side applications. Can be any
2758
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2759
+ # @param [Google::Apis::RequestOptions] options
2760
+ # Request-specific options
2761
+ #
2762
+ # @yield [result, err] Result & error if block supplied
2763
+ # @yieldparam result [Google::Apis::YoutubeV3::Playlist] parsed result object
2764
+ # @yieldparam err [StandardError] error object if request failed
2765
+ #
2766
+ # @return [Google::Apis::YoutubeV3::Playlist]
2767
+ #
2768
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2769
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2770
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2771
+ def update_playlist(part, playlist_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
2772
+ command = make_simple_command(:put, 'youtube/v3/playlists', options)
2773
+ command.request_representation = Google::Apis::YoutubeV3::Playlist::Representation
2774
+ command.request_object = playlist_object
2775
+ command.response_representation = Google::Apis::YoutubeV3::Playlist::Representation
2776
+ command.response_class = Google::Apis::YoutubeV3::Playlist
2777
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2778
+ command.query['part'] = part unless part.nil?
2779
+ command.query['fields'] = fields unless fields.nil?
2780
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2781
+ execute_or_queue_command(command, &block)
2782
+ end
2783
+
2784
+ # Retrieves a list of search resources
2785
+ # @param [Array<String>, String] part
2786
+ # The *part* parameter specifies a comma-separated list of one or more search
2787
+ # resource properties that the API response will include. Set the parameter
2788
+ # value to snippet.
2789
+ # @param [String] channel_id
2790
+ # Filter on resources belonging to this channelId.
2791
+ # @param [String] channel_type
2792
+ # Add a filter on the channel search.
2793
+ # @param [String] event_type
2794
+ # Filter on the livestream status of the videos.
2795
+ # @param [Boolean] for_content_owner
2796
+ # Search owned by a content owner.
2797
+ # @param [Boolean] for_developer
2798
+ # Restrict the search to only retrieve videos uploaded using the project id of
2799
+ # the authenticated user.
2800
+ # @param [Boolean] for_mine
2801
+ # Search for the private videos of the authenticated user.
2802
+ # @param [String] location
2803
+ # Filter on location of the video
2804
+ # @param [String] location_radius
2805
+ # Filter on distance from the location (specified above).
2806
+ # @param [Fixnum] max_results
2807
+ # The *maxResults* parameter specifies the maximum number of items that should
2808
+ # be returned in the result set.
2809
+ # @param [String] on_behalf_of_content_owner
2810
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
2811
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
2812
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2813
+ # of the content owner specified in the parameter value. This parameter is
2814
+ # intended for YouTube content partners that own and manage many different
2815
+ # YouTube channels. It allows content owners to authenticate once and get access
2816
+ # to all their video and channel data, without having to provide authentication
2817
+ # credentials for each individual channel. The CMS account that the user
2818
+ # authenticates with must be linked to the specified YouTube content owner.
2819
+ # @param [String] order
2820
+ # Sort order of the results.
2821
+ # @param [String] page_token
2822
+ # The *pageToken* parameter identifies a specific page in the result set that
2823
+ # should be returned. In an API response, the nextPageToken and prevPageToken
2824
+ # properties identify other pages that could be retrieved.
2825
+ # @param [String] published_after
2826
+ # Filter on resources published after this date.
2827
+ # @param [String] published_before
2828
+ # Filter on resources published before this date.
2829
+ # @param [String] q
2830
+ # Textual search terms to match.
2831
+ # @param [String] region_code
2832
+ # Display the content as seen by viewers in this country.
2833
+ # @param [String] related_to_video_id
2834
+ # Search related to a resource.
2835
+ # @param [String] relevance_language
2836
+ # Return results relevant to this language.
2837
+ # @param [String] safe_search
2838
+ # Indicates whether the search results should include restricted content as well
2839
+ # as standard content.
2840
+ # @param [String] topic_id
2841
+ # Restrict results to a particular topic.
2842
+ # @param [Array<String>, String] type
2843
+ # Restrict results to a particular set of resource types from One Platform.
2844
+ # @param [String] video_caption
2845
+ # Filter on the presence of captions on the videos.
2846
+ # @param [String] video_category_id
2847
+ # Filter on videos in a specific category.
2848
+ # @param [String] video_definition
2849
+ # Filter on the definition of the videos.
2850
+ # @param [String] video_dimension
2851
+ # Filter on 3d videos.
2852
+ # @param [String] video_duration
2853
+ # Filter on the duration of the videos.
2854
+ # @param [String] video_embeddable
2855
+ # Filter on embeddable videos.
2856
+ # @param [String] video_license
2857
+ # Filter on the license of the videos.
2858
+ # @param [String] video_syndicated
2859
+ # Filter on syndicated videos.
2860
+ # @param [String] video_type
2861
+ # Filter on videos of a specific type.
2862
+ # @param [String] fields
2863
+ # Selector specifying which fields to include in a partial response.
2864
+ # @param [String] quota_user
2865
+ # Available to use for quota purposes for server-side applications. Can be any
2866
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2867
+ # @param [Google::Apis::RequestOptions] options
2868
+ # Request-specific options
2869
+ #
2870
+ # @yield [result, err] Result & error if block supplied
2871
+ # @yieldparam result [Google::Apis::YoutubeV3::SearchListsResponse] parsed result object
2872
+ # @yieldparam err [StandardError] error object if request failed
2873
+ #
2874
+ # @return [Google::Apis::YoutubeV3::SearchListsResponse]
2875
+ #
2876
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2877
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2878
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2879
+ def list_searches(part, channel_id: nil, channel_type: nil, event_type: nil, for_content_owner: nil, for_developer: nil, for_mine: nil, location: nil, location_radius: nil, max_results: nil, on_behalf_of_content_owner: nil, order: nil, page_token: nil, published_after: nil, published_before: nil, q: nil, region_code: nil, related_to_video_id: nil, relevance_language: nil, safe_search: nil, topic_id: nil, type: nil, video_caption: nil, video_category_id: nil, video_definition: nil, video_dimension: nil, video_duration: nil, video_embeddable: nil, video_license: nil, video_syndicated: nil, video_type: nil, fields: nil, quota_user: nil, options: nil, &block)
2880
+ command = make_simple_command(:get, 'youtube/v3/search', options)
2881
+ command.response_representation = Google::Apis::YoutubeV3::SearchListsResponse::Representation
2882
+ command.response_class = Google::Apis::YoutubeV3::SearchListsResponse
2883
+ command.query['channelId'] = channel_id unless channel_id.nil?
2884
+ command.query['channelType'] = channel_type unless channel_type.nil?
2885
+ command.query['eventType'] = event_type unless event_type.nil?
2886
+ command.query['forContentOwner'] = for_content_owner unless for_content_owner.nil?
2887
+ command.query['forDeveloper'] = for_developer unless for_developer.nil?
2888
+ command.query['forMine'] = for_mine unless for_mine.nil?
2889
+ command.query['location'] = location unless location.nil?
2890
+ command.query['locationRadius'] = location_radius unless location_radius.nil?
2891
+ command.query['maxResults'] = max_results unless max_results.nil?
2892
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2893
+ command.query['order'] = order unless order.nil?
2894
+ command.query['pageToken'] = page_token unless page_token.nil?
2895
+ command.query['part'] = part unless part.nil?
2896
+ command.query['publishedAfter'] = published_after unless published_after.nil?
2897
+ command.query['publishedBefore'] = published_before unless published_before.nil?
2898
+ command.query['q'] = q unless q.nil?
2899
+ command.query['regionCode'] = region_code unless region_code.nil?
2900
+ command.query['relatedToVideoId'] = related_to_video_id unless related_to_video_id.nil?
2901
+ command.query['relevanceLanguage'] = relevance_language unless relevance_language.nil?
2902
+ command.query['safeSearch'] = safe_search unless safe_search.nil?
2903
+ command.query['topicId'] = topic_id unless topic_id.nil?
2904
+ command.query['type'] = type unless type.nil?
2905
+ command.query['videoCaption'] = video_caption unless video_caption.nil?
2906
+ command.query['videoCategoryId'] = video_category_id unless video_category_id.nil?
2907
+ command.query['videoDefinition'] = video_definition unless video_definition.nil?
2908
+ command.query['videoDimension'] = video_dimension unless video_dimension.nil?
2909
+ command.query['videoDuration'] = video_duration unless video_duration.nil?
2910
+ command.query['videoEmbeddable'] = video_embeddable unless video_embeddable.nil?
2911
+ command.query['videoLicense'] = video_license unless video_license.nil?
2912
+ command.query['videoSyndicated'] = video_syndicated unless video_syndicated.nil?
2913
+ command.query['videoType'] = video_type unless video_type.nil?
2914
+ command.query['fields'] = fields unless fields.nil?
2915
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2916
+ execute_or_queue_command(command, &block)
2917
+ end
2918
+
2919
+ # Deletes a resource.
2920
+ # @param [String] id
2921
+ # @param [String] fields
2922
+ # Selector specifying which fields to include in a partial response.
2923
+ # @param [String] quota_user
2924
+ # Available to use for quota purposes for server-side applications. Can be any
2925
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2926
+ # @param [Google::Apis::RequestOptions] options
2927
+ # Request-specific options
2928
+ #
2929
+ # @yield [result, err] Result & error if block supplied
2930
+ # @yieldparam result [NilClass] No result returned for this method
2931
+ # @yieldparam err [StandardError] error object if request failed
2932
+ #
2933
+ # @return [void]
2934
+ #
2935
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2936
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2937
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2938
+ def delete_subscription(id, fields: nil, quota_user: nil, options: nil, &block)
2939
+ command = make_simple_command(:delete, 'youtube/v3/subscriptions', options)
2940
+ command.query['id'] = id unless id.nil?
2941
+ command.query['fields'] = fields unless fields.nil?
2942
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2943
+ execute_or_queue_command(command, &block)
2944
+ end
2945
+
2946
+ # Inserts a new resource into this collection.
2947
+ # @param [Array<String>, String] part
2948
+ # The *part* parameter serves two purposes in this operation. It identifies the
2949
+ # properties that the write operation will set as well as the properties that
2950
+ # the API response will include.
2951
+ # @param [Google::Apis::YoutubeV3::Subscription] subscription_object
2952
+ # @param [String] fields
2953
+ # Selector specifying which fields to include in a partial response.
2954
+ # @param [String] quota_user
2955
+ # Available to use for quota purposes for server-side applications. Can be any
2956
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2957
+ # @param [Google::Apis::RequestOptions] options
2958
+ # Request-specific options
2959
+ #
2960
+ # @yield [result, err] Result & error if block supplied
2961
+ # @yieldparam result [Google::Apis::YoutubeV3::Subscription] parsed result object
2962
+ # @yieldparam err [StandardError] error object if request failed
2963
+ #
2964
+ # @return [Google::Apis::YoutubeV3::Subscription]
2965
+ #
2966
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2967
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2968
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2969
+ def insert_subscription(part, subscription_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2970
+ command = make_simple_command(:post, 'youtube/v3/subscriptions', options)
2971
+ command.request_representation = Google::Apis::YoutubeV3::Subscription::Representation
2972
+ command.request_object = subscription_object
2973
+ command.response_representation = Google::Apis::YoutubeV3::Subscription::Representation
2974
+ command.response_class = Google::Apis::YoutubeV3::Subscription
2975
+ command.query['part'] = part unless part.nil?
2976
+ command.query['fields'] = fields unless fields.nil?
2977
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2978
+ execute_or_queue_command(command, &block)
2979
+ end
2980
+
2981
+ # Retrieves a list of resources, possibly filtered.
2982
+ # @param [Array<String>, String] part
2983
+ # The *part* parameter specifies a comma-separated list of one or more
2984
+ # subscription resource properties that the API response will include. If the
2985
+ # parameter identifies a property that contains child properties, the child
2986
+ # properties will be included in the response. For example, in a subscription
2987
+ # resource, the snippet property contains other properties, such as a display
2988
+ # title for the subscription. If you set *part=snippet*, the API response will
2989
+ # also contain all of those nested properties.
2990
+ # @param [String] channel_id
2991
+ # Return the subscriptions of the given channel owner.
2992
+ # @param [String] for_channel_id
2993
+ # Return the subscriptions to the subset of these channels that the
2994
+ # authenticated user is subscribed to.
2995
+ # @param [Array<String>, String] id
2996
+ # Return the subscriptions with the given IDs for Stubby or Apiary.
2997
+ # @param [Fixnum] max_results
2998
+ # The *maxResults* parameter specifies the maximum number of items that should
2999
+ # be returned in the result set.
3000
+ # @param [Boolean] mine
3001
+ # Flag for returning the subscriptions of the authenticated user.
3002
+ # @param [Boolean] my_recent_subscribers
3003
+ # @param [Boolean] my_subscribers
3004
+ # Return the subscribers of the given channel owner.
3005
+ # @param [String] on_behalf_of_content_owner
3006
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3007
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3008
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3009
+ # of the content owner specified in the parameter value. This parameter is
3010
+ # intended for YouTube content partners that own and manage many different
3011
+ # YouTube channels. It allows content owners to authenticate once and get access
3012
+ # to all their video and channel data, without having to provide authentication
3013
+ # credentials for each individual channel. The CMS account that the user
3014
+ # authenticates with must be linked to the specified YouTube content owner.
3015
+ # @param [String] on_behalf_of_content_owner_channel
3016
+ # This parameter can only be used in a properly authorized request. *Note:* This
3017
+ # parameter is intended exclusively for YouTube content partners. The *
3018
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
3019
+ # the channel to which a video is being added. This parameter is required when a
3020
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
3021
+ # only be used in conjunction with that parameter. In addition, the request must
3022
+ # be authorized using a CMS account that is linked to the content owner that the
3023
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
3024
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
3025
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
3026
+ # parameter is intended for YouTube content partners that own and manage many
3027
+ # different YouTube channels. It allows content owners to authenticate once and
3028
+ # perform actions on behalf of the channel specified in the parameter value,
3029
+ # without having to provide authentication credentials for each separate channel.
3030
+ # @param [String] order
3031
+ # The order of the returned subscriptions
3032
+ # @param [String] page_token
3033
+ # The *pageToken* parameter identifies a specific page in the result set that
3034
+ # should be returned. In an API response, the nextPageToken and prevPageToken
3035
+ # properties identify other pages that could be retrieved.
3036
+ # @param [String] fields
3037
+ # Selector specifying which fields to include in a partial response.
3038
+ # @param [String] quota_user
3039
+ # Available to use for quota purposes for server-side applications. Can be any
3040
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3041
+ # @param [Google::Apis::RequestOptions] options
3042
+ # Request-specific options
3043
+ #
3044
+ # @yield [result, err] Result & error if block supplied
3045
+ # @yieldparam result [Google::Apis::YoutubeV3::ListSubscriptionResponse] parsed result object
3046
+ # @yieldparam err [StandardError] error object if request failed
3047
+ #
3048
+ # @return [Google::Apis::YoutubeV3::ListSubscriptionResponse]
3049
+ #
3050
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3051
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3052
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3053
+ def list_subscriptions(part, channel_id: nil, for_channel_id: nil, id: nil, max_results: nil, mine: nil, my_recent_subscribers: nil, my_subscribers: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, order: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
3054
+ command = make_simple_command(:get, 'youtube/v3/subscriptions', options)
3055
+ command.response_representation = Google::Apis::YoutubeV3::ListSubscriptionResponse::Representation
3056
+ command.response_class = Google::Apis::YoutubeV3::ListSubscriptionResponse
3057
+ command.query['channelId'] = channel_id unless channel_id.nil?
3058
+ command.query['forChannelId'] = for_channel_id unless for_channel_id.nil?
3059
+ command.query['id'] = id unless id.nil?
3060
+ command.query['maxResults'] = max_results unless max_results.nil?
3061
+ command.query['mine'] = mine unless mine.nil?
3062
+ command.query['myRecentSubscribers'] = my_recent_subscribers unless my_recent_subscribers.nil?
3063
+ command.query['mySubscribers'] = my_subscribers unless my_subscribers.nil?
3064
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3065
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
3066
+ command.query['order'] = order unless order.nil?
3067
+ command.query['pageToken'] = page_token unless page_token.nil?
3068
+ command.query['part'] = part unless part.nil?
3069
+ command.query['fields'] = fields unless fields.nil?
3070
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3071
+ execute_or_queue_command(command, &block)
3072
+ end
3073
+
3074
+ # Retrieves a list of resources, possibly filtered.
3075
+ # @param [Array<String>, String] part
3076
+ # The *part* parameter specifies the superChatEvent resource parts that the API
3077
+ # response will include. Supported values are id and snippet.
3078
+ # @param [String] hl
3079
+ # Return rendered funding amounts in specified language.
3080
+ # @param [Fixnum] max_results
3081
+ # The *maxResults* parameter specifies the maximum number of items that should
3082
+ # be returned in the result set.
3083
+ # @param [String] page_token
3084
+ # The *pageToken* parameter identifies a specific page in the result set that
3085
+ # should be returned. In an API response, the nextPageToken and prevPageToken
3086
+ # properties identify other pages that could be retrieved.
3087
+ # @param [String] fields
3088
+ # Selector specifying which fields to include in a partial response.
3089
+ # @param [String] quota_user
3090
+ # Available to use for quota purposes for server-side applications. Can be any
3091
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3092
+ # @param [Google::Apis::RequestOptions] options
3093
+ # Request-specific options
3094
+ #
3095
+ # @yield [result, err] Result & error if block supplied
3096
+ # @yieldparam result [Google::Apis::YoutubeV3::SuperChatEventListResponse] parsed result object
3097
+ # @yieldparam err [StandardError] error object if request failed
3098
+ #
3099
+ # @return [Google::Apis::YoutubeV3::SuperChatEventListResponse]
3100
+ #
3101
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3102
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3103
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3104
+ def list_super_chat_events(part, hl: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
3105
+ command = make_simple_command(:get, 'youtube/v3/superChatEvents', options)
3106
+ command.response_representation = Google::Apis::YoutubeV3::SuperChatEventListResponse::Representation
3107
+ command.response_class = Google::Apis::YoutubeV3::SuperChatEventListResponse
3108
+ command.query['hl'] = hl unless hl.nil?
3109
+ command.query['maxResults'] = max_results unless max_results.nil?
3110
+ command.query['pageToken'] = page_token unless page_token.nil?
3111
+ command.query['part'] = part unless part.nil?
3112
+ command.query['fields'] = fields unless fields.nil?
3113
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3114
+ execute_or_queue_command(command, &block)
3115
+ end
3116
+
3117
+ # POST method.
3118
+ # @param [Array<String>, String] part
3119
+ # @param [Google::Apis::YoutubeV3::TestItem] test_item_object
3120
+ # @param [String] fields
3121
+ # Selector specifying which fields to include in a partial response.
3122
+ # @param [String] quota_user
3123
+ # Available to use for quota purposes for server-side applications. Can be any
3124
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3125
+ # @param [Google::Apis::RequestOptions] options
3126
+ # Request-specific options
3127
+ #
3128
+ # @yield [result, err] Result & error if block supplied
3129
+ # @yieldparam result [Google::Apis::YoutubeV3::TestItem] parsed result object
3130
+ # @yieldparam err [StandardError] error object if request failed
3131
+ #
3132
+ # @return [Google::Apis::YoutubeV3::TestItem]
3133
+ #
3134
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3135
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3136
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3137
+ def insert_test(part, test_item_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3138
+ command = make_simple_command(:post, 'youtube/v3/tests', options)
3139
+ command.request_representation = Google::Apis::YoutubeV3::TestItem::Representation
3140
+ command.request_object = test_item_object
3141
+ command.response_representation = Google::Apis::YoutubeV3::TestItem::Representation
3142
+ command.response_class = Google::Apis::YoutubeV3::TestItem
3143
+ command.query['part'] = part unless part.nil?
3144
+ command.query['fields'] = fields unless fields.nil?
3145
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3146
+ execute_or_queue_command(command, &block)
3147
+ end
3148
+
3149
+ # Deletes a resource.
3150
+ # @param [String] linking_token
3151
+ # Delete the partner links with the given linking token.
3152
+ # @param [String] type
3153
+ # Type of the link to be deleted.
3154
+ # @param [Array<String>, String] part
3155
+ # Do not use. Required for compatibility.
3156
+ # @param [String] fields
3157
+ # Selector specifying which fields to include in a partial response.
3158
+ # @param [String] quota_user
3159
+ # Available to use for quota purposes for server-side applications. Can be any
3160
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3161
+ # @param [Google::Apis::RequestOptions] options
3162
+ # Request-specific options
3163
+ #
3164
+ # @yield [result, err] Result & error if block supplied
3165
+ # @yieldparam result [NilClass] No result returned for this method
3166
+ # @yieldparam err [StandardError] error object if request failed
3167
+ #
3168
+ # @return [void]
3169
+ #
3170
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3171
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3172
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3173
+ def delete_third_party_link(linking_token, type, part: nil, fields: nil, quota_user: nil, options: nil, &block)
3174
+ command = make_simple_command(:delete, 'youtube/v3/thirdPartyLinks', options)
3175
+ command.query['linkingToken'] = linking_token unless linking_token.nil?
3176
+ command.query['part'] = part unless part.nil?
3177
+ command.query['type'] = type unless type.nil?
3178
+ command.query['fields'] = fields unless fields.nil?
3179
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3180
+ execute_or_queue_command(command, &block)
3181
+ end
3182
+
3183
+ # Inserts a new resource into this collection.
3184
+ # @param [Array<String>, String] part
3185
+ # The *part* parameter specifies the thirdPartyLink resource parts that the API
3186
+ # request and response will include. Supported values are linkingToken, status,
3187
+ # and snippet.
3188
+ # @param [Google::Apis::YoutubeV3::ThirdPartyLink] third_party_link_object
3189
+ # @param [String] fields
3190
+ # Selector specifying which fields to include in a partial response.
3191
+ # @param [String] quota_user
3192
+ # Available to use for quota purposes for server-side applications. Can be any
3193
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3194
+ # @param [Google::Apis::RequestOptions] options
3195
+ # Request-specific options
3196
+ #
3197
+ # @yield [result, err] Result & error if block supplied
3198
+ # @yieldparam result [Google::Apis::YoutubeV3::ThirdPartyLink] parsed result object
3199
+ # @yieldparam err [StandardError] error object if request failed
3200
+ #
3201
+ # @return [Google::Apis::YoutubeV3::ThirdPartyLink]
3202
+ #
3203
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3204
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3205
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3206
+ def insert_third_party_link(part, third_party_link_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3207
+ command = make_simple_command(:post, 'youtube/v3/thirdPartyLinks', options)
3208
+ command.request_representation = Google::Apis::YoutubeV3::ThirdPartyLink::Representation
3209
+ command.request_object = third_party_link_object
3210
+ command.response_representation = Google::Apis::YoutubeV3::ThirdPartyLink::Representation
3211
+ command.response_class = Google::Apis::YoutubeV3::ThirdPartyLink
3212
+ command.query['part'] = part unless part.nil?
3213
+ command.query['fields'] = fields unless fields.nil?
3214
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3215
+ execute_or_queue_command(command, &block)
3216
+ end
3217
+
3218
+ # Retrieves a list of resources, possibly filtered.
3219
+ # @param [Array<String>, String] part
3220
+ # The *part* parameter specifies the thirdPartyLink resource parts that the API
3221
+ # response will include. Supported values are linkingToken, status, and snippet.
3222
+ # @param [String] linking_token
3223
+ # Get a third party link with the given linking token.
3224
+ # @param [String] type
3225
+ # Get a third party link of the given type.
3226
+ # @param [String] fields
3227
+ # Selector specifying which fields to include in a partial response.
3228
+ # @param [String] quota_user
3229
+ # Available to use for quota purposes for server-side applications. Can be any
3230
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3231
+ # @param [Google::Apis::RequestOptions] options
3232
+ # Request-specific options
3233
+ #
3234
+ # @yield [result, err] Result & error if block supplied
3235
+ # @yieldparam result [Google::Apis::YoutubeV3::ThirdPartyLink] parsed result object
3236
+ # @yieldparam err [StandardError] error object if request failed
3237
+ #
3238
+ # @return [Google::Apis::YoutubeV3::ThirdPartyLink]
3239
+ #
3240
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3241
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3242
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3243
+ def list_third_party_links(part, linking_token: nil, type: nil, fields: nil, quota_user: nil, options: nil, &block)
3244
+ command = make_simple_command(:get, 'youtube/v3/thirdPartyLinks', options)
3245
+ command.response_representation = Google::Apis::YoutubeV3::ThirdPartyLink::Representation
3246
+ command.response_class = Google::Apis::YoutubeV3::ThirdPartyLink
3247
+ command.query['linkingToken'] = linking_token unless linking_token.nil?
3248
+ command.query['part'] = part unless part.nil?
3249
+ command.query['type'] = type unless type.nil?
3250
+ command.query['fields'] = fields unless fields.nil?
3251
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3252
+ execute_or_queue_command(command, &block)
3253
+ end
3254
+
3255
+ # Updates an existing resource.
3256
+ # @param [Array<String>, String] part
3257
+ # The *part* parameter specifies the thirdPartyLink resource parts that the API
3258
+ # request and response will include. Supported values are linkingToken, status,
3259
+ # and snippet.
3260
+ # @param [Google::Apis::YoutubeV3::ThirdPartyLink] third_party_link_object
3261
+ # @param [String] fields
3262
+ # Selector specifying which fields to include in a partial response.
3263
+ # @param [String] quota_user
3264
+ # Available to use for quota purposes for server-side applications. Can be any
3265
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3266
+ # @param [Google::Apis::RequestOptions] options
3267
+ # Request-specific options
3268
+ #
3269
+ # @yield [result, err] Result & error if block supplied
3270
+ # @yieldparam result [Google::Apis::YoutubeV3::ThirdPartyLink] parsed result object
3271
+ # @yieldparam err [StandardError] error object if request failed
3272
+ #
3273
+ # @return [Google::Apis::YoutubeV3::ThirdPartyLink]
3274
+ #
3275
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3276
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3277
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3278
+ def update_third_party_link(part, third_party_link_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3279
+ command = make_simple_command(:put, 'youtube/v3/thirdPartyLinks', options)
3280
+ command.request_representation = Google::Apis::YoutubeV3::ThirdPartyLink::Representation
3281
+ command.request_object = third_party_link_object
3282
+ command.response_representation = Google::Apis::YoutubeV3::ThirdPartyLink::Representation
3283
+ command.response_class = Google::Apis::YoutubeV3::ThirdPartyLink
3284
+ command.query['part'] = part unless part.nil?
3285
+ command.query['fields'] = fields unless fields.nil?
3286
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3287
+ execute_or_queue_command(command, &block)
3288
+ end
3289
+
3290
+ # As this is not an insert in a strict sense (it supports uploading/setting of a
3291
+ # thumbnail for multiple videos, which doesn't result in creation of a single
3292
+ # resource), I use a custom verb here.
3293
+ # @param [String] video_id
3294
+ # Returns the Thumbnail with the given video IDs for Stubby or Apiary.
3295
+ # @param [String] on_behalf_of_content_owner
3296
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3297
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3298
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3299
+ # of the content owner specified in the parameter value. This parameter is
3300
+ # intended for YouTube content partners that own and manage many different
3301
+ # YouTube channels. It allows content owners to authenticate once and get access
3302
+ # to all their video and channel data, without having to provide authentication
3303
+ # credentials for each individual channel. The actual CMS account that the user
3304
+ # authenticates with must be linked to the specified YouTube content owner.
3305
+ # @param [String] fields
3306
+ # Selector specifying which fields to include in a partial response.
3307
+ # @param [String] quota_user
3308
+ # Available to use for quota purposes for server-side applications. Can be any
3309
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3310
+ # @param [IO, String] upload_source
3311
+ # IO stream or filename containing content to upload
3312
+ # @param [String] content_type
3313
+ # Content type of the uploaded content.
3314
+ # @param [Google::Apis::RequestOptions] options
3315
+ # Request-specific options
3316
+ #
3317
+ # @yield [result, err] Result & error if block supplied
3318
+ # @yieldparam result [Google::Apis::YoutubeV3::SetThumbnailResponse] parsed result object
3319
+ # @yieldparam err [StandardError] error object if request failed
3320
+ #
3321
+ # @return [Google::Apis::YoutubeV3::SetThumbnailResponse]
3322
+ #
3323
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3324
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3325
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3326
+ def set_thumbnail(video_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
3327
+ if upload_source.nil?
3328
+ command = make_simple_command(:post, 'youtube/v3/thumbnails/set', options)
3329
+ else
3330
+ command = make_upload_command(:post, 'youtube/v3/thumbnails/set', options)
3331
+ command.upload_source = upload_source
3332
+ command.upload_content_type = content_type
3333
+ end
3334
+ command.response_representation = Google::Apis::YoutubeV3::SetThumbnailResponse::Representation
3335
+ command.response_class = Google::Apis::YoutubeV3::SetThumbnailResponse
3336
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3337
+ command.query['videoId'] = video_id unless video_id.nil?
3338
+ command.query['fields'] = fields unless fields.nil?
3339
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3340
+ execute_or_queue_command(command, &block)
3341
+ end
3342
+
3343
+ # Retrieves a list of resources, possibly filtered.
3344
+ # @param [Array<String>, String] part
3345
+ # The *part* parameter specifies the videoCategory resource parts that the API
3346
+ # response will include. Supported values are id and snippet.
3347
+ # @param [String] hl
3348
+ # @param [String] fields
3349
+ # Selector specifying which fields to include in a partial response.
3350
+ # @param [String] quota_user
3351
+ # Available to use for quota purposes for server-side applications. Can be any
3352
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3353
+ # @param [Google::Apis::RequestOptions] options
3354
+ # Request-specific options
3355
+ #
3356
+ # @yield [result, err] Result & error if block supplied
3357
+ # @yieldparam result [Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse] parsed result object
3358
+ # @yieldparam err [StandardError] error object if request failed
3359
+ #
3360
+ # @return [Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse]
3361
+ #
3362
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3363
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3364
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3365
+ def list_video_abuse_report_reasons(part, hl: nil, fields: nil, quota_user: nil, options: nil, &block)
3366
+ command = make_simple_command(:get, 'youtube/v3/videoAbuseReportReasons', options)
3367
+ command.response_representation = Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse::Representation
3368
+ command.response_class = Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse
3369
+ command.query['hl'] = hl unless hl.nil?
3370
+ command.query['part'] = part unless part.nil?
3371
+ command.query['fields'] = fields unless fields.nil?
3372
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3373
+ execute_or_queue_command(command, &block)
3374
+ end
3375
+
3376
+ # Retrieves a list of resources, possibly filtered.
3377
+ # @param [Array<String>, String] part
3378
+ # The *part* parameter specifies the videoCategory resource properties that the
3379
+ # API response will include. Set the parameter value to snippet.
3380
+ # @param [String] hl
3381
+ # @param [Array<String>, String] id
3382
+ # Returns the video categories with the given IDs for Stubby or Apiary.
3383
+ # @param [String] region_code
3384
+ # @param [String] fields
3385
+ # Selector specifying which fields to include in a partial response.
3386
+ # @param [String] quota_user
3387
+ # Available to use for quota purposes for server-side applications. Can be any
3388
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3389
+ # @param [Google::Apis::RequestOptions] options
3390
+ # Request-specific options
3391
+ #
3392
+ # @yield [result, err] Result & error if block supplied
3393
+ # @yieldparam result [Google::Apis::YoutubeV3::ListVideoCategoryResponse] parsed result object
3394
+ # @yieldparam err [StandardError] error object if request failed
3395
+ #
3396
+ # @return [Google::Apis::YoutubeV3::ListVideoCategoryResponse]
3397
+ #
3398
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3399
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3400
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3401
+ def list_video_categories(part, hl: nil, id: nil, region_code: nil, fields: nil, quota_user: nil, options: nil, &block)
3402
+ command = make_simple_command(:get, 'youtube/v3/videoCategories', options)
3403
+ command.response_representation = Google::Apis::YoutubeV3::ListVideoCategoryResponse::Representation
3404
+ command.response_class = Google::Apis::YoutubeV3::ListVideoCategoryResponse
3405
+ command.query['hl'] = hl unless hl.nil?
3406
+ command.query['id'] = id unless id.nil?
3407
+ command.query['part'] = part unless part.nil?
3408
+ command.query['regionCode'] = region_code unless region_code.nil?
3409
+ command.query['fields'] = fields unless fields.nil?
3410
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3411
+ execute_or_queue_command(command, &block)
3412
+ end
3413
+
3414
+ # Deletes a resource.
3415
+ # @param [String] id
3416
+ # @param [String] on_behalf_of_content_owner
3417
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3418
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3419
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3420
+ # of the content owner specified in the parameter value. This parameter is
3421
+ # intended for YouTube content partners that own and manage many different
3422
+ # YouTube channels. It allows content owners to authenticate once and get access
3423
+ # to all their video and channel data, without having to provide authentication
3424
+ # credentials for each individual channel. The actual CMS account that the user
3425
+ # authenticates with must be linked to the specified YouTube content owner.
3426
+ # @param [String] fields
3427
+ # Selector specifying which fields to include in a partial response.
3428
+ # @param [String] quota_user
3429
+ # Available to use for quota purposes for server-side applications. Can be any
3430
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3431
+ # @param [Google::Apis::RequestOptions] options
3432
+ # Request-specific options
3433
+ #
3434
+ # @yield [result, err] Result & error if block supplied
3435
+ # @yieldparam result [NilClass] No result returned for this method
3436
+ # @yieldparam err [StandardError] error object if request failed
3437
+ #
3438
+ # @return [void]
3439
+ #
3440
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3441
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3442
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3443
+ def delete_video(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
3444
+ command = make_simple_command(:delete, 'youtube/v3/videos', options)
3445
+ command.query['id'] = id unless id.nil?
3446
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3447
+ command.query['fields'] = fields unless fields.nil?
3448
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3449
+ execute_or_queue_command(command, &block)
3450
+ end
3451
+
3452
+ # Retrieves the ratings that the authorized user gave to a list of specified
3453
+ # videos.
3454
+ # @param [Array<String>, String] id
3455
+ # @param [String] on_behalf_of_content_owner
3456
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3457
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3458
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3459
+ # of the content owner specified in the parameter value. This parameter is
3460
+ # intended for YouTube content partners that own and manage many different
3461
+ # YouTube channels. It allows content owners to authenticate once and get access
3462
+ # to all their video and channel data, without having to provide authentication
3463
+ # credentials for each individual channel. The CMS account that the user
3464
+ # authenticates with must be linked to the specified YouTube content owner.
3465
+ # @param [String] fields
3466
+ # Selector specifying which fields to include in a partial response.
3467
+ # @param [String] quota_user
3468
+ # Available to use for quota purposes for server-side applications. Can be any
3469
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3470
+ # @param [Google::Apis::RequestOptions] options
3471
+ # Request-specific options
3472
+ #
3473
+ # @yield [result, err] Result & error if block supplied
3474
+ # @yieldparam result [Google::Apis::YoutubeV3::VideoRatingListResponse] parsed result object
3475
+ # @yieldparam err [StandardError] error object if request failed
3476
+ #
3477
+ # @return [Google::Apis::YoutubeV3::VideoRatingListResponse]
3478
+ #
3479
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3480
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3481
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3482
+ def get_video_rating(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
3483
+ command = make_simple_command(:get, 'youtube/v3/videos/getRating', options)
3484
+ command.response_representation = Google::Apis::YoutubeV3::VideoRatingListResponse::Representation
3485
+ command.response_class = Google::Apis::YoutubeV3::VideoRatingListResponse
3486
+ command.query['id'] = id unless id.nil?
3487
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3488
+ command.query['fields'] = fields unless fields.nil?
3489
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3490
+ execute_or_queue_command(command, &block)
3491
+ end
3492
+
3493
+ # Inserts a new resource into this collection.
3494
+ # @param [Array<String>, String] part
3495
+ # The *part* parameter serves two purposes in this operation. It identifies the
3496
+ # properties that the write operation will set as well as the properties that
3497
+ # the API response will include. Note that not all parts contain properties that
3498
+ # can be set when inserting or updating a video. For example, the statistics
3499
+ # object encapsulates statistics that YouTube calculates for a video and does
3500
+ # not contain values that you can set or modify. If the parameter value
3501
+ # specifies a part that does not contain mutable values, that part will still be
3502
+ # included in the API response.
3503
+ # @param [Google::Apis::YoutubeV3::Video] video_object
3504
+ # @param [Boolean] auto_levels
3505
+ # Should auto-levels be applied to the upload.
3506
+ # @param [Boolean] notify_subscribers
3507
+ # Notify the channel subscribers about the new video. As default, the
3508
+ # notification is enabled.
3509
+ # @param [String] on_behalf_of_content_owner
3510
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3511
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3512
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3513
+ # of the content owner specified in the parameter value. This parameter is
3514
+ # intended for YouTube content partners that own and manage many different
3515
+ # YouTube channels. It allows content owners to authenticate once and get access
3516
+ # to all their video and channel data, without having to provide authentication
3517
+ # credentials for each individual channel. The CMS account that the user
3518
+ # authenticates with must be linked to the specified YouTube content owner.
3519
+ # @param [String] on_behalf_of_content_owner_channel
3520
+ # This parameter can only be used in a properly authorized request. *Note:* This
3521
+ # parameter is intended exclusively for YouTube content partners. The *
3522
+ # onBehalfOfContentOwnerChannel* parameter specifies the YouTube channel ID of
3523
+ # the channel to which a video is being added. This parameter is required when a
3524
+ # request specifies a value for the onBehalfOfContentOwner parameter, and it can
3525
+ # only be used in conjunction with that parameter. In addition, the request must
3526
+ # be authorized using a CMS account that is linked to the content owner that the
3527
+ # onBehalfOfContentOwner parameter specifies. Finally, the channel that the
3528
+ # onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
3529
+ # content owner that the onBehalfOfContentOwner parameter specifies. This
3530
+ # parameter is intended for YouTube content partners that own and manage many
3531
+ # different YouTube channels. It allows content owners to authenticate once and
3532
+ # perform actions on behalf of the channel specified in the parameter value,
3533
+ # without having to provide authentication credentials for each separate channel.
3534
+ # @param [Boolean] stabilize
3535
+ # Should stabilize be applied to the upload.
3536
+ # @param [String] fields
3537
+ # Selector specifying which fields to include in a partial response.
3538
+ # @param [String] quota_user
3539
+ # Available to use for quota purposes for server-side applications. Can be any
3540
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3541
+ # @param [IO, String] upload_source
3542
+ # IO stream or filename containing content to upload
3543
+ # @param [String] content_type
3544
+ # Content type of the uploaded content.
3545
+ # @param [Google::Apis::RequestOptions] options
3546
+ # Request-specific options
3547
+ #
3548
+ # @yield [result, err] Result & error if block supplied
3549
+ # @yieldparam result [Google::Apis::YoutubeV3::Video] parsed result object
3550
+ # @yieldparam err [StandardError] error object if request failed
3551
+ #
3552
+ # @return [Google::Apis::YoutubeV3::Video]
3553
+ #
3554
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3555
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3556
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3557
+ def insert_video(part, video_object = nil, auto_levels: nil, notify_subscribers: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, stabilize: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
3558
+ if upload_source.nil?
3559
+ command = make_simple_command(:post, 'youtube/v3/videos', options)
3560
+ else
3561
+ command = make_upload_command(:post, 'youtube/v3/videos', options)
3562
+ command.upload_source = upload_source
3563
+ command.upload_content_type = content_type
3564
+ end
3565
+ command.request_representation = Google::Apis::YoutubeV3::Video::Representation
3566
+ command.request_object = video_object
3567
+ command.response_representation = Google::Apis::YoutubeV3::Video::Representation
3568
+ command.response_class = Google::Apis::YoutubeV3::Video
3569
+ command.query['autoLevels'] = auto_levels unless auto_levels.nil?
3570
+ command.query['notifySubscribers'] = notify_subscribers unless notify_subscribers.nil?
3571
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3572
+ command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
3573
+ command.query['part'] = part unless part.nil?
3574
+ command.query['stabilize'] = stabilize unless stabilize.nil?
3575
+ command.query['fields'] = fields unless fields.nil?
3576
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3577
+ execute_or_queue_command(command, &block)
3578
+ end
3579
+
3580
+ # Retrieves a list of resources, possibly filtered.
3581
+ # @param [Array<String>, String] part
3582
+ # The *part* parameter specifies a comma-separated list of one or more video
3583
+ # resource properties that the API response will include. If the parameter
3584
+ # identifies a property that contains child properties, the child properties
3585
+ # will be included in the response. For example, in a video resource, the
3586
+ # snippet property contains the channelId, title, description, tags, and
3587
+ # categoryId properties. As such, if you set *part=snippet*, the API response
3588
+ # will contain all of those properties.
3589
+ # @param [String] chart
3590
+ # Return the videos that are in the specified chart.
3591
+ # @param [String] hl
3592
+ # Stands for "host language". Specifies the localization language of the
3593
+ # metadata to be filled into snippet.localized. The field is filled with the
3594
+ # default metadata if there is no localization in the specified language. The
3595
+ # parameter value must be a language code included in the list returned by the
3596
+ # i18nLanguages.list method (e.g. en_US, es_MX).
3597
+ # @param [Array<String>, String] id
3598
+ # Return videos with the given ids.
3599
+ # @param [String] locale
3600
+ # @param [Fixnum] max_height
3601
+ # @param [Fixnum] max_results
3602
+ # The *maxResults* parameter specifies the maximum number of items that should
3603
+ # be returned in the result set. *Note:* This parameter is supported for use in
3604
+ # conjunction with the myRating and chart parameters, but it is not supported
3605
+ # for use in conjunction with the id parameter.
3606
+ # @param [Fixnum] max_width
3607
+ # Return the player with maximum height specified in
3608
+ # @param [String] my_rating
3609
+ # Return videos liked/disliked by the authenticated user. Does not support
3610
+ # RateType.RATED_TYPE_NONE.
3611
+ # @param [String] on_behalf_of_content_owner
3612
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3613
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3614
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3615
+ # of the content owner specified in the parameter value. This parameter is
3616
+ # intended for YouTube content partners that own and manage many different
3617
+ # YouTube channels. It allows content owners to authenticate once and get access
3618
+ # to all their video and channel data, without having to provide authentication
3619
+ # credentials for each individual channel. The CMS account that the user
3620
+ # authenticates with must be linked to the specified YouTube content owner.
3621
+ # @param [String] page_token
3622
+ # The *pageToken* parameter identifies a specific page in the result set that
3623
+ # should be returned. In an API response, the nextPageToken and prevPageToken
3624
+ # properties identify other pages that could be retrieved. *Note:* This
3625
+ # parameter is supported for use in conjunction with the myRating and chart
3626
+ # parameters, but it is not supported for use in conjunction with the id
3627
+ # parameter.
3628
+ # @param [String] region_code
3629
+ # Use a chart that is specific to the specified region
3630
+ # @param [String] video_category_id
3631
+ # Use chart that is specific to the specified video category
3632
+ # @param [String] fields
3633
+ # Selector specifying which fields to include in a partial response.
3634
+ # @param [String] quota_user
3635
+ # Available to use for quota purposes for server-side applications. Can be any
3636
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3637
+ # @param [Google::Apis::RequestOptions] options
3638
+ # Request-specific options
3639
+ #
3640
+ # @yield [result, err] Result & error if block supplied
3641
+ # @yieldparam result [Google::Apis::YoutubeV3::ListVideosResponse] parsed result object
3642
+ # @yieldparam err [StandardError] error object if request failed
3643
+ #
3644
+ # @return [Google::Apis::YoutubeV3::ListVideosResponse]
3645
+ #
3646
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3647
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3648
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3649
+ def list_videos(part, chart: nil, hl: nil, id: nil, locale: nil, max_height: nil, max_results: nil, max_width: nil, my_rating: nil, on_behalf_of_content_owner: nil, page_token: nil, region_code: nil, video_category_id: nil, fields: nil, quota_user: nil, options: nil, &block)
3650
+ command = make_simple_command(:get, 'youtube/v3/videos', options)
3651
+ command.response_representation = Google::Apis::YoutubeV3::ListVideosResponse::Representation
3652
+ command.response_class = Google::Apis::YoutubeV3::ListVideosResponse
3653
+ command.query['chart'] = chart unless chart.nil?
3654
+ command.query['hl'] = hl unless hl.nil?
3655
+ command.query['id'] = id unless id.nil?
3656
+ command.query['locale'] = locale unless locale.nil?
3657
+ command.query['maxHeight'] = max_height unless max_height.nil?
3658
+ command.query['maxResults'] = max_results unless max_results.nil?
3659
+ command.query['maxWidth'] = max_width unless max_width.nil?
3660
+ command.query['myRating'] = my_rating unless my_rating.nil?
3661
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3662
+ command.query['pageToken'] = page_token unless page_token.nil?
3663
+ command.query['part'] = part unless part.nil?
3664
+ command.query['regionCode'] = region_code unless region_code.nil?
3665
+ command.query['videoCategoryId'] = video_category_id unless video_category_id.nil?
3666
+ command.query['fields'] = fields unless fields.nil?
3667
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3668
+ execute_or_queue_command(command, &block)
3669
+ end
3670
+
3671
+ # Adds a like or dislike rating to a video or removes a rating from a video.
3672
+ # @param [String] id
3673
+ # @param [String] rating
3674
+ # @param [String] fields
3675
+ # Selector specifying which fields to include in a partial response.
3676
+ # @param [String] quota_user
3677
+ # Available to use for quota purposes for server-side applications. Can be any
3678
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3679
+ # @param [Google::Apis::RequestOptions] options
3680
+ # Request-specific options
3681
+ #
3682
+ # @yield [result, err] Result & error if block supplied
3683
+ # @yieldparam result [NilClass] No result returned for this method
3684
+ # @yieldparam err [StandardError] error object if request failed
3685
+ #
3686
+ # @return [void]
3687
+ #
3688
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3689
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3690
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3691
+ def rate_video(id, rating, fields: nil, quota_user: nil, options: nil, &block)
3692
+ command = make_simple_command(:post, 'youtube/v3/videos/rate', options)
3693
+ command.query['id'] = id unless id.nil?
3694
+ command.query['rating'] = rating unless rating.nil?
3695
+ command.query['fields'] = fields unless fields.nil?
3696
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3697
+ execute_or_queue_command(command, &block)
3698
+ end
3699
+
3700
+ # Report abuse for a video.
3701
+ # @param [Google::Apis::YoutubeV3::VideoAbuseReport] video_abuse_report_object
3702
+ # @param [String] on_behalf_of_content_owner
3703
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3704
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3705
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3706
+ # of the content owner specified in the parameter value. This parameter is
3707
+ # intended for YouTube content partners that own and manage many different
3708
+ # YouTube channels. It allows content owners to authenticate once and get access
3709
+ # to all their video and channel data, without having to provide authentication
3710
+ # credentials for each individual channel. The CMS account that the user
3711
+ # authenticates with must be linked to the specified YouTube content owner.
3712
+ # @param [String] fields
3713
+ # Selector specifying which fields to include in a partial response.
3714
+ # @param [String] quota_user
3715
+ # Available to use for quota purposes for server-side applications. Can be any
3716
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3717
+ # @param [Google::Apis::RequestOptions] options
3718
+ # Request-specific options
3719
+ #
3720
+ # @yield [result, err] Result & error if block supplied
3721
+ # @yieldparam result [NilClass] No result returned for this method
3722
+ # @yieldparam err [StandardError] error object if request failed
3723
+ #
3724
+ # @return [void]
3725
+ #
3726
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3727
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3728
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3729
+ def report_video_abuse(video_abuse_report_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
3730
+ command = make_simple_command(:post, 'youtube/v3/videos/reportAbuse', options)
3731
+ command.request_representation = Google::Apis::YoutubeV3::VideoAbuseReport::Representation
3732
+ command.request_object = video_abuse_report_object
3733
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3734
+ command.query['fields'] = fields unless fields.nil?
3735
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3736
+ execute_or_queue_command(command, &block)
3737
+ end
3738
+
3739
+ # Updates an existing resource.
3740
+ # @param [Array<String>, String] part
3741
+ # The *part* parameter serves two purposes in this operation. It identifies the
3742
+ # properties that the write operation will set as well as the properties that
3743
+ # the API response will include. Note that this method will override the
3744
+ # existing values for all of the mutable properties that are contained in any
3745
+ # parts that the parameter value specifies. For example, a video's privacy
3746
+ # setting is contained in the status part. As such, if your request is updating
3747
+ # a private video, and the request's part parameter value includes the status
3748
+ # part, the video's privacy setting will be updated to whatever value the
3749
+ # request body specifies. If the request body does not specify a value, the
3750
+ # existing privacy setting will be removed and the video will revert to the
3751
+ # default privacy setting. In addition, not all parts contain properties that
3752
+ # can be set when inserting or updating a video. For example, the statistics
3753
+ # object encapsulates statistics that YouTube calculates for a video and does
3754
+ # not contain values that you can set or modify. If the parameter value
3755
+ # specifies a part that does not contain mutable values, that part will still be
3756
+ # included in the API response.
3757
+ # @param [Google::Apis::YoutubeV3::Video] video_object
3758
+ # @param [String] on_behalf_of_content_owner
3759
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3760
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3761
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3762
+ # of the content owner specified in the parameter value. This parameter is
3763
+ # intended for YouTube content partners that own and manage many different
3764
+ # YouTube channels. It allows content owners to authenticate once and get access
3765
+ # to all their video and channel data, without having to provide authentication
3766
+ # credentials for each individual channel. The actual CMS account that the user
3767
+ # authenticates with must be linked to the specified YouTube content owner.
3768
+ # @param [String] fields
3769
+ # Selector specifying which fields to include in a partial response.
3770
+ # @param [String] quota_user
3771
+ # Available to use for quota purposes for server-side applications. Can be any
3772
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3773
+ # @param [Google::Apis::RequestOptions] options
3774
+ # Request-specific options
3775
+ #
3776
+ # @yield [result, err] Result & error if block supplied
3777
+ # @yieldparam result [Google::Apis::YoutubeV3::Video] parsed result object
3778
+ # @yieldparam err [StandardError] error object if request failed
3779
+ #
3780
+ # @return [Google::Apis::YoutubeV3::Video]
3781
+ #
3782
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3783
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3784
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3785
+ def update_video(part, video_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
3786
+ command = make_simple_command(:put, 'youtube/v3/videos', options)
3787
+ command.request_representation = Google::Apis::YoutubeV3::Video::Representation
3788
+ command.request_object = video_object
3789
+ command.response_representation = Google::Apis::YoutubeV3::Video::Representation
3790
+ command.response_class = Google::Apis::YoutubeV3::Video
3791
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3792
+ command.query['part'] = part unless part.nil?
3793
+ command.query['fields'] = fields unless fields.nil?
3794
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3795
+ execute_or_queue_command(command, &block)
3796
+ end
3797
+
3798
+ # Allows upload of watermark image and setting it for a channel.
3799
+ # @param [String] channel_id
3800
+ # @param [Google::Apis::YoutubeV3::InvideoBranding] invideo_branding_object
3801
+ # @param [String] on_behalf_of_content_owner
3802
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3803
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3804
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3805
+ # of the content owner specified in the parameter value. This parameter is
3806
+ # intended for YouTube content partners that own and manage many different
3807
+ # YouTube channels. It allows content owners to authenticate once and get access
3808
+ # to all their video and channel data, without having to provide authentication
3809
+ # credentials for each individual channel. The CMS account that the user
3810
+ # authenticates with must be linked to the specified YouTube content owner.
3811
+ # @param [String] fields
3812
+ # Selector specifying which fields to include in a partial response.
3813
+ # @param [String] quota_user
3814
+ # Available to use for quota purposes for server-side applications. Can be any
3815
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3816
+ # @param [IO, String] upload_source
3817
+ # IO stream or filename containing content to upload
3818
+ # @param [String] content_type
3819
+ # Content type of the uploaded content.
3820
+ # @param [Google::Apis::RequestOptions] options
3821
+ # Request-specific options
3822
+ #
3823
+ # @yield [result, err] Result & error if block supplied
3824
+ # @yieldparam result [NilClass] No result returned for this method
3825
+ # @yieldparam err [StandardError] error object if request failed
3826
+ #
3827
+ # @return [void]
3828
+ #
3829
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3830
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3831
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3832
+ def set_watermark(channel_id, invideo_branding_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
3833
+ if upload_source.nil?
3834
+ command = make_simple_command(:post, 'youtube/v3/watermarks/set', options)
3835
+ else
3836
+ command = make_upload_command(:post, 'youtube/v3/watermarks/set', options)
3837
+ command.upload_source = upload_source
3838
+ command.upload_content_type = content_type
3839
+ end
3840
+ command.request_representation = Google::Apis::YoutubeV3::InvideoBranding::Representation
3841
+ command.request_object = invideo_branding_object
3842
+ command.query['channelId'] = channel_id unless channel_id.nil?
3843
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3844
+ command.query['fields'] = fields unless fields.nil?
3845
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3846
+ execute_or_queue_command(command, &block)
3847
+ end
3848
+
3849
+ # Allows removal of channel watermark.
3850
+ # @param [String] channel_id
3851
+ # @param [String] on_behalf_of_content_owner
3852
+ # *Note:* This parameter is intended exclusively for YouTube content partners.
3853
+ # The *onBehalfOfContentOwner* parameter indicates that the request's
3854
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
3855
+ # of the content owner specified in the parameter value. This parameter is
3856
+ # intended for YouTube content partners that own and manage many different
3857
+ # YouTube channels. It allows content owners to authenticate once and get access
3858
+ # to all their video and channel data, without having to provide authentication
3859
+ # credentials for each individual channel. The CMS account that the user
3860
+ # authenticates with must be linked to the specified YouTube content owner.
3861
+ # @param [String] fields
3862
+ # Selector specifying which fields to include in a partial response.
3863
+ # @param [String] quota_user
3864
+ # Available to use for quota purposes for server-side applications. Can be any
3865
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3866
+ # @param [Google::Apis::RequestOptions] options
3867
+ # Request-specific options
3868
+ #
3869
+ # @yield [result, err] Result & error if block supplied
3870
+ # @yieldparam result [NilClass] No result returned for this method
3871
+ # @yieldparam err [StandardError] error object if request failed
3872
+ #
3873
+ # @return [void]
3874
+ #
3875
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3876
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3877
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3878
+ def unset_watermark(channel_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
3879
+ command = make_simple_command(:post, 'youtube/v3/watermarks/unset', options)
3880
+ command.query['channelId'] = channel_id unless channel_id.nil?
3881
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3882
+ command.query['fields'] = fields unless fields.nil?
3883
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3884
+ execute_or_queue_command(command, &block)
3885
+ end
3886
+
3887
+ protected
3888
+
3889
+ def apply_command_defaults(command)
3890
+ command.query['key'] = key unless key.nil?
3891
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3892
+ end
3893
+ end
3894
+ end
3895
+ end
3896
+ end