google-apis-youtubereporting_v1 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,28 @@
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
+ module Google
16
+ module Apis
17
+ module YoutubereportingV1
18
+ # Version of the google-apis-youtubereporting_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200801"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,355 @@
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 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module YoutubereportingV1
24
+
25
+ class Empty
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GdataBlobstore2Info
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GdataCompositeMedia
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GdataContentTypeInfo
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GdataDiffChecksumsResponse
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GdataDiffDownloadResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GdataDiffUploadRequest
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GdataDiffUploadResponse
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GdataDiffVersionResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GdataDownloadParameters
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GdataMedia
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GdataObjectId
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Job
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class ListJobsResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class ListReportTypesResponse
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class ListReportsResponse
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Report
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class ReportType
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class Empty
134
+ # @private
135
+ class Representation < Google::Apis::Core::JsonRepresentation
136
+ end
137
+ end
138
+
139
+ class GdataBlobstore2Info
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ property :blob_generation, :numeric_string => true, as: 'blobGeneration'
143
+ property :blob_id, as: 'blobId'
144
+ property :download_read_handle, :base64 => true, as: 'downloadReadHandle'
145
+ property :read_token, as: 'readToken'
146
+ property :upload_metadata_container, :base64 => true, as: 'uploadMetadataContainer'
147
+ end
148
+ end
149
+
150
+ class GdataCompositeMedia
151
+ # @private
152
+ class Representation < Google::Apis::Core::JsonRepresentation
153
+ property :blob_ref, :base64 => true, as: 'blobRef'
154
+ property :blobstore2_info, as: 'blobstore2Info', class: Google::Apis::YoutubereportingV1::GdataBlobstore2Info, decorator: Google::Apis::YoutubereportingV1::GdataBlobstore2Info::Representation
155
+
156
+ property :cosmo_binary_reference, :base64 => true, as: 'cosmoBinaryReference'
157
+ property :crc32c_hash, as: 'crc32cHash'
158
+ property :inline, :base64 => true, as: 'inline'
159
+ property :length, :numeric_string => true, as: 'length'
160
+ property :md5_hash, :base64 => true, as: 'md5Hash'
161
+ property :object_id_prop, as: 'objectId', class: Google::Apis::YoutubereportingV1::GdataObjectId, decorator: Google::Apis::YoutubereportingV1::GdataObjectId::Representation
162
+
163
+ property :path, as: 'path'
164
+ property :reference_type, as: 'referenceType'
165
+ property :sha1_hash, :base64 => true, as: 'sha1Hash'
166
+ end
167
+ end
168
+
169
+ class GdataContentTypeInfo
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ property :best_guess, as: 'bestGuess'
173
+ property :from_bytes, as: 'fromBytes'
174
+ property :from_file_name, as: 'fromFileName'
175
+ property :from_header, as: 'fromHeader'
176
+ property :from_url_path, as: 'fromUrlPath'
177
+ end
178
+ end
179
+
180
+ class GdataDiffChecksumsResponse
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ property :checksums_location, as: 'checksumsLocation', class: Google::Apis::YoutubereportingV1::GdataCompositeMedia, decorator: Google::Apis::YoutubereportingV1::GdataCompositeMedia::Representation
184
+
185
+ property :chunk_size_bytes, :numeric_string => true, as: 'chunkSizeBytes'
186
+ property :object_location, as: 'objectLocation', class: Google::Apis::YoutubereportingV1::GdataCompositeMedia, decorator: Google::Apis::YoutubereportingV1::GdataCompositeMedia::Representation
187
+
188
+ property :object_size_bytes, :numeric_string => true, as: 'objectSizeBytes'
189
+ property :object_version, as: 'objectVersion'
190
+ end
191
+ end
192
+
193
+ class GdataDiffDownloadResponse
194
+ # @private
195
+ class Representation < Google::Apis::Core::JsonRepresentation
196
+ property :object_location, as: 'objectLocation', class: Google::Apis::YoutubereportingV1::GdataCompositeMedia, decorator: Google::Apis::YoutubereportingV1::GdataCompositeMedia::Representation
197
+
198
+ end
199
+ end
200
+
201
+ class GdataDiffUploadRequest
202
+ # @private
203
+ class Representation < Google::Apis::Core::JsonRepresentation
204
+ property :checksums_info, as: 'checksumsInfo', class: Google::Apis::YoutubereportingV1::GdataCompositeMedia, decorator: Google::Apis::YoutubereportingV1::GdataCompositeMedia::Representation
205
+
206
+ property :object_info, as: 'objectInfo', class: Google::Apis::YoutubereportingV1::GdataCompositeMedia, decorator: Google::Apis::YoutubereportingV1::GdataCompositeMedia::Representation
207
+
208
+ property :object_version, as: 'objectVersion'
209
+ end
210
+ end
211
+
212
+ class GdataDiffUploadResponse
213
+ # @private
214
+ class Representation < Google::Apis::Core::JsonRepresentation
215
+ property :object_version, as: 'objectVersion'
216
+ property :original_object, as: 'originalObject', class: Google::Apis::YoutubereportingV1::GdataCompositeMedia, decorator: Google::Apis::YoutubereportingV1::GdataCompositeMedia::Representation
217
+
218
+ end
219
+ end
220
+
221
+ class GdataDiffVersionResponse
222
+ # @private
223
+ class Representation < Google::Apis::Core::JsonRepresentation
224
+ property :object_size_bytes, :numeric_string => true, as: 'objectSizeBytes'
225
+ property :object_version, as: 'objectVersion'
226
+ end
227
+ end
228
+
229
+ class GdataDownloadParameters
230
+ # @private
231
+ class Representation < Google::Apis::Core::JsonRepresentation
232
+ property :allow_gzip_compression, as: 'allowGzipCompression'
233
+ property :ignore_range, as: 'ignoreRange'
234
+ end
235
+ end
236
+
237
+ class GdataMedia
238
+ # @private
239
+ class Representation < Google::Apis::Core::JsonRepresentation
240
+ property :algorithm, as: 'algorithm'
241
+ property :bigstore_object_ref, :base64 => true, as: 'bigstoreObjectRef'
242
+ property :blob_ref, :base64 => true, as: 'blobRef'
243
+ property :blobstore2_info, as: 'blobstore2Info', class: Google::Apis::YoutubereportingV1::GdataBlobstore2Info, decorator: Google::Apis::YoutubereportingV1::GdataBlobstore2Info::Representation
244
+
245
+ collection :composite_media, as: 'compositeMedia', class: Google::Apis::YoutubereportingV1::GdataCompositeMedia, decorator: Google::Apis::YoutubereportingV1::GdataCompositeMedia::Representation
246
+
247
+ property :content_type, as: 'contentType'
248
+ property :content_type_info, as: 'contentTypeInfo', class: Google::Apis::YoutubereportingV1::GdataContentTypeInfo, decorator: Google::Apis::YoutubereportingV1::GdataContentTypeInfo::Representation
249
+
250
+ property :cosmo_binary_reference, :base64 => true, as: 'cosmoBinaryReference'
251
+ property :crc32c_hash, as: 'crc32cHash'
252
+ property :diff_checksums_response, as: 'diffChecksumsResponse', class: Google::Apis::YoutubereportingV1::GdataDiffChecksumsResponse, decorator: Google::Apis::YoutubereportingV1::GdataDiffChecksumsResponse::Representation
253
+
254
+ property :diff_download_response, as: 'diffDownloadResponse', class: Google::Apis::YoutubereportingV1::GdataDiffDownloadResponse, decorator: Google::Apis::YoutubereportingV1::GdataDiffDownloadResponse::Representation
255
+
256
+ property :diff_upload_request, as: 'diffUploadRequest', class: Google::Apis::YoutubereportingV1::GdataDiffUploadRequest, decorator: Google::Apis::YoutubereportingV1::GdataDiffUploadRequest::Representation
257
+
258
+ property :diff_upload_response, as: 'diffUploadResponse', class: Google::Apis::YoutubereportingV1::GdataDiffUploadResponse, decorator: Google::Apis::YoutubereportingV1::GdataDiffUploadResponse::Representation
259
+
260
+ property :diff_version_response, as: 'diffVersionResponse', class: Google::Apis::YoutubereportingV1::GdataDiffVersionResponse, decorator: Google::Apis::YoutubereportingV1::GdataDiffVersionResponse::Representation
261
+
262
+ property :download_parameters, as: 'downloadParameters', class: Google::Apis::YoutubereportingV1::GdataDownloadParameters, decorator: Google::Apis::YoutubereportingV1::GdataDownloadParameters::Representation
263
+
264
+ property :filename, as: 'filename'
265
+ property :hash_prop, as: 'hash'
266
+ property :hash_verified, as: 'hashVerified'
267
+ property :inline, :base64 => true, as: 'inline'
268
+ property :is_potential_retry, as: 'isPotentialRetry'
269
+ property :length, :numeric_string => true, as: 'length'
270
+ property :md5_hash, :base64 => true, as: 'md5Hash'
271
+ property :media_id, :base64 => true, as: 'mediaId'
272
+ property :object_id_prop, as: 'objectId', class: Google::Apis::YoutubereportingV1::GdataObjectId, decorator: Google::Apis::YoutubereportingV1::GdataObjectId::Representation
273
+
274
+ property :path, as: 'path'
275
+ property :reference_type, as: 'referenceType'
276
+ property :sha1_hash, :base64 => true, as: 'sha1Hash'
277
+ property :sha256_hash, :base64 => true, as: 'sha256Hash'
278
+ property :timestamp, :numeric_string => true, as: 'timestamp'
279
+ property :token, as: 'token'
280
+ end
281
+ end
282
+
283
+ class GdataObjectId
284
+ # @private
285
+ class Representation < Google::Apis::Core::JsonRepresentation
286
+ property :bucket_name, as: 'bucketName'
287
+ property :generation, :numeric_string => true, as: 'generation'
288
+ property :object_name, as: 'objectName'
289
+ end
290
+ end
291
+
292
+ class Job
293
+ # @private
294
+ class Representation < Google::Apis::Core::JsonRepresentation
295
+ property :create_time, as: 'createTime'
296
+ property :expire_time, as: 'expireTime'
297
+ property :id, as: 'id'
298
+ property :name, as: 'name'
299
+ property :report_type_id, as: 'reportTypeId'
300
+ property :system_managed, as: 'systemManaged'
301
+ end
302
+ end
303
+
304
+ class ListJobsResponse
305
+ # @private
306
+ class Representation < Google::Apis::Core::JsonRepresentation
307
+ collection :jobs, as: 'jobs', class: Google::Apis::YoutubereportingV1::Job, decorator: Google::Apis::YoutubereportingV1::Job::Representation
308
+
309
+ property :next_page_token, as: 'nextPageToken'
310
+ end
311
+ end
312
+
313
+ class ListReportTypesResponse
314
+ # @private
315
+ class Representation < Google::Apis::Core::JsonRepresentation
316
+ property :next_page_token, as: 'nextPageToken'
317
+ collection :report_types, as: 'reportTypes', class: Google::Apis::YoutubereportingV1::ReportType, decorator: Google::Apis::YoutubereportingV1::ReportType::Representation
318
+
319
+ end
320
+ end
321
+
322
+ class ListReportsResponse
323
+ # @private
324
+ class Representation < Google::Apis::Core::JsonRepresentation
325
+ property :next_page_token, as: 'nextPageToken'
326
+ collection :reports, as: 'reports', class: Google::Apis::YoutubereportingV1::Report, decorator: Google::Apis::YoutubereportingV1::Report::Representation
327
+
328
+ end
329
+ end
330
+
331
+ class Report
332
+ # @private
333
+ class Representation < Google::Apis::Core::JsonRepresentation
334
+ property :create_time, as: 'createTime'
335
+ property :download_url, as: 'downloadUrl'
336
+ property :end_time, as: 'endTime'
337
+ property :id, as: 'id'
338
+ property :job_expire_time, as: 'jobExpireTime'
339
+ property :job_id, as: 'jobId'
340
+ property :start_time, as: 'startTime'
341
+ end
342
+ end
343
+
344
+ class ReportType
345
+ # @private
346
+ class Representation < Google::Apis::Core::JsonRepresentation
347
+ property :deprecate_time, as: 'deprecateTime'
348
+ property :id, as: 'id'
349
+ property :name, as: 'name'
350
+ property :system_managed, as: 'systemManaged'
351
+ end
352
+ end
353
+ end
354
+ end
355
+ end
@@ -0,0 +1,384 @@
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 YoutubereportingV1
23
+ # YouTube Reporting API
24
+ #
25
+ # Schedules reporting jobs containing your YouTube Analytics data and downloads
26
+ # the resulting bulk data reports in the form of CSV files.
27
+ #
28
+ # @example
29
+ # require 'google/apis/youtubereporting_v1'
30
+ #
31
+ # Youtubereporting = Google::Apis::YoutubereportingV1 # Alias the module
32
+ # service = Youtubereporting::YouTubeReportingService.new
33
+ #
34
+ # @see https://developers.google.com/youtube/reporting/v1/reports/
35
+ class YouTubeReportingService < 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://youtubereporting.googleapis.com/', '',
48
+ client_name: 'google-apis-youtubereporting_v1',
49
+ client_version: Google::Apis::YoutubereportingV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Creates a job and returns it.
54
+ # @param [Google::Apis::YoutubereportingV1::Job] job_object
55
+ # @param [String] on_behalf_of_content_owner
56
+ # The content owner's external ID on which behalf the user is acting on. If not
57
+ # set, the user is acting for himself (his own channel).
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::YoutubereportingV1::Job] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::YoutubereportingV1::Job]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def create_job(job_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:post, 'v1/jobs', options)
77
+ command.request_representation = Google::Apis::YoutubereportingV1::Job::Representation
78
+ command.request_object = job_object
79
+ command.response_representation = Google::Apis::YoutubereportingV1::Job::Representation
80
+ command.response_class = Google::Apis::YoutubereportingV1::Job
81
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
82
+ command.query['fields'] = fields unless fields.nil?
83
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
84
+ execute_or_queue_command(command, &block)
85
+ end
86
+
87
+ # Deletes a job.
88
+ # @param [String] job_id
89
+ # The ID of the job to delete.
90
+ # @param [String] on_behalf_of_content_owner
91
+ # The content owner's external ID on which behalf the user is acting on. If not
92
+ # set, the user is acting for himself (his own channel).
93
+ # @param [String] fields
94
+ # Selector specifying which fields to include in a partial response.
95
+ # @param [String] quota_user
96
+ # Available to use for quota purposes for server-side applications. Can be any
97
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
98
+ # @param [Google::Apis::RequestOptions] options
99
+ # Request-specific options
100
+ #
101
+ # @yield [result, err] Result & error if block supplied
102
+ # @yieldparam result [Google::Apis::YoutubereportingV1::Empty] parsed result object
103
+ # @yieldparam err [StandardError] error object if request failed
104
+ #
105
+ # @return [Google::Apis::YoutubereportingV1::Empty]
106
+ #
107
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
108
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
109
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
110
+ def delete_job(job_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
111
+ command = make_simple_command(:delete, 'v1/jobs/{jobId}', options)
112
+ command.response_representation = Google::Apis::YoutubereportingV1::Empty::Representation
113
+ command.response_class = Google::Apis::YoutubereportingV1::Empty
114
+ command.params['jobId'] = job_id unless job_id.nil?
115
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
116
+ command.query['fields'] = fields unless fields.nil?
117
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
118
+ execute_or_queue_command(command, &block)
119
+ end
120
+
121
+ # Gets a job.
122
+ # @param [String] job_id
123
+ # The ID of the job to retrieve.
124
+ # @param [String] on_behalf_of_content_owner
125
+ # The content owner's external ID on which behalf the user is acting on. If not
126
+ # set, the user is acting for himself (his own channel).
127
+ # @param [String] fields
128
+ # Selector specifying which fields to include in a partial response.
129
+ # @param [String] quota_user
130
+ # Available to use for quota purposes for server-side applications. Can be any
131
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
132
+ # @param [Google::Apis::RequestOptions] options
133
+ # Request-specific options
134
+ #
135
+ # @yield [result, err] Result & error if block supplied
136
+ # @yieldparam result [Google::Apis::YoutubereportingV1::Job] parsed result object
137
+ # @yieldparam err [StandardError] error object if request failed
138
+ #
139
+ # @return [Google::Apis::YoutubereportingV1::Job]
140
+ #
141
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
142
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
143
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
144
+ def get_job(job_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
145
+ command = make_simple_command(:get, 'v1/jobs/{jobId}', options)
146
+ command.response_representation = Google::Apis::YoutubereportingV1::Job::Representation
147
+ command.response_class = Google::Apis::YoutubereportingV1::Job
148
+ command.params['jobId'] = job_id unless job_id.nil?
149
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
150
+ command.query['fields'] = fields unless fields.nil?
151
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
152
+ execute_or_queue_command(command, &block)
153
+ end
154
+
155
+ # Lists jobs.
156
+ # @param [Boolean] include_system_managed
157
+ # If set to true, also system-managed jobs will be returned; otherwise only user-
158
+ # created jobs will be returned. System-managed jobs can neither be modified nor
159
+ # deleted.
160
+ # @param [String] on_behalf_of_content_owner
161
+ # The content owner's external ID on which behalf the user is acting on. If not
162
+ # set, the user is acting for himself (his own channel).
163
+ # @param [Fixnum] page_size
164
+ # Requested page size. Server may return fewer jobs than requested. If
165
+ # unspecified, server will pick an appropriate default.
166
+ # @param [String] page_token
167
+ # A token identifying a page of results the server should return. Typically,
168
+ # this is the value of ListReportTypesResponse.next_page_token returned in
169
+ # response to the previous call to the `ListJobs` method.
170
+ # @param [String] fields
171
+ # Selector specifying which fields to include in a partial response.
172
+ # @param [String] quota_user
173
+ # Available to use for quota purposes for server-side applications. Can be any
174
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
175
+ # @param [Google::Apis::RequestOptions] options
176
+ # Request-specific options
177
+ #
178
+ # @yield [result, err] Result & error if block supplied
179
+ # @yieldparam result [Google::Apis::YoutubereportingV1::ListJobsResponse] parsed result object
180
+ # @yieldparam err [StandardError] error object if request failed
181
+ #
182
+ # @return [Google::Apis::YoutubereportingV1::ListJobsResponse]
183
+ #
184
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
185
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
186
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
187
+ def list_jobs(include_system_managed: nil, on_behalf_of_content_owner: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
188
+ command = make_simple_command(:get, 'v1/jobs', options)
189
+ command.response_representation = Google::Apis::YoutubereportingV1::ListJobsResponse::Representation
190
+ command.response_class = Google::Apis::YoutubereportingV1::ListJobsResponse
191
+ command.query['includeSystemManaged'] = include_system_managed unless include_system_managed.nil?
192
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
193
+ command.query['pageSize'] = page_size unless page_size.nil?
194
+ command.query['pageToken'] = page_token unless page_token.nil?
195
+ command.query['fields'] = fields unless fields.nil?
196
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
197
+ execute_or_queue_command(command, &block)
198
+ end
199
+
200
+ # Gets the metadata of a specific report.
201
+ # @param [String] job_id
202
+ # The ID of the job.
203
+ # @param [String] report_id
204
+ # The ID of the report to retrieve.
205
+ # @param [String] on_behalf_of_content_owner
206
+ # The content owner's external ID on which behalf the user is acting on. If not
207
+ # set, the user is acting for himself (his own channel).
208
+ # @param [String] fields
209
+ # Selector specifying which fields to include in a partial response.
210
+ # @param [String] quota_user
211
+ # Available to use for quota purposes for server-side applications. Can be any
212
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
213
+ # @param [Google::Apis::RequestOptions] options
214
+ # Request-specific options
215
+ #
216
+ # @yield [result, err] Result & error if block supplied
217
+ # @yieldparam result [Google::Apis::YoutubereportingV1::Report] parsed result object
218
+ # @yieldparam err [StandardError] error object if request failed
219
+ #
220
+ # @return [Google::Apis::YoutubereportingV1::Report]
221
+ #
222
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
223
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
224
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
225
+ def get_job_report(job_id, report_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
226
+ command = make_simple_command(:get, 'v1/jobs/{jobId}/reports/{reportId}', options)
227
+ command.response_representation = Google::Apis::YoutubereportingV1::Report::Representation
228
+ command.response_class = Google::Apis::YoutubereportingV1::Report
229
+ command.params['jobId'] = job_id unless job_id.nil?
230
+ command.params['reportId'] = report_id unless report_id.nil?
231
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
232
+ command.query['fields'] = fields unless fields.nil?
233
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
234
+ execute_or_queue_command(command, &block)
235
+ end
236
+
237
+ # Lists reports created by a specific job. Returns NOT_FOUND if the job does not
238
+ # exist.
239
+ # @param [String] job_id
240
+ # The ID of the job.
241
+ # @param [String] created_after
242
+ # If set, only reports created after the specified date/time are returned.
243
+ # @param [String] on_behalf_of_content_owner
244
+ # The content owner's external ID on which behalf the user is acting on. If not
245
+ # set, the user is acting for himself (his own channel).
246
+ # @param [Fixnum] page_size
247
+ # Requested page size. Server may return fewer report types than requested. If
248
+ # unspecified, server will pick an appropriate default.
249
+ # @param [String] page_token
250
+ # A token identifying a page of results the server should return. Typically,
251
+ # this is the value of ListReportsResponse.next_page_token returned in response
252
+ # to the previous call to the `ListReports` method.
253
+ # @param [String] start_time_at_or_after
254
+ # If set, only reports whose start time is greater than or equal the specified
255
+ # date/time are returned.
256
+ # @param [String] start_time_before
257
+ # If set, only reports whose start time is smaller than the specified date/time
258
+ # are returned.
259
+ # @param [String] fields
260
+ # Selector specifying which fields to include in a partial response.
261
+ # @param [String] quota_user
262
+ # Available to use for quota purposes for server-side applications. Can be any
263
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
264
+ # @param [Google::Apis::RequestOptions] options
265
+ # Request-specific options
266
+ #
267
+ # @yield [result, err] Result & error if block supplied
268
+ # @yieldparam result [Google::Apis::YoutubereportingV1::ListReportsResponse] parsed result object
269
+ # @yieldparam err [StandardError] error object if request failed
270
+ #
271
+ # @return [Google::Apis::YoutubereportingV1::ListReportsResponse]
272
+ #
273
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
274
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
275
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
276
+ def list_job_reports(job_id, created_after: nil, on_behalf_of_content_owner: nil, page_size: nil, page_token: nil, start_time_at_or_after: nil, start_time_before: nil, fields: nil, quota_user: nil, options: nil, &block)
277
+ command = make_simple_command(:get, 'v1/jobs/{jobId}/reports', options)
278
+ command.response_representation = Google::Apis::YoutubereportingV1::ListReportsResponse::Representation
279
+ command.response_class = Google::Apis::YoutubereportingV1::ListReportsResponse
280
+ command.params['jobId'] = job_id unless job_id.nil?
281
+ command.query['createdAfter'] = created_after unless created_after.nil?
282
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
283
+ command.query['pageSize'] = page_size unless page_size.nil?
284
+ command.query['pageToken'] = page_token unless page_token.nil?
285
+ command.query['startTimeAtOrAfter'] = start_time_at_or_after unless start_time_at_or_after.nil?
286
+ command.query['startTimeBefore'] = start_time_before unless start_time_before.nil?
287
+ command.query['fields'] = fields unless fields.nil?
288
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
289
+ execute_or_queue_command(command, &block)
290
+ end
291
+
292
+ # Method for media download. Download is supported on the URI `/v1/media/`+name`?
293
+ # alt=media`.
294
+ # @param [String] resource_name
295
+ # Name of the media that is being downloaded.
296
+ # @param [String] fields
297
+ # Selector specifying which fields to include in a partial response.
298
+ # @param [String] quota_user
299
+ # Available to use for quota purposes for server-side applications. Can be any
300
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
301
+ # @param [IO, String] download_dest
302
+ # IO stream or filename to receive content download
303
+ # @param [Google::Apis::RequestOptions] options
304
+ # Request-specific options
305
+ #
306
+ # @yield [result, err] Result & error if block supplied
307
+ # @yieldparam result [Google::Apis::YoutubereportingV1::GdataMedia] parsed result object
308
+ # @yieldparam err [StandardError] error object if request failed
309
+ #
310
+ # @return [Google::Apis::YoutubereportingV1::GdataMedia]
311
+ #
312
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
313
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
314
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
315
+ def download_medium(resource_name, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
316
+ if download_dest.nil?
317
+ command = make_simple_command(:get, 'v1/media/{+resourceName}', options)
318
+ else
319
+ command = make_download_command(:get, 'v1/media/{+resourceName}', options)
320
+ command.download_dest = download_dest
321
+ end
322
+ command.response_representation = Google::Apis::YoutubereportingV1::GdataMedia::Representation
323
+ command.response_class = Google::Apis::YoutubereportingV1::GdataMedia
324
+ command.params['resourceName'] = resource_name unless resource_name.nil?
325
+ command.query['fields'] = fields unless fields.nil?
326
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
327
+ execute_or_queue_command(command, &block)
328
+ end
329
+
330
+ # Lists report types.
331
+ # @param [Boolean] include_system_managed
332
+ # If set to true, also system-managed report types will be returned; otherwise
333
+ # only the report types that can be used to create new reporting jobs will be
334
+ # returned.
335
+ # @param [String] on_behalf_of_content_owner
336
+ # The content owner's external ID on which behalf the user is acting on. If not
337
+ # set, the user is acting for himself (his own channel).
338
+ # @param [Fixnum] page_size
339
+ # Requested page size. Server may return fewer report types than requested. If
340
+ # unspecified, server will pick an appropriate default.
341
+ # @param [String] page_token
342
+ # A token identifying a page of results the server should return. Typically,
343
+ # this is the value of ListReportTypesResponse.next_page_token returned in
344
+ # response to the previous call to the `ListReportTypes` method.
345
+ # @param [String] fields
346
+ # Selector specifying which fields to include in a partial response.
347
+ # @param [String] quota_user
348
+ # Available to use for quota purposes for server-side applications. Can be any
349
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
350
+ # @param [Google::Apis::RequestOptions] options
351
+ # Request-specific options
352
+ #
353
+ # @yield [result, err] Result & error if block supplied
354
+ # @yieldparam result [Google::Apis::YoutubereportingV1::ListReportTypesResponse] parsed result object
355
+ # @yieldparam err [StandardError] error object if request failed
356
+ #
357
+ # @return [Google::Apis::YoutubereportingV1::ListReportTypesResponse]
358
+ #
359
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
360
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
361
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
362
+ def list_report_types(include_system_managed: nil, on_behalf_of_content_owner: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
363
+ command = make_simple_command(:get, 'v1/reportTypes', options)
364
+ command.response_representation = Google::Apis::YoutubereportingV1::ListReportTypesResponse::Representation
365
+ command.response_class = Google::Apis::YoutubereportingV1::ListReportTypesResponse
366
+ command.query['includeSystemManaged'] = include_system_managed unless include_system_managed.nil?
367
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
368
+ command.query['pageSize'] = page_size unless page_size.nil?
369
+ command.query['pageToken'] = page_token unless page_token.nil?
370
+ command.query['fields'] = fields unless fields.nil?
371
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
372
+ execute_or_queue_command(command, &block)
373
+ end
374
+
375
+ protected
376
+
377
+ def apply_command_defaults(command)
378
+ command.query['key'] = key unless key.nil?
379
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end