google-cloud-video_intelligence-v1p2beta1 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b2f59df82afa223cc99c31d861a1bcd4fbe76a676a0f18abb85d77919cdcdeb
4
- data.tar.gz: f7e79a01a2141ce412c16fb2f922d25e24c4133059071d628ea844ba2591ce06
3
+ metadata.gz: 29898887cb22ef9df21e529980144698635f5ed759c232855864591252cba562
4
+ data.tar.gz: 7da49686e2d7a37ec85f52a1fe751f3741f94f5984efe0a6d05a1d7640afe730
5
5
  SHA512:
6
- metadata.gz: 577d3d43bc7c3b818d0a97ec6f11ad26a6a69b057ac6b2aeda5df5d0b5819a4c986e8704a0401a4761796f38b6349d984cd40ab76582329afb6da8b4b9b0714d
7
- data.tar.gz: a197aa14f7abc3fc7fc02cb29a36a06f5da124b92ef27bd040c44070c991d604018febe87ed5cebcefda9f288d1319fb649a8bbeb051e7dc20ca83b2692a527a
6
+ metadata.gz: 4914cf03b2508c641711237d57a12918f971298b79c028e49aee68ad5fe0100500bbb02a22216c2a88fb76d16c688bfff637c7f6f242a7e96b90d8ea636fb385
7
+ data.tar.gz: 8ab4f059535389720f24d7596596d1c0f903255b62be3b80e964f442f178f9ee81cfe6d0b0383932bc5a0f3f8b20c5541c669f69561cedf36a2889c2947a5bf8
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/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
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.
@@ -69,16 +69,21 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
75
80
 
76
81
  Google provides official support for Ruby versions that are actively supported
77
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
78
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
79
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
80
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
81
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
82
87
 
83
88
  ## Which client should I use?
84
89
 
@@ -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/v1p2beta1/video_intelligence_service/rest"
20
+ require "google/cloud/video_intelligence/v1p2beta1/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/v1p2beta1/rest"
31
+ # client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.new
32
+ #
33
+ module V1p2beta1
34
+ end
35
+ end
36
+ end
37
+ end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module VideoIntelligence
23
23
  module V1p2beta1
24
- VERSION = "0.5.0"
24
+ VERSION = "0.7.0"
25
25
  end
26
26
  end
27
27
  end
@@ -232,14 +232,14 @@ module Google
232
232
  # # Call the annotate_video method.
233
233
  # result = client.annotate_video request
234
234
  #
235
- # # The returned object is of type Gapic::Operation. You can use this
236
- # # object to check the status of an operation, cancel it, or wait
237
- # # for results. Here is how to block until completion:
235
+ # # The returned object is of type Gapic::Operation. You can use it to
236
+ # # check the status of an operation, cancel it, or wait for results.
237
+ # # Here is how to wait for a response.
238
238
  # result.wait_until_done! timeout: 60
239
239
  # if result.response?
240
240
  # p result.response
241
241
  # else
242
- # puts "Error!"
242
+ # puts "No response received."
243
243
  # end
244
244
  #
245
245
  def annotate_video request, options = nil
@@ -95,6 +95,9 @@ module Google
95
95
  channel_args: @config.channel_args,
96
96
  interceptors: @config.interceptors
97
97
  )
98
+
99
+ # Used by an LRO wrapper for some methods of this service
100
+ @operations_client = self
98
101
  end
99
102
 
100
103
  # Service calls
@@ -155,13 +158,11 @@ module Google
155
158
  # # Call the list_operations method.
156
159
  # result = client.list_operations request
157
160
  #
158
- # # The returned object is of type Gapic::PagedEnumerable. You can
159
- # # iterate over all elements by calling #each, and the enumerable
160
- # # will lazily make API calls to fetch subsequent pages. Other
161
- # # methods are also available for managing paging directly.
162
- # 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|
163
164
  # # Each element is of type ::Google::Longrunning::Operation.
164
- # p response
165
+ # p item
165
166
  # end
166
167
  #
167
168
  def list_operations request, options = nil
@@ -250,14 +251,14 @@ module Google
250
251
  # # Call the get_operation method.
251
252
  # result = client.get_operation request
252
253
  #
253
- # # The returned object is of type Gapic::Operation. You can use this
254
- # # object to check the status of an operation, cancel it, or wait
255
- # # for results. Here is how to block until completion:
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.
256
257
  # result.wait_until_done! timeout: 60
257
258
  # if result.response?
258
259
  # p result.response
259
260
  # else
260
- # puts "Error!"
261
+ # puts "No response received."
261
262
  # end
262
263
  #
263
264
  def get_operation request, options = nil
@@ -537,14 +538,14 @@ module Google
537
538
  # # Call the wait_operation method.
538
539
  # result = client.wait_operation request
539
540
  #
540
- # # The returned object is of type Gapic::Operation. You can use this
541
- # # object to check the status of an operation, cancel it, or wait
542
- # # for results. Here is how to block until completion:
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.
543
544
  # result.wait_until_done! timeout: 60
544
545
  # if result.response?
545
546
  # p result.response
546
547
  # else
547
- # puts "Error!"
548
+ # puts "No response received."
548
549
  # end
549
550
  #
550
551
  def wait_operation request, options = nil
@@ -0,0 +1,392 @@
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/v1p2beta1/video_intelligence_pb"
21
+ require "google/cloud/video_intelligence/v1p2beta1/video_intelligence_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module VideoIntelligence
26
+ module V1p2beta1
27
+ module VideoIntelligenceService
28
+ module Rest
29
+ ##
30
+ # REST client for the VideoIntelligenceService service.
31
+ #
32
+ # Service that implements Google Cloud 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::V1p2beta1::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::V1p2beta1::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", "V1p2beta1"]
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::V1p2beta1::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::V1p2beta1::VideoIntelligenceService::Rest::Client.new
105
+ #
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::VideoIntelligence::V1p2beta1::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::V1p2beta1::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::V1p2beta1::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::V1p2beta1::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::V1p2beta1::AnnotateVideoRequest} or an equivalent Hash.
163
+ #
164
+ # @param request [::Google::Cloud::VideoIntelligence::V1p2beta1::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
+ # [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
178
+ # supported, which 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 more information, see
181
+ # [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
182
+ # A video URI may include wildcards in `object-id`, and thus identify
183
+ # multiple videos. Supported wildcards: '*' to match 0 or more characters;
184
+ # '?' to match 1 character. If unset, the input video should be embedded
185
+ # in the request as `input_content`. If set, `input_content` should be unset.
186
+ # @param input_content [::String]
187
+ # The video data bytes.
188
+ # If unset, the input video(s) should be specified via `input_uri`.
189
+ # If set, `input_uri` should be unset.
190
+ # @param features [::Array<::Google::Cloud::VideoIntelligence::V1p2beta1::Feature>]
191
+ # Required. Requested video annotation features.
192
+ # @param video_context [::Google::Cloud::VideoIntelligence::V1p2beta1::VideoContext, ::Hash]
193
+ # Additional video context and/or feature-specific parameters.
194
+ # @param output_uri [::String]
195
+ # Optional. Location where the output (in JSON format) should be stored.
196
+ # Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
197
+ # URIs are supported, which must be specified in the following format:
198
+ # `gs://bucket-id/object-id` (other URI formats return
199
+ # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
200
+ # [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
201
+ # @param location_id [::String]
202
+ # Optional. Cloud region where annotation should take place. Supported cloud
203
+ # regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
204
+ # is specified, a region will be determined based on video file location.
205
+ # @yield [result, operation] Access the result along with the TransportOperation object
206
+ # @yieldparam result [::Gapic::Operation]
207
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
208
+ #
209
+ # @return [::Gapic::Operation]
210
+ #
211
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
212
+ def annotate_video request, options = nil
213
+ raise ::ArgumentError, "request must be provided" if request.nil?
214
+
215
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VideoIntelligence::V1p2beta1::AnnotateVideoRequest
216
+
217
+ # Converts hash and nil to an options object
218
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
219
+
220
+ # Customize the options with defaults
221
+ call_metadata = @config.rpcs.annotate_video.metadata.to_h
222
+
223
+ # Set x-goog-api-client and x-goog-user-project headers
224
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
225
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
226
+ gapic_version: ::Google::Cloud::VideoIntelligence::V1p2beta1::VERSION,
227
+ transports_version_send: [:rest]
228
+
229
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
230
+
231
+ options.apply_defaults timeout: @config.rpcs.annotate_video.timeout,
232
+ metadata: call_metadata,
233
+ retry_policy: @config.rpcs.annotate_video.retry_policy
234
+
235
+ options.apply_defaults timeout: @config.timeout,
236
+ metadata: @config.metadata,
237
+ retry_policy: @config.retry_policy
238
+
239
+ @video_intelligence_service_stub.annotate_video request, options do |result, operation|
240
+ result = ::Gapic::Operation.new result, @operations_client, options: options
241
+ yield result, operation if block_given?
242
+ return result
243
+ end
244
+ rescue ::Gapic::Rest::Error => e
245
+ raise ::Google::Cloud::Error.from_error(e)
246
+ end
247
+
248
+ ##
249
+ # Configuration class for the VideoIntelligenceService REST API.
250
+ #
251
+ # This class represents the configuration for VideoIntelligenceService REST,
252
+ # providing control over timeouts, retry behavior, logging, transport
253
+ # parameters, and other low-level controls. Certain parameters can also be
254
+ # applied individually to specific RPCs. See
255
+ # {::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client::Configuration::Rpcs}
256
+ # for a list of RPCs that can be configured independently.
257
+ #
258
+ # Configuration can be applied globally to all clients, or to a single client
259
+ # on construction.
260
+ #
261
+ # @example
262
+ #
263
+ # # Modify the global config, setting the timeout for
264
+ # # annotate_video to 20 seconds,
265
+ # # and all remaining timeouts to 10 seconds.
266
+ # ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.configure do |config|
267
+ # config.timeout = 10.0
268
+ # config.rpcs.annotate_video.timeout = 20.0
269
+ # end
270
+ #
271
+ # # Apply the above configuration only to a new client.
272
+ # client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.new do |config|
273
+ # config.timeout = 10.0
274
+ # config.rpcs.annotate_video.timeout = 20.0
275
+ # end
276
+ #
277
+ # @!attribute [rw] endpoint
278
+ # The hostname or hostname:port of the service endpoint.
279
+ # Defaults to `"videointelligence.googleapis.com"`.
280
+ # @return [::String]
281
+ # @!attribute [rw] credentials
282
+ # Credentials to send with calls. You may provide any of the following types:
283
+ # * (`String`) The path to a service account key file in JSON format
284
+ # * (`Hash`) A service account key as a Hash
285
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
286
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
287
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
288
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
289
+ # * (`nil`) indicating no credentials
290
+ # @return [::Object]
291
+ # @!attribute [rw] scope
292
+ # The OAuth scopes
293
+ # @return [::Array<::String>]
294
+ # @!attribute [rw] lib_name
295
+ # The library name as recorded in instrumentation and logging
296
+ # @return [::String]
297
+ # @!attribute [rw] lib_version
298
+ # The library version as recorded in instrumentation and logging
299
+ # @return [::String]
300
+ # @!attribute [rw] timeout
301
+ # The call timeout in seconds.
302
+ # @return [::Numeric]
303
+ # @!attribute [rw] metadata
304
+ # Additional headers to be sent with the call.
305
+ # @return [::Hash{::Symbol=>::String}]
306
+ # @!attribute [rw] retry_policy
307
+ # The retry policy. The value is a hash with the following keys:
308
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
309
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
310
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
311
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
312
+ # trigger a retry.
313
+ # @return [::Hash]
314
+ # @!attribute [rw] quota_project
315
+ # A separate project against which to charge quota.
316
+ # @return [::String]
317
+ #
318
+ class Configuration
319
+ extend ::Gapic::Config
320
+
321
+ config_attr :endpoint, "videointelligence.googleapis.com", ::String
322
+ config_attr :credentials, nil do |value|
323
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
324
+ allowed.any? { |klass| klass === value }
325
+ end
326
+ config_attr :scope, nil, ::String, ::Array, nil
327
+ config_attr :lib_name, nil, ::String, nil
328
+ config_attr :lib_version, nil, ::String, nil
329
+ config_attr :timeout, nil, ::Numeric, nil
330
+ config_attr :metadata, nil, ::Hash, nil
331
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
332
+ config_attr :quota_project, nil, ::String, nil
333
+
334
+ # @private
335
+ def initialize parent_config = nil
336
+ @parent_config = parent_config unless parent_config.nil?
337
+
338
+ yield self if block_given?
339
+ end
340
+
341
+ ##
342
+ # Configurations for individual RPCs
343
+ # @return [Rpcs]
344
+ #
345
+ def rpcs
346
+ @rpcs ||= begin
347
+ parent_rpcs = nil
348
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
349
+ Rpcs.new parent_rpcs
350
+ end
351
+ end
352
+
353
+ ##
354
+ # Configuration RPC class for the VideoIntelligenceService API.
355
+ #
356
+ # Includes fields providing the configuration for each RPC in this service.
357
+ # Each configuration object is of type `Gapic::Config::Method` and includes
358
+ # the following configuration fields:
359
+ #
360
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
361
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
362
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
363
+ # include the following keys:
364
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
365
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
366
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
367
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
368
+ # trigger a retry.
369
+ #
370
+ class Rpcs
371
+ ##
372
+ # RPC-specific configuration for `annotate_video`
373
+ # @return [::Gapic::Config::Method]
374
+ #
375
+ attr_reader :annotate_video
376
+
377
+ # @private
378
+ def initialize parent_rpcs = nil
379
+ annotate_video_config = parent_rpcs.annotate_video if parent_rpcs.respond_to? :annotate_video
380
+ @annotate_video = ::Gapic::Config::Method.new annotate_video_config
381
+
382
+ yield self if block_given?
383
+ end
384
+ end
385
+ end
386
+ end
387
+ end
388
+ end
389
+ end
390
+ end
391
+ end
392
+ end