google-apis-transcoder_v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,331 @@
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 TranscoderV1beta1
23
+ # Transcoder API
24
+ #
25
+ # This API converts video files into formats suitable for consumer distribution.
26
+ #
27
+ # @example
28
+ # require 'google/apis/transcoder_v1beta1'
29
+ #
30
+ # Transcoder = Google::Apis::TranscoderV1beta1 # Alias the module
31
+ # service = Transcoder::TranscoderService.new
32
+ #
33
+ # @see https://cloud.google.com/transcoder/docs/
34
+ class TranscoderService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://transcoder.googleapis.com/', '',
47
+ client_name: 'google-apis-transcoder_v1beta1',
48
+ client_version: Google::Apis::TranscoderV1beta1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Creates a job template in the specified region.
53
+ # @param [String] parent
54
+ # Required. The parent location to create this job template. Format: `projects/`
55
+ # project`/locations/`location``
56
+ # @param [Google::Apis::TranscoderV1beta1::JobTemplate] job_template_object
57
+ # @param [String] job_template_id
58
+ # Required. The ID to use for the job template, which will become the final
59
+ # component of the job template's resource name. This value should be 4-63
60
+ # characters, and valid characters must match the regular expression `a-zA-Z*`.
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [Google::Apis::RequestOptions] options
67
+ # Request-specific options
68
+ #
69
+ # @yield [result, err] Result & error if block supplied
70
+ # @yieldparam result [Google::Apis::TranscoderV1beta1::JobTemplate] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::TranscoderV1beta1::JobTemplate]
74
+ #
75
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
78
+ def create_project_location_job_template(parent, job_template_object = nil, job_template_id: nil, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:post, 'v1beta1/{+parent}/jobTemplates', options)
80
+ command.request_representation = Google::Apis::TranscoderV1beta1::JobTemplate::Representation
81
+ command.request_object = job_template_object
82
+ command.response_representation = Google::Apis::TranscoderV1beta1::JobTemplate::Representation
83
+ command.response_class = Google::Apis::TranscoderV1beta1::JobTemplate
84
+ command.params['parent'] = parent unless parent.nil?
85
+ command.query['jobTemplateId'] = job_template_id unless job_template_id.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Deletes a job template.
92
+ # @param [String] name
93
+ # Required. The name of the job template to delete. `projects/`project`/
94
+ # locations/`location`/jobTemplates/`job_template``
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # @param [Google::Apis::RequestOptions] options
101
+ # Request-specific options
102
+ #
103
+ # @yield [result, err] Result & error if block supplied
104
+ # @yieldparam result [Google::Apis::TranscoderV1beta1::Empty] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::TranscoderV1beta1::Empty]
108
+ #
109
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
110
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
111
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
112
+ def delete_project_location_job_template(name, fields: nil, quota_user: nil, options: nil, &block)
113
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
114
+ command.response_representation = Google::Apis::TranscoderV1beta1::Empty::Representation
115
+ command.response_class = Google::Apis::TranscoderV1beta1::Empty
116
+ command.params['name'] = name unless name.nil?
117
+ command.query['fields'] = fields unless fields.nil?
118
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
119
+ execute_or_queue_command(command, &block)
120
+ end
121
+
122
+ # Returns the job template data.
123
+ # @param [String] name
124
+ # Required. The name of the job template to retrieve. Format: `projects/`project`
125
+ # /locations/`location`/jobTemplates/`job_template``
126
+ # @param [String] fields
127
+ # Selector specifying which fields to include in a partial response.
128
+ # @param [String] quota_user
129
+ # Available to use for quota purposes for server-side applications. Can be any
130
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
131
+ # @param [Google::Apis::RequestOptions] options
132
+ # Request-specific options
133
+ #
134
+ # @yield [result, err] Result & error if block supplied
135
+ # @yieldparam result [Google::Apis::TranscoderV1beta1::JobTemplate] parsed result object
136
+ # @yieldparam err [StandardError] error object if request failed
137
+ #
138
+ # @return [Google::Apis::TranscoderV1beta1::JobTemplate]
139
+ #
140
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
141
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
142
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
143
+ def get_project_location_job_template(name, fields: nil, quota_user: nil, options: nil, &block)
144
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
145
+ command.response_representation = Google::Apis::TranscoderV1beta1::JobTemplate::Representation
146
+ command.response_class = Google::Apis::TranscoderV1beta1::JobTemplate
147
+ command.params['name'] = name unless name.nil?
148
+ command.query['fields'] = fields unless fields.nil?
149
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
150
+ execute_or_queue_command(command, &block)
151
+ end
152
+
153
+ # Lists job templates in the specified region.
154
+ # @param [String] parent
155
+ # Required. The parent location from which to retrieve the collection of job
156
+ # templates. Format: `projects/`project`/locations/`location``
157
+ # @param [Fixnum] page_size
158
+ # The maximum number of items to return.
159
+ # @param [String] page_token
160
+ # The `next_page_token` value returned from a previous List request, if any.
161
+ # @param [String] fields
162
+ # Selector specifying which fields to include in a partial response.
163
+ # @param [String] quota_user
164
+ # Available to use for quota purposes for server-side applications. Can be any
165
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
166
+ # @param [Google::Apis::RequestOptions] options
167
+ # Request-specific options
168
+ #
169
+ # @yield [result, err] Result & error if block supplied
170
+ # @yieldparam result [Google::Apis::TranscoderV1beta1::ListJobTemplatesResponse] parsed result object
171
+ # @yieldparam err [StandardError] error object if request failed
172
+ #
173
+ # @return [Google::Apis::TranscoderV1beta1::ListJobTemplatesResponse]
174
+ #
175
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
176
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
177
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
178
+ def list_project_location_job_templates(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
179
+ command = make_simple_command(:get, 'v1beta1/{+parent}/jobTemplates', options)
180
+ command.response_representation = Google::Apis::TranscoderV1beta1::ListJobTemplatesResponse::Representation
181
+ command.response_class = Google::Apis::TranscoderV1beta1::ListJobTemplatesResponse
182
+ command.params['parent'] = parent unless parent.nil?
183
+ command.query['pageSize'] = page_size unless page_size.nil?
184
+ command.query['pageToken'] = page_token unless page_token.nil?
185
+ command.query['fields'] = fields unless fields.nil?
186
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
187
+ execute_or_queue_command(command, &block)
188
+ end
189
+
190
+ # Creates a job in the specified region.
191
+ # @param [String] parent
192
+ # Required. The parent location to create and process this job. Format: `
193
+ # projects/`project`/locations/`location``
194
+ # @param [Google::Apis::TranscoderV1beta1::Job] job_object
195
+ # @param [String] fields
196
+ # Selector specifying which fields to include in a partial response.
197
+ # @param [String] quota_user
198
+ # Available to use for quota purposes for server-side applications. Can be any
199
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
200
+ # @param [Google::Apis::RequestOptions] options
201
+ # Request-specific options
202
+ #
203
+ # @yield [result, err] Result & error if block supplied
204
+ # @yieldparam result [Google::Apis::TranscoderV1beta1::Job] parsed result object
205
+ # @yieldparam err [StandardError] error object if request failed
206
+ #
207
+ # @return [Google::Apis::TranscoderV1beta1::Job]
208
+ #
209
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
210
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
211
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
212
+ def create_project_location_job(parent, job_object = nil, fields: nil, quota_user: nil, options: nil, &block)
213
+ command = make_simple_command(:post, 'v1beta1/{+parent}/jobs', options)
214
+ command.request_representation = Google::Apis::TranscoderV1beta1::Job::Representation
215
+ command.request_object = job_object
216
+ command.response_representation = Google::Apis::TranscoderV1beta1::Job::Representation
217
+ command.response_class = Google::Apis::TranscoderV1beta1::Job
218
+ command.params['parent'] = parent unless parent.nil?
219
+ command.query['fields'] = fields unless fields.nil?
220
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
221
+ execute_or_queue_command(command, &block)
222
+ end
223
+
224
+ # Deletes a job.
225
+ # @param [String] name
226
+ # Required. The name of the job to delete. Format: `projects/`project`/locations/
227
+ # `location`/jobs/`job``
228
+ # @param [String] fields
229
+ # Selector specifying which fields to include in a partial response.
230
+ # @param [String] quota_user
231
+ # Available to use for quota purposes for server-side applications. Can be any
232
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
233
+ # @param [Google::Apis::RequestOptions] options
234
+ # Request-specific options
235
+ #
236
+ # @yield [result, err] Result & error if block supplied
237
+ # @yieldparam result [Google::Apis::TranscoderV1beta1::Empty] parsed result object
238
+ # @yieldparam err [StandardError] error object if request failed
239
+ #
240
+ # @return [Google::Apis::TranscoderV1beta1::Empty]
241
+ #
242
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
243
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
244
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
245
+ def delete_project_location_job(name, fields: nil, quota_user: nil, options: nil, &block)
246
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
247
+ command.response_representation = Google::Apis::TranscoderV1beta1::Empty::Representation
248
+ command.response_class = Google::Apis::TranscoderV1beta1::Empty
249
+ command.params['name'] = name unless name.nil?
250
+ command.query['fields'] = fields unless fields.nil?
251
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
252
+ execute_or_queue_command(command, &block)
253
+ end
254
+
255
+ # Returns the job data.
256
+ # @param [String] name
257
+ # Required. The name of the job to retrieve. Format: `projects/`project`/
258
+ # locations/`location`/jobs/`job``
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::TranscoderV1beta1::Job] parsed result object
269
+ # @yieldparam err [StandardError] error object if request failed
270
+ #
271
+ # @return [Google::Apis::TranscoderV1beta1::Job]
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 get_project_location_job(name, fields: nil, quota_user: nil, options: nil, &block)
277
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
278
+ command.response_representation = Google::Apis::TranscoderV1beta1::Job::Representation
279
+ command.response_class = Google::Apis::TranscoderV1beta1::Job
280
+ command.params['name'] = name unless name.nil?
281
+ command.query['fields'] = fields unless fields.nil?
282
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
283
+ execute_or_queue_command(command, &block)
284
+ end
285
+
286
+ # Lists jobs in the specified region.
287
+ # @param [String] parent
288
+ # Required. Format: `projects/`project`/locations/`location``
289
+ # @param [Fixnum] page_size
290
+ # The maximum number of items to return.
291
+ # @param [String] page_token
292
+ # The `next_page_token` value returned from a previous List request, if any.
293
+ # @param [String] fields
294
+ # Selector specifying which fields to include in a partial response.
295
+ # @param [String] quota_user
296
+ # Available to use for quota purposes for server-side applications. Can be any
297
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
298
+ # @param [Google::Apis::RequestOptions] options
299
+ # Request-specific options
300
+ #
301
+ # @yield [result, err] Result & error if block supplied
302
+ # @yieldparam result [Google::Apis::TranscoderV1beta1::ListJobsResponse] parsed result object
303
+ # @yieldparam err [StandardError] error object if request failed
304
+ #
305
+ # @return [Google::Apis::TranscoderV1beta1::ListJobsResponse]
306
+ #
307
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
308
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
309
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
310
+ def list_project_location_jobs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
311
+ command = make_simple_command(:get, 'v1beta1/{+parent}/jobs', options)
312
+ command.response_representation = Google::Apis::TranscoderV1beta1::ListJobsResponse::Representation
313
+ command.response_class = Google::Apis::TranscoderV1beta1::ListJobsResponse
314
+ command.params['parent'] = parent unless parent.nil?
315
+ command.query['pageSize'] = page_size unless page_size.nil?
316
+ command.query['pageToken'] = page_token unless page_token.nil?
317
+ command.query['fields'] = fields unless fields.nil?
318
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
319
+ execute_or_queue_command(command, &block)
320
+ end
321
+
322
+ protected
323
+
324
+ def apply_command_defaults(command)
325
+ command.query['key'] = key unless key.nil?
326
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
327
+ end
328
+ end
329
+ end
330
+ end
331
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-transcoder_v1beta1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Transcoder API V1beta1. Simple REST
28
+ clients are Ruby client libraries that provide access to Google services via their
29
+ HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Transcoder API, but note that some services may provide
33
+ a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-transcoder_v1beta1.rb
44
+ - lib/google/apis/transcoder_v1beta1.rb
45
+ - lib/google/apis/transcoder_v1beta1/classes.rb
46
+ - lib/google/apis/transcoder_v1beta1/gem_version.rb
47
+ - lib/google/apis/transcoder_v1beta1/representations.rb
48
+ - lib/google/apis/transcoder_v1beta1/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-transcoder_v1beta1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-transcoder_v1beta1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-transcoder_v1beta1
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Transcoder API V1beta1
76
+ test_files: []