Class: Google::Apis::TranscoderV1::TranscoderService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/transcoder_v1/service.rb

Overview

Transcoder API

This API converts video files into formats suitable for consumer distribution. For more information, see the Transcoder API overview.

Examples:

require 'google/apis/transcoder_v1'

Transcoder = Google::Apis::TranscoderV1 # Alias the module
service = Transcoder::TranscoderService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://transcoder.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTranscoderService

Returns a new instance of TranscoderService.



48
49
50
51
52
53
# File 'lib/google/apis/transcoder_v1/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-transcoder_v1',
        client_version: Google::Apis::TranscoderV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



41
42
43
# File 'lib/google/apis/transcoder_v1/service.rb', line 41

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



46
47
48
# File 'lib/google/apis/transcoder_v1/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#create_project_location_job(parent, job_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::Job

Creates a job in the specified region.

Parameters:

  • parent (String)

    Required. The parent location to create and process this job. Format: projects/project/locations/location``

  • job_object (Google::Apis::TranscoderV1::Job) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



227
228
229
230
231
232
233
234
235
236
237
# File 'lib/google/apis/transcoder_v1/service.rb', line 227

def create_project_location_job(parent, job_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/jobs', options)
  command.request_representation = Google::Apis::TranscoderV1::Job::Representation
  command.request_object = job_object
  command.response_representation = Google::Apis::TranscoderV1::Job::Representation
  command.response_class = Google::Apis::TranscoderV1::Job
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_job_template(parent, job_template_object = nil, job_template_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::JobTemplate

Creates a job template in the specified region.

Parameters:

  • parent (String)

    Required. The parent location to create this job template. Format: projects/ project/locations/location``

  • job_template_object (Google::Apis::TranscoderV1::JobTemplate) (defaults to: nil)
  • job_template_id (String) (defaults to: nil)

    Required. The ID to use for the job template, which will become the final component of the job template's resource name. This value should be 4-63 characters, and valid characters must match the regular expression a-zA-Z*.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/google/apis/transcoder_v1/service.rb', line 81

def create_project_location_job_template(parent, job_template_object = nil, job_template_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/jobTemplates', options)
  command.request_representation = Google::Apis::TranscoderV1::JobTemplate::Representation
  command.request_object = job_template_object
  command.response_representation = Google::Apis::TranscoderV1::JobTemplate::Representation
  command.response_class = Google::Apis::TranscoderV1::JobTemplate
  command.params['parent'] = parent unless parent.nil?
  command.query['jobTemplateId'] = job_template_id unless job_template_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_job(name, allow_missing: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::Empty

Deletes a job.

Parameters:

  • name (String)

    Required. The name of the job to delete. Format: projects/project/locations/ location/jobs/job``

  • allow_missing (Boolean) (defaults to: nil)

    If set to true, and the job is not found, the request will succeed but no action will be taken on the server.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



263
264
265
266
267
268
269
270
271
272
# File 'lib/google/apis/transcoder_v1/service.rb', line 263

def delete_project_location_job(name, allow_missing: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::TranscoderV1::Empty::Representation
  command.response_class = Google::Apis::TranscoderV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['allowMissing'] = allow_missing unless allow_missing.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_job_template(name, allow_missing: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::Empty

Deletes a job template.

Parameters:

  • name (String)

    Required. The name of the job template to delete. projects/project/ locations/location/jobTemplates/job_template``

  • allow_missing (Boolean) (defaults to: nil)

    If set to true, and the job template is not found, the request will succeed but no action will be taken on the server.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



118
119
120
121
122
123
124
125
126
127
# File 'lib/google/apis/transcoder_v1/service.rb', line 118

def delete_project_location_job_template(name, allow_missing: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::TranscoderV1::Empty::Representation
  command.response_class = Google::Apis::TranscoderV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['allowMissing'] = allow_missing unless allow_missing.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_job(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::Job

Returns the job data.

Parameters:

  • name (String)

    Required. The name of the job to retrieve. Format: projects/project/ locations/location/jobs/job``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



295
296
297
298
299
300
301
302
303
# File 'lib/google/apis/transcoder_v1/service.rb', line 295

def get_project_location_job(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::TranscoderV1::Job::Representation
  command.response_class = Google::Apis::TranscoderV1::Job
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_job_template(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::JobTemplate

Returns the job template data.

Parameters:

  • name (String)

    Required. The name of the job template to retrieve. Format: projects/project /locations/location/jobTemplates/job_template``

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



150
151
152
153
154
155
156
157
158
# File 'lib/google/apis/transcoder_v1/service.rb', line 150

def get_project_location_job_template(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::TranscoderV1::JobTemplate::Representation
  command.response_class = Google::Apis::TranscoderV1::JobTemplate
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_job_templates(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::ListJobTemplatesResponse

Lists job templates in the specified region.

Parameters:

  • parent (String)

    Required. The parent location from which to retrieve the collection of job templates. Format: projects/project/locations/location``

  • filter (String) (defaults to: nil)

    The filter expression, following the syntax outlined in https://google.aip.dev/ 160.

  • order_by (String) (defaults to: nil)

    One or more fields to compare and use to sort the output. See https://google. aip.dev/132#ordering.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of items to return.

  • page_token (String) (defaults to: nil)

    The next_page_token value returned from a previous List request, if any.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/google/apis/transcoder_v1/service.rb', line 191

def list_project_location_job_templates(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/jobTemplates', options)
  command.response_representation = Google::Apis::TranscoderV1::ListJobTemplatesResponse::Representation
  command.response_class = Google::Apis::TranscoderV1::ListJobTemplatesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_jobs(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TranscoderV1::ListJobsResponse

Lists jobs in the specified region.

Parameters:

  • parent (String)

    Required. Format: projects/project/locations/location``

  • filter (String) (defaults to: nil)

    The filter expression, following the syntax outlined in https://google.aip.dev/ 160.

  • order_by (String) (defaults to: nil)

    One or more fields to compare and use to sort the output. See https://google. aip.dev/132#ordering.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of items to return.

  • page_token (String) (defaults to: nil)

    The next_page_token value returned from a previous List request, if any.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/google/apis/transcoder_v1/service.rb', line 335

def list_project_location_jobs(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/jobs', options)
  command.response_representation = Google::Apis::TranscoderV1::ListJobsResponse::Representation
  command.response_class = Google::Apis::TranscoderV1::ListJobsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end