google-cloud-video-transcoder-v1beta1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +139 -0
- data/lib/google-cloud-video-transcoder-v1beta1.rb +21 -0
- data/lib/google/cloud/video/transcoder/v1beta1.rb +40 -0
- data/lib/google/cloud/video/transcoder/v1beta1/resources_pb.rb +325 -0
- data/lib/google/cloud/video/transcoder/v1beta1/services_pb.rb +75 -0
- data/lib/google/cloud/video/transcoder/v1beta1/services_services_pb.rb +66 -0
- data/lib/google/cloud/video/transcoder/v1beta1/transcoder_service.rb +56 -0
- data/lib/google/cloud/video/transcoder/v1beta1/transcoder_service/client.rb +947 -0
- data/lib/google/cloud/video/transcoder/v1beta1/transcoder_service/credentials.rb +53 -0
- data/lib/google/cloud/video/transcoder/v1beta1/transcoder_service/paths.rb +90 -0
- data/lib/google/cloud/video/transcoder/v1beta1/version.rb +30 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +65 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/video/transcoder/v1beta1/resources.rb +966 -0
- data/proto_docs/google/cloud/video/transcoder/v1beta1/services.rb +160 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- metadata +208 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/video/transcoder/v1beta1/services.proto for package 'google.cloud.video.transcoder.v1beta1'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2020 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/video/transcoder/v1beta1/services_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Video
|
25
|
+
module Transcoder
|
26
|
+
module V1beta1
|
27
|
+
module TranscoderService
|
28
|
+
# Using the Transcoder API, you can queue asynchronous jobs for transcoding
|
29
|
+
# media into various output formats. Output formats may include different
|
30
|
+
# streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive
|
31
|
+
# Streaming over HTTP (DASH). You can also customize jobs using advanced
|
32
|
+
# features such as Digital Rights Management (DRM), audio equalization, content
|
33
|
+
# concatenation, and digital ad-stitch ready content generation.
|
34
|
+
class Service
|
35
|
+
|
36
|
+
include GRPC::GenericService
|
37
|
+
|
38
|
+
self.marshal_class_method = :encode
|
39
|
+
self.unmarshal_class_method = :decode
|
40
|
+
self.service_name = 'google.cloud.video.transcoder.v1beta1.TranscoderService'
|
41
|
+
|
42
|
+
# Creates a job in the specified region.
|
43
|
+
rpc :CreateJob, ::Google::Cloud::Video::Transcoder::V1beta1::CreateJobRequest, ::Google::Cloud::Video::Transcoder::V1beta1::Job
|
44
|
+
# Lists jobs in the specified region.
|
45
|
+
rpc :ListJobs, ::Google::Cloud::Video::Transcoder::V1beta1::ListJobsRequest, ::Google::Cloud::Video::Transcoder::V1beta1::ListJobsResponse
|
46
|
+
# Returns the job data.
|
47
|
+
rpc :GetJob, ::Google::Cloud::Video::Transcoder::V1beta1::GetJobRequest, ::Google::Cloud::Video::Transcoder::V1beta1::Job
|
48
|
+
# Deletes a job.
|
49
|
+
rpc :DeleteJob, ::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobRequest, ::Google::Protobuf::Empty
|
50
|
+
# Creates a job template in the specified region.
|
51
|
+
rpc :CreateJobTemplate, ::Google::Cloud::Video::Transcoder::V1beta1::CreateJobTemplateRequest, ::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate
|
52
|
+
# Lists job templates in the specified region.
|
53
|
+
rpc :ListJobTemplates, ::Google::Cloud::Video::Transcoder::V1beta1::ListJobTemplatesRequest, ::Google::Cloud::Video::Transcoder::V1beta1::ListJobTemplatesResponse
|
54
|
+
# Returns the job template data.
|
55
|
+
rpc :GetJobTemplate, ::Google::Cloud::Video::Transcoder::V1beta1::GetJobTemplateRequest, ::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate
|
56
|
+
# Deletes a job template.
|
57
|
+
rpc :DeleteJobTemplate, ::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobTemplateRequest, ::Google::Protobuf::Empty
|
58
|
+
end
|
59
|
+
|
60
|
+
Stub = Service.rpc_stub_class
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/video/transcoder/v1beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/video/transcoder/v1beta1/transcoder_service/credentials"
|
26
|
+
require "google/cloud/video/transcoder/v1beta1/transcoder_service/paths"
|
27
|
+
require "google/cloud/video/transcoder/v1beta1/transcoder_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Video
|
32
|
+
module Transcoder
|
33
|
+
module V1beta1
|
34
|
+
##
|
35
|
+
# Using the Transcoder API, you can queue asynchronous jobs for transcoding
|
36
|
+
# media into various output formats. Output formats may include different
|
37
|
+
# streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive
|
38
|
+
# Streaming over HTTP (DASH). You can also customize jobs using advanced
|
39
|
+
# features such as Digital Rights Management (DRM), audio equalization, content
|
40
|
+
# concatenation, and digital ad-stitch ready content generation.
|
41
|
+
#
|
42
|
+
# To load this service and instantiate a client:
|
43
|
+
#
|
44
|
+
# require "google/cloud/video/transcoder/v1beta1/transcoder_service"
|
45
|
+
# client = ::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client.new
|
46
|
+
#
|
47
|
+
module TranscoderService
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
helper_path = ::File.join __dir__, "transcoder_service", "helpers.rb"
|
56
|
+
require "google/cloud/video/transcoder/v1beta1/transcoder_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,947 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/video/transcoder/v1beta1/services_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Video
|
25
|
+
module Transcoder
|
26
|
+
module V1beta1
|
27
|
+
module TranscoderService
|
28
|
+
##
|
29
|
+
# Client for the TranscoderService service.
|
30
|
+
#
|
31
|
+
# Using the Transcoder API, you can queue asynchronous jobs for transcoding
|
32
|
+
# media into various output formats. Output formats may include different
|
33
|
+
# streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive
|
34
|
+
# Streaming over HTTP (DASH). You can also customize jobs using advanced
|
35
|
+
# features such as Digital Rights Management (DRM), audio equalization, content
|
36
|
+
# concatenation, and digital ad-stitch ready content generation.
|
37
|
+
#
|
38
|
+
class Client
|
39
|
+
include Paths
|
40
|
+
|
41
|
+
# @private
|
42
|
+
attr_reader :transcoder_service_stub
|
43
|
+
|
44
|
+
##
|
45
|
+
# Configure the TranscoderService Client class.
|
46
|
+
#
|
47
|
+
# See {::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client::Configuration}
|
48
|
+
# for a description of the configuration fields.
|
49
|
+
#
|
50
|
+
# ## Example
|
51
|
+
#
|
52
|
+
# To modify the configuration for all TranscoderService clients:
|
53
|
+
#
|
54
|
+
# ::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client.configure do |config|
|
55
|
+
# config.timeout = 10.0
|
56
|
+
# end
|
57
|
+
#
|
58
|
+
# @yield [config] Configure the Client client.
|
59
|
+
# @yieldparam config [Client::Configuration]
|
60
|
+
#
|
61
|
+
# @return [Client::Configuration]
|
62
|
+
#
|
63
|
+
def self.configure
|
64
|
+
@configure ||= begin
|
65
|
+
namespace = ["Google", "Cloud", "Video", "Transcoder", "V1beta1"]
|
66
|
+
parent_config = while namespace.any?
|
67
|
+
parent_name = namespace.join "::"
|
68
|
+
parent_const = const_get parent_name
|
69
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
70
|
+
namespace.pop
|
71
|
+
end
|
72
|
+
default_config = Client::Configuration.new parent_config
|
73
|
+
|
74
|
+
default_config.timeout = 60.0
|
75
|
+
default_config.retry_policy = {
|
76
|
+
initial_delay: 1.0,
|
77
|
+
max_delay: 10.0,
|
78
|
+
multiplier: 1.3,
|
79
|
+
retry_codes: [14]
|
80
|
+
}
|
81
|
+
|
82
|
+
default_config.rpcs.create_job.timeout = 60.0
|
83
|
+
|
84
|
+
default_config.rpcs.list_jobs.timeout = 60.0
|
85
|
+
|
86
|
+
default_config.rpcs.get_job.timeout = 60.0
|
87
|
+
|
88
|
+
default_config.rpcs.delete_job.timeout = 60.0
|
89
|
+
|
90
|
+
default_config.rpcs.create_job_template.timeout = 60.0
|
91
|
+
|
92
|
+
default_config.rpcs.list_job_templates.timeout = 60.0
|
93
|
+
|
94
|
+
default_config.rpcs.get_job_template.timeout = 60.0
|
95
|
+
|
96
|
+
default_config.rpcs.delete_job_template.timeout = 60.0
|
97
|
+
|
98
|
+
default_config
|
99
|
+
end
|
100
|
+
yield @configure if block_given?
|
101
|
+
@configure
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# Configure the TranscoderService Client instance.
|
106
|
+
#
|
107
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
108
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
109
|
+
# should be made on {Client.configure}.
|
110
|
+
#
|
111
|
+
# See {::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client::Configuration}
|
112
|
+
# for a description of the configuration fields.
|
113
|
+
#
|
114
|
+
# @yield [config] Configure the Client client.
|
115
|
+
# @yieldparam config [Client::Configuration]
|
116
|
+
#
|
117
|
+
# @return [Client::Configuration]
|
118
|
+
#
|
119
|
+
def configure
|
120
|
+
yield @config if block_given?
|
121
|
+
@config
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Create a new TranscoderService client object.
|
126
|
+
#
|
127
|
+
# ## Examples
|
128
|
+
#
|
129
|
+
# To create a new TranscoderService client with the default
|
130
|
+
# configuration:
|
131
|
+
#
|
132
|
+
# client = ::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client.new
|
133
|
+
#
|
134
|
+
# To create a new TranscoderService client with a custom
|
135
|
+
# configuration:
|
136
|
+
#
|
137
|
+
# client = ::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client.new do |config|
|
138
|
+
# config.timeout = 10.0
|
139
|
+
# end
|
140
|
+
#
|
141
|
+
# @yield [config] Configure the TranscoderService client.
|
142
|
+
# @yieldparam config [Client::Configuration]
|
143
|
+
#
|
144
|
+
def initialize
|
145
|
+
# These require statements are intentionally placed here to initialize
|
146
|
+
# the gRPC module only when it's required.
|
147
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
148
|
+
require "gapic/grpc"
|
149
|
+
require "google/cloud/video/transcoder/v1beta1/services_services_pb"
|
150
|
+
|
151
|
+
# Create the configuration object
|
152
|
+
@config = Configuration.new Client.configure
|
153
|
+
|
154
|
+
# Yield the configuration if needed
|
155
|
+
yield @config if block_given?
|
156
|
+
|
157
|
+
# Create credentials
|
158
|
+
credentials = @config.credentials
|
159
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
160
|
+
# but only if the default endpoint does not have a region prefix.
|
161
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
162
|
+
@config.endpoint == Client.configure.endpoint &&
|
163
|
+
!@config.endpoint.split(".").first.include?("-")
|
164
|
+
credentials ||= Credentials.default scope: @config.scope,
|
165
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
166
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
167
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
168
|
+
end
|
169
|
+
@quota_project_id = @config.quota_project
|
170
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
171
|
+
|
172
|
+
@transcoder_service_stub = ::Gapic::ServiceStub.new(
|
173
|
+
::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Stub,
|
174
|
+
credentials: credentials,
|
175
|
+
endpoint: @config.endpoint,
|
176
|
+
channel_args: @config.channel_args,
|
177
|
+
interceptors: @config.interceptors
|
178
|
+
)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Service calls
|
182
|
+
|
183
|
+
##
|
184
|
+
# Creates a job in the specified region.
|
185
|
+
#
|
186
|
+
# @overload create_job(request, options = nil)
|
187
|
+
# Pass arguments to `create_job` via a request object, either of type
|
188
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::CreateJobRequest} or an equivalent Hash.
|
189
|
+
#
|
190
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::CreateJobRequest, ::Hash]
|
191
|
+
# A request object representing the call parameters. Required. To specify no
|
192
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
193
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
194
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
195
|
+
#
|
196
|
+
# @overload create_job(parent: nil, job: nil)
|
197
|
+
# Pass arguments to `create_job` via keyword arguments. Note that at
|
198
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
199
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
200
|
+
#
|
201
|
+
# @param parent [::String]
|
202
|
+
# Required. The parent location to create and process this job.
|
203
|
+
# Format: `projects/{project}/locations/{location}`
|
204
|
+
# @param job [::Google::Cloud::Video::Transcoder::V1beta1::Job, ::Hash]
|
205
|
+
# Required. Parameters for creating transcoding job.
|
206
|
+
#
|
207
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
208
|
+
# @yieldparam response [::Google::Cloud::Video::Transcoder::V1beta1::Job]
|
209
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
210
|
+
#
|
211
|
+
# @return [::Google::Cloud::Video::Transcoder::V1beta1::Job]
|
212
|
+
#
|
213
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
214
|
+
#
|
215
|
+
def create_job request, options = nil
|
216
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
217
|
+
|
218
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::CreateJobRequest
|
219
|
+
|
220
|
+
# Converts hash and nil to an options object
|
221
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
222
|
+
|
223
|
+
# Customize the options with defaults
|
224
|
+
metadata = @config.rpcs.create_job.metadata.to_h
|
225
|
+
|
226
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
227
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
228
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
229
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
230
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
231
|
+
|
232
|
+
header_params = {
|
233
|
+
"parent" => request.parent
|
234
|
+
}
|
235
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
236
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
237
|
+
|
238
|
+
options.apply_defaults timeout: @config.rpcs.create_job.timeout,
|
239
|
+
metadata: metadata,
|
240
|
+
retry_policy: @config.rpcs.create_job.retry_policy
|
241
|
+
options.apply_defaults metadata: @config.metadata,
|
242
|
+
retry_policy: @config.retry_policy
|
243
|
+
|
244
|
+
@transcoder_service_stub.call_rpc :create_job, request, options: options do |response, operation|
|
245
|
+
yield response, operation if block_given?
|
246
|
+
return response
|
247
|
+
end
|
248
|
+
rescue ::GRPC::BadStatus => e
|
249
|
+
raise ::Google::Cloud::Error.from_error(e)
|
250
|
+
end
|
251
|
+
|
252
|
+
##
|
253
|
+
# Lists jobs in the specified region.
|
254
|
+
#
|
255
|
+
# @overload list_jobs(request, options = nil)
|
256
|
+
# Pass arguments to `list_jobs` via a request object, either of type
|
257
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::ListJobsRequest} or an equivalent Hash.
|
258
|
+
#
|
259
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::ListJobsRequest, ::Hash]
|
260
|
+
# A request object representing the call parameters. Required. To specify no
|
261
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
262
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
263
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
264
|
+
#
|
265
|
+
# @overload list_jobs(parent: nil, page_size: nil, page_token: nil)
|
266
|
+
# Pass arguments to `list_jobs` via keyword arguments. Note that at
|
267
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
268
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
269
|
+
#
|
270
|
+
# @param parent [::String]
|
271
|
+
# Required. Format: `projects/{project}/locations/{location}`
|
272
|
+
# @param page_size [::Integer]
|
273
|
+
# The maximum number of items to return.
|
274
|
+
# @param page_token [::String]
|
275
|
+
# The `next_page_token` value returned from a previous List request, if
|
276
|
+
# any.
|
277
|
+
#
|
278
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
279
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::Transcoder::V1beta1::Job>]
|
280
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
281
|
+
#
|
282
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::Transcoder::V1beta1::Job>]
|
283
|
+
#
|
284
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
285
|
+
#
|
286
|
+
def list_jobs request, options = nil
|
287
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
288
|
+
|
289
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::ListJobsRequest
|
290
|
+
|
291
|
+
# Converts hash and nil to an options object
|
292
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
293
|
+
|
294
|
+
# Customize the options with defaults
|
295
|
+
metadata = @config.rpcs.list_jobs.metadata.to_h
|
296
|
+
|
297
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
298
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
299
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
300
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
301
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
302
|
+
|
303
|
+
header_params = {
|
304
|
+
"parent" => request.parent
|
305
|
+
}
|
306
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
307
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
308
|
+
|
309
|
+
options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
|
310
|
+
metadata: metadata,
|
311
|
+
retry_policy: @config.rpcs.list_jobs.retry_policy
|
312
|
+
options.apply_defaults metadata: @config.metadata,
|
313
|
+
retry_policy: @config.retry_policy
|
314
|
+
|
315
|
+
@transcoder_service_stub.call_rpc :list_jobs, request, options: options do |response, operation|
|
316
|
+
response = ::Gapic::PagedEnumerable.new @transcoder_service_stub, :list_jobs, request, response, operation, options
|
317
|
+
yield response, operation if block_given?
|
318
|
+
return response
|
319
|
+
end
|
320
|
+
rescue ::GRPC::BadStatus => e
|
321
|
+
raise ::Google::Cloud::Error.from_error(e)
|
322
|
+
end
|
323
|
+
|
324
|
+
##
|
325
|
+
# Returns the job data.
|
326
|
+
#
|
327
|
+
# @overload get_job(request, options = nil)
|
328
|
+
# Pass arguments to `get_job` via a request object, either of type
|
329
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::GetJobRequest} or an equivalent Hash.
|
330
|
+
#
|
331
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::GetJobRequest, ::Hash]
|
332
|
+
# A request object representing the call parameters. Required. To specify no
|
333
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
334
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
335
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
336
|
+
#
|
337
|
+
# @overload get_job(name: nil)
|
338
|
+
# Pass arguments to `get_job` via keyword arguments. Note that at
|
339
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
340
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
341
|
+
#
|
342
|
+
# @param name [::String]
|
343
|
+
# Required. The name of the job to retrieve.
|
344
|
+
# Format: `projects/{project}/locations/{location}/jobs/{job}`
|
345
|
+
#
|
346
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
347
|
+
# @yieldparam response [::Google::Cloud::Video::Transcoder::V1beta1::Job]
|
348
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
349
|
+
#
|
350
|
+
# @return [::Google::Cloud::Video::Transcoder::V1beta1::Job]
|
351
|
+
#
|
352
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
353
|
+
#
|
354
|
+
def get_job request, options = nil
|
355
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
356
|
+
|
357
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::GetJobRequest
|
358
|
+
|
359
|
+
# Converts hash and nil to an options object
|
360
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
361
|
+
|
362
|
+
# Customize the options with defaults
|
363
|
+
metadata = @config.rpcs.get_job.metadata.to_h
|
364
|
+
|
365
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
366
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
367
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
368
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
369
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
370
|
+
|
371
|
+
header_params = {
|
372
|
+
"name" => request.name
|
373
|
+
}
|
374
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
375
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
376
|
+
|
377
|
+
options.apply_defaults timeout: @config.rpcs.get_job.timeout,
|
378
|
+
metadata: metadata,
|
379
|
+
retry_policy: @config.rpcs.get_job.retry_policy
|
380
|
+
options.apply_defaults metadata: @config.metadata,
|
381
|
+
retry_policy: @config.retry_policy
|
382
|
+
|
383
|
+
@transcoder_service_stub.call_rpc :get_job, request, options: options do |response, operation|
|
384
|
+
yield response, operation if block_given?
|
385
|
+
return response
|
386
|
+
end
|
387
|
+
rescue ::GRPC::BadStatus => e
|
388
|
+
raise ::Google::Cloud::Error.from_error(e)
|
389
|
+
end
|
390
|
+
|
391
|
+
##
|
392
|
+
# Deletes a job.
|
393
|
+
#
|
394
|
+
# @overload delete_job(request, options = nil)
|
395
|
+
# Pass arguments to `delete_job` via a request object, either of type
|
396
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobRequest} or an equivalent Hash.
|
397
|
+
#
|
398
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobRequest, ::Hash]
|
399
|
+
# A request object representing the call parameters. Required. To specify no
|
400
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
401
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
402
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
403
|
+
#
|
404
|
+
# @overload delete_job(name: nil)
|
405
|
+
# Pass arguments to `delete_job` via keyword arguments. Note that at
|
406
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
407
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
408
|
+
#
|
409
|
+
# @param name [::String]
|
410
|
+
# Required. The name of the job to delete.
|
411
|
+
# Format: `projects/{project}/locations/{location}/jobs/{job}`
|
412
|
+
#
|
413
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
414
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
415
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
416
|
+
#
|
417
|
+
# @return [::Google::Protobuf::Empty]
|
418
|
+
#
|
419
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
420
|
+
#
|
421
|
+
def delete_job request, options = nil
|
422
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
423
|
+
|
424
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobRequest
|
425
|
+
|
426
|
+
# Converts hash and nil to an options object
|
427
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
428
|
+
|
429
|
+
# Customize the options with defaults
|
430
|
+
metadata = @config.rpcs.delete_job.metadata.to_h
|
431
|
+
|
432
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
433
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
434
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
435
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
436
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
437
|
+
|
438
|
+
header_params = {
|
439
|
+
"name" => request.name
|
440
|
+
}
|
441
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
442
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
443
|
+
|
444
|
+
options.apply_defaults timeout: @config.rpcs.delete_job.timeout,
|
445
|
+
metadata: metadata,
|
446
|
+
retry_policy: @config.rpcs.delete_job.retry_policy
|
447
|
+
options.apply_defaults metadata: @config.metadata,
|
448
|
+
retry_policy: @config.retry_policy
|
449
|
+
|
450
|
+
@transcoder_service_stub.call_rpc :delete_job, request, options: options do |response, operation|
|
451
|
+
yield response, operation if block_given?
|
452
|
+
return response
|
453
|
+
end
|
454
|
+
rescue ::GRPC::BadStatus => e
|
455
|
+
raise ::Google::Cloud::Error.from_error(e)
|
456
|
+
end
|
457
|
+
|
458
|
+
##
|
459
|
+
# Creates a job template in the specified region.
|
460
|
+
#
|
461
|
+
# @overload create_job_template(request, options = nil)
|
462
|
+
# Pass arguments to `create_job_template` via a request object, either of type
|
463
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::CreateJobTemplateRequest} or an equivalent Hash.
|
464
|
+
#
|
465
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::CreateJobTemplateRequest, ::Hash]
|
466
|
+
# A request object representing the call parameters. Required. To specify no
|
467
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
468
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
469
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
470
|
+
#
|
471
|
+
# @overload create_job_template(parent: nil, job_template: nil, job_template_id: nil)
|
472
|
+
# Pass arguments to `create_job_template` via keyword arguments. Note that at
|
473
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
474
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
475
|
+
#
|
476
|
+
# @param parent [::String]
|
477
|
+
# Required. The parent location to create this job template.
|
478
|
+
# Format: `projects/{project}/locations/{location}`
|
479
|
+
# @param job_template [::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate, ::Hash]
|
480
|
+
# Required. Parameters for creating job template.
|
481
|
+
# @param job_template_id [::String]
|
482
|
+
# Required. The ID to use for the job template, which will become the final component
|
483
|
+
# of the job template's resource name.
|
484
|
+
#
|
485
|
+
# This value should be 4-63 characters, and valid characters must match the
|
486
|
+
# regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
|
487
|
+
#
|
488
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
489
|
+
# @yieldparam response [::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate]
|
490
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
491
|
+
#
|
492
|
+
# @return [::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate]
|
493
|
+
#
|
494
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
495
|
+
#
|
496
|
+
def create_job_template request, options = nil
|
497
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
498
|
+
|
499
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::CreateJobTemplateRequest
|
500
|
+
|
501
|
+
# Converts hash and nil to an options object
|
502
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
503
|
+
|
504
|
+
# Customize the options with defaults
|
505
|
+
metadata = @config.rpcs.create_job_template.metadata.to_h
|
506
|
+
|
507
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
508
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
509
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
510
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
511
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
512
|
+
|
513
|
+
header_params = {
|
514
|
+
"parent" => request.parent
|
515
|
+
}
|
516
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
517
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
518
|
+
|
519
|
+
options.apply_defaults timeout: @config.rpcs.create_job_template.timeout,
|
520
|
+
metadata: metadata,
|
521
|
+
retry_policy: @config.rpcs.create_job_template.retry_policy
|
522
|
+
options.apply_defaults metadata: @config.metadata,
|
523
|
+
retry_policy: @config.retry_policy
|
524
|
+
|
525
|
+
@transcoder_service_stub.call_rpc :create_job_template, request, options: options do |response, operation|
|
526
|
+
yield response, operation if block_given?
|
527
|
+
return response
|
528
|
+
end
|
529
|
+
rescue ::GRPC::BadStatus => e
|
530
|
+
raise ::Google::Cloud::Error.from_error(e)
|
531
|
+
end
|
532
|
+
|
533
|
+
##
|
534
|
+
# Lists job templates in the specified region.
|
535
|
+
#
|
536
|
+
# @overload list_job_templates(request, options = nil)
|
537
|
+
# Pass arguments to `list_job_templates` via a request object, either of type
|
538
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::ListJobTemplatesRequest} or an equivalent Hash.
|
539
|
+
#
|
540
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::ListJobTemplatesRequest, ::Hash]
|
541
|
+
# A request object representing the call parameters. Required. To specify no
|
542
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
543
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
544
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
545
|
+
#
|
546
|
+
# @overload list_job_templates(parent: nil, page_size: nil, page_token: nil)
|
547
|
+
# Pass arguments to `list_job_templates` via keyword arguments. Note that at
|
548
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
549
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
550
|
+
#
|
551
|
+
# @param parent [::String]
|
552
|
+
# Required. The parent location from which to retrieve the collection of job templates.
|
553
|
+
# Format: `projects/{project}/locations/{location}`
|
554
|
+
# @param page_size [::Integer]
|
555
|
+
# The maximum number of items to return.
|
556
|
+
# @param page_token [::String]
|
557
|
+
# The `next_page_token` value returned from a previous List request, if
|
558
|
+
# any.
|
559
|
+
#
|
560
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
561
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate>]
|
562
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
563
|
+
#
|
564
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate>]
|
565
|
+
#
|
566
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
567
|
+
#
|
568
|
+
def list_job_templates request, options = nil
|
569
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
570
|
+
|
571
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::ListJobTemplatesRequest
|
572
|
+
|
573
|
+
# Converts hash and nil to an options object
|
574
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
575
|
+
|
576
|
+
# Customize the options with defaults
|
577
|
+
metadata = @config.rpcs.list_job_templates.metadata.to_h
|
578
|
+
|
579
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
580
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
581
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
582
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
583
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
584
|
+
|
585
|
+
header_params = {
|
586
|
+
"parent" => request.parent
|
587
|
+
}
|
588
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
589
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
590
|
+
|
591
|
+
options.apply_defaults timeout: @config.rpcs.list_job_templates.timeout,
|
592
|
+
metadata: metadata,
|
593
|
+
retry_policy: @config.rpcs.list_job_templates.retry_policy
|
594
|
+
options.apply_defaults metadata: @config.metadata,
|
595
|
+
retry_policy: @config.retry_policy
|
596
|
+
|
597
|
+
@transcoder_service_stub.call_rpc :list_job_templates, request, options: options do |response, operation|
|
598
|
+
response = ::Gapic::PagedEnumerable.new @transcoder_service_stub, :list_job_templates, request, response, operation, options
|
599
|
+
yield response, operation if block_given?
|
600
|
+
return response
|
601
|
+
end
|
602
|
+
rescue ::GRPC::BadStatus => e
|
603
|
+
raise ::Google::Cloud::Error.from_error(e)
|
604
|
+
end
|
605
|
+
|
606
|
+
##
|
607
|
+
# Returns the job template data.
|
608
|
+
#
|
609
|
+
# @overload get_job_template(request, options = nil)
|
610
|
+
# Pass arguments to `get_job_template` via a request object, either of type
|
611
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::GetJobTemplateRequest} or an equivalent Hash.
|
612
|
+
#
|
613
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::GetJobTemplateRequest, ::Hash]
|
614
|
+
# A request object representing the call parameters. Required. To specify no
|
615
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
616
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
617
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
618
|
+
#
|
619
|
+
# @overload get_job_template(name: nil)
|
620
|
+
# Pass arguments to `get_job_template` via keyword arguments. Note that at
|
621
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
622
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
623
|
+
#
|
624
|
+
# @param name [::String]
|
625
|
+
# Required. The name of the job template to retrieve.
|
626
|
+
# Format:
|
627
|
+
# `projects/{project}/locations/{location}/jobTemplates/{job_template}`
|
628
|
+
#
|
629
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
630
|
+
# @yieldparam response [::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate]
|
631
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
632
|
+
#
|
633
|
+
# @return [::Google::Cloud::Video::Transcoder::V1beta1::JobTemplate]
|
634
|
+
#
|
635
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
636
|
+
#
|
637
|
+
def get_job_template request, options = nil
|
638
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
639
|
+
|
640
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::GetJobTemplateRequest
|
641
|
+
|
642
|
+
# Converts hash and nil to an options object
|
643
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
644
|
+
|
645
|
+
# Customize the options with defaults
|
646
|
+
metadata = @config.rpcs.get_job_template.metadata.to_h
|
647
|
+
|
648
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
649
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
650
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
651
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
652
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
653
|
+
|
654
|
+
header_params = {
|
655
|
+
"name" => request.name
|
656
|
+
}
|
657
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
658
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
659
|
+
|
660
|
+
options.apply_defaults timeout: @config.rpcs.get_job_template.timeout,
|
661
|
+
metadata: metadata,
|
662
|
+
retry_policy: @config.rpcs.get_job_template.retry_policy
|
663
|
+
options.apply_defaults metadata: @config.metadata,
|
664
|
+
retry_policy: @config.retry_policy
|
665
|
+
|
666
|
+
@transcoder_service_stub.call_rpc :get_job_template, request, options: options do |response, operation|
|
667
|
+
yield response, operation if block_given?
|
668
|
+
return response
|
669
|
+
end
|
670
|
+
rescue ::GRPC::BadStatus => e
|
671
|
+
raise ::Google::Cloud::Error.from_error(e)
|
672
|
+
end
|
673
|
+
|
674
|
+
##
|
675
|
+
# Deletes a job template.
|
676
|
+
#
|
677
|
+
# @overload delete_job_template(request, options = nil)
|
678
|
+
# Pass arguments to `delete_job_template` via a request object, either of type
|
679
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobTemplateRequest} or an equivalent Hash.
|
680
|
+
#
|
681
|
+
# @param request [::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobTemplateRequest, ::Hash]
|
682
|
+
# A request object representing the call parameters. Required. To specify no
|
683
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
684
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
685
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
686
|
+
#
|
687
|
+
# @overload delete_job_template(name: nil)
|
688
|
+
# Pass arguments to `delete_job_template` via keyword arguments. Note that at
|
689
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
690
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
691
|
+
#
|
692
|
+
# @param name [::String]
|
693
|
+
# Required. The name of the job template to delete.
|
694
|
+
# `projects/{project}/locations/{location}/jobTemplates/{job_template}`
|
695
|
+
#
|
696
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
697
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
698
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
699
|
+
#
|
700
|
+
# @return [::Google::Protobuf::Empty]
|
701
|
+
#
|
702
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
703
|
+
#
|
704
|
+
def delete_job_template request, options = nil
|
705
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
706
|
+
|
707
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::Transcoder::V1beta1::DeleteJobTemplateRequest
|
708
|
+
|
709
|
+
# Converts hash and nil to an options object
|
710
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
711
|
+
|
712
|
+
# Customize the options with defaults
|
713
|
+
metadata = @config.rpcs.delete_job_template.metadata.to_h
|
714
|
+
|
715
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
716
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
717
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
718
|
+
gapic_version: ::Google::Cloud::Video::Transcoder::V1beta1::VERSION
|
719
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
720
|
+
|
721
|
+
header_params = {
|
722
|
+
"name" => request.name
|
723
|
+
}
|
724
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
725
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
726
|
+
|
727
|
+
options.apply_defaults timeout: @config.rpcs.delete_job_template.timeout,
|
728
|
+
metadata: metadata,
|
729
|
+
retry_policy: @config.rpcs.delete_job_template.retry_policy
|
730
|
+
options.apply_defaults metadata: @config.metadata,
|
731
|
+
retry_policy: @config.retry_policy
|
732
|
+
|
733
|
+
@transcoder_service_stub.call_rpc :delete_job_template, request, options: options do |response, operation|
|
734
|
+
yield response, operation if block_given?
|
735
|
+
return response
|
736
|
+
end
|
737
|
+
rescue ::GRPC::BadStatus => e
|
738
|
+
raise ::Google::Cloud::Error.from_error(e)
|
739
|
+
end
|
740
|
+
|
741
|
+
##
|
742
|
+
# Configuration class for the TranscoderService API.
|
743
|
+
#
|
744
|
+
# This class represents the configuration for TranscoderService,
|
745
|
+
# providing control over timeouts, retry behavior, logging, transport
|
746
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
747
|
+
# applied individually to specific RPCs. See
|
748
|
+
# {::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client::Configuration::Rpcs}
|
749
|
+
# for a list of RPCs that can be configured independently.
|
750
|
+
#
|
751
|
+
# Configuration can be applied globally to all clients, or to a single client
|
752
|
+
# on construction.
|
753
|
+
#
|
754
|
+
# # Examples
|
755
|
+
#
|
756
|
+
# To modify the global config, setting the timeout for create_job
|
757
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
758
|
+
#
|
759
|
+
# ::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client.configure do |config|
|
760
|
+
# config.timeout = 10.0
|
761
|
+
# config.rpcs.create_job.timeout = 20.0
|
762
|
+
# end
|
763
|
+
#
|
764
|
+
# To apply the above configuration only to a new client:
|
765
|
+
#
|
766
|
+
# client = ::Google::Cloud::Video::Transcoder::V1beta1::TranscoderService::Client.new do |config|
|
767
|
+
# config.timeout = 10.0
|
768
|
+
# config.rpcs.create_job.timeout = 20.0
|
769
|
+
# end
|
770
|
+
#
|
771
|
+
# @!attribute [rw] endpoint
|
772
|
+
# The hostname or hostname:port of the service endpoint.
|
773
|
+
# Defaults to `"transcoder.googleapis.com"`.
|
774
|
+
# @return [::String]
|
775
|
+
# @!attribute [rw] credentials
|
776
|
+
# Credentials to send with calls. You may provide any of the following types:
|
777
|
+
# * (`String`) The path to a service account key file in JSON format
|
778
|
+
# * (`Hash`) A service account key as a Hash
|
779
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
780
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
781
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
782
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
783
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
784
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
785
|
+
# * (`nil`) indicating no credentials
|
786
|
+
# @return [::Object]
|
787
|
+
# @!attribute [rw] scope
|
788
|
+
# The OAuth scopes
|
789
|
+
# @return [::Array<::String>]
|
790
|
+
# @!attribute [rw] lib_name
|
791
|
+
# The library name as recorded in instrumentation and logging
|
792
|
+
# @return [::String]
|
793
|
+
# @!attribute [rw] lib_version
|
794
|
+
# The library version as recorded in instrumentation and logging
|
795
|
+
# @return [::String]
|
796
|
+
# @!attribute [rw] channel_args
|
797
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
798
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
799
|
+
# @return [::Hash]
|
800
|
+
# @!attribute [rw] interceptors
|
801
|
+
# An array of interceptors that are run before calls are executed.
|
802
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
803
|
+
# @!attribute [rw] timeout
|
804
|
+
# The call timeout in seconds.
|
805
|
+
# @return [::Numeric]
|
806
|
+
# @!attribute [rw] metadata
|
807
|
+
# Additional gRPC headers to be sent with the call.
|
808
|
+
# @return [::Hash{::Symbol=>::String}]
|
809
|
+
# @!attribute [rw] retry_policy
|
810
|
+
# The retry policy. The value is a hash with the following keys:
|
811
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
812
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
813
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
814
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
815
|
+
# trigger a retry.
|
816
|
+
# @return [::Hash]
|
817
|
+
# @!attribute [rw] quota_project
|
818
|
+
# A separate project against which to charge quota.
|
819
|
+
# @return [::String]
|
820
|
+
#
|
821
|
+
class Configuration
|
822
|
+
extend ::Gapic::Config
|
823
|
+
|
824
|
+
config_attr :endpoint, "transcoder.googleapis.com", ::String
|
825
|
+
config_attr :credentials, nil do |value|
|
826
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
827
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
828
|
+
allowed.any? { |klass| klass === value }
|
829
|
+
end
|
830
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
831
|
+
config_attr :lib_name, nil, ::String, nil
|
832
|
+
config_attr :lib_version, nil, ::String, nil
|
833
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
834
|
+
config_attr :interceptors, nil, ::Array, nil
|
835
|
+
config_attr :timeout, nil, ::Numeric, nil
|
836
|
+
config_attr :metadata, nil, ::Hash, nil
|
837
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
838
|
+
config_attr :quota_project, nil, ::String, nil
|
839
|
+
|
840
|
+
# @private
|
841
|
+
def initialize parent_config = nil
|
842
|
+
@parent_config = parent_config unless parent_config.nil?
|
843
|
+
|
844
|
+
yield self if block_given?
|
845
|
+
end
|
846
|
+
|
847
|
+
##
|
848
|
+
# Configurations for individual RPCs
|
849
|
+
# @return [Rpcs]
|
850
|
+
#
|
851
|
+
def rpcs
|
852
|
+
@rpcs ||= begin
|
853
|
+
parent_rpcs = nil
|
854
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
855
|
+
Rpcs.new parent_rpcs
|
856
|
+
end
|
857
|
+
end
|
858
|
+
|
859
|
+
##
|
860
|
+
# Configuration RPC class for the TranscoderService API.
|
861
|
+
#
|
862
|
+
# Includes fields providing the configuration for each RPC in this service.
|
863
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
864
|
+
# the following configuration fields:
|
865
|
+
#
|
866
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
867
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
868
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
869
|
+
# include the following keys:
|
870
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
871
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
872
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
873
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
874
|
+
# trigger a retry.
|
875
|
+
#
|
876
|
+
class Rpcs
|
877
|
+
##
|
878
|
+
# RPC-specific configuration for `create_job`
|
879
|
+
# @return [::Gapic::Config::Method]
|
880
|
+
#
|
881
|
+
attr_reader :create_job
|
882
|
+
##
|
883
|
+
# RPC-specific configuration for `list_jobs`
|
884
|
+
# @return [::Gapic::Config::Method]
|
885
|
+
#
|
886
|
+
attr_reader :list_jobs
|
887
|
+
##
|
888
|
+
# RPC-specific configuration for `get_job`
|
889
|
+
# @return [::Gapic::Config::Method]
|
890
|
+
#
|
891
|
+
attr_reader :get_job
|
892
|
+
##
|
893
|
+
# RPC-specific configuration for `delete_job`
|
894
|
+
# @return [::Gapic::Config::Method]
|
895
|
+
#
|
896
|
+
attr_reader :delete_job
|
897
|
+
##
|
898
|
+
# RPC-specific configuration for `create_job_template`
|
899
|
+
# @return [::Gapic::Config::Method]
|
900
|
+
#
|
901
|
+
attr_reader :create_job_template
|
902
|
+
##
|
903
|
+
# RPC-specific configuration for `list_job_templates`
|
904
|
+
# @return [::Gapic::Config::Method]
|
905
|
+
#
|
906
|
+
attr_reader :list_job_templates
|
907
|
+
##
|
908
|
+
# RPC-specific configuration for `get_job_template`
|
909
|
+
# @return [::Gapic::Config::Method]
|
910
|
+
#
|
911
|
+
attr_reader :get_job_template
|
912
|
+
##
|
913
|
+
# RPC-specific configuration for `delete_job_template`
|
914
|
+
# @return [::Gapic::Config::Method]
|
915
|
+
#
|
916
|
+
attr_reader :delete_job_template
|
917
|
+
|
918
|
+
# @private
|
919
|
+
def initialize parent_rpcs = nil
|
920
|
+
create_job_config = parent_rpcs&.create_job if parent_rpcs&.respond_to? :create_job
|
921
|
+
@create_job = ::Gapic::Config::Method.new create_job_config
|
922
|
+
list_jobs_config = parent_rpcs&.list_jobs if parent_rpcs&.respond_to? :list_jobs
|
923
|
+
@list_jobs = ::Gapic::Config::Method.new list_jobs_config
|
924
|
+
get_job_config = parent_rpcs&.get_job if parent_rpcs&.respond_to? :get_job
|
925
|
+
@get_job = ::Gapic::Config::Method.new get_job_config
|
926
|
+
delete_job_config = parent_rpcs&.delete_job if parent_rpcs&.respond_to? :delete_job
|
927
|
+
@delete_job = ::Gapic::Config::Method.new delete_job_config
|
928
|
+
create_job_template_config = parent_rpcs&.create_job_template if parent_rpcs&.respond_to? :create_job_template
|
929
|
+
@create_job_template = ::Gapic::Config::Method.new create_job_template_config
|
930
|
+
list_job_templates_config = parent_rpcs&.list_job_templates if parent_rpcs&.respond_to? :list_job_templates
|
931
|
+
@list_job_templates = ::Gapic::Config::Method.new list_job_templates_config
|
932
|
+
get_job_template_config = parent_rpcs&.get_job_template if parent_rpcs&.respond_to? :get_job_template
|
933
|
+
@get_job_template = ::Gapic::Config::Method.new get_job_template_config
|
934
|
+
delete_job_template_config = parent_rpcs&.delete_job_template if parent_rpcs&.respond_to? :delete_job_template
|
935
|
+
@delete_job_template = ::Gapic::Config::Method.new delete_job_template_config
|
936
|
+
|
937
|
+
yield self if block_given?
|
938
|
+
end
|
939
|
+
end
|
940
|
+
end
|
941
|
+
end
|
942
|
+
end
|
943
|
+
end
|
944
|
+
end
|
945
|
+
end
|
946
|
+
end
|
947
|
+
end
|