google-apis-videointelligence_v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,347 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module VideointelligenceV1
23
+ # Cloud Video Intelligence API
24
+ #
25
+ # Detects objects, explicit content, and scene changes in videos. It also
26
+ # specifies the region for annotation and transcribes speech to text. Supports
27
+ # both asynchronous API and streaming API.
28
+ #
29
+ # @example
30
+ # require 'google/apis/videointelligence_v1'
31
+ #
32
+ # Videointelligence = Google::Apis::VideointelligenceV1 # Alias the module
33
+ # service = Videointelligence::CloudVideoIntelligenceService.new
34
+ #
35
+ # @see https://cloud.google.com/video-intelligence/docs/
36
+ class CloudVideoIntelligenceService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://videointelligence.googleapis.com/', '',
49
+ client_name: 'google-apis-videointelligence_v1',
50
+ client_version: Google::Apis::VideointelligenceV1::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Starts asynchronous cancellation on a long-running operation. The server makes
55
+ # a best effort to cancel the operation, but success is not guaranteed. If the
56
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
57
+ # Clients can use Operations.GetOperation or other methods to check whether the
58
+ # cancellation succeeded or whether the operation completed despite cancellation.
59
+ # On successful cancellation, the operation is not deleted; instead, it becomes
60
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
61
+ # corresponding to `Code.CANCELLED`.
62
+ # @param [String] name
63
+ # The name of the operation resource to be cancelled.
64
+ # @param [String] fields
65
+ # Selector specifying which fields to include in a partial response.
66
+ # @param [String] quota_user
67
+ # Available to use for quota purposes for server-side applications. Can be any
68
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def cancel_operation_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:post, 'v1/operations/{+name}:cancel', options)
83
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty::Representation
84
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty
85
+ command.params['name'] = name unless name.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Deletes a long-running operation. This method indicates that the client is no
92
+ # longer interested in the operation result. It does not cancel the operation.
93
+ # If the server doesn't support this method, it returns `google.rpc.Code.
94
+ # UNIMPLEMENTED`.
95
+ # @param [String] name
96
+ # The name of the operation resource to be deleted.
97
+ # @param [String] fields
98
+ # Selector specifying which fields to include in a partial response.
99
+ # @param [String] quota_user
100
+ # Available to use for quota purposes for server-side applications. Can be any
101
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
102
+ # @param [Google::Apis::RequestOptions] options
103
+ # Request-specific options
104
+ #
105
+ # @yield [result, err] Result & error if block supplied
106
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty] parsed result object
107
+ # @yieldparam err [StandardError] error object if request failed
108
+ #
109
+ # @return [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty]
110
+ #
111
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
112
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
113
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
114
+ def delete_operation_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
115
+ command = make_simple_command(:delete, 'v1/operations/{+name}', options)
116
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty::Representation
117
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty
118
+ command.params['name'] = name unless name.nil?
119
+ command.query['fields'] = fields unless fields.nil?
120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
121
+ execute_or_queue_command(command, &block)
122
+ end
123
+
124
+ # Gets the latest state of a long-running operation. Clients can use this method
125
+ # to poll the operation result at intervals as recommended by the API service.
126
+ # @param [String] name
127
+ # The name of the operation resource.
128
+ # @param [String] fields
129
+ # Selector specifying which fields to include in a partial response.
130
+ # @param [String] quota_user
131
+ # Available to use for quota purposes for server-side applications. Can be any
132
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
133
+ # @param [Google::Apis::RequestOptions] options
134
+ # Request-specific options
135
+ #
136
+ # @yield [result, err] Result & error if block supplied
137
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleLongrunningOperation] parsed result object
138
+ # @yieldparam err [StandardError] error object if request failed
139
+ #
140
+ # @return [Google::Apis::VideointelligenceV1::GoogleLongrunningOperation]
141
+ #
142
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
143
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
144
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
145
+ def get_operation_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
146
+ command = make_simple_command(:get, 'v1/operations/{+name}', options)
147
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleLongrunningOperation::Representation
148
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleLongrunningOperation
149
+ command.params['name'] = name unless name.nil?
150
+ command.query['fields'] = fields unless fields.nil?
151
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
152
+ execute_or_queue_command(command, &block)
153
+ end
154
+
155
+ # Starts asynchronous cancellation on a long-running operation. The server makes
156
+ # a best effort to cancel the operation, but success is not guaranteed. If the
157
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
158
+ # Clients can use Operations.GetOperation or other methods to check whether the
159
+ # cancellation succeeded or whether the operation completed despite cancellation.
160
+ # On successful cancellation, the operation is not deleted; instead, it becomes
161
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
162
+ # corresponding to `Code.CANCELLED`.
163
+ # @param [String] name
164
+ # The name of the operation resource to be cancelled.
165
+ # @param [Google::Apis::VideointelligenceV1::GoogleLongrunningCancelOperationRequest] google_longrunning_cancel_operation_request_object
166
+ # @param [String] fields
167
+ # Selector specifying which fields to include in a partial response.
168
+ # @param [String] quota_user
169
+ # Available to use for quota purposes for server-side applications. Can be any
170
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
171
+ # @param [Google::Apis::RequestOptions] options
172
+ # Request-specific options
173
+ #
174
+ # @yield [result, err] Result & error if block supplied
175
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty] parsed result object
176
+ # @yieldparam err [StandardError] error object if request failed
177
+ #
178
+ # @return [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty]
179
+ #
180
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
181
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
182
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
183
+ def cancel_project_location_operation(name, google_longrunning_cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
184
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
185
+ command.request_representation = Google::Apis::VideointelligenceV1::GoogleLongrunningCancelOperationRequest::Representation
186
+ command.request_object = google_longrunning_cancel_operation_request_object
187
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty::Representation
188
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty
189
+ command.params['name'] = name unless name.nil?
190
+ command.query['fields'] = fields unless fields.nil?
191
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
192
+ execute_or_queue_command(command, &block)
193
+ end
194
+
195
+ # Deletes a long-running operation. This method indicates that the client is no
196
+ # longer interested in the operation result. It does not cancel the operation.
197
+ # If the server doesn't support this method, it returns `google.rpc.Code.
198
+ # UNIMPLEMENTED`.
199
+ # @param [String] name
200
+ # The name of the operation resource to be deleted.
201
+ # @param [String] fields
202
+ # Selector specifying which fields to include in a partial response.
203
+ # @param [String] quota_user
204
+ # Available to use for quota purposes for server-side applications. Can be any
205
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
206
+ # @param [Google::Apis::RequestOptions] options
207
+ # Request-specific options
208
+ #
209
+ # @yield [result, err] Result & error if block supplied
210
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty] parsed result object
211
+ # @yieldparam err [StandardError] error object if request failed
212
+ #
213
+ # @return [Google::Apis::VideointelligenceV1::GoogleProtobufEmpty]
214
+ #
215
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
216
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
217
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
218
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
219
+ command = make_simple_command(:delete, 'v1/{+name}', options)
220
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty::Representation
221
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleProtobufEmpty
222
+ command.params['name'] = name unless name.nil?
223
+ command.query['fields'] = fields unless fields.nil?
224
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
225
+ execute_or_queue_command(command, &block)
226
+ end
227
+
228
+ # Gets the latest state of a long-running operation. Clients can use this method
229
+ # to poll the operation result at intervals as recommended by the API service.
230
+ # @param [String] name
231
+ # The name of the operation resource.
232
+ # @param [String] fields
233
+ # Selector specifying which fields to include in a partial response.
234
+ # @param [String] quota_user
235
+ # Available to use for quota purposes for server-side applications. Can be any
236
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
237
+ # @param [Google::Apis::RequestOptions] options
238
+ # Request-specific options
239
+ #
240
+ # @yield [result, err] Result & error if block supplied
241
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleLongrunningOperation] parsed result object
242
+ # @yieldparam err [StandardError] error object if request failed
243
+ #
244
+ # @return [Google::Apis::VideointelligenceV1::GoogleLongrunningOperation]
245
+ #
246
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
247
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
248
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
249
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
250
+ command = make_simple_command(:get, 'v1/{+name}', options)
251
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleLongrunningOperation::Representation
252
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleLongrunningOperation
253
+ command.params['name'] = name unless name.nil?
254
+ command.query['fields'] = fields unless fields.nil?
255
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
256
+ execute_or_queue_command(command, &block)
257
+ end
258
+
259
+ # Lists operations that match the specified filter in the request. If the server
260
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
261
+ # binding allows API services to override the binding to use different resource
262
+ # name schemes, such as `users/*/operations`. To override the binding, API
263
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
264
+ # service configuration. For backwards compatibility, the default name includes
265
+ # the operations collection id, however overriding users must ensure the name
266
+ # binding is the parent resource, without the operations collection id.
267
+ # @param [String] name
268
+ # The name of the operation's parent resource.
269
+ # @param [String] filter
270
+ # The standard list filter.
271
+ # @param [Fixnum] page_size
272
+ # The standard list page size.
273
+ # @param [String] page_token
274
+ # The standard list page token.
275
+ # @param [String] fields
276
+ # Selector specifying which fields to include in a partial response.
277
+ # @param [String] quota_user
278
+ # Available to use for quota purposes for server-side applications. Can be any
279
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
280
+ # @param [Google::Apis::RequestOptions] options
281
+ # Request-specific options
282
+ #
283
+ # @yield [result, err] Result & error if block supplied
284
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleLongrunningListOperationsResponse] parsed result object
285
+ # @yieldparam err [StandardError] error object if request failed
286
+ #
287
+ # @return [Google::Apis::VideointelligenceV1::GoogleLongrunningListOperationsResponse]
288
+ #
289
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
290
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
291
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
292
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
293
+ command = make_simple_command(:get, 'v1/{+name}/operations', options)
294
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleLongrunningListOperationsResponse::Representation
295
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleLongrunningListOperationsResponse
296
+ command.params['name'] = name unless name.nil?
297
+ command.query['filter'] = filter unless filter.nil?
298
+ command.query['pageSize'] = page_size unless page_size.nil?
299
+ command.query['pageToken'] = page_token unless page_token.nil?
300
+ command.query['fields'] = fields unless fields.nil?
301
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
302
+ execute_or_queue_command(command, &block)
303
+ end
304
+
305
+ # Performs asynchronous video annotation. Progress and results can be retrieved
306
+ # through the `google.longrunning.Operations` interface. `Operation.metadata`
307
+ # contains `AnnotateVideoProgress` (progress). `Operation.response` contains `
308
+ # AnnotateVideoResponse` (results).
309
+ # @param [Google::Apis::VideointelligenceV1::GoogleCloudVideointelligenceV1AnnotateVideoRequest] google_cloud_videointelligence_v1_annotate_video_request_object
310
+ # @param [String] fields
311
+ # Selector specifying which fields to include in a partial response.
312
+ # @param [String] quota_user
313
+ # Available to use for quota purposes for server-side applications. Can be any
314
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
315
+ # @param [Google::Apis::RequestOptions] options
316
+ # Request-specific options
317
+ #
318
+ # @yield [result, err] Result & error if block supplied
319
+ # @yieldparam result [Google::Apis::VideointelligenceV1::GoogleLongrunningOperation] parsed result object
320
+ # @yieldparam err [StandardError] error object if request failed
321
+ #
322
+ # @return [Google::Apis::VideointelligenceV1::GoogleLongrunningOperation]
323
+ #
324
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
325
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
326
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
327
+ def annotate_video(google_cloud_videointelligence_v1_annotate_video_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
328
+ command = make_simple_command(:post, 'v1/videos:annotate', options)
329
+ command.request_representation = Google::Apis::VideointelligenceV1::GoogleCloudVideointelligenceV1AnnotateVideoRequest::Representation
330
+ command.request_object = google_cloud_videointelligence_v1_annotate_video_request_object
331
+ command.response_representation = Google::Apis::VideointelligenceV1::GoogleLongrunningOperation::Representation
332
+ command.response_class = Google::Apis::VideointelligenceV1::GoogleLongrunningOperation
333
+ command.query['fields'] = fields unless fields.nil?
334
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
335
+ execute_or_queue_command(command, &block)
336
+ end
337
+
338
+ protected
339
+
340
+ def apply_command_defaults(command)
341
+ command.query['key'] = key unless key.nil?
342
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-videointelligence_v1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Cloud Video Intelligence API V1. Simple
28
+ REST clients are Ruby client libraries that provide access to Google services via
29
+ their HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Cloud Video Intelligence API, but note that some services
33
+ may provide a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-videointelligence_v1.rb
44
+ - lib/google/apis/videointelligence_v1.rb
45
+ - lib/google/apis/videointelligence_v1/classes.rb
46
+ - lib/google/apis/videointelligence_v1/gem_version.rb
47
+ - lib/google/apis/videointelligence_v1/representations.rb
48
+ - lib/google/apis/videointelligence_v1/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-videointelligence_v1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-videointelligence_v1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-videointelligence_v1
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Cloud Video Intelligence API V1
76
+ test_files: []