google-cloud-video_intelligence-v1 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +1 -1
- data/lib/google/cloud/video_intelligence/v1/rest.rb +37 -0
- data/lib/google/cloud/video_intelligence/v1/version.rb +1 -1
- data/lib/google/cloud/video_intelligence/v1/video_intelligence_service/client.rb +4 -4
- data/lib/google/cloud/video_intelligence/v1/video_intelligence_service/operations.rb +12 -14
- data/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest/client.rb +395 -0
- data/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest/operations.rb +814 -0
- data/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest/service_stub.rb +106 -0
- data/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest.rb +52 -0
- data/lib/google/cloud/video_intelligence/v1/video_intelligence_service.rb +7 -1
- data/lib/google/cloud/video_intelligence/v1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +14 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23a5d29841f0c439de320561b22e8d890c4ba12caa22b37b1ab3ab1eb8dfbeae
|
4
|
+
data.tar.gz: a0d5b167c24306398f24237976e229a1ef99ce06a71eca66a353a8fe9bb8ac2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825409b720f1a58a13693b8449a247795e0b038b602717bdbbb359b301c71ed562417adaa3ead09a61d5a75724eb76cef37ce0a8d457b91cf7fb409200cfecd9
|
7
|
+
data.tar.gz: 923f66550fccaf72199e09656242346bbc176190b0d0dce4e5be553ce237fc563a2e47297e08fc00caaee0a0f2220bd9e706e65712391e1b3718d6788a1514cf
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/video_intelligence/v1/video_intelligence_service/rest"
|
20
|
+
require "google/cloud/video_intelligence/v1/version"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module VideoIntelligence
|
25
|
+
##
|
26
|
+
# To load just the REST part of this package, including all its services, and instantiate a REST client:
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
#
|
30
|
+
# require "google/cloud/video_intelligence/v1/rest"
|
31
|
+
# client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client.new
|
32
|
+
#
|
33
|
+
module V1
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -235,14 +235,14 @@ module Google
|
|
235
235
|
# # Call the annotate_video method.
|
236
236
|
# result = client.annotate_video request
|
237
237
|
#
|
238
|
-
# # The returned object is of type Gapic::Operation. You can use
|
239
|
-
# #
|
240
|
-
# #
|
238
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
239
|
+
# # check the status of an operation, cancel it, or wait for results.
|
240
|
+
# # Here is how to wait for a response.
|
241
241
|
# result.wait_until_done! timeout: 60
|
242
242
|
# if result.response?
|
243
243
|
# p result.response
|
244
244
|
# else
|
245
|
-
# puts "
|
245
|
+
# puts "No response received."
|
246
246
|
# end
|
247
247
|
#
|
248
248
|
def annotate_video request, options = nil
|
@@ -158,13 +158,11 @@ module Google
|
|
158
158
|
# # Call the list_operations method.
|
159
159
|
# result = client.list_operations request
|
160
160
|
#
|
161
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
162
|
-
# #
|
163
|
-
#
|
164
|
-
# # methods are also available for managing paging directly.
|
165
|
-
# result.each do |response|
|
161
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
162
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
163
|
+
# result.each do |item|
|
166
164
|
# # Each element is of type ::Google::Longrunning::Operation.
|
167
|
-
# p
|
165
|
+
# p item
|
168
166
|
# end
|
169
167
|
#
|
170
168
|
def list_operations request, options = nil
|
@@ -253,14 +251,14 @@ module Google
|
|
253
251
|
# # Call the get_operation method.
|
254
252
|
# result = client.get_operation request
|
255
253
|
#
|
256
|
-
# # The returned object is of type Gapic::Operation. You can use
|
257
|
-
# #
|
258
|
-
# #
|
254
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
255
|
+
# # check the status of an operation, cancel it, or wait for results.
|
256
|
+
# # Here is how to wait for a response.
|
259
257
|
# result.wait_until_done! timeout: 60
|
260
258
|
# if result.response?
|
261
259
|
# p result.response
|
262
260
|
# else
|
263
|
-
# puts "
|
261
|
+
# puts "No response received."
|
264
262
|
# end
|
265
263
|
#
|
266
264
|
def get_operation request, options = nil
|
@@ -540,14 +538,14 @@ module Google
|
|
540
538
|
# # Call the wait_operation method.
|
541
539
|
# result = client.wait_operation request
|
542
540
|
#
|
543
|
-
# # The returned object is of type Gapic::Operation. You can use
|
544
|
-
# #
|
545
|
-
# #
|
541
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
542
|
+
# # check the status of an operation, cancel it, or wait for results.
|
543
|
+
# # Here is how to wait for a response.
|
546
544
|
# result.wait_until_done! timeout: 60
|
547
545
|
# if result.response?
|
548
546
|
# p result.response
|
549
547
|
# else
|
550
|
-
# puts "
|
548
|
+
# puts "No response received."
|
551
549
|
# end
|
552
550
|
#
|
553
551
|
def wait_operation request, options = nil
|
@@ -0,0 +1,395 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/videointelligence/v1/video_intelligence_pb"
|
21
|
+
require "google/cloud/video_intelligence/v1/video_intelligence_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module VideoIntelligence
|
26
|
+
module V1
|
27
|
+
module VideoIntelligenceService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the VideoIntelligenceService service.
|
31
|
+
#
|
32
|
+
# Service that implements the Video Intelligence API.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
attr_reader :video_intelligence_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the VideoIntelligenceService Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
#
|
46
|
+
# # Modify the configuration for all VideoIntelligenceService clients
|
47
|
+
# ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @yield [config] Configure the Client client.
|
52
|
+
# @yieldparam config [Client::Configuration]
|
53
|
+
#
|
54
|
+
# @return [Client::Configuration]
|
55
|
+
#
|
56
|
+
def self.configure
|
57
|
+
@configure ||= begin
|
58
|
+
namespace = ["Google", "Cloud", "VideoIntelligence", "V1"]
|
59
|
+
parent_config = while namespace.any?
|
60
|
+
parent_name = namespace.join "::"
|
61
|
+
parent_const = const_get parent_name
|
62
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
63
|
+
namespace.pop
|
64
|
+
end
|
65
|
+
default_config = Client::Configuration.new parent_config
|
66
|
+
|
67
|
+
default_config.rpcs.annotate_video.timeout = 600.0
|
68
|
+
default_config.rpcs.annotate_video.retry_policy = {
|
69
|
+
initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14, 4]
|
70
|
+
}
|
71
|
+
|
72
|
+
default_config
|
73
|
+
end
|
74
|
+
yield @configure if block_given?
|
75
|
+
@configure
|
76
|
+
end
|
77
|
+
|
78
|
+
##
|
79
|
+
# Configure the VideoIntelligenceService Client instance.
|
80
|
+
#
|
81
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
82
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
83
|
+
# should be made on {Client.configure}.
|
84
|
+
#
|
85
|
+
# See {::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client::Configuration}
|
86
|
+
# for a description of the configuration fields.
|
87
|
+
#
|
88
|
+
# @yield [config] Configure the Client client.
|
89
|
+
# @yieldparam config [Client::Configuration]
|
90
|
+
#
|
91
|
+
# @return [Client::Configuration]
|
92
|
+
#
|
93
|
+
def configure
|
94
|
+
yield @config if block_given?
|
95
|
+
@config
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Create a new VideoIntelligenceService REST client object.
|
100
|
+
#
|
101
|
+
# @example
|
102
|
+
#
|
103
|
+
# # Create a client using the default configuration
|
104
|
+
# client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client.new
|
105
|
+
#
|
106
|
+
# # Create a client using a custom configuration
|
107
|
+
# client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client.new do |config|
|
108
|
+
# config.timeout = 10.0
|
109
|
+
# end
|
110
|
+
#
|
111
|
+
# @yield [config] Configure the VideoIntelligenceService client.
|
112
|
+
# @yieldparam config [Client::Configuration]
|
113
|
+
#
|
114
|
+
def initialize
|
115
|
+
# Create the configuration object
|
116
|
+
@config = Configuration.new Client.configure
|
117
|
+
|
118
|
+
# Yield the configuration if needed
|
119
|
+
yield @config if block_given?
|
120
|
+
|
121
|
+
# Create credentials
|
122
|
+
credentials = @config.credentials
|
123
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
124
|
+
# but only if the default endpoint does not have a region prefix.
|
125
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
126
|
+
!@config.endpoint.split(".").first.include?("-")
|
127
|
+
credentials ||= Credentials.default scope: @config.scope,
|
128
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
129
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
130
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
131
|
+
end
|
132
|
+
|
133
|
+
@quota_project_id = @config.quota_project
|
134
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
135
|
+
|
136
|
+
@operations_client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Operations.new do |config|
|
137
|
+
config.credentials = credentials
|
138
|
+
config.quota_project = @quota_project_id
|
139
|
+
config.endpoint = @config.endpoint
|
140
|
+
end
|
141
|
+
|
142
|
+
@video_intelligence_service_stub = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
143
|
+
end
|
144
|
+
|
145
|
+
##
|
146
|
+
# Get the associated client for long-running operations.
|
147
|
+
#
|
148
|
+
# @return [::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Operations]
|
149
|
+
#
|
150
|
+
attr_reader :operations_client
|
151
|
+
|
152
|
+
# Service calls
|
153
|
+
|
154
|
+
##
|
155
|
+
# Performs asynchronous video annotation. Progress and results can be
|
156
|
+
# retrieved through the `google.longrunning.Operations` interface.
|
157
|
+
# `Operation.metadata` contains `AnnotateVideoProgress` (progress).
|
158
|
+
# `Operation.response` contains `AnnotateVideoResponse` (results).
|
159
|
+
#
|
160
|
+
# @overload annotate_video(request, options = nil)
|
161
|
+
# Pass arguments to `annotate_video` via a request object, either of type
|
162
|
+
# {::Google::Cloud::VideoIntelligence::V1::AnnotateVideoRequest} or an equivalent Hash.
|
163
|
+
#
|
164
|
+
# @param request [::Google::Cloud::VideoIntelligence::V1::AnnotateVideoRequest, ::Hash]
|
165
|
+
# A request object representing the call parameters. Required. To specify no
|
166
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
167
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
168
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
169
|
+
#
|
170
|
+
# @overload annotate_video(input_uri: nil, input_content: nil, features: nil, video_context: nil, output_uri: nil, location_id: nil)
|
171
|
+
# Pass arguments to `annotate_video` via keyword arguments. Note that at
|
172
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
173
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
174
|
+
#
|
175
|
+
# @param input_uri [::String]
|
176
|
+
# Input video location. Currently, only
|
177
|
+
# [Cloud Storage](https://cloud.google.com/storage/) URIs are
|
178
|
+
# supported. URIs must be specified in the following format:
|
179
|
+
# `gs://bucket-id/object-id` (other URI formats return
|
180
|
+
# [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
|
181
|
+
# more information, see [Request
|
182
|
+
# URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify
|
183
|
+
# multiple videos, a video URI may include wildcards in the `object-id`.
|
184
|
+
# Supported wildcards: '*' to match 0 or more characters;
|
185
|
+
# '?' to match 1 character. If unset, the input video should be embedded
|
186
|
+
# in the request as `input_content`. If set, `input_content` must be unset.
|
187
|
+
# @param input_content [::String]
|
188
|
+
# The video data bytes.
|
189
|
+
# If unset, the input video(s) should be specified via the `input_uri`.
|
190
|
+
# If set, `input_uri` must be unset.
|
191
|
+
# @param features [::Array<::Google::Cloud::VideoIntelligence::V1::Feature>]
|
192
|
+
# Required. Requested video annotation features.
|
193
|
+
# @param video_context [::Google::Cloud::VideoIntelligence::V1::VideoContext, ::Hash]
|
194
|
+
# Additional video context and/or feature-specific parameters.
|
195
|
+
# @param output_uri [::String]
|
196
|
+
# Optional. Location where the output (in JSON format) should be stored.
|
197
|
+
# Currently, only [Cloud Storage](https://cloud.google.com/storage/)
|
198
|
+
# URIs are supported. These must be specified in the following format:
|
199
|
+
# `gs://bucket-id/object-id` (other URI formats return
|
200
|
+
# [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
|
201
|
+
# more information, see [Request
|
202
|
+
# URIs](https://cloud.google.com/storage/docs/request-endpoints).
|
203
|
+
# @param location_id [::String]
|
204
|
+
# Optional. Cloud region where annotation should take place. Supported cloud
|
205
|
+
# regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no
|
206
|
+
# region is specified, the region will be determined based on video file
|
207
|
+
# location.
|
208
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
209
|
+
# @yieldparam result [::Gapic::Operation]
|
210
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
211
|
+
#
|
212
|
+
# @return [::Gapic::Operation]
|
213
|
+
#
|
214
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
215
|
+
def annotate_video request, options = nil
|
216
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
217
|
+
|
218
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VideoIntelligence::V1::AnnotateVideoRequest
|
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
|
+
call_metadata = @config.rpcs.annotate_video.metadata.to_h
|
225
|
+
|
226
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
227
|
+
call_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::VideoIntelligence::V1::VERSION,
|
230
|
+
transports_version_send: [:rest]
|
231
|
+
|
232
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
233
|
+
|
234
|
+
options.apply_defaults timeout: @config.rpcs.annotate_video.timeout,
|
235
|
+
metadata: call_metadata,
|
236
|
+
retry_policy: @config.rpcs.annotate_video.retry_policy
|
237
|
+
|
238
|
+
options.apply_defaults timeout: @config.timeout,
|
239
|
+
metadata: @config.metadata,
|
240
|
+
retry_policy: @config.retry_policy
|
241
|
+
|
242
|
+
@video_intelligence_service_stub.annotate_video request, options do |result, operation|
|
243
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
244
|
+
yield result, operation if block_given?
|
245
|
+
return result
|
246
|
+
end
|
247
|
+
rescue ::Gapic::Rest::Error => e
|
248
|
+
raise ::Google::Cloud::Error.from_error(e)
|
249
|
+
end
|
250
|
+
|
251
|
+
##
|
252
|
+
# Configuration class for the VideoIntelligenceService REST API.
|
253
|
+
#
|
254
|
+
# This class represents the configuration for VideoIntelligenceService REST,
|
255
|
+
# providing control over timeouts, retry behavior, logging, transport
|
256
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
257
|
+
# applied individually to specific RPCs. See
|
258
|
+
# {::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client::Configuration::Rpcs}
|
259
|
+
# for a list of RPCs that can be configured independently.
|
260
|
+
#
|
261
|
+
# Configuration can be applied globally to all clients, or to a single client
|
262
|
+
# on construction.
|
263
|
+
#
|
264
|
+
# @example
|
265
|
+
#
|
266
|
+
# # Modify the global config, setting the timeout for
|
267
|
+
# # annotate_video to 20 seconds,
|
268
|
+
# # and all remaining timeouts to 10 seconds.
|
269
|
+
# ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client.configure do |config|
|
270
|
+
# config.timeout = 10.0
|
271
|
+
# config.rpcs.annotate_video.timeout = 20.0
|
272
|
+
# end
|
273
|
+
#
|
274
|
+
# # Apply the above configuration only to a new client.
|
275
|
+
# client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client.new do |config|
|
276
|
+
# config.timeout = 10.0
|
277
|
+
# config.rpcs.annotate_video.timeout = 20.0
|
278
|
+
# end
|
279
|
+
#
|
280
|
+
# @!attribute [rw] endpoint
|
281
|
+
# The hostname or hostname:port of the service endpoint.
|
282
|
+
# Defaults to `"videointelligence.googleapis.com"`.
|
283
|
+
# @return [::String]
|
284
|
+
# @!attribute [rw] credentials
|
285
|
+
# Credentials to send with calls. You may provide any of the following types:
|
286
|
+
# * (`String`) The path to a service account key file in JSON format
|
287
|
+
# * (`Hash`) A service account key as a Hash
|
288
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
289
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
290
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
291
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
292
|
+
# * (`nil`) indicating no credentials
|
293
|
+
# @return [::Object]
|
294
|
+
# @!attribute [rw] scope
|
295
|
+
# The OAuth scopes
|
296
|
+
# @return [::Array<::String>]
|
297
|
+
# @!attribute [rw] lib_name
|
298
|
+
# The library name as recorded in instrumentation and logging
|
299
|
+
# @return [::String]
|
300
|
+
# @!attribute [rw] lib_version
|
301
|
+
# The library version as recorded in instrumentation and logging
|
302
|
+
# @return [::String]
|
303
|
+
# @!attribute [rw] timeout
|
304
|
+
# The call timeout in seconds.
|
305
|
+
# @return [::Numeric]
|
306
|
+
# @!attribute [rw] metadata
|
307
|
+
# Additional headers to be sent with the call.
|
308
|
+
# @return [::Hash{::Symbol=>::String}]
|
309
|
+
# @!attribute [rw] retry_policy
|
310
|
+
# The retry policy. The value is a hash with the following keys:
|
311
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
312
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
313
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
314
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
315
|
+
# trigger a retry.
|
316
|
+
# @return [::Hash]
|
317
|
+
# @!attribute [rw] quota_project
|
318
|
+
# A separate project against which to charge quota.
|
319
|
+
# @return [::String]
|
320
|
+
#
|
321
|
+
class Configuration
|
322
|
+
extend ::Gapic::Config
|
323
|
+
|
324
|
+
config_attr :endpoint, "videointelligence.googleapis.com", ::String
|
325
|
+
config_attr :credentials, nil do |value|
|
326
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
327
|
+
allowed.any? { |klass| klass === value }
|
328
|
+
end
|
329
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
330
|
+
config_attr :lib_name, nil, ::String, nil
|
331
|
+
config_attr :lib_version, nil, ::String, nil
|
332
|
+
config_attr :timeout, nil, ::Numeric, nil
|
333
|
+
config_attr :metadata, nil, ::Hash, nil
|
334
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
335
|
+
config_attr :quota_project, nil, ::String, nil
|
336
|
+
|
337
|
+
# @private
|
338
|
+
def initialize parent_config = nil
|
339
|
+
@parent_config = parent_config unless parent_config.nil?
|
340
|
+
|
341
|
+
yield self if block_given?
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# Configurations for individual RPCs
|
346
|
+
# @return [Rpcs]
|
347
|
+
#
|
348
|
+
def rpcs
|
349
|
+
@rpcs ||= begin
|
350
|
+
parent_rpcs = nil
|
351
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
352
|
+
Rpcs.new parent_rpcs
|
353
|
+
end
|
354
|
+
end
|
355
|
+
|
356
|
+
##
|
357
|
+
# Configuration RPC class for the VideoIntelligenceService API.
|
358
|
+
#
|
359
|
+
# Includes fields providing the configuration for each RPC in this service.
|
360
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
361
|
+
# the following configuration fields:
|
362
|
+
#
|
363
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
364
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
365
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
366
|
+
# include the following keys:
|
367
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
368
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
369
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
370
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
371
|
+
# trigger a retry.
|
372
|
+
#
|
373
|
+
class Rpcs
|
374
|
+
##
|
375
|
+
# RPC-specific configuration for `annotate_video`
|
376
|
+
# @return [::Gapic::Config::Method]
|
377
|
+
#
|
378
|
+
attr_reader :annotate_video
|
379
|
+
|
380
|
+
# @private
|
381
|
+
def initialize parent_rpcs = nil
|
382
|
+
annotate_video_config = parent_rpcs.annotate_video if parent_rpcs.respond_to? :annotate_video
|
383
|
+
@annotate_video = ::Gapic::Config::Method.new annotate_video_config
|
384
|
+
|
385
|
+
yield self if block_given?
|
386
|
+
end
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
390
|
+
end
|
391
|
+
end
|
392
|
+
end
|
393
|
+
end
|
394
|
+
end
|
395
|
+
end
|