Skip to content

Commit

Permalink
docs: auto-generate samples and update protos (#622)
Browse files Browse the repository at this point in the history
* fix(ruby)!: Fix Ruby namespace for videointelligence/v1p3beta1

PiperOrigin-RevId: 399448269

Source-Link: googleapis/googleapis@f75ccc2

Source-Link: googleapis/googleapis-gen@6e2de21
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmUyZGUyMTkwYzM4YjFlMTg4NTIzZjI4ZjRkMzJmOTU4ZDJhZDI0NCJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 28, 2021
1 parent dd719c8 commit 8dd95cc
Show file tree
Hide file tree
Showing 8 changed files with 546 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ option java_multiple_files = true;
option java_outer_classname = "VideoIntelligenceServiceProto";
option java_package = "com.google.cloud.videointelligence.v1p3beta1";
option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p3beta1";
option ruby_package = "Google::Cloud::VideoIntelligence::V1p3beta1";

// Service that implements the Video Intelligence API.
service VideoIntelligenceService {
Expand Down
3 changes: 2 additions & 1 deletion packages/google-cloud-videointelligence/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(features) {
// [START videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Input video location. Currently, only
* [Cloud Storage](https://cloud.google.com/storage/) URIs are
* supported. URIs must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
* more information, see [Request
* URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify
* multiple videos, a video URI may include wildcards in the `object-id`.
* Supported wildcards: '*' to match 0 or more characters;
* '?' to match 1 character. If unset, the input video should be embedded
* in the request as `input_content`. If set, `input_content` must be unset.
*/
// const inputUri = 'abc123'
/**
* The video data bytes.
* If unset, the input video(s) should be specified via the `input_uri`.
* If set, `input_uri` must be unset.
*/
// const inputContent = 'Buffer.from('string')'
/**
* Required. Requested video annotation features.
*/
// const features = 1234
/**
* Additional video context and/or feature-specific parameters.
*/
// const videoContext = ''
/**
* Optional. Location where the output (in JSON format) should be stored.
* Currently, only [Cloud Storage](https://cloud.google.com/storage/)
* URIs are supported. These must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
* more information, see [Request
* URIs](https://cloud.google.com/storage/docs/request-endpoints).
*/
// const outputUri = 'abc123'
/**
* Optional. Cloud region where annotation should take place. Supported cloud
* regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no
* region is specified, the region will be determined based on video file
* location.
*/
// const locationId = 'abc123'

// Imports the Videointelligence library
const {VideoIntelligenceServiceClient} =
require('@google-cloud/video-intelligence').v1;

// Instantiates a client
const videointelligenceClient = new VideoIntelligenceServiceClient();

async function annotateVideo() {
// Construct request
const request = {
features,
};

// Run request
const [operation] = await videointelligenceClient.annotateVideo(request);
const [response] = await operation.promise();
console.log(response);
}

annotateVideo();
// [END videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(features) {
// [START videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Input video location. Currently, only
* [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
* supported, which must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
* more information, see [Request
* URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI
* may include wildcards in `object-id`, and thus identify multiple videos.
* Supported wildcards: '*' to match 0 or more characters;
* '?' to match 1 character. If unset, the input video should be embedded
* in the request as `input_content`. If set, `input_content` should be unset.
*/
// const inputUri = 'abc123'
/**
* The video data bytes.
* If unset, the input video(s) should be specified via `input_uri`.
* If set, `input_uri` should be unset.
*/
// const inputContent = 'Buffer.from('string')'
/**
* Required. Requested video annotation features.
*/
// const features = 1234
/**
* Additional video context and/or feature-specific parameters.
*/
// const videoContext = ''
/**
* Optional. Location where the output (in JSON format) should be stored.
* Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
* URIs are supported, which must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
* more information, see [Request
* URIs](https://cloud.google.com/storage/docs/request-endpoints).
*/
// const outputUri = 'abc123'
/**
* Optional. Cloud region where annotation should take place. Supported cloud
* regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
* is specified, a region will be determined based on video file location.
*/
// const locationId = 'abc123'

// Imports the Videointelligence library
const {VideoIntelligenceServiceClient} =
require('@google-cloud/video-intelligence').v1beta2;

// Instantiates a client
const videointelligenceClient = new VideoIntelligenceServiceClient();

async function annotateVideo() {
// Construct request
const request = {
features,
};

// Run request
const [operation] = await videointelligenceClient.annotateVideo(request);
const [response] = await operation.promise();
console.log(response);
}

annotateVideo();
// [END videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(features) {
// [START videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Input video location. Currently, only
* [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
* supported, which must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
* more information, see [Request
* URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI
* may include wildcards in `object-id`, and thus identify multiple videos.
* Supported wildcards: '*' to match 0 or more characters;
* '?' to match 1 character. If unset, the input video should be embedded
* in the request as `input_content`. If set, `input_content` should be unset.
*/
// const inputUri = 'abc123'
/**
* The video data bytes.
* If unset, the input video(s) should be specified via `input_uri`.
* If set, `input_uri` should be unset.
*/
// const inputContent = 'Buffer.from('string')'
/**
* Required. Requested video annotation features.
*/
// const features = 1234
/**
* Additional video context and/or feature-specific parameters.
*/
// const videoContext = ''
/**
* Optional. Location where the output (in JSON format) should be stored.
* Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
* URIs are supported, which must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For
* more information, see [Request
* URIs](https://cloud.google.com/storage/docs/request-endpoints).
*/
// const outputUri = 'abc123'
/**
* Optional. Cloud region where annotation should take place. Supported cloud
* regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
* is specified, a region will be determined based on video file location.
*/
// const locationId = 'abc123'

// Imports the Videointelligence library
const {VideoIntelligenceServiceClient} =
require('@google-cloud/video-intelligence').v1p1beta1;

// Instantiates a client
const videointelligenceClient = new VideoIntelligenceServiceClient();

async function annotateVideo() {
// Construct request
const request = {
features,
};

// Run request
const [operation] = await videointelligenceClient.annotateVideo(request);
const [response] = await operation.promise();
console.log(response);
}

annotateVideo();
// [END videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(features) {
// [START videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Input video location. Currently, only
* [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
* supported, which must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
* [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
* A video URI may include wildcards in `object-id`, and thus identify
* multiple videos. Supported wildcards: '*' to match 0 or more characters;
* '?' to match 1 character. If unset, the input video should be embedded
* in the request as `input_content`. If set, `input_content` should be unset.
*/
// const inputUri = 'abc123'
/**
* The video data bytes.
* If unset, the input video(s) should be specified via `input_uri`.
* If set, `input_uri` should be unset.
*/
// const inputContent = 'Buffer.from('string')'
/**
* Required. Requested video annotation features.
*/
// const features = 1234
/**
* Additional video context and/or feature-specific parameters.
*/
// const videoContext = ''
/**
* Optional. Location where the output (in JSON format) should be stored.
* Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
* URIs are supported, which must be specified in the following format:
* `gs://bucket-id/object-id` (other URI formats return
* [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
* [Request URIs](https://cloud.google.com/storage/docs/request-endpoints).
*/
// const outputUri = 'abc123'
/**
* Optional. Cloud region where annotation should take place. Supported cloud
* regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
* is specified, a region will be determined based on video file location.
*/
// const locationId = 'abc123'

// Imports the Videointelligence library
const {VideoIntelligenceServiceClient} =
require('@google-cloud/video-intelligence').v1p2beta1;

// Instantiates a client
const videointelligenceClient = new VideoIntelligenceServiceClient();

async function annotateVideo() {
// Construct request
const request = {
features,
};

// Run request
const [operation] = await videointelligenceClient.annotateVideo(request);
const [response] = await operation.promise();
console.log(response);
}

annotateVideo();
// [END videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading

0 comments on commit 8dd95cc

Please sign in to comment.