From f943e3c209ece341f5e60c9149c7f5568a1af31b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 21 Mar 2023 02:02:52 +0000 Subject: [PATCH 1/2] feat: added TimecodeConfig for specifying the source of timecode used in media workflow synchronization feat: added Encryption for enabling output encryption with DRM systems feat: added InputConfig to allow enabling/disabling automatic failover feat: added new tasks to Event: inputSwitch, returnToProgram, mute, unmute feat: added support for audio normalization and audio gain docs: clarify behavior when update_mask is omitted in PATCH requests PiperOrigin-RevId: 518110162 Source-Link: https://github.com/googleapis/googleapis/commit/874ec6afe7cbcb8e097295ab0bbb286da892f681 Source-Link: https://github.com/googleapis/googleapis-gen/commit/414df04b50ac793d6523030e7f2b7c2565f12277 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLWxpdmVzdHJlYW0vLk93bEJvdC55YW1sIiwiaCI6IjQxNGRmMDRiNTBhYzc5M2Q2NTIzMDMwZTdmMmI3YzI1NjVmMTIyNzcifQ== --- .../v1/.eslintignore | 7 + .../v1/.eslintrc.json | 3 + .../v1/.gitignore | 14 + .../v1/.jsdoc.js | 55 + .../v1/.mocharc.js | 33 + .../v1/.prettierrc.js | 22 + .../v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../v1/package.json | 64 + .../cloud/video/livestream/v1/outputs.proto | 479 +++ .../cloud/video/livestream/v1/resources.proto | 586 +++ .../cloud/video/livestream/v1/service.proto | 739 ++++ .../v1/livestream_service.create_channel.js | 89 + .../v1/livestream_service.create_event.js | 88 + .../v1/livestream_service.create_input.js | 89 + .../v1/livestream_service.delete_channel.js | 84 + .../v1/livestream_service.delete_event.js | 76 + .../v1/livestream_service.delete_input.js | 77 + .../v1/livestream_service.get_channel.js | 62 + .../v1/livestream_service.get_event.js | 62 + .../v1/livestream_service.get_input.js | 62 + .../v1/livestream_service.list_channels.js | 85 + .../v1/livestream_service.list_events.js | 85 + .../v1/livestream_service.list_inputs.js | 85 + .../v1/livestream_service.start_channel.js | 77 + .../v1/livestream_service.stop_channel.js | 77 + .../v1/livestream_service.update_channel.js | 96 + .../v1/livestream_service.update_input.js | 88 + ...data.google.cloud.video.livestream.v1.json | 779 ++++ .../v1/src/index.ts | 25 + .../v1/src/v1/gapic_metadata.json | 195 + .../v1/src/v1/index.ts | 19 + .../v1/src/v1/livestream_service_client.ts | 2817 ++++++++++++++ .../v1/livestream_service_client_config.json | 118 + .../src/v1/livestream_service_proto_list.json | 5 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_livestream_service_v1.ts | 3366 +++++++++++++++++ .../v1/tsconfig.json | 19 + .../v1/webpack.config.js | 64 + 41 files changed, 10816 insertions(+) create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/README.md create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/package.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore b/owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json b/owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.gitignore b/owl-bot-staging/google-cloud-video-livestream/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js b/owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js new file mode 100644 index 00000000000..4e0607efea5 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/livestream', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js b/owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js b/owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/README.md b/owl-bot-staging/google-cloud-video-livestream/v1/README.md new file mode 100644 index 00000000000..98e6f3fe769 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/README.md @@ -0,0 +1 @@ +Livestream: Nodejs Client diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json b/owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/package.json b/owl-bot-staging/google-cloud-video-livestream/v1/package.json new file mode 100644 index 00000000000..5b1d934f291 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/livestream", + "version": "0.1.0", + "description": "Livestream client for Node.js", + "repository": "googleapis/nodejs-livestream", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google livestream", + "livestream", + "livestream service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto new file mode 100644 index 00000000000..2eceb825ef6 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto @@ -0,0 +1,479 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.cloud.video.livestream.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/type/datetime.proto"; + +option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; +option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb"; +option java_multiple_files = true; +option java_outer_classname = "OutputsProto"; +option java_package = "com.google.cloud.video.livestream.v1"; +option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; +option ruby_package = "Google::Cloud::Video::LiveStream::V1"; + +// Encoding of an input element such as an audio, video, or text track. +// Elementary streams must be packaged before mapping and sharing between +// different output formats. +message ElementaryStream { + // A unique key for this elementary stream. + string key = 4; + + // Required. Encoding of an audio, video, or text track. + oneof elementary_stream { + // Encoding of a video stream. + VideoStream video_stream = 1; + + // Encoding of an audio stream. + AudioStream audio_stream = 2; + + // Encoding of a text stream. For example, closed captions or subtitles. + TextStream text_stream = 3; + } +} + +// Multiplexing settings for output stream. +message MuxStream { + // A unique key for this multiplexed stream. + string key = 1; + + // The container format. The default is `fmp4`. + // + // Supported container formats: + // + // - `fmp4` - the corresponding file extension is `.m4s` + // - `ts` - the corresponding file extension is `.ts` + string container = 3; + + // List of `ElementaryStream` + // [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed + // in this stream. + // + // - For `fmp4` container, must contain either one video or one audio stream. + // - For `ts` container, must contain exactly one audio stream and up to one + // video stream. + repeated string elementary_streams = 4; + + // Segment settings for `fmp4` and `ts`. + SegmentSettings segment_settings = 5; + + // Identifier of the encryption configuration to use. If omitted, output + // will be unencrypted. + string encryption_id = 6; +} + +// Manifest configuration. +message Manifest { + // The manifest type can be either `HLS` or `DASH`. + enum ManifestType { + // The manifest type is not specified. + MANIFEST_TYPE_UNSPECIFIED = 0; + + // Create an `HLS` manifest. The corresponding file extension is `.m3u8`. + HLS = 1; + + // Create a `DASH` manifest. The corresponding file extension is `.mpd`. + DASH = 2; + } + + // The name of the generated file. The default is `manifest` with the + // extension suffix corresponding to the `Manifest` + // [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple + // manifests are added to the channel, each must have a unique file name. + string file_name = 1; + + // Required. Type of the manifest, can be `HLS` or `DASH`. + ManifestType type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of `MuxStream` + // [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear + // in this manifest. + // + // - For HLS, either `fmp4` or `ts` mux streams can be specified but not + // mixed. + // - For DASH, only `fmp4` mux streams can be specified. + repeated string mux_streams = 3 [(google.api.field_behavior) = REQUIRED]; + + // Maximum number of segments that this manifest holds. Once the manifest + // reaches this maximum number of segments, whenever a new segment is added to + // the manifest, the oldest segment will be removed from the manifest. + // The minimum value is 3 and the default value is 5. + int32 max_segment_count = 4; + + // How long to keep a segment on the output Google Cloud Storage bucket after + // it is removed from the manifest. This field should be large enough to cover + // the manifest propagation delay. Otherwise, a player could receive 404 + // errors while accessing segments which are listed in the manifest that the + // player has, but were already deleted from the output Google Cloud Storage + // bucket. Default value is `60s`. + google.protobuf.Duration segment_keep_duration = 5; + + // Whether to use the timecode, as specified in timecode config, when setting: + // + // - `availabilityStartTime` attribute in DASH manifests. + // - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. + // + // If false, ignore the input timecode and use the time from system clock + // when the manifest is first generated. This is the default behavior. + bool use_timecode_as_timeline = 6; +} + +// Sprite sheet configuration. +message SpriteSheet { + // Format type. The default is `jpeg`. + // + // Supported formats: + // + // - `jpeg` + string format = 1; + + // Required. File name prefix for the generated sprite sheets. If multiple + // sprite sheets are added to the channel, each must have a unique file + // prefix. + // Each sprite sheet has an incremental 10-digit zero-padded suffix starting + // from 0 before the extension, such as `sprite_sheet0000000123.jpeg`. + string file_prefix = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The width of the sprite in pixels. Must be an even integer. + int32 sprite_width_pixels = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The height of the sprite in pixels. Must be an even integer. + int32 sprite_height_pixels = 4 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of sprites per row in a sprite sheet. Valid range is + // [1, 10] and the default value is 1. + int32 column_count = 5; + + // The maximum number of rows per sprite sheet. When the sprite sheet is full, + // a new sprite sheet is created. Valid range is [1, 10] and the default value + // is 1. + int32 row_count = 6; + + // Create sprites at regular intervals. Valid range is [1 second, 1 hour] and + // the default value is `10s`. + google.protobuf.Duration interval = 7; + + // The quality of the generated sprite sheet. Enter a value between 1 + // and 100, where 1 is the lowest quality and 100 is the highest quality. + // The default is 100. A high quality value corresponds to a low image data + // compression ratio. + int32 quality = 8; +} + +// Preprocessing configurations. +message PreprocessingConfig { + // Audio preprocessing configuration. + message Audio { + // Specify audio loudness normalization in loudness units relative to full + // scale (LUFS). Enter a value between -24 and 0 according to the following: + // + // - -24 is the Advanced Television Systems Committee (ATSC A/85) + // - -23 is the EU R128 broadcast standard + // - -19 is the prior standard for online mono audio + // - -18 is the ReplayGain standard + // - -16 is the prior standard for stereo audio + // - -14 is the new online audio standard recommended by Spotify, as well as + // Amazon Echo + // - 0 disables normalization. The default is 0. + double lufs = 1; + } + + // Video cropping configuration for the input video. The cropped input video + // is scaled to match the output resolution. + message Crop { + // The number of pixels to crop from the top. The default is 0. + int32 top_pixels = 1; + + // The number of pixels to crop from the bottom. The default is 0. + int32 bottom_pixels = 2; + + // The number of pixels to crop from the left. The default is 0. + int32 left_pixels = 3; + + // The number of pixels to crop from the right. The default is 0. + int32 right_pixels = 4; + } + + // Pad filter configuration for the input video. The padded input video + // is scaled after padding with black to match the output resolution. + message Pad { + // The number of pixels to add to the top. The default is 0. + int32 top_pixels = 1; + + // The number of pixels to add to the bottom. The default is 0. + int32 bottom_pixels = 2; + + // The number of pixels to add to the left. The default is 0. + int32 left_pixels = 3; + + // The number of pixels to add to the right. The default is 0. + int32 right_pixels = 4; + } + + // Audio preprocessing configuration. + Audio audio = 1; + + // Specify the video cropping configuration. + Crop crop = 2; + + // Specify the video pad filter configuration. + Pad pad = 3; +} + +// Video stream resource. +message VideoStream { + // H264 codec settings. + message H264CodecSettings { + // Required. The width of the video in pixels. Must be an even integer. + // Valid range is [320, 1920]. + int32 width_pixels = 1; + + // Required. The height of the video in pixels. Must be an even integer. + // Valid range is [180, 1080]. + int32 height_pixels = 2; + + // Required. The target video frame rate in frames per second (FPS). Must be + // less than or equal to 60. Will default to the input frame rate if larger + // than the input frame rate. The API will generate an output FPS that is + // divisible by the input FPS, and smaller or equal to the target FPS. See + // [Calculating frame + // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for + // more information. + double frame_rate = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The video bitrate in bits per second. Minimum value is 10,000. + // + // - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps). + // - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps). + int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED]; + + // Specifies whether an open Group of Pictures (GOP) structure should be + // allowed or not. The default is `false`. + bool allow_open_gop = 6; + + // GOP mode can be either by frame count or duration. + oneof gop_mode { + // Select the GOP size based on the specified frame count. + // If GOP frame count is set instead of GOP duration, GOP duration will be + // calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration + // must satisfy the limitations on `gopDuration` as well. + // Valid range is [60, 600]. + int32 gop_frame_count = 7; + + // Select the GOP size based on the specified duration. The default is + // `2s`. Note that `gopDuration` must be less than or equal to + // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], + // and + // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] + // must be divisible by `gopDuration`. Valid range is [2s, 20s]. + // + // All video streams in the same channel must have the same GOP size. + google.protobuf.Duration gop_duration = 8; + } + + // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be + // greater than zero. The default is equal to + // [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. + int32 vbv_size_bits = 9; + + // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. + // Must be greater than zero. The default is equal to 90% of + // [vbv_size_bits][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.vbv_size_bits]. + int32 vbv_fullness_bits = 10; + + // The entropy coder to use. The default is `cabac`. + // + // Supported entropy coders: + // + // - `cavlc` + // - `cabac` + string entropy_coder = 11; + + // Allow B-pyramid for reference frame selection. This may not be supported + // on all decoders. The default is `false`. + bool b_pyramid = 12; + + // The number of consecutive B-frames. Must be greater than or equal to + // zero. Must be less than + // [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] + // if set. The default is 0. + int32 b_frame_count = 13; + + // Specify the intensity of the adaptive quantizer (AQ). Must be between 0 + // and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A + // higher value equals a lower bitrate but smoother image. The default is 0. + double aq_strength = 14; + + // Enforces the specified codec profile. The following profiles are + // supported: + // + // * `baseline` + // * `main` (default) + // * `high` + // + // The available options are [FFmpeg-compatible Profile + // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). + // Note that certain values for this field may cause the + // transcoder to override other fields you set in the + // [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + // message. + string profile = 15; + + // Enforces the specified codec tune. The available options are + // [FFmpeg-compatible Encode + // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) + // Note that certain values for this field may cause the transcoder to + // override other fields you set in the + // [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + // message. + string tune = 16; + } + + // Codec settings. + oneof codec_settings { + // H264 codec settings. + H264CodecSettings h264 = 20; + } +} + +// Audio stream resource. +message AudioStream { + // The mapping for the input streams and audio channels. + message AudioMapping { + // Required. The `Channel` + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + // that identifies the input that this audio mapping applies to. If an + // active input doesn't have an audio mapping, the primary audio track in + // the input stream will be selected. + string input_key = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the track in the input stream. + // All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in + // the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must + // have the same input track. + int32 input_track = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the channel in the input stream. + int32 input_channel = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the channel in the output audio stream. + // Must be consistent with the + // [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + int32 output_channel = 4 [(google.api.field_behavior) = REQUIRED]; + + // Audio volume control in dB. Negative values decrease volume, + // positive values increase. The default is 0. + double gain_db = 5; + } + + // Specifies whether pass through (transmuxing) is enabled or not. + // If set to `true`, the rest of the settings, other than `mapping`, will be + // ignored. The default is `false`. + bool transmux = 8; + + // The codec for this audio stream. The default is `aac`. + // + // Supported audio codecs: + // + // - `aac` + string codec = 1; + + // Required. Audio bitrate in bits per second. Must be between 1 and + // 10,000,000. + int32 bitrate_bps = 2 [(google.api.field_behavior) = REQUIRED]; + + // Number of audio channels. Must be between 1 and 6. The default is 2. + int32 channel_count = 3; + + // A list of channel names specifying layout of the audio channels. + // This only affects the metadata embedded in the container headers, if + // supported by the specified format. The default is `[fl, fr]`. + // + // Supported channel names: + // + // - `fl` - Front left channel + // - `fr` - Front right channel + // - `sl` - Side left channel + // - `sr` - Side right channel + // - `fc` - Front center channel + // - `lfe` - Low frequency + repeated string channel_layout = 4; + + // The mapping for the input streams and audio channels. + repeated AudioMapping mapping = 5; + + // The audio sample rate in Hertz. The default is 48000 Hertz. + int32 sample_rate_hertz = 6; +} + +// Encoding of a text stream. For example, closed captions or subtitles. +message TextStream { + // Required. The codec for this text stream. + // + // Supported text codecs: + // + // - `cea608` + // - `cea708` + string codec = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Segment settings for `fmp4` and `ts`. +message SegmentSettings { + // Duration of the segments in seconds. The default is `6s`. Note that + // `segmentDuration` must be greater than or equal to + // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], + // and `segmentDuration` must be divisible by + // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. + // Valid range is [2s, 20s]. + // + // All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in + // the same manifest must have the same segment duration. + google.protobuf.Duration segment_duration = 1; +} + +// Timecode configuration. +message TimecodeConfig { + // The source of timecode. + enum TimecodeSource { + // The timecode source is not specified. + TIMECODE_SOURCE_UNSPECIFIED = 0; + + // Use input media timestamp. + MEDIA_TIMESTAMP = 1; + + // Use input embedded timecode e.g. picture timing SEI message. + EMBEDDED_TIMECODE = 2; + } + + // The source of the timecode that will later be used in outputs/manifests. + // It determines the initial timecode/timestamp (first frame) of output + // streams. + TimecodeSource source = 1; + + // For EMBEDDED_TIMECODE source only. + // Used to interpret the embedded timecode (which contains only the time part + // and no date). We assume all inputs are live. + oneof time_offset { + // UTC offset. Must be whole seconds, between -18 hours and +18 hours. + google.protobuf.Duration utc_offset = 2; + + // Time zone e.g. "America/Los_Angeles". + google.type.TimeZone time_zone = 3; + } +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto new file mode 100644 index 00000000000..1691139e2c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto @@ -0,0 +1,586 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.cloud.video.livestream.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/video/livestream/v1/outputs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; +option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.video.livestream.v1"; +option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; +option ruby_package = "Google::Cloud::Video::LiveStream::V1"; + +// Input resource represents the endpoint from which the channel ingests +// the input stream. +message Input { + option (google.api.resource) = { + type: "livestream.googleapis.com/Input" + pattern: "projects/{project}/locations/{location}/inputs/{input}" + }; + + // The type of the input. + enum Type { + // Input type is not specified. + TYPE_UNSPECIFIED = 0; + + // Input will take an rtmp input stream. + RTMP_PUSH = 1; + + // Input will take an srt (Secure Reliable Transport) input stream. + SRT_PUSH = 2; + } + + // Tier of the input specification. + enum Tier { + // Tier is not specified. + TIER_UNSPECIFIED = 0; + + // Resolution < 1280x720. Bitrate <= 6 Mbps. FPS <= 60. + SD = 1; + + // Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. + HD = 2; + + // Resolution <= 4096x2160. Not supported yet. + UHD = 3; + } + + // Security rules for access control. Each field represents one security rule. + // Only when the source of the input stream satisfies all the fields, this + // input stream can be accepted. + message SecurityRule { + // At least one ip range must match unless none specified. The IP range is + // defined by CIDR block: for example, `192.0.1.0/24` for a range and + // `192.0.1.0/32` for a single IP address. + repeated string ip_ranges = 1; + } + + // The resource name of the input, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-defined key/value metadata. + map labels = 4; + + // Source type. + Type type = 5; + + // Tier defines the maximum input specification that is accepted by the + // video pipeline. The billing is charged based on the tier specified here. + // See [Pricing](https://cloud.google.com/livestream/pricing) for more detail. + // The default is `HD`. + Tier tier = 14; + + // Output only. URI to push the input stream to. + // Its format depends on the input + // [type][google.cloud.video.livestream.v1.Input.type], for example: + // + // * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` + // * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` + string uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Preprocessing configurations. + PreprocessingConfig preprocessing_config = 9; + + // Security rule for access control. + SecurityRule security_rules = 12; + + // Output only. The information for the input stream. This field will be + // present only when this input receives the input stream. + InputStreamProperty input_stream_property = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Channel resource represents the processor that does a user-defined +// "streaming" operation, which includes getting an input stream through an +// input, transcoding it to multiple renditions, and publishing output live +// streams in certain formats (for example, HLS or DASH) to the specified +// location. +message Channel { + option (google.api.resource) = { + type: "livestream.googleapis.com/Channel" + pattern: "projects/{project}/locations/{location}/channels/{channel}" + }; + + // Location of output file(s) in a Google Cloud Storage bucket. + message Output { + // URI for the output file(s). For example, `gs://my-bucket/outputs/`. + string uri = 1; + } + + // State of streaming operation that the channel is running. + enum StreamingState { + // Streaming state is not specified. + STREAMING_STATE_UNSPECIFIED = 0; + + // Channel is getting the input stream, generating the live streams to the + // specified output location. + STREAMING = 1; + + // Channel is waiting for the input stream through the input. + AWAITING_INPUT = 2; + + // Channel is running, but has trouble publishing the live streams onto the + // specified output location (for example, the specified Cloud Storage + // bucket is not writable). + STREAMING_ERROR = 4; + + // Channel is generating live streams with no input stream. Live streams are + // filled out with black screen, while input stream is missing. + // Not supported yet. + STREAMING_NO_INPUT = 5; + + // Channel is stopped, finishing live streams. + STOPPED = 6; + + // Channel is starting. + STARTING = 7; + + // Channel is stopping. + STOPPING = 8; + } + + // The resource name of the channel, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-defined key/value metadata. + map labels = 4; + + // A list of input attachments that this channel uses. + // One channel can have multiple inputs as the input sources. Only one + // input can be selected as the input source at one time. + repeated InputAttachment input_attachments = 16; + + // Output only. The + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + // that serves as the current input source. The first input in the + // [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] + // is the initial input source. + string active_input = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Information about the output (that is, the Cloud Storage bucket + // to store the generated live stream). + Output output = 9 [(google.api.field_behavior) = REQUIRED]; + + // List of elementary streams. + repeated ElementaryStream elementary_streams = 10; + + // List of multiplexing settings for output streams. + repeated MuxStream mux_streams = 11; + + // List of output manifests. + repeated Manifest manifests = 12; + + // List of output sprite sheets. + repeated SpriteSheet sprite_sheets = 13; + + // Output only. State of the streaming operation. + StreamingState streaming_state = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A description of the reason for the streaming error. This + // property is always present when + // [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] + // is + // [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. + google.rpc.Status streaming_error = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration of platform logs for this channel. + LogConfig log_config = 19; + + // Configuration of timecode for this channel. + TimecodeConfig timecode_config = 21; + + // Encryption configurations for this channel. Each configuration has an ID + // which is referred to by each MuxStream to indicate which configuration is + // used for that output. + repeated Encryption encryptions = 24; + + // The configuration for input sources defined in + // [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]. + InputConfig input_config = 25; +} + +// Configuration for the input sources of a channel. +message InputConfig { + // Input switch mode. + enum InputSwitchMode { + // The input switch mode is not specified. + INPUT_SWITCH_MODE_UNSPECIFIED = 0; + + // Automatic failover is enabled. The primary input stream is always + // preferred over its backup input streams configured using the + // [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] + // field. + FAILOVER_PREFER_PRIMARY = 1; + + // Automatic failover is disabled. You must use the + // [inputSwitch][google.cloud.video.livestream.v1.Event.input_switch] event + // to switch the active input source for the channel to stream from. When + // this mode is chosen, the + // [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] + // field is ignored. + MANUAL = 3; + } + + // Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. + InputSwitchMode input_switch_mode = 1; +} + +// Configuration of platform logs. +// See [Using and managing platform +// logs](https://cloud.google.com/logging/docs/api/platform-logs#managing-logs) +// for more information about how to view platform logs through Cloud Logging. +message LogConfig { + // The severity level of platform logging for this channel. Logs with a + // severity level higher than or equal to the chosen severity level will be + // logged and can be viewed through Cloud Logging. + // The severity level of a log is ranked as followed from low to high: DEBUG < + // INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY. + // See + // [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity) + // for more information. + enum LogSeverity { + // Log severity is not specified. This is the same as log severity is OFF. + LOG_SEVERITY_UNSPECIFIED = 0; + + // Log is turned off. + OFF = 1; + + // Log with severity higher than or equal to DEBUG are logged. + DEBUG = 100; + + // Logs with severity higher than or equal to INFO are logged. + INFO = 200; + + // Logs with severity higher than or equal to WARNING are logged. + WARNING = 400; + + // Logs with severity higher than or equal to ERROR are logged. + ERROR = 500; + } + + // The severity level of platform logging for this resource. + LogSeverity log_severity = 1; +} + +// Properties of the input stream. +message InputStreamProperty { + // The time that the current input stream is accepted and the connection is + // established. + google.protobuf.Timestamp last_establish_time = 1; + + // Properties of the video streams. + repeated VideoStreamProperty video_streams = 2; + + // Properties of the audio streams. + repeated AudioStreamProperty audio_streams = 3; +} + +// Properties of the video stream. +message VideoStreamProperty { + // Index of this video stream. + int32 index = 1; + + // Properties of the video format. + VideoFormat video_format = 2; +} + +// Properties of the video format. +message VideoFormat { + // Video codec used in this video stream. + string codec = 1; + + // The width of the video stream in pixels. + int32 width_pixels = 2; + + // The height of the video stream in pixels. + int32 height_pixels = 3; + + // The frame rate of the input video stream. + double frame_rate = 4; +} + +// Properties of the audio stream. +message AudioStreamProperty { + // Index of this audio stream. + int32 index = 1; + + // Properties of the audio format. + AudioFormat audio_format = 2; +} + +// Properties of the audio format. +message AudioFormat { + // Audio codec used in this audio stream. + string codec = 1; + + // The number of audio channels. + int32 channel_count = 2; + + // A list of channel names specifying the layout of the audio channels. + repeated string channel_layout = 3; +} + +// A group of information for attaching an input resource to this channel. +message InputAttachment { + // Configurations to follow when automatic failover happens. + message AutomaticFailover { + // The + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s + // of inputs to failover to when this input is disconnected. Currently, only + // up to one backup input is supported. + repeated string input_keys = 1; + } + + // A unique key for this input attachment. + string key = 1; + + // The resource name of an existing input, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string input = 2 [(google.api.resource_reference) = { + type: "livestream.googleapis.com/Input" + }]; + + // Automatic failover configurations. + AutomaticFailover automatic_failover = 3; +} + +// Event is a sub-resource of a channel, which can be scheduled by the user to +// execute operations on a channel resource without having to stop the channel. +message Event { + option (google.api.resource) = { + type: "livestream.googleapis.com/Event" + pattern: "projects/{project}/locations/{location}/channels/{channel}/events/{event}" + }; + + // Switches to another input stream. Automatic failover is then disabled. + message InputSwitchTask { + // The + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + // of the input to switch to. + string input_key = 1; + } + + // Inserts a new ad opportunity. + message AdBreakTask { + // Duration of an ad opportunity. Must be greater than 0. + google.protobuf.Duration duration = 1; + } + + // Stops any events which are currently running. This only applies to events + // with a duration. + message ReturnToProgramTask {} + + // Mutes the stream. + message MuteTask { + // Duration for which the stream should be muted. If omitted, the stream + // will be muted until an UnmuteTask event is sent. + google.protobuf.Duration duration = 1; + } + + // Unmutes the stream. The task will fail if the stream is not + // currently muted. + message UnmuteTask {} + + // State of the event + enum State { + // Event state is not specified. + STATE_UNSPECIFIED = 0; + + // Event is scheduled but not executed yet. + SCHEDULED = 1; + + // Event is being executed. + RUNNING = 2; + + // Event has been successfully executed. + SUCCEEDED = 3; + + // Event fails to be executed. + FAILED = 4; + + // Event has been created but not scheduled yet. + PENDING = 5; + + // Event was stopped before running for its full duration. + STOPPED = 6; + } + + // The resource name of the event, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-defined key/value metadata. + map labels = 4; + + // Required. Operation to be executed by this event. + oneof task { + // Required. Switches to another input stream. + InputSwitchTask input_switch = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Inserts a new ad opportunity. + AdBreakTask ad_break = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Stops any running ad break. + ReturnToProgramTask return_to_program = 13 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mutes the stream. + MuteTask mute = 15 [(google.api.field_behavior) = REQUIRED]; + + // Required. Unmutes the stream. + UnmuteTask unmute = 16 [(google.api.field_behavior) = REQUIRED]; + } + + // When this field is set to true, the event will be executed at the earliest + // time that the server can schedule the event and + // [execution_time][google.cloud.video.livestream.v1.Event.execution_time] + // will be populated with the time that the server actually schedules the + // event. + bool execute_now = 9; + + // The time to execute the event. If you set + // [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + // `true`, then do not set this field in the `CreateEvent` request. In + // this case, the server schedules the event and populates this field. If you + // set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + // `false`, then you must set this field to at least 10 seconds in the future + // or else the event can't be created. + google.protobuf.Timestamp execution_time = 10; + + // Output only. The state of the event. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An error object that describes the reason for the failure. + // This property is always present when `state` is `FAILED`. + google.rpc.Status error = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Encryption settings. +message Encryption { + // Configuration for secrets stored in Google Secret Manager. + message SecretManagerSource { + // Required. The name of the Secret Version containing the encryption key. + // `projects/{project}/secrets/{secret_id}/versions/{version_number}` + string secret_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // Widevine configuration. + message Widevine {} + + // Fairplay configuration. + message Fairplay {} + + // Playready configuration. + message Playready {} + + // Clearkey configuration. + message Clearkey {} + + // Defines configuration for DRM systems in use. If a field is omitted, + // that DRM system will be considered to be disabled. + message DrmSystems { + // Widevine configuration. + Widevine widevine = 1; + + // Fairplay configuration. + Fairplay fairplay = 2; + + // Playready configuration. + Playready playready = 3; + + // Clearkey configuration. + Clearkey clearkey = 4; + } + + // Configuration for HLS AES-128 encryption. + message Aes128Encryption {} + + // Configuration for HLS SAMPLE-AES encryption. + message SampleAesEncryption {} + + // Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + message MpegCommonEncryption { + // Required. Specify the encryption scheme, supported schemes: + // - `cenc` - AES-CTR subsample + // - `cbcs`- AES-CBC subsample pattern + string scheme = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Identifier for this set of encryption options. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Defines where content keys are stored. + oneof secret_source { + // For keys stored in Google Secret Manager. + SecretManagerSource secret_manager_key_source = 7; + } + + // Required. Configuration for DRM systems. + DrmSystems drm_systems = 3 [(google.api.field_behavior) = REQUIRED]; + + // Encryption modes for HLS and MPEG-Dash. + oneof encryption_mode { + // Configuration for HLS AES-128 encryption. + Aes128Encryption aes128 = 4; + + // Configuration for HLS SAMPLE-AES encryption. + SampleAesEncryption sample_aes = 5; + + // Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + MpegCommonEncryption mpeg_cenc = 6; + } +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto new file mode 100644 index 00000000000..e424e54a4af --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto @@ -0,0 +1,739 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.cloud.video.livestream.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/video/livestream/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; +option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.video.livestream.v1"; +option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; +option ruby_package = "Google::Cloud::Video::LiveStream::V1"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; + +// Using Live Stream API, you can generate live streams in the various +// renditions and streaming formats. The streaming format include HTTP Live +// Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send +// a source stream in the various ways, including Real-Time Messaging +// Protocol (RTMP) and Secure Reliable Transport (SRT). +service LivestreamService { + option (google.api.default_host) = "livestream.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a channel with the provided unique ID in the specified + // region. + rpc CreateChannel(CreateChannelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/channels" + body: "channel" + }; + option (google.api.method_signature) = "parent,channel,channel_id"; + option (google.longrunning.operation_info) = { + response_type: "Channel" + metadata_type: "OperationMetadata" + }; + } + + // Returns a list of all channels in the specified region. + rpc ListChannels(ListChannelsRequest) returns (ListChannelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/channels" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the specified channel. + rpc GetChannel(GetChannelRequest) returns (Channel) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/channels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified channel. + rpc DeleteChannel(DeleteChannelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/channels/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates the specified channel. + rpc UpdateChannel(UpdateChannelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{channel.name=projects/*/locations/*/channels/*}" + body: "channel" + }; + option (google.api.method_signature) = "channel,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Channel" + metadata_type: "OperationMetadata" + }; + } + + // Starts the specified channel. Part of the video pipeline will be created + // only when the StartChannel request is received by the server. + rpc StartChannel(StartChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/channels/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ChannelOperationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Stops the specified channel. Part of the video pipeline will be released + // when the StopChannel request is received by the server. + rpc StopChannel(StopChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/channels/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ChannelOperationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Creates an input with the provided unique ID in the specified region. + rpc CreateInput(CreateInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/inputs" + body: "input" + }; + option (google.api.method_signature) = "parent,input,input_id"; + option (google.longrunning.operation_info) = { + response_type: "Input" + metadata_type: "OperationMetadata" + }; + } + + // Returns a list of all inputs in the specified region. + rpc ListInputs(ListInputsRequest) returns (ListInputsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/inputs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the specified input. + rpc GetInput(GetInputRequest) returns (Input) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/inputs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified input. + rpc DeleteInput(DeleteInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/inputs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates the specified input. + rpc UpdateInput(UpdateInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{input.name=projects/*/locations/*/inputs/*}" + body: "input" + }; + option (google.api.method_signature) = "input,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Input" + metadata_type: "OperationMetadata" + }; + } + + // Creates an event with the provided unique ID in the specified channel. + rpc CreateEvent(CreateEventRequest) returns (Event) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/channels/*}/events" + body: "event" + }; + option (google.api.method_signature) = "parent,event,event_id"; + } + + // Returns a list of all events in the specified channel. + rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/channels/*}/events" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the specified event. + rpc GetEvent(GetEventRequest) returns (Event) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/channels/*/events/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified event. + rpc DeleteEvent(DeleteEventRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/channels/*/events/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for "LivestreamService.CreateChannel". +message CreateChannelRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Channel" + } + ]; + + // Required. The channel resource to be created. + Channel channel = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the channel resource to be created. + // This value must be 1-63 characters, begin and end with `[a-z0-9]`, + // could contain dashes (-) in between. + string channel_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; +} + +// Request message for "LivestreamService.ListChannels". +message ListChannelsRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Channel" + } + ]; + + // The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] + // to determine if there are more items left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // The filter to apply to list results. + string filter = 4; + + // Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for "LivestreamService.ListChannels". +message ListChannelsResponse { + // A list of channels. + repeated Channel channels = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for "LivestreamService.GetChannel". +message GetChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; +} + +// Request message for "LivestreamService.DeleteChannel". +message DeleteChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; + + // If the `force` field is set to the default value of `false`, you must + // delete all of a channel's events before you can delete the channel itself. + // If the field is set to `true`, requests to delete a channel also delete + // associated channel events. + bool force = 3; +} + +// Request message for "LivestreamService.UpdateChannel". +message UpdateChannelRequest { + // Field mask is used to specify the fields to be overwritten in the Channel + // resource by the update. You can only update the following fields: + // + // * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + // * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) + // * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + // * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) + // * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + // * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + // * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + // * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + // * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + // * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) + // + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. + // + // If the mask is not present, then each field from the list above is updated + // if the field appears in the request payload. To unset a field, add the + // field to the update mask and remove it from the request payload. + google.protobuf.FieldMask update_mask = 1; + + // Required. The channel resource to be updated. + Channel channel = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 3; +} + +// Request message for "LivestreamService.StartChannel". +message StartChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Request message for "LivestreamService.StopChannel". +message StopChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Request message for "LivestreamService.CreateInput". +message CreateInputRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Input" + } + ]; + + // Required. The input resource to be created. + Input input = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the input resource to be created. + // This value must be 1-63 characters, begin and end with `[a-z0-9]`, + // could contain dashes (-) in between. + string input_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; +} + +// Request message for "LivestreamService.ListInputs". +message ListInputsRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Input" + } + ]; + + // The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] + // to determine if there are more items left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // The filter to apply to list results. + string filter = 4; + + // Specifies the ordering of results following syntax at [Sorting + // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + string order_by = 5; +} + +// Response message for "LivestreamService.ListInputs". +message ListInputsResponse { + // A list of inputs. + repeated Input inputs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for "LivestreamService.GetInput". +message GetInputRequest { + // Required. The name of the input resource, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Input" + } + ]; +} + +// Request message for "LivestreamService.DeleteInput". +message DeleteInputRequest { + // Required. The name of the input resource, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Input" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Request message for "LivestreamService.UpdateInput". +message UpdateInputRequest { + // Field mask is used to specify the fields to be overwritten in the Input + // resource by the update. You can only update the following fields: + // + // * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + // * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + // + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. + // + // If the mask is not present, then each field from the list above is updated + // if the field appears in the request payload. To unset a field, add the + // field to the update mask and remove it from the request payload. + google.protobuf.FieldMask update_mask = 1; + + // Required. The input resource to be updated. + Input input = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 3; +} + +// Request message for "LivestreamService.CreateEvent". +message CreateEventRequest { + // Required. The parent channel for the resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Event" + } + ]; + + // Required. The event resource to be created. + Event event = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the event resource to be created. + // This value must be 1-63 characters, begin and end with `[a-z0-9]`, + // could contain dashes (-) in between. + string event_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; +} + +// Request message for "LivestreamService.ListEvents". +message ListEventsRequest { + // Required. The parent channel for the resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Event" + } + ]; + + // The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] + // to determine if there are more items left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // The filter to apply to list results. + string filter = 4; + + // Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for "LivestreamService.ListEvents". +message ListEventsResponse { + // A list of events. + repeated Event events = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for "LivestreamService.GetEvent". +message GetEventRequest { + // Required. The name of the event resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Event" + } + ]; +} + +// Request message for "LivestreamService.DeleteEvent". +message DeleteEventRequest { + // Required. The name of the event resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Event" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Response message for Start/Stop Channel long-running operations. +message ChannelOperationResponse {} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js new file mode 100644 index 00000000000..04e526d83d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js @@ -0,0 +1,89 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, channel, channelId) { + // [START livestream_v1_generated_LivestreamService_CreateChannel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The channel resource to be created. + */ + // const channel = {} + /** + * Required. The ID of the channel resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + */ + // const channelId = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callCreateChannel() { + // Construct request + const request = { + parent, + channel, + channelId, + }; + + // Run request + const [operation] = await livestreamClient.createChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateChannel(); + // [END livestream_v1_generated_LivestreamService_CreateChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js new file mode 100644 index 00000000000..13b7c56b98a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js @@ -0,0 +1,88 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, event, eventId) { + // [START livestream_v1_generated_LivestreamService_CreateEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const parent = 'abc123' + /** + * Required. The event resource to be created. + */ + // const event = {} + /** + * Required. The ID of the event resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + */ + // const eventId = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callCreateEvent() { + // Construct request + const request = { + parent, + event, + eventId, + }; + + // Run request + const response = await livestreamClient.createEvent(request); + console.log(response); + } + + callCreateEvent(); + // [END livestream_v1_generated_LivestreamService_CreateEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js new file mode 100644 index 00000000000..594a071e5c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js @@ -0,0 +1,89 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, input, inputId) { + // [START livestream_v1_generated_LivestreamService_CreateInput_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The input resource to be created. + */ + // const input = {} + /** + * Required. The ID of the input resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + */ + // const inputId = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callCreateInput() { + // Construct request + const request = { + parent, + input, + inputId, + }; + + // Run request + const [operation] = await livestreamClient.createInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInput(); + // [END livestream_v1_generated_LivestreamService_CreateInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js new file mode 100644 index 00000000000..38bacb1edcb --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js @@ -0,0 +1,84 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_DeleteChannel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + /** + * If the `force` field is set to the default value of `false`, you must + * delete all of a channel's events before you can delete the channel itself. + * If the field is set to `true`, requests to delete a channel also delete + * associated channel events. + */ + // const force = true + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callDeleteChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.deleteChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteChannel(); + // [END livestream_v1_generated_LivestreamService_DeleteChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js new file mode 100644 index 00000000000..18753a8208a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js @@ -0,0 +1,76 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_DeleteEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callDeleteEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.deleteEvent(request); + console.log(response); + } + + callDeleteEvent(); + // [END livestream_v1_generated_LivestreamService_DeleteEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js new file mode 100644 index 00000000000..9a675459a08 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js @@ -0,0 +1,77 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_DeleteInput_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callDeleteInput() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.deleteInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInput(); + // [END livestream_v1_generated_LivestreamService_DeleteInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js new file mode 100644 index 00000000000..3008a487b7a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_GetChannel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callGetChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.getChannel(request); + console.log(response); + } + + callGetChannel(); + // [END livestream_v1_generated_LivestreamService_GetChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js new file mode 100644 index 00000000000..d965de3aa75 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_GetEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + */ + // const name = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callGetEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.getEvent(request); + console.log(response); + } + + callGetEvent(); + // [END livestream_v1_generated_LivestreamService_GetEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js new file mode 100644 index 00000000000..752f655ab61 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_GetInput_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + */ + // const name = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callGetInput() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.getInput(request); + console.log(response); + } + + callGetInput(); + // [END livestream_v1_generated_LivestreamService_GetInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js new file mode 100644 index 00000000000..ae51e11b30a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js @@ -0,0 +1,85 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START livestream_v1_generated_LivestreamService_ListChannels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token + * to determine if there are more items left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callListChannels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listChannelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChannels(); + // [END livestream_v1_generated_LivestreamService_ListChannels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js new file mode 100644 index 00000000000..6af569412f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js @@ -0,0 +1,85 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START livestream_v1_generated_LivestreamService_ListEvents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListEventsResponse.next_page_token + * to determine if there are more items left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callListEvents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listEventsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvents(); + // [END livestream_v1_generated_LivestreamService_ListEvents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js new file mode 100644 index 00000000000..bb79d657055 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js @@ -0,0 +1,85 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START livestream_v1_generated_LivestreamService_ListInputs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListInputsResponse.next_page_token + * to determine if there are more items left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Specifies the ordering of results following syntax at Sorting + * Order (https://cloud.google.com/apis/design/design_patterns#sorting_order). + */ + // const orderBy = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callListInputs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listInputsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInputs(); + // [END livestream_v1_generated_LivestreamService_ListInputs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js new file mode 100644 index 00000000000..7ff7452ce31 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js @@ -0,0 +1,77 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_StartChannel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callStartChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.startChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartChannel(); + // [END livestream_v1_generated_LivestreamService_StartChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js new file mode 100644 index 00000000000..b4d6d3ba567 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js @@ -0,0 +1,77 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_StopChannel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callStopChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.stopChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStopChannel(); + // [END livestream_v1_generated_LivestreamService_StopChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js new file mode 100644 index 00000000000..a31d32a1a8e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js @@ -0,0 +1,96 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(channel) { + // [START livestream_v1_generated_LivestreamService_UpdateChannel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Field mask is used to specify the fields to be overwritten in the Channel + * resource by the update. You can only update the following fields: + * * `inputAttachments` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * `inputConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) + * * `output` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + * * `elementaryStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) + * * `muxStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + * * `manifests` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * `spriteSheets` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * `logConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * `timecodeConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * `encryptions` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. + */ + // const updateMask = {} + /** + * Required. The channel resource to be updated. + */ + // const channel = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callUpdateChannel() { + // Construct request + const request = { + channel, + }; + + // Run request + const [operation] = await livestreamClient.updateChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateChannel(); + // [END livestream_v1_generated_LivestreamService_UpdateChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js new file mode 100644 index 00000000000..3e5bc7af43a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js @@ -0,0 +1,88 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(input) { + // [START livestream_v1_generated_LivestreamService_UpdateInput_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Field mask is used to specify the fields to be overwritten in the Input + * resource by the update. You can only update the following fields: + * * `preprocessingConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + * * `securityRules` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. + */ + // const updateMask = {} + /** + * Required. The input resource to be updated. + */ + // const input = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callUpdateInput() { + // Construct request + const request = { + input, + }; + + // Run request + const [operation] = await livestreamClient.updateInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInput(); + // [END livestream_v1_generated_LivestreamService_UpdateInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json new file mode 100644 index 00000000000..f25a8675879 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json @@ -0,0 +1,779 @@ +{ + "clientLibrary": { + "name": "nodejs-livestream", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.video.livestream.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "livestream_v1_generated_LivestreamService_CreateChannel_async", + "title": "LivestreamService createChannel Sample", + "origin": "API_DEFINITION", + "description": " Creates a channel with the provided unique ID in the specified region.", + "canonical": true, + "file": "livestream_service.create_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "channel", + "type": ".google.cloud.video.livestream.v1.Channel" + }, + { + "name": "channel_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "CreateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_ListChannels_async", + "title": "LivestreamService listChannels Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all channels in the specified region.", + "canonical": true, + "file": "livestream_service.list_channels.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListChannels", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.ListChannelsResponse", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "ListChannels", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_GetChannel_async", + "title": "LivestreamService getChannel Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified channel.", + "canonical": true, + "file": "livestream_service.get_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Channel", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "GetChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_DeleteChannel_async", + "title": "LivestreamService deleteChannel Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified channel.", + "canonical": true, + "file": "livestream_service.delete_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "DeleteChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_UpdateChannel_async", + "title": "LivestreamService updateChannel Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified channel.", + "canonical": true, + "file": "livestream_service.update_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "channel", + "type": ".google.cloud.video.livestream.v1.Channel" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "UpdateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_StartChannel_async", + "title": "LivestreamService startChannel Sample", + "origin": "API_DEFINITION", + "description": " Starts the specified channel. Part of the video pipeline will be created only when the StartChannel request is received by the server.", + "canonical": true, + "file": "livestream_service.start_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "StartChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_StopChannel_async", + "title": "LivestreamService stopChannel Sample", + "origin": "API_DEFINITION", + "description": " Stops the specified channel. Part of the video pipeline will be released when the StopChannel request is received by the server.", + "canonical": true, + "file": "livestream_service.stop_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "StopChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_CreateInput_async", + "title": "LivestreamService createInput Sample", + "origin": "API_DEFINITION", + "description": " Creates an input with the provided unique ID in the specified region.", + "canonical": true, + "file": "livestream_service.create_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "input", + "type": ".google.cloud.video.livestream.v1.Input" + }, + { + "name": "input_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "CreateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_ListInputs_async", + "title": "LivestreamService listInputs Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all inputs in the specified region.", + "canonical": true, + "file": "livestream_service.list_inputs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInputs", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.ListInputsResponse", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "ListInputs", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_GetInput_async", + "title": "LivestreamService getInput Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified input.", + "canonical": true, + "file": "livestream_service.get_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetInput", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Input", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "GetInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_DeleteInput_async", + "title": "LivestreamService deleteInput Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified input.", + "canonical": true, + "file": "livestream_service.delete_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "DeleteInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_UpdateInput_async", + "title": "LivestreamService updateInput Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified input.", + "canonical": true, + "file": "livestream_service.update_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "input", + "type": ".google.cloud.video.livestream.v1.Input" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "UpdateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_CreateEvent_async", + "title": "LivestreamService createEvent Sample", + "origin": "API_DEFINITION", + "description": " Creates an event with the provided unique ID in the specified channel.", + "canonical": true, + "file": "livestream_service.create_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "event", + "type": ".google.cloud.video.livestream.v1.Event" + }, + { + "name": "event_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Event", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "CreateEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_ListEvents_async", + "title": "LivestreamService listEvents Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all events in the specified channel.", + "canonical": true, + "file": "livestream_service.list_events.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvents", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.ListEventsResponse", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "ListEvents", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_GetEvent_async", + "title": "LivestreamService getEvent Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified event.", + "canonical": true, + "file": "livestream_service.get_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Event", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "GetEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_DeleteEvent_async", + "title": "LivestreamService deleteEvent Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified event.", + "canonical": true, + "file": "livestream_service.delete_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "DeleteEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts b/owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts new file mode 100644 index 00000000000..c4d9c2546ff --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const LivestreamServiceClient = v1.LivestreamServiceClient; +type LivestreamServiceClient = v1.LivestreamServiceClient; +export {v1, LivestreamServiceClient}; +export default {v1, LivestreamServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..7e4e701773a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json @@ -0,0 +1,195 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.video.livestream.v1", + "libraryPackage": "@google-cloud/livestream", + "services": { + "LivestreamService": { + "clients": { + "grpc": { + "libraryClient": "LivestreamServiceClient", + "rpcs": { + "GetChannel": { + "methods": [ + "getChannel" + ] + }, + "GetInput": { + "methods": [ + "getInput" + ] + }, + "CreateEvent": { + "methods": [ + "createEvent" + ] + }, + "GetEvent": { + "methods": [ + "getEvent" + ] + }, + "DeleteEvent": { + "methods": [ + "deleteEvent" + ] + }, + "CreateChannel": { + "methods": [ + "createChannel" + ] + }, + "DeleteChannel": { + "methods": [ + "deleteChannel" + ] + }, + "UpdateChannel": { + "methods": [ + "updateChannel" + ] + }, + "StartChannel": { + "methods": [ + "startChannel" + ] + }, + "StopChannel": { + "methods": [ + "stopChannel" + ] + }, + "CreateInput": { + "methods": [ + "createInput" + ] + }, + "DeleteInput": { + "methods": [ + "deleteInput" + ] + }, + "UpdateInput": { + "methods": [ + "updateInput" + ] + }, + "ListChannels": { + "methods": [ + "listChannels", + "listChannelsStream", + "listChannelsAsync" + ] + }, + "ListInputs": { + "methods": [ + "listInputs", + "listInputsStream", + "listInputsAsync" + ] + }, + "ListEvents": { + "methods": [ + "listEvents", + "listEventsStream", + "listEventsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LivestreamServiceClient", + "rpcs": { + "GetChannel": { + "methods": [ + "getChannel" + ] + }, + "GetInput": { + "methods": [ + "getInput" + ] + }, + "CreateEvent": { + "methods": [ + "createEvent" + ] + }, + "GetEvent": { + "methods": [ + "getEvent" + ] + }, + "DeleteEvent": { + "methods": [ + "deleteEvent" + ] + }, + "CreateChannel": { + "methods": [ + "createChannel" + ] + }, + "DeleteChannel": { + "methods": [ + "deleteChannel" + ] + }, + "UpdateChannel": { + "methods": [ + "updateChannel" + ] + }, + "StartChannel": { + "methods": [ + "startChannel" + ] + }, + "StopChannel": { + "methods": [ + "stopChannel" + ] + }, + "CreateInput": { + "methods": [ + "createInput" + ] + }, + "DeleteInput": { + "methods": [ + "deleteInput" + ] + }, + "UpdateInput": { + "methods": [ + "updateInput" + ] + }, + "ListChannels": { + "methods": [ + "listChannels", + "listChannelsStream", + "listChannelsAsync" + ] + }, + "ListInputs": { + "methods": [ + "listInputs", + "listInputsStream", + "listInputsAsync" + ] + }, + "ListEvents": { + "methods": [ + "listEvents", + "listEventsStream", + "listEventsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts new file mode 100644 index 00000000000..152ae8d5ad5 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {LivestreamServiceClient} from './livestream_service_client'; diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts new file mode 100644 index 00000000000..bff25ea570b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts @@ -0,0 +1,2817 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/livestream_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './livestream_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Using Live Stream API, you can generate live streams in the various + * renditions and streaming formats. The streaming format include HTTP Live + * Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send + * a source stream in the various ways, including Real-Time Messaging + * Protocol (RTMP) and Secure Reliable Transport (SRT). + * @class + * @memberof v1 + */ +export class LivestreamServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + livestreamServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LivestreamServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new LivestreamServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof LivestreamServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + channelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/channels/{channel}' + ), + eventPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/channels/{channel}/events/{event}' + ), + inputPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/inputs/{input}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listChannels: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'channels'), + listInputs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'inputs'), + listEvents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'events') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Channel') as gax.protobuf.Type; + const createChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + const deleteChannelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + const updateChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Channel') as gax.protobuf.Type; + const updateChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + const startChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.ChannelOperationResponse') as gax.protobuf.Type; + const startChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + const stopChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.ChannelOperationResponse') as gax.protobuf.Type; + const stopChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + const createInputResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Input') as gax.protobuf.Type; + const createInputMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInputResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInputMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + const updateInputResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Input') as gax.protobuf.Type; + const updateInputMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createChannelResponse.decode.bind(createChannelResponse), + createChannelMetadata.decode.bind(createChannelMetadata)), + deleteChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteChannelResponse.decode.bind(deleteChannelResponse), + deleteChannelMetadata.decode.bind(deleteChannelMetadata)), + updateChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateChannelResponse.decode.bind(updateChannelResponse), + updateChannelMetadata.decode.bind(updateChannelMetadata)), + startChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startChannelResponse.decode.bind(startChannelResponse), + startChannelMetadata.decode.bind(startChannelMetadata)), + stopChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + stopChannelResponse.decode.bind(stopChannelResponse), + stopChannelMetadata.decode.bind(stopChannelMetadata)), + createInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInputResponse.decode.bind(createInputResponse), + createInputMetadata.decode.bind(createInputMetadata)), + deleteInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInputResponse.decode.bind(deleteInputResponse), + deleteInputMetadata.decode.bind(deleteInputMetadata)), + updateInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInputResponse.decode.bind(updateInputResponse), + updateInputMetadata.decode.bind(updateInputMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.video.livestream.v1.LivestreamService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.livestreamServiceStub) { + return this.livestreamServiceStub; + } + + // Put together the "service stub" for + // google.cloud.video.livestream.v1.LivestreamService. + this.livestreamServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.video.livestream.v1.LivestreamService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.video.livestream.v1.LivestreamService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const livestreamServiceStubMethods = + ['createChannel', 'listChannels', 'getChannel', 'deleteChannel', 'updateChannel', 'startChannel', 'stopChannel', 'createInput', 'listInputs', 'getInput', 'deleteInput', 'updateInput', 'createEvent', 'listEvents', 'getEvent', 'deleteEvent']; + for (const methodName of livestreamServiceStubMethods) { + const callPromise = this.livestreamServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.livestreamServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'livestream.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'livestream.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Returns the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Channel | Channel}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.get_channel.js + * region_tag:livestream_v1_generated_LivestreamService_GetChannel_async + */ + getChannel( + request?: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest|undefined, {}|undefined + ]>; + getChannel( + request: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, + {}|null|undefined>): void; + getChannel( + request: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, + {}|null|undefined>): void; + getChannel( + request?: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getChannel(request, options, callback); + } +/** + * Returns the specified input. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Input | Input}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.get_input.js + * region_tag:livestream_v1_generated_LivestreamService_GetInput_async + */ + getInput( + request?: protos.google.cloud.video.livestream.v1.IGetInputRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest|undefined, {}|undefined + ]>; + getInput( + request: protos.google.cloud.video.livestream.v1.IGetInputRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, + {}|null|undefined>): void; + getInput( + request: protos.google.cloud.video.livestream.v1.IGetInputRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, + {}|null|undefined>): void; + getInput( + request?: protos.google.cloud.video.livestream.v1.IGetInputRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getInput(request, options, callback); + } +/** + * Creates an event with the provided unique ID in the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {google.cloud.video.livestream.v1.Event} request.event + * Required. The event resource to be created. + * @param {string} request.eventId + * Required. The ID of the event resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Event | Event}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.create_event.js + * region_tag:livestream_v1_generated_LivestreamService_CreateEvent_async + */ + createEvent( + request?: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest|undefined, {}|undefined + ]>; + createEvent( + request: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, + {}|null|undefined>): void; + createEvent( + request: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, + {}|null|undefined>): void; + createEvent( + request?: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createEvent(request, options, callback); + } +/** + * Returns the specified event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Event | Event}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.get_event.js + * region_tag:livestream_v1_generated_LivestreamService_GetEvent_async + */ + getEvent( + request?: protos.google.cloud.video.livestream.v1.IGetEventRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest|undefined, {}|undefined + ]>; + getEvent( + request: protos.google.cloud.video.livestream.v1.IGetEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, + {}|null|undefined>): void; + getEvent( + request: protos.google.cloud.video.livestream.v1.IGetEventRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, + {}|null|undefined>): void; + getEvent( + request?: protos.google.cloud.video.livestream.v1.IGetEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEvent(request, options, callback); + } +/** + * Deletes the specified event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.delete_event.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteEvent_async + */ + deleteEvent( + request?: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest|undefined, {}|undefined + ]>; + deleteEvent( + request: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, + {}|null|undefined>): void; + deleteEvent( + request: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, + {}|null|undefined>): void; + deleteEvent( + request?: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteEvent(request, options, callback); + } + +/** + * Creates a channel with the provided unique ID in the specified + * region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {google.cloud.video.livestream.v1.Channel} request.channel + * Required. The channel resource to be created. + * @param {string} request.channelId + * Required. The ID of the channel resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.create_channel.js + * region_tag:livestream_v1_generated_LivestreamService_CreateChannel_async + */ + createChannel( + request?: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createChannel( + request: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createChannel( + request: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createChannel( + request?: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createChannel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createChannel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.create_channel.js + * region_tag:livestream_v1_generated_LivestreamService_CreateChannel_async + */ + async checkCreateChannelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createChannel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {boolean} request.force + * If the `force` field is set to the default value of `false`, you must + * delete all of a channel's events before you can delete the channel itself. + * If the field is set to `true`, requests to delete a channel also delete + * associated channel events. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.delete_channel.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteChannel_async + */ + deleteChannel( + request?: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteChannel( + request: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteChannel( + request: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteChannel( + request?: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteChannel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteChannel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.delete_channel.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteChannel_async + */ + async checkDeleteChannelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteChannel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the Channel + * resource by the update. You can only update the following fields: + * + * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) + * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) + * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) + * + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. + * @param {google.cloud.video.livestream.v1.Channel} request.channel + * Required. The channel resource to be updated. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.update_channel.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateChannel_async + */ + updateChannel( + request?: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateChannel( + request: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateChannel( + request: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateChannel( + request?: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'channel.name': request.channel!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateChannel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateChannel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.update_channel.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateChannel_async + */ + async checkUpdateChannelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateChannel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Starts the specified channel. Part of the video pipeline will be created + * only when the StartChannel request is received by the server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.start_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StartChannel_async + */ + startChannel( + request?: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + startChannel( + request: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startChannel( + request: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startChannel( + request?: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.startChannel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `startChannel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.start_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StartChannel_async + */ + async checkStartChannelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.startChannel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Stops the specified channel. Part of the video pipeline will be released + * when the StopChannel request is received by the server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.stop_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StopChannel_async + */ + stopChannel( + request?: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + stopChannel( + request: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopChannel( + request: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopChannel( + request?: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.stopChannel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `stopChannel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.stop_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StopChannel_async + */ + async checkStopChannelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.stopChannel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates an input with the provided unique ID in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {google.cloud.video.livestream.v1.Input} request.input + * Required. The input resource to be created. + * @param {string} request.inputId + * Required. The ID of the input resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.create_input.js + * region_tag:livestream_v1_generated_LivestreamService_CreateInput_async + */ + createInput( + request?: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInput( + request: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInput( + request: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInput( + request?: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createInput(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createInput()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.create_input.js + * region_tag:livestream_v1_generated_LivestreamService_CreateInput_async + */ + async checkCreateInputProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInput, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the specified input. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.delete_input.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteInput_async + */ + deleteInput( + request?: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInput( + request: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInput( + request: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInput( + request?: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteInput(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteInput()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.delete_input.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteInput_async + */ + async checkDeleteInputProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInput, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the specified input. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the Input + * resource by the update. You can only update the following fields: + * + * * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + * * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + * + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. + * @param {google.cloud.video.livestream.v1.Input} request.input + * Required. The input resource to be updated. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.update_input.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateInput_async + */ + updateInput( + request?: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInput( + request: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInput( + request: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInput( + request?: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'input.name': request.input!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateInput(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateInput()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.update_input.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateInput_async + */ + async checkUpdateInputProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInput, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Returns a list of all channels in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.video.livestream.v1.Channel | Channel}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listChannelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listChannels( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.video.livestream.v1.IChannel[], + protos.google.cloud.video.livestream.v1.IListChannelsRequest|null, + protos.google.cloud.video.livestream.v1.IListChannelsResponse + ]>; + listChannels( + request: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IChannel>): void; + listChannels( + request: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IChannel>): void; + listChannels( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IChannel>, + callback?: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IChannel>): + Promise<[ + protos.google.cloud.video.livestream.v1.IChannel[], + protos.google.cloud.video.livestream.v1.IListChannelsRequest|null, + protos.google.cloud.video.livestream.v1.IListChannelsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listChannels(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.video.livestream.v1.Channel | Channel} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listChannelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listChannelsStream( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChannels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannels.createStream( + this.innerApiCalls.listChannels as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listChannels`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.video.livestream.v1.Channel | Channel}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.list_channels.js + * region_tag:livestream_v1_generated_LivestreamService_ListChannels_async + */ + listChannelsAsync( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChannels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannels.asyncIterate( + this.innerApiCalls['listChannels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of all inputs in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at [Sorting + * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.video.livestream.v1.Input | Input}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInputsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInputs( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.video.livestream.v1.IInput[], + protos.google.cloud.video.livestream.v1.IListInputsRequest|null, + protos.google.cloud.video.livestream.v1.IListInputsResponse + ]>; + listInputs( + request: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IInput>): void; + listInputs( + request: protos.google.cloud.video.livestream.v1.IListInputsRequest, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IInput>): void; + listInputs( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IInput>, + callback?: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IInput>): + Promise<[ + protos.google.cloud.video.livestream.v1.IInput[], + protos.google.cloud.video.livestream.v1.IListInputsRequest|null, + protos.google.cloud.video.livestream.v1.IListInputsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listInputs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at [Sorting + * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.video.livestream.v1.Input | Input} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInputsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInputsStream( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInputs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInputs.createStream( + this.innerApiCalls.listInputs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInputs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at [Sorting + * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.video.livestream.v1.Input | Input}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.list_inputs.js + * region_tag:livestream_v1_generated_LivestreamService_ListInputs_async + */ + listInputsAsync( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInputs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInputs.asyncIterate( + this.innerApiCalls['listInputs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of all events in the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.video.livestream.v1.Event | Event}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEvents( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.video.livestream.v1.IEvent[], + protos.google.cloud.video.livestream.v1.IListEventsRequest|null, + protos.google.cloud.video.livestream.v1.IListEventsResponse + ]>; + listEvents( + request: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IEvent>): void; + listEvents( + request: protos.google.cloud.video.livestream.v1.IListEventsRequest, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IEvent>): void; + listEvents( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IEvent>, + callback?: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, + protos.google.cloud.video.livestream.v1.IEvent>): + Promise<[ + protos.google.cloud.video.livestream.v1.IEvent[], + protos.google.cloud.video.livestream.v1.IListEventsRequest|null, + protos.google.cloud.video.livestream.v1.IListEventsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listEvents(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.video.livestream.v1.Event | Event} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEventsStream( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEvents.createStream( + this.innerApiCalls.listEvents as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvents`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.video.livestream.v1.Event | Event}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.list_events.js + * region_tag:livestream_v1_generated_LivestreamService_ListEvents_async + */ + listEventsAsync( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEvents.asyncIterate( + this.innerApiCalls['listEvents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified channel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} channel + * @returns {string} Resource name string. + */ + channelPath(project:string,location:string,channel:string) { + return this.pathTemplates.channelPathTemplate.render({ + project: project, + location: location, + channel: channel, + }); + } + + /** + * Parse the project from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).project; + } + + /** + * Parse the location from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).location; + } + + /** + * Parse the channel from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).channel; + } + + /** + * Return a fully-qualified event resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} channel + * @param {string} event + * @returns {string} Resource name string. + */ + eventPath(project:string,location:string,channel:string,event:string) { + return this.pathTemplates.eventPathTemplate.render({ + project: project, + location: location, + channel: channel, + event: event, + }); + } + + /** + * Parse the project from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).project; + } + + /** + * Parse the location from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).location; + } + + /** + * Parse the channel from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).channel; + } + + /** + * Parse the event from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the event. + */ + matchEventFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).event; + } + + /** + * Return a fully-qualified input resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} input + * @returns {string} Resource name string. + */ + inputPath(project:string,location:string,input:string) { + return this.pathTemplates.inputPathTemplate.render({ + project: project, + location: location, + input: input, + }); + } + + /** + * Parse the project from Input resource. + * + * @param {string} inputName + * A fully-qualified path representing Input resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInputName(inputName: string) { + return this.pathTemplates.inputPathTemplate.match(inputName).project; + } + + /** + * Parse the location from Input resource. + * + * @param {string} inputName + * A fully-qualified path representing Input resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInputName(inputName: string) { + return this.pathTemplates.inputPathTemplate.match(inputName).location; + } + + /** + * Parse the input from Input resource. + * + * @param {string} inputName + * A fully-qualified path representing Input resource. + * @returns {string} A string representing the input. + */ + matchInputFromInputName(inputName: string) { + return this.pathTemplates.inputPathTemplate.match(inputName).input; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.livestreamServiceStub && !this._terminated) { + return this.livestreamServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json new file mode 100644 index 00000000000..54b1640f293 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json @@ -0,0 +1,118 @@ +{ + "interfaces": { + "google.cloud.video.livestream.v1.LivestreamService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListChannels": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetChannel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInput": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInputs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetInput": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteInput": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInput": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEvent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEvents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetEvent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteEvent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json new file mode 100644 index 00000000000..59db12abdff --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/video/livestream/v1/outputs.proto", + "../../protos/google/cloud/video/livestream/v1/resources.proto", + "../../protos/google/cloud/video/livestream/v1/service.proto" +] diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..162bf42986e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const livestream = require('@google-cloud/livestream'); + +function main() { + const livestreamServiceClient = new livestream.LivestreamServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..030bd445734 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {LivestreamServiceClient} from '@google-cloud/livestream'; + +// check that the client class type name can be used +function doStuffWithLivestreamServiceClient(client: LivestreamServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const livestreamServiceClient = new LivestreamServiceClient(); + doStuffWithLivestreamServiceClient(livestreamServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts b/owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts new file mode 100644 index 00000000000..b396752c5c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts @@ -0,0 +1,3366 @@ +// Copyright 2023 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as livestreamserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.LivestreamServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = livestreamserviceModule.v1.LivestreamServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = livestreamserviceModule.v1.LivestreamServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = livestreamserviceModule.v1.LivestreamServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.livestreamServiceStub, undefined); + await client.initialize(); + assert(client.livestreamServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.livestreamServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.livestreamServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getChannel', () => { + it('invokes getChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ); + client.innerApiCalls.getChannel = stubSimpleCall(expectedResponse); + const [response] = await client.getChannel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ); + client.innerApiCalls.getChannel = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChannel( + request, + (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IChannel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannel with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChannel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getChannel(request), expectedError); + const actualRequest = (client.innerApiCalls.getChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannel with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getChannel(request), expectedError); + }); + }); + + describe('getInput', () => { + it('invokes getInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ); + client.innerApiCalls.getInput = stubSimpleCall(expectedResponse); + const [response] = await client.getInput(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ); + client.innerApiCalls.getInput = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInput( + request, + (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IInput|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInput with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInput = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInput(request), expectedError); + const actualRequest = (client.innerApiCalls.getInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInput with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInput(request), expectedError); + }); + }); + + describe('createEvent', () => { + it('invokes createEvent without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.createEvent = stubSimpleCall(expectedResponse); + const [response] = await client.createEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.createEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEvent( + request, + (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IEvent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.createEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createEvent(request), expectedError); + }); + }); + + describe('getEvent', () => { + it('invokes getEvent without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.getEvent = stubSimpleCall(expectedResponse); + const [response] = await client.getEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.getEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvent( + request, + (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IEvent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEvent(request), expectedError); + }); + }); + + describe('deleteEvent', () => { + it('invokes deleteEvent without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvent( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteEvent(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEvent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteEvent(request), expectedError); + }); + }); + + describe('createChannel', () => { + it('invokes createChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createChannel = stubLongRunningCall(expectedResponse); + const [operation] = await client.createChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createChannel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createChannel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createChannel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createChannel(request), expectedError); + const actualRequest = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createChannel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateChannelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateChannelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteChannel', () => { + it('invokes deleteChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteChannel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteChannel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteChannel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteChannel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteChannel(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteChannel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteChannelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteChannelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateChannel', () => { + it('invokes updateChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateChannel = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateChannel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateChannel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateChannel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateChannel(request), expectedError); + const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateChannel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateChannelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateChannelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('startChannel', () => { + it('invokes startChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startChannel = stubLongRunningCall(expectedResponse); + const [operation] = await client.startChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startChannel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startChannel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startChannel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.startChannel(request), expectedError); + const actualRequest = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startChannel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.startChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkStartChannelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkStartChannelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('stopChannel', () => { + it('invokes stopChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopChannel = stubLongRunningCall(expectedResponse); + const [operation] = await client.stopChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopChannel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopChannel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopChannel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.stopChannel(request), expectedError); + const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopChannel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.stopChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStopChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkStopChannelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStopChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkStopChannelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInput', () => { + it('invokes createInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInput = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInput = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInput( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInput with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInput = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInput(request), expectedError); + const actualRequest = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInput with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInput = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInputProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInputProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInputProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInputProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInput', () => { + it('invokes deleteInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInput = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInput = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInput( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInput with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInput = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInput(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInput with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInput = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInputProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInputProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInputProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInputProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInput', () => { + it('invokes updateInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInput = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInput = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInput( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInput with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInput = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInput(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInput with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInput = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInputProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInputProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInputProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInputProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listChannels', () => { + it('invokes listChannels without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + ]; + client.innerApiCalls.listChannels = stubSimpleCall(expectedResponse); + const [response] = await client.listChannels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listChannels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChannels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannels without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + ]; + client.innerApiCalls.listChannels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChannels( + request, + (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IChannel[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listChannels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChannels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannels with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChannels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listChannels(request), expectedError); + const actualRequest = (client.innerApiCalls.listChannels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChannels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelsStream without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + ]; + client.descriptors.page.listChannels.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listChannelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Channel[] = []; + stream.on('data', (response: protos.google.cloud.video.livestream.v1.Channel) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listChannels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listChannels, request)); + assert( + (client.descriptors.page.listChannels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listChannelsStream with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannels.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listChannelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Channel[] = []; + stream.on('data', (response: protos.google.cloud.video.livestream.v1.Channel) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listChannels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listChannels, request)); + assert( + (client.descriptors.page.listChannels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannels without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), + ]; + client.descriptors.page.listChannels.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.livestream.v1.IChannel[] = []; + const iterable = client.listChannelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listChannels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listChannels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannels with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChannelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.livestream.v1.IChannel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listChannels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listChannels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInputs', () => { + it('invokes listInputs without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + ]; + client.innerApiCalls.listInputs = stubSimpleCall(expectedResponse); + const [response] = await client.listInputs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInputs without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + ]; + client.innerApiCalls.listInputs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInputs( + request, + (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IInput[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInputs with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInputs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInputs(request), expectedError); + const actualRequest = (client.innerApiCalls.listInputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInputsStream without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + ]; + client.descriptors.page.listInputs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInputsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Input[] = []; + stream.on('data', (response: protos.google.cloud.video.livestream.v1.Input) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInputs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInputs, request)); + assert( + (client.descriptors.page.listInputs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInputsStream with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInputs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInputsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Input[] = []; + stream.on('data', (response: protos.google.cloud.video.livestream.v1.Input) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInputs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInputs, request)); + assert( + (client.descriptors.page.listInputs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInputs without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), + ]; + client.descriptors.page.listInputs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.livestream.v1.IInput[] = []; + const iterable = client.listInputsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInputs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInputs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInputs with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInputs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInputsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.livestream.v1.IInput[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInputs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInputs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvents', () => { + it('invokes listEvents without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + ]; + client.innerApiCalls.listEvents = stubSimpleCall(expectedResponse); + const [response] = await client.listEvents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvents without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + ]; + client.innerApiCalls.listEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvents( + request, + (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IEvent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvents with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEventsStream without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + ]; + client.descriptors.page.listEvents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Event[] = []; + stream.on('data', (response: protos.google.cloud.video.livestream.v1.Event) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvents, request)); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEventsStream with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Event[] = []; + stream.on('data', (response: protos.google.cloud.video.livestream.v1.Event) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvents, request)); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvents without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), + ]; + client.descriptors.page.listEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.livestream.v1.IEvent[] = []; + const iterable = client.listEventsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvents with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEventsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.livestream.v1.IEvent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('channel', () => { + const fakePath = "/rendered/path/channel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + channel: "channelValue", + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.channelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.channelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('channelPath', () => { + const result = client.channelPath("projectValue", "locationValue", "channelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.channelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChannelName', () => { + const result = client.matchProjectFromChannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChannelName', () => { + const result = client.matchLocationFromChannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChannelFromChannelName', () => { + const result = client.matchChannelFromChannelName(fakePath); + assert.strictEqual(result, "channelValue"); + assert((client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('event', () => { + const fakePath = "/rendered/path/event"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + channel: "channelValue", + event: "eventValue", + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.eventPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.eventPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('eventPath', () => { + const result = client.eventPath("projectValue", "locationValue", "channelValue", "eventValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.eventPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEventName', () => { + const result = client.matchProjectFromEventName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEventName', () => { + const result = client.matchLocationFromEventName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChannelFromEventName', () => { + const result = client.matchChannelFromEventName(fakePath); + assert.strictEqual(result, "channelValue"); + assert((client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEventFromEventName', () => { + const result = client.matchEventFromEventName(fakePath); + assert.strictEqual(result, "eventValue"); + assert((client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('input', () => { + const fakePath = "/rendered/path/input"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + input: "inputValue", + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inputPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.inputPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('inputPath', () => { + const result = client.inputPath("projectValue", "locationValue", "inputValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.inputPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInputName', () => { + const result = client.matchProjectFromInputName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.inputPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInputName', () => { + const result = client.matchLocationFromInputName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.inputPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInputFromInputName', () => { + const result = client.matchInputFromInputName(fakePath); + assert.strictEqual(result, "inputValue"); + assert((client.pathTemplates.inputPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json b/owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js b/owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js new file mode 100644 index 00000000000..72c9acab0ac --- /dev/null +++ b/owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js @@ -0,0 +1,64 @@ +// 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 +// +// https://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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'LivestreamService', + filename: './livestream-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 503fa03dadf7923573d57e3f24e15ee4120c0b19 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 21 Mar 2023 02:07:43 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../v1/.eslintignore | 7 - .../v1/.eslintrc.json | 3 - .../v1/.gitignore | 14 - .../v1/.jsdoc.js | 55 - .../v1/.mocharc.js | 33 - .../v1/.prettierrc.js | 22 - .../v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../v1/package.json | 64 - .../cloud/video/livestream/v1/outputs.proto | 479 - .../cloud/video/livestream/v1/resources.proto | 586 - .../cloud/video/livestream/v1/service.proto | 739 - .../v1/livestream_service.create_channel.js | 89 - .../v1/livestream_service.create_event.js | 88 - .../v1/livestream_service.create_input.js | 89 - .../v1/livestream_service.delete_channel.js | 84 - .../v1/livestream_service.delete_event.js | 76 - .../v1/livestream_service.delete_input.js | 77 - .../v1/livestream_service.get_channel.js | 62 - .../v1/livestream_service.get_event.js | 62 - .../v1/livestream_service.get_input.js | 62 - .../v1/livestream_service.list_channels.js | 85 - .../v1/livestream_service.list_events.js | 85 - .../v1/livestream_service.list_inputs.js | 85 - .../v1/livestream_service.start_channel.js | 77 - .../v1/livestream_service.stop_channel.js | 77 - .../v1/livestream_service.update_channel.js | 96 - .../v1/livestream_service.update_input.js | 88 - ...data.google.cloud.video.livestream.v1.json | 779 - .../v1/src/index.ts | 25 - .../v1/src/v1/gapic_metadata.json | 195 - .../v1/src/v1/index.ts | 19 - .../v1/src/v1/livestream_service_client.ts | 2817 --- .../v1/livestream_service_client_config.json | 118 - .../src/v1/livestream_service_proto_list.json | 5 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_livestream_service_v1.ts | 3366 --- .../v1/tsconfig.json | 19 - .../v1/webpack.config.js | 64 - .../cloud/video/livestream/v1/outputs.proto | 134 +- .../cloud/video/livestream/v1/resources.proto | 232 +- .../cloud/video/livestream/v1/service.proto | 56 +- .../protos/protos.d.ts | 2170 +- .../protos/protos.js | 19289 ++++++++++------ .../protos/protos.json | 330 +- .../v1/livestream_service.list_channels.js | 4 +- .../v1/livestream_service.list_events.js | 4 +- .../v1/livestream_service.list_inputs.js | 4 +- .../v1/livestream_service.update_channel.js | 13 +- .../v1/livestream_service.update_input.js | 3 + ...data.google.cloud.video.livestream.v1.json | 6 +- .../src/v1/livestream_service_client.ts | 317 +- .../test/gapic_livestream_service_v1.ts | 510 +- 55 files changed, 15581 insertions(+), 18307 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore b/owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json b/owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.gitignore b/owl-bot-staging/google-cloud-video-livestream/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js b/owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js deleted file mode 100644 index 4e0607efea5..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/livestream', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js b/owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js b/owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/README.md b/owl-bot-staging/google-cloud-video-livestream/v1/README.md deleted file mode 100644 index 98e6f3fe769..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Livestream: Nodejs Client diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json b/owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/package.json b/owl-bot-staging/google-cloud-video-livestream/v1/package.json deleted file mode 100644 index 5b1d934f291..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/livestream", - "version": "0.1.0", - "description": "Livestream client for Node.js", - "repository": "googleapis/nodejs-livestream", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google livestream", - "livestream", - "livestream service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto deleted file mode 100644 index 2eceb825ef6..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/outputs.proto +++ /dev/null @@ -1,479 +0,0 @@ -// Copyright 2022 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. - -syntax = "proto3"; - -package google.cloud.video.livestream.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/duration.proto"; -import "google/type/datetime.proto"; - -option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; -option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb"; -option java_multiple_files = true; -option java_outer_classname = "OutputsProto"; -option java_package = "com.google.cloud.video.livestream.v1"; -option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; -option ruby_package = "Google::Cloud::Video::LiveStream::V1"; - -// Encoding of an input element such as an audio, video, or text track. -// Elementary streams must be packaged before mapping and sharing between -// different output formats. -message ElementaryStream { - // A unique key for this elementary stream. - string key = 4; - - // Required. Encoding of an audio, video, or text track. - oneof elementary_stream { - // Encoding of a video stream. - VideoStream video_stream = 1; - - // Encoding of an audio stream. - AudioStream audio_stream = 2; - - // Encoding of a text stream. For example, closed captions or subtitles. - TextStream text_stream = 3; - } -} - -// Multiplexing settings for output stream. -message MuxStream { - // A unique key for this multiplexed stream. - string key = 1; - - // The container format. The default is `fmp4`. - // - // Supported container formats: - // - // - `fmp4` - the corresponding file extension is `.m4s` - // - `ts` - the corresponding file extension is `.ts` - string container = 3; - - // List of `ElementaryStream` - // [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed - // in this stream. - // - // - For `fmp4` container, must contain either one video or one audio stream. - // - For `ts` container, must contain exactly one audio stream and up to one - // video stream. - repeated string elementary_streams = 4; - - // Segment settings for `fmp4` and `ts`. - SegmentSettings segment_settings = 5; - - // Identifier of the encryption configuration to use. If omitted, output - // will be unencrypted. - string encryption_id = 6; -} - -// Manifest configuration. -message Manifest { - // The manifest type can be either `HLS` or `DASH`. - enum ManifestType { - // The manifest type is not specified. - MANIFEST_TYPE_UNSPECIFIED = 0; - - // Create an `HLS` manifest. The corresponding file extension is `.m3u8`. - HLS = 1; - - // Create a `DASH` manifest. The corresponding file extension is `.mpd`. - DASH = 2; - } - - // The name of the generated file. The default is `manifest` with the - // extension suffix corresponding to the `Manifest` - // [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple - // manifests are added to the channel, each must have a unique file name. - string file_name = 1; - - // Required. Type of the manifest, can be `HLS` or `DASH`. - ManifestType type = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. List of `MuxStream` - // [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear - // in this manifest. - // - // - For HLS, either `fmp4` or `ts` mux streams can be specified but not - // mixed. - // - For DASH, only `fmp4` mux streams can be specified. - repeated string mux_streams = 3 [(google.api.field_behavior) = REQUIRED]; - - // Maximum number of segments that this manifest holds. Once the manifest - // reaches this maximum number of segments, whenever a new segment is added to - // the manifest, the oldest segment will be removed from the manifest. - // The minimum value is 3 and the default value is 5. - int32 max_segment_count = 4; - - // How long to keep a segment on the output Google Cloud Storage bucket after - // it is removed from the manifest. This field should be large enough to cover - // the manifest propagation delay. Otherwise, a player could receive 404 - // errors while accessing segments which are listed in the manifest that the - // player has, but were already deleted from the output Google Cloud Storage - // bucket. Default value is `60s`. - google.protobuf.Duration segment_keep_duration = 5; - - // Whether to use the timecode, as specified in timecode config, when setting: - // - // - `availabilityStartTime` attribute in DASH manifests. - // - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. - // - // If false, ignore the input timecode and use the time from system clock - // when the manifest is first generated. This is the default behavior. - bool use_timecode_as_timeline = 6; -} - -// Sprite sheet configuration. -message SpriteSheet { - // Format type. The default is `jpeg`. - // - // Supported formats: - // - // - `jpeg` - string format = 1; - - // Required. File name prefix for the generated sprite sheets. If multiple - // sprite sheets are added to the channel, each must have a unique file - // prefix. - // Each sprite sheet has an incremental 10-digit zero-padded suffix starting - // from 0 before the extension, such as `sprite_sheet0000000123.jpeg`. - string file_prefix = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The width of the sprite in pixels. Must be an even integer. - int32 sprite_width_pixels = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The height of the sprite in pixels. Must be an even integer. - int32 sprite_height_pixels = 4 [(google.api.field_behavior) = REQUIRED]; - - // The maximum number of sprites per row in a sprite sheet. Valid range is - // [1, 10] and the default value is 1. - int32 column_count = 5; - - // The maximum number of rows per sprite sheet. When the sprite sheet is full, - // a new sprite sheet is created. Valid range is [1, 10] and the default value - // is 1. - int32 row_count = 6; - - // Create sprites at regular intervals. Valid range is [1 second, 1 hour] and - // the default value is `10s`. - google.protobuf.Duration interval = 7; - - // The quality of the generated sprite sheet. Enter a value between 1 - // and 100, where 1 is the lowest quality and 100 is the highest quality. - // The default is 100. A high quality value corresponds to a low image data - // compression ratio. - int32 quality = 8; -} - -// Preprocessing configurations. -message PreprocessingConfig { - // Audio preprocessing configuration. - message Audio { - // Specify audio loudness normalization in loudness units relative to full - // scale (LUFS). Enter a value between -24 and 0 according to the following: - // - // - -24 is the Advanced Television Systems Committee (ATSC A/85) - // - -23 is the EU R128 broadcast standard - // - -19 is the prior standard for online mono audio - // - -18 is the ReplayGain standard - // - -16 is the prior standard for stereo audio - // - -14 is the new online audio standard recommended by Spotify, as well as - // Amazon Echo - // - 0 disables normalization. The default is 0. - double lufs = 1; - } - - // Video cropping configuration for the input video. The cropped input video - // is scaled to match the output resolution. - message Crop { - // The number of pixels to crop from the top. The default is 0. - int32 top_pixels = 1; - - // The number of pixels to crop from the bottom. The default is 0. - int32 bottom_pixels = 2; - - // The number of pixels to crop from the left. The default is 0. - int32 left_pixels = 3; - - // The number of pixels to crop from the right. The default is 0. - int32 right_pixels = 4; - } - - // Pad filter configuration for the input video. The padded input video - // is scaled after padding with black to match the output resolution. - message Pad { - // The number of pixels to add to the top. The default is 0. - int32 top_pixels = 1; - - // The number of pixels to add to the bottom. The default is 0. - int32 bottom_pixels = 2; - - // The number of pixels to add to the left. The default is 0. - int32 left_pixels = 3; - - // The number of pixels to add to the right. The default is 0. - int32 right_pixels = 4; - } - - // Audio preprocessing configuration. - Audio audio = 1; - - // Specify the video cropping configuration. - Crop crop = 2; - - // Specify the video pad filter configuration. - Pad pad = 3; -} - -// Video stream resource. -message VideoStream { - // H264 codec settings. - message H264CodecSettings { - // Required. The width of the video in pixels. Must be an even integer. - // Valid range is [320, 1920]. - int32 width_pixels = 1; - - // Required. The height of the video in pixels. Must be an even integer. - // Valid range is [180, 1080]. - int32 height_pixels = 2; - - // Required. The target video frame rate in frames per second (FPS). Must be - // less than or equal to 60. Will default to the input frame rate if larger - // than the input frame rate. The API will generate an output FPS that is - // divisible by the input FPS, and smaller or equal to the target FPS. See - // [Calculating frame - // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for - // more information. - double frame_rate = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The video bitrate in bits per second. Minimum value is 10,000. - // - // - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps). - // - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps). - int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED]; - - // Specifies whether an open Group of Pictures (GOP) structure should be - // allowed or not. The default is `false`. - bool allow_open_gop = 6; - - // GOP mode can be either by frame count or duration. - oneof gop_mode { - // Select the GOP size based on the specified frame count. - // If GOP frame count is set instead of GOP duration, GOP duration will be - // calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration - // must satisfy the limitations on `gopDuration` as well. - // Valid range is [60, 600]. - int32 gop_frame_count = 7; - - // Select the GOP size based on the specified duration. The default is - // `2s`. Note that `gopDuration` must be less than or equal to - // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], - // and - // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] - // must be divisible by `gopDuration`. Valid range is [2s, 20s]. - // - // All video streams in the same channel must have the same GOP size. - google.protobuf.Duration gop_duration = 8; - } - - // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be - // greater than zero. The default is equal to - // [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. - int32 vbv_size_bits = 9; - - // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. - // Must be greater than zero. The default is equal to 90% of - // [vbv_size_bits][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.vbv_size_bits]. - int32 vbv_fullness_bits = 10; - - // The entropy coder to use. The default is `cabac`. - // - // Supported entropy coders: - // - // - `cavlc` - // - `cabac` - string entropy_coder = 11; - - // Allow B-pyramid for reference frame selection. This may not be supported - // on all decoders. The default is `false`. - bool b_pyramid = 12; - - // The number of consecutive B-frames. Must be greater than or equal to - // zero. Must be less than - // [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] - // if set. The default is 0. - int32 b_frame_count = 13; - - // Specify the intensity of the adaptive quantizer (AQ). Must be between 0 - // and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A - // higher value equals a lower bitrate but smoother image. The default is 0. - double aq_strength = 14; - - // Enforces the specified codec profile. The following profiles are - // supported: - // - // * `baseline` - // * `main` (default) - // * `high` - // - // The available options are [FFmpeg-compatible Profile - // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). - // Note that certain values for this field may cause the - // transcoder to override other fields you set in the - // [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] - // message. - string profile = 15; - - // Enforces the specified codec tune. The available options are - // [FFmpeg-compatible Encode - // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) - // Note that certain values for this field may cause the transcoder to - // override other fields you set in the - // [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] - // message. - string tune = 16; - } - - // Codec settings. - oneof codec_settings { - // H264 codec settings. - H264CodecSettings h264 = 20; - } -} - -// Audio stream resource. -message AudioStream { - // The mapping for the input streams and audio channels. - message AudioMapping { - // Required. The `Channel` - // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] - // that identifies the input that this audio mapping applies to. If an - // active input doesn't have an audio mapping, the primary audio track in - // the input stream will be selected. - string input_key = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. The zero-based index of the track in the input stream. - // All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in - // the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must - // have the same input track. - int32 input_track = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The zero-based index of the channel in the input stream. - int32 input_channel = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The zero-based index of the channel in the output audio stream. - // Must be consistent with the - // [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. - int32 output_channel = 4 [(google.api.field_behavior) = REQUIRED]; - - // Audio volume control in dB. Negative values decrease volume, - // positive values increase. The default is 0. - double gain_db = 5; - } - - // Specifies whether pass through (transmuxing) is enabled or not. - // If set to `true`, the rest of the settings, other than `mapping`, will be - // ignored. The default is `false`. - bool transmux = 8; - - // The codec for this audio stream. The default is `aac`. - // - // Supported audio codecs: - // - // - `aac` - string codec = 1; - - // Required. Audio bitrate in bits per second. Must be between 1 and - // 10,000,000. - int32 bitrate_bps = 2 [(google.api.field_behavior) = REQUIRED]; - - // Number of audio channels. Must be between 1 and 6. The default is 2. - int32 channel_count = 3; - - // A list of channel names specifying layout of the audio channels. - // This only affects the metadata embedded in the container headers, if - // supported by the specified format. The default is `[fl, fr]`. - // - // Supported channel names: - // - // - `fl` - Front left channel - // - `fr` - Front right channel - // - `sl` - Side left channel - // - `sr` - Side right channel - // - `fc` - Front center channel - // - `lfe` - Low frequency - repeated string channel_layout = 4; - - // The mapping for the input streams and audio channels. - repeated AudioMapping mapping = 5; - - // The audio sample rate in Hertz. The default is 48000 Hertz. - int32 sample_rate_hertz = 6; -} - -// Encoding of a text stream. For example, closed captions or subtitles. -message TextStream { - // Required. The codec for this text stream. - // - // Supported text codecs: - // - // - `cea608` - // - `cea708` - string codec = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Segment settings for `fmp4` and `ts`. -message SegmentSettings { - // Duration of the segments in seconds. The default is `6s`. Note that - // `segmentDuration` must be greater than or equal to - // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], - // and `segmentDuration` must be divisible by - // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. - // Valid range is [2s, 20s]. - // - // All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in - // the same manifest must have the same segment duration. - google.protobuf.Duration segment_duration = 1; -} - -// Timecode configuration. -message TimecodeConfig { - // The source of timecode. - enum TimecodeSource { - // The timecode source is not specified. - TIMECODE_SOURCE_UNSPECIFIED = 0; - - // Use input media timestamp. - MEDIA_TIMESTAMP = 1; - - // Use input embedded timecode e.g. picture timing SEI message. - EMBEDDED_TIMECODE = 2; - } - - // The source of the timecode that will later be used in outputs/manifests. - // It determines the initial timecode/timestamp (first frame) of output - // streams. - TimecodeSource source = 1; - - // For EMBEDDED_TIMECODE source only. - // Used to interpret the embedded timecode (which contains only the time part - // and no date). We assume all inputs are live. - oneof time_offset { - // UTC offset. Must be whole seconds, between -18 hours and +18 hours. - google.protobuf.Duration utc_offset = 2; - - // Time zone e.g. "America/Los_Angeles". - google.type.TimeZone time_zone = 3; - } -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto deleted file mode 100644 index 1691139e2c4..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/resources.proto +++ /dev/null @@ -1,586 +0,0 @@ -// Copyright 2022 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. - -syntax = "proto3"; - -package google.cloud.video.livestream.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/video/livestream/v1/outputs.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; -option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.google.cloud.video.livestream.v1"; -option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; -option ruby_package = "Google::Cloud::Video::LiveStream::V1"; - -// Input resource represents the endpoint from which the channel ingests -// the input stream. -message Input { - option (google.api.resource) = { - type: "livestream.googleapis.com/Input" - pattern: "projects/{project}/locations/{location}/inputs/{input}" - }; - - // The type of the input. - enum Type { - // Input type is not specified. - TYPE_UNSPECIFIED = 0; - - // Input will take an rtmp input stream. - RTMP_PUSH = 1; - - // Input will take an srt (Secure Reliable Transport) input stream. - SRT_PUSH = 2; - } - - // Tier of the input specification. - enum Tier { - // Tier is not specified. - TIER_UNSPECIFIED = 0; - - // Resolution < 1280x720. Bitrate <= 6 Mbps. FPS <= 60. - SD = 1; - - // Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. - HD = 2; - - // Resolution <= 4096x2160. Not supported yet. - UHD = 3; - } - - // Security rules for access control. Each field represents one security rule. - // Only when the source of the input stream satisfies all the fields, this - // input stream can be accepted. - message SecurityRule { - // At least one ip range must match unless none specified. The IP range is - // defined by CIDR block: for example, `192.0.1.0/24` for a range and - // `192.0.1.0/32` for a single IP address. - repeated string ip_ranges = 1; - } - - // The resource name of the input, in the form of: - // `projects/{project}/locations/{location}/inputs/{inputId}`. - string name = 1; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The update time. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-defined key/value metadata. - map labels = 4; - - // Source type. - Type type = 5; - - // Tier defines the maximum input specification that is accepted by the - // video pipeline. The billing is charged based on the tier specified here. - // See [Pricing](https://cloud.google.com/livestream/pricing) for more detail. - // The default is `HD`. - Tier tier = 14; - - // Output only. URI to push the input stream to. - // Its format depends on the input - // [type][google.cloud.video.livestream.v1.Input.type], for example: - // - // * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` - // * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` - string uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Preprocessing configurations. - PreprocessingConfig preprocessing_config = 9; - - // Security rule for access control. - SecurityRule security_rules = 12; - - // Output only. The information for the input stream. This field will be - // present only when this input receives the input stream. - InputStreamProperty input_stream_property = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Channel resource represents the processor that does a user-defined -// "streaming" operation, which includes getting an input stream through an -// input, transcoding it to multiple renditions, and publishing output live -// streams in certain formats (for example, HLS or DASH) to the specified -// location. -message Channel { - option (google.api.resource) = { - type: "livestream.googleapis.com/Channel" - pattern: "projects/{project}/locations/{location}/channels/{channel}" - }; - - // Location of output file(s) in a Google Cloud Storage bucket. - message Output { - // URI for the output file(s). For example, `gs://my-bucket/outputs/`. - string uri = 1; - } - - // State of streaming operation that the channel is running. - enum StreamingState { - // Streaming state is not specified. - STREAMING_STATE_UNSPECIFIED = 0; - - // Channel is getting the input stream, generating the live streams to the - // specified output location. - STREAMING = 1; - - // Channel is waiting for the input stream through the input. - AWAITING_INPUT = 2; - - // Channel is running, but has trouble publishing the live streams onto the - // specified output location (for example, the specified Cloud Storage - // bucket is not writable). - STREAMING_ERROR = 4; - - // Channel is generating live streams with no input stream. Live streams are - // filled out with black screen, while input stream is missing. - // Not supported yet. - STREAMING_NO_INPUT = 5; - - // Channel is stopped, finishing live streams. - STOPPED = 6; - - // Channel is starting. - STARTING = 7; - - // Channel is stopping. - STOPPING = 8; - } - - // The resource name of the channel, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}`. - string name = 1; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The update time. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-defined key/value metadata. - map labels = 4; - - // A list of input attachments that this channel uses. - // One channel can have multiple inputs as the input sources. Only one - // input can be selected as the input source at one time. - repeated InputAttachment input_attachments = 16; - - // Output only. The - // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] - // that serves as the current input source. The first input in the - // [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] - // is the initial input source. - string active_input = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Information about the output (that is, the Cloud Storage bucket - // to store the generated live stream). - Output output = 9 [(google.api.field_behavior) = REQUIRED]; - - // List of elementary streams. - repeated ElementaryStream elementary_streams = 10; - - // List of multiplexing settings for output streams. - repeated MuxStream mux_streams = 11; - - // List of output manifests. - repeated Manifest manifests = 12; - - // List of output sprite sheets. - repeated SpriteSheet sprite_sheets = 13; - - // Output only. State of the streaming operation. - StreamingState streaming_state = 14 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A description of the reason for the streaming error. This - // property is always present when - // [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] - // is - // [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. - google.rpc.Status streaming_error = 18 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Configuration of platform logs for this channel. - LogConfig log_config = 19; - - // Configuration of timecode for this channel. - TimecodeConfig timecode_config = 21; - - // Encryption configurations for this channel. Each configuration has an ID - // which is referred to by each MuxStream to indicate which configuration is - // used for that output. - repeated Encryption encryptions = 24; - - // The configuration for input sources defined in - // [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]. - InputConfig input_config = 25; -} - -// Configuration for the input sources of a channel. -message InputConfig { - // Input switch mode. - enum InputSwitchMode { - // The input switch mode is not specified. - INPUT_SWITCH_MODE_UNSPECIFIED = 0; - - // Automatic failover is enabled. The primary input stream is always - // preferred over its backup input streams configured using the - // [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] - // field. - FAILOVER_PREFER_PRIMARY = 1; - - // Automatic failover is disabled. You must use the - // [inputSwitch][google.cloud.video.livestream.v1.Event.input_switch] event - // to switch the active input source for the channel to stream from. When - // this mode is chosen, the - // [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] - // field is ignored. - MANUAL = 3; - } - - // Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. - InputSwitchMode input_switch_mode = 1; -} - -// Configuration of platform logs. -// See [Using and managing platform -// logs](https://cloud.google.com/logging/docs/api/platform-logs#managing-logs) -// for more information about how to view platform logs through Cloud Logging. -message LogConfig { - // The severity level of platform logging for this channel. Logs with a - // severity level higher than or equal to the chosen severity level will be - // logged and can be viewed through Cloud Logging. - // The severity level of a log is ranked as followed from low to high: DEBUG < - // INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY. - // See - // [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity) - // for more information. - enum LogSeverity { - // Log severity is not specified. This is the same as log severity is OFF. - LOG_SEVERITY_UNSPECIFIED = 0; - - // Log is turned off. - OFF = 1; - - // Log with severity higher than or equal to DEBUG are logged. - DEBUG = 100; - - // Logs with severity higher than or equal to INFO are logged. - INFO = 200; - - // Logs with severity higher than or equal to WARNING are logged. - WARNING = 400; - - // Logs with severity higher than or equal to ERROR are logged. - ERROR = 500; - } - - // The severity level of platform logging for this resource. - LogSeverity log_severity = 1; -} - -// Properties of the input stream. -message InputStreamProperty { - // The time that the current input stream is accepted and the connection is - // established. - google.protobuf.Timestamp last_establish_time = 1; - - // Properties of the video streams. - repeated VideoStreamProperty video_streams = 2; - - // Properties of the audio streams. - repeated AudioStreamProperty audio_streams = 3; -} - -// Properties of the video stream. -message VideoStreamProperty { - // Index of this video stream. - int32 index = 1; - - // Properties of the video format. - VideoFormat video_format = 2; -} - -// Properties of the video format. -message VideoFormat { - // Video codec used in this video stream. - string codec = 1; - - // The width of the video stream in pixels. - int32 width_pixels = 2; - - // The height of the video stream in pixels. - int32 height_pixels = 3; - - // The frame rate of the input video stream. - double frame_rate = 4; -} - -// Properties of the audio stream. -message AudioStreamProperty { - // Index of this audio stream. - int32 index = 1; - - // Properties of the audio format. - AudioFormat audio_format = 2; -} - -// Properties of the audio format. -message AudioFormat { - // Audio codec used in this audio stream. - string codec = 1; - - // The number of audio channels. - int32 channel_count = 2; - - // A list of channel names specifying the layout of the audio channels. - repeated string channel_layout = 3; -} - -// A group of information for attaching an input resource to this channel. -message InputAttachment { - // Configurations to follow when automatic failover happens. - message AutomaticFailover { - // The - // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s - // of inputs to failover to when this input is disconnected. Currently, only - // up to one backup input is supported. - repeated string input_keys = 1; - } - - // A unique key for this input attachment. - string key = 1; - - // The resource name of an existing input, in the form of: - // `projects/{project}/locations/{location}/inputs/{inputId}`. - string input = 2 [(google.api.resource_reference) = { - type: "livestream.googleapis.com/Input" - }]; - - // Automatic failover configurations. - AutomaticFailover automatic_failover = 3; -} - -// Event is a sub-resource of a channel, which can be scheduled by the user to -// execute operations on a channel resource without having to stop the channel. -message Event { - option (google.api.resource) = { - type: "livestream.googleapis.com/Event" - pattern: "projects/{project}/locations/{location}/channels/{channel}/events/{event}" - }; - - // Switches to another input stream. Automatic failover is then disabled. - message InputSwitchTask { - // The - // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] - // of the input to switch to. - string input_key = 1; - } - - // Inserts a new ad opportunity. - message AdBreakTask { - // Duration of an ad opportunity. Must be greater than 0. - google.protobuf.Duration duration = 1; - } - - // Stops any events which are currently running. This only applies to events - // with a duration. - message ReturnToProgramTask {} - - // Mutes the stream. - message MuteTask { - // Duration for which the stream should be muted. If omitted, the stream - // will be muted until an UnmuteTask event is sent. - google.protobuf.Duration duration = 1; - } - - // Unmutes the stream. The task will fail if the stream is not - // currently muted. - message UnmuteTask {} - - // State of the event - enum State { - // Event state is not specified. - STATE_UNSPECIFIED = 0; - - // Event is scheduled but not executed yet. - SCHEDULED = 1; - - // Event is being executed. - RUNNING = 2; - - // Event has been successfully executed. - SUCCEEDED = 3; - - // Event fails to be executed. - FAILED = 4; - - // Event has been created but not scheduled yet. - PENDING = 5; - - // Event was stopped before running for its full duration. - STOPPED = 6; - } - - // The resource name of the event, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - string name = 1; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The update time. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-defined key/value metadata. - map labels = 4; - - // Required. Operation to be executed by this event. - oneof task { - // Required. Switches to another input stream. - InputSwitchTask input_switch = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Inserts a new ad opportunity. - AdBreakTask ad_break = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. Stops any running ad break. - ReturnToProgramTask return_to_program = 13 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Mutes the stream. - MuteTask mute = 15 [(google.api.field_behavior) = REQUIRED]; - - // Required. Unmutes the stream. - UnmuteTask unmute = 16 [(google.api.field_behavior) = REQUIRED]; - } - - // When this field is set to true, the event will be executed at the earliest - // time that the server can schedule the event and - // [execution_time][google.cloud.video.livestream.v1.Event.execution_time] - // will be populated with the time that the server actually schedules the - // event. - bool execute_now = 9; - - // The time to execute the event. If you set - // [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to - // `true`, then do not set this field in the `CreateEvent` request. In - // this case, the server schedules the event and populates this field. If you - // set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to - // `false`, then you must set this field to at least 10 seconds in the future - // or else the event can't be created. - google.protobuf.Timestamp execution_time = 10; - - // Output only. The state of the event. - State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. An error object that describes the reason for the failure. - // This property is always present when `state` is `FAILED`. - google.rpc.Status error = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Encryption settings. -message Encryption { - // Configuration for secrets stored in Google Secret Manager. - message SecretManagerSource { - // Required. The name of the Secret Version containing the encryption key. - // `projects/{project}/secrets/{secret_id}/versions/{version_number}` - string secret_version = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - } - ]; - } - - // Widevine configuration. - message Widevine {} - - // Fairplay configuration. - message Fairplay {} - - // Playready configuration. - message Playready {} - - // Clearkey configuration. - message Clearkey {} - - // Defines configuration for DRM systems in use. If a field is omitted, - // that DRM system will be considered to be disabled. - message DrmSystems { - // Widevine configuration. - Widevine widevine = 1; - - // Fairplay configuration. - Fairplay fairplay = 2; - - // Playready configuration. - Playready playready = 3; - - // Clearkey configuration. - Clearkey clearkey = 4; - } - - // Configuration for HLS AES-128 encryption. - message Aes128Encryption {} - - // Configuration for HLS SAMPLE-AES encryption. - message SampleAesEncryption {} - - // Configuration for MPEG-Dash Common Encryption (MPEG-CENC). - message MpegCommonEncryption { - // Required. Specify the encryption scheme, supported schemes: - // - `cenc` - AES-CTR subsample - // - `cbcs`- AES-CBC subsample pattern - string scheme = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Identifier for this set of encryption options. - string id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Defines where content keys are stored. - oneof secret_source { - // For keys stored in Google Secret Manager. - SecretManagerSource secret_manager_key_source = 7; - } - - // Required. Configuration for DRM systems. - DrmSystems drm_systems = 3 [(google.api.field_behavior) = REQUIRED]; - - // Encryption modes for HLS and MPEG-Dash. - oneof encryption_mode { - // Configuration for HLS AES-128 encryption. - Aes128Encryption aes128 = 4; - - // Configuration for HLS SAMPLE-AES encryption. - SampleAesEncryption sample_aes = 5; - - // Configuration for MPEG-Dash Common Encryption (MPEG-CENC). - MpegCommonEncryption mpeg_cenc = 6; - } -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto b/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto deleted file mode 100644 index e424e54a4af..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/protos/google/cloud/video/livestream/v1/service.proto +++ /dev/null @@ -1,739 +0,0 @@ -// Copyright 2022 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. - -syntax = "proto3"; - -package google.cloud.video.livestream.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/video/livestream/v1/resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; -option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceProto"; -option java_package = "com.google.cloud.video.livestream.v1"; -option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; -option ruby_package = "Google::Cloud::Video::LiveStream::V1"; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/SecretVersion" - pattern: "projects/{project}/secrets/{secret}/versions/{version}" -}; - -// Using Live Stream API, you can generate live streams in the various -// renditions and streaming formats. The streaming format include HTTP Live -// Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send -// a source stream in the various ways, including Real-Time Messaging -// Protocol (RTMP) and Secure Reliable Transport (SRT). -service LivestreamService { - option (google.api.default_host) = "livestream.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a channel with the provided unique ID in the specified - // region. - rpc CreateChannel(CreateChannelRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/channels" - body: "channel" - }; - option (google.api.method_signature) = "parent,channel,channel_id"; - option (google.longrunning.operation_info) = { - response_type: "Channel" - metadata_type: "OperationMetadata" - }; - } - - // Returns a list of all channels in the specified region. - rpc ListChannels(ListChannelsRequest) returns (ListChannelsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/channels" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns the specified channel. - rpc GetChannel(GetChannelRequest) returns (Channel) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/channels/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes the specified channel. - rpc DeleteChannel(DeleteChannelRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/channels/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Updates the specified channel. - rpc UpdateChannel(UpdateChannelRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{channel.name=projects/*/locations/*/channels/*}" - body: "channel" - }; - option (google.api.method_signature) = "channel,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Channel" - metadata_type: "OperationMetadata" - }; - } - - // Starts the specified channel. Part of the video pipeline will be created - // only when the StartChannel request is received by the server. - rpc StartChannel(StartChannelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/channels/*}:start" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "ChannelOperationResponse" - metadata_type: "OperationMetadata" - }; - } - - // Stops the specified channel. Part of the video pipeline will be released - // when the StopChannel request is received by the server. - rpc StopChannel(StopChannelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/channels/*}:stop" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "ChannelOperationResponse" - metadata_type: "OperationMetadata" - }; - } - - // Creates an input with the provided unique ID in the specified region. - rpc CreateInput(CreateInputRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/inputs" - body: "input" - }; - option (google.api.method_signature) = "parent,input,input_id"; - option (google.longrunning.operation_info) = { - response_type: "Input" - metadata_type: "OperationMetadata" - }; - } - - // Returns a list of all inputs in the specified region. - rpc ListInputs(ListInputsRequest) returns (ListInputsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/inputs" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns the specified input. - rpc GetInput(GetInputRequest) returns (Input) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/inputs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes the specified input. - rpc DeleteInput(DeleteInputRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/inputs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Updates the specified input. - rpc UpdateInput(UpdateInputRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{input.name=projects/*/locations/*/inputs/*}" - body: "input" - }; - option (google.api.method_signature) = "input,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Input" - metadata_type: "OperationMetadata" - }; - } - - // Creates an event with the provided unique ID in the specified channel. - rpc CreateEvent(CreateEventRequest) returns (Event) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/channels/*}/events" - body: "event" - }; - option (google.api.method_signature) = "parent,event,event_id"; - } - - // Returns a list of all events in the specified channel. - rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/channels/*}/events" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns the specified event. - rpc GetEvent(GetEventRequest) returns (Event) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/channels/*/events/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes the specified event. - rpc DeleteEvent(DeleteEventRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/channels/*/events/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for "LivestreamService.CreateChannel". -message CreateChannelRequest { - // Required. The parent location for the resource, in the form of: - // `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "livestream.googleapis.com/Channel" - } - ]; - - // Required. The channel resource to be created. - Channel channel = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID of the channel resource to be created. - // This value must be 1-63 characters, begin and end with `[a-z0-9]`, - // could contain dashes (-) in between. - string channel_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 4; -} - -// Request message for "LivestreamService.ListChannels". -message ListChannelsRequest { - // Required. The parent location for the resource, in the form of: - // `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "livestream.googleapis.com/Channel" - } - ]; - - // The maximum number of items to return. If unspecified, server - // will pick an appropriate default. Server may return fewer items than - // requested. A caller should only rely on response's - // [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] - // to determine if there are more items left to be queried. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 3; - - // The filter to apply to list results. - string filter = 4; - - // Specifies the ordering of results following syntax at - // https://cloud.google.com/apis/design/design_patterns#sorting_order. - string order_by = 5; -} - -// Response message for "LivestreamService.ListChannels". -message ListChannelsResponse { - // A list of channels. - repeated Channel channels = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for "LivestreamService.GetChannel". -message GetChannelRequest { - // Required. The name of the channel resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Channel" - } - ]; -} - -// Request message for "LivestreamService.DeleteChannel". -message DeleteChannelRequest { - // Required. The name of the channel resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Channel" - } - ]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 2; - - // If the `force` field is set to the default value of `false`, you must - // delete all of a channel's events before you can delete the channel itself. - // If the field is set to `true`, requests to delete a channel also delete - // associated channel events. - bool force = 3; -} - -// Request message for "LivestreamService.UpdateChannel". -message UpdateChannelRequest { - // Field mask is used to specify the fields to be overwritten in the Channel - // resource by the update. You can only update the following fields: - // - // * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) - // * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) - // * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - // * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) - // * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - // * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) - // * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) - // * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) - // * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) - // * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) - // - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. - // - // If the mask is not present, then each field from the list above is updated - // if the field appears in the request payload. To unset a field, add the - // field to the update mask and remove it from the request payload. - google.protobuf.FieldMask update_mask = 1; - - // Required. The channel resource to be updated. - Channel channel = 2 [(google.api.field_behavior) = REQUIRED]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 3; -} - -// Request message for "LivestreamService.StartChannel". -message StartChannelRequest { - // Required. The name of the channel resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Channel" - } - ]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 2; -} - -// Request message for "LivestreamService.StopChannel". -message StopChannelRequest { - // Required. The name of the channel resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Channel" - } - ]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 2; -} - -// Request message for "LivestreamService.CreateInput". -message CreateInputRequest { - // Required. The parent location for the resource, in the form of: - // `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "livestream.googleapis.com/Input" - } - ]; - - // Required. The input resource to be created. - Input input = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID of the input resource to be created. - // This value must be 1-63 characters, begin and end with `[a-z0-9]`, - // could contain dashes (-) in between. - string input_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 4; -} - -// Request message for "LivestreamService.ListInputs". -message ListInputsRequest { - // Required. The parent location for the resource, in the form of: - // `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "livestream.googleapis.com/Input" - } - ]; - - // The maximum number of items to return. If unspecified, server - // will pick an appropriate default. Server may return fewer items than - // requested. A caller should only rely on response's - // [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] - // to determine if there are more items left to be queried. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 3; - - // The filter to apply to list results. - string filter = 4; - - // Specifies the ordering of results following syntax at [Sorting - // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - string order_by = 5; -} - -// Response message for "LivestreamService.ListInputs". -message ListInputsResponse { - // A list of inputs. - repeated Input inputs = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for "LivestreamService.GetInput". -message GetInputRequest { - // Required. The name of the input resource, in the form of: - // `projects/{project}/locations/{location}/inputs/{inputId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Input" - } - ]; -} - -// Request message for "LivestreamService.DeleteInput". -message DeleteInputRequest { - // Required. The name of the input resource, in the form of: - // `projects/{project}/locations/{location}/inputs/{inputId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Input" - } - ]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 2; -} - -// Request message for "LivestreamService.UpdateInput". -message UpdateInputRequest { - // Field mask is used to specify the fields to be overwritten in the Input - // resource by the update. You can only update the following fields: - // - // * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) - // * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) - // - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. - // - // If the mask is not present, then each field from the list above is updated - // if the field appears in the request payload. To unset a field, add the - // field to the update mask and remove it from the request payload. - google.protobuf.FieldMask update_mask = 1; - - // Required. The input resource to be updated. - Input input = 2 [(google.api.field_behavior) = REQUIRED]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 3; -} - -// Request message for "LivestreamService.CreateEvent". -message CreateEventRequest { - // Required. The parent channel for the resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "livestream.googleapis.com/Event" - } - ]; - - // Required. The event resource to be created. - Event event = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID of the event resource to be created. - // This value must be 1-63 characters, begin and end with `[a-z0-9]`, - // could contain dashes (-) in between. - string event_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 4; -} - -// Request message for "LivestreamService.ListEvents". -message ListEventsRequest { - // Required. The parent channel for the resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "livestream.googleapis.com/Event" - } - ]; - - // The maximum number of items to return. If unspecified, server - // will pick an appropriate default. Server may return fewer items than - // requested. A caller should only rely on response's - // [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] - // to determine if there are more items left to be queried. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 3; - - // The filter to apply to list results. - string filter = 4; - - // Specifies the ordering of results following syntax at - // https://cloud.google.com/apis/design/design_patterns#sorting_order. - string order_by = 5; -} - -// Response message for "LivestreamService.ListEvents". -message ListEventsResponse { - // A list of events. - repeated Event events = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for "LivestreamService.GetEvent". -message GetEventRequest { - // Required. The name of the event resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Event" - } - ]; -} - -// Request message for "LivestreamService.DeleteEvent". -message DeleteEventRequest { - // Required. The name of the event resource, in the form of: - // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "livestream.googleapis.com/Event" - } - ]; - - // A request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and the - // request times out. If you make the request again with the same request ID, - // the server can check if original operation with the same request ID was - // received, and if so, will ignore the second request. This prevents clients - // from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported `(00000000-0000-0000-0000-000000000000)`. - string request_id = 2; -} - -// Response message for Start/Stop Channel long-running operations. -message ChannelOperationResponse {} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. - bool requested_cancellation = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js deleted file mode 100644 index 04e526d83d5..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_channel.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, channel, channelId) { - // [START livestream_v1_generated_LivestreamService_CreateChannel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - /** - * Required. The channel resource to be created. - */ - // const channel = {} - /** - * Required. The ID of the channel resource to be created. - * This value must be 1-63 characters, begin and end with `[a-z0-9]`, - * could contain dashes (-) in between. - */ - // const channelId = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callCreateChannel() { - // Construct request - const request = { - parent, - channel, - channelId, - }; - - // Run request - const [operation] = await livestreamClient.createChannel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateChannel(); - // [END livestream_v1_generated_LivestreamService_CreateChannel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js deleted file mode 100644 index 13b7c56b98a..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_event.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, event, eventId) { - // [START livestream_v1_generated_LivestreamService_CreateEvent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent channel for the resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - */ - // const parent = 'abc123' - /** - * Required. The event resource to be created. - */ - // const event = {} - /** - * Required. The ID of the event resource to be created. - * This value must be 1-63 characters, begin and end with `[a-z0-9]`, - * could contain dashes (-) in between. - */ - // const eventId = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callCreateEvent() { - // Construct request - const request = { - parent, - event, - eventId, - }; - - // Run request - const response = await livestreamClient.createEvent(request); - console.log(response); - } - - callCreateEvent(); - // [END livestream_v1_generated_LivestreamService_CreateEvent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js deleted file mode 100644 index 594a071e5c6..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.create_input.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, input, inputId) { - // [START livestream_v1_generated_LivestreamService_CreateInput_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - /** - * Required. The input resource to be created. - */ - // const input = {} - /** - * Required. The ID of the input resource to be created. - * This value must be 1-63 characters, begin and end with `[a-z0-9]`, - * could contain dashes (-) in between. - */ - // const inputId = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callCreateInput() { - // Construct request - const request = { - parent, - input, - inputId, - }; - - // Run request - const [operation] = await livestreamClient.createInput(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateInput(); - // [END livestream_v1_generated_LivestreamService_CreateInput_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js deleted file mode 100644 index 38bacb1edcb..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_channel.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_DeleteChannel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - */ - // const name = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - /** - * If the `force` field is set to the default value of `false`, you must - * delete all of a channel's events before you can delete the channel itself. - * If the field is set to `true`, requests to delete a channel also delete - * associated channel events. - */ - // const force = true - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callDeleteChannel() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await livestreamClient.deleteChannel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteChannel(); - // [END livestream_v1_generated_LivestreamService_DeleteChannel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js deleted file mode 100644 index 18753a8208a..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_event.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_DeleteEvent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the event resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - */ - // const name = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callDeleteEvent() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await livestreamClient.deleteEvent(request); - console.log(response); - } - - callDeleteEvent(); - // [END livestream_v1_generated_LivestreamService_DeleteEvent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js deleted file mode 100644 index 9a675459a08..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.delete_input.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_DeleteInput_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the input resource, in the form of: - * `projects/{project}/locations/{location}/inputs/{inputId}`. - */ - // const name = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callDeleteInput() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await livestreamClient.deleteInput(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteInput(); - // [END livestream_v1_generated_LivestreamService_DeleteInput_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js deleted file mode 100644 index 3008a487b7a..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_channel.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_GetChannel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - */ - // const name = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callGetChannel() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await livestreamClient.getChannel(request); - console.log(response); - } - - callGetChannel(); - // [END livestream_v1_generated_LivestreamService_GetChannel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js deleted file mode 100644 index d965de3aa75..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_event.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_GetEvent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the event resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - */ - // const name = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callGetEvent() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await livestreamClient.getEvent(request); - console.log(response); - } - - callGetEvent(); - // [END livestream_v1_generated_LivestreamService_GetEvent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js deleted file mode 100644 index 752f655ab61..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.get_input.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_GetInput_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the input resource, in the form of: - * `projects/{project}/locations/{location}/inputs/{inputId}`. - */ - // const name = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callGetInput() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await livestreamClient.getInput(request); - console.log(response); - } - - callGetInput(); - // [END livestream_v1_generated_LivestreamService_GetInput_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js deleted file mode 100644 index ae51e11b30a..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_channels.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START livestream_v1_generated_LivestreamService_ListChannels_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * next_page_token google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token - * to determine if there are more items left to be queried. - */ - // const pageSize = 1234 - /** - * The next_page_token value returned from a previous List request, if any. - */ - // const pageToken = 'abc123' - /** - * The filter to apply to list results. - */ - // const filter = 'abc123' - /** - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - */ - // const orderBy = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callListChannels() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await livestreamClient.listChannelsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListChannels(); - // [END livestream_v1_generated_LivestreamService_ListChannels_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js deleted file mode 100644 index 6af569412f4..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_events.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START livestream_v1_generated_LivestreamService_ListEvents_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent channel for the resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * next_page_token google.cloud.video.livestream.v1.ListEventsResponse.next_page_token - * to determine if there are more items left to be queried. - */ - // const pageSize = 1234 - /** - * The next_page_token value returned from a previous List request, if any. - */ - // const pageToken = 'abc123' - /** - * The filter to apply to list results. - */ - // const filter = 'abc123' - /** - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - */ - // const orderBy = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callListEvents() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await livestreamClient.listEventsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEvents(); - // [END livestream_v1_generated_LivestreamService_ListEvents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js deleted file mode 100644 index bb79d657055..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.list_inputs.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START livestream_v1_generated_LivestreamService_ListInputs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * next_page_token google.cloud.video.livestream.v1.ListInputsResponse.next_page_token - * to determine if there are more items left to be queried. - */ - // const pageSize = 1234 - /** - * The next_page_token value returned from a previous List request, if any. - */ - // const pageToken = 'abc123' - /** - * The filter to apply to list results. - */ - // const filter = 'abc123' - /** - * Specifies the ordering of results following syntax at Sorting - * Order (https://cloud.google.com/apis/design/design_patterns#sorting_order). - */ - // const orderBy = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callListInputs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await livestreamClient.listInputsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListInputs(); - // [END livestream_v1_generated_LivestreamService_ListInputs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js deleted file mode 100644 index 7ff7452ce31..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.start_channel.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_StartChannel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - */ - // const name = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callStartChannel() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await livestreamClient.startChannel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callStartChannel(); - // [END livestream_v1_generated_LivestreamService_StartChannel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js deleted file mode 100644 index b4d6d3ba567..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.stop_channel.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START livestream_v1_generated_LivestreamService_StopChannel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - */ - // const name = 'abc123' - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callStopChannel() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await livestreamClient.stopChannel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callStopChannel(); - // [END livestream_v1_generated_LivestreamService_StopChannel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js deleted file mode 100644 index a31d32a1a8e..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_channel.js +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(channel) { - // [START livestream_v1_generated_LivestreamService_UpdateChannel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Field mask is used to specify the fields to be overwritten in the Channel - * resource by the update. You can only update the following fields: - * * `inputAttachments` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) - * * `inputConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) - * * `output` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * `elementaryStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) - * * `muxStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * `manifests` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) - * * `spriteSheets` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) - * * `logConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) - * * `timecodeConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) - * * `encryptions` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. - * If the mask is not present, then each field from the list above is updated - * if the field appears in the request payload. To unset a field, add the - * field to the update mask and remove it from the request payload. - */ - // const updateMask = {} - /** - * Required. The channel resource to be updated. - */ - // const channel = {} - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callUpdateChannel() { - // Construct request - const request = { - channel, - }; - - // Run request - const [operation] = await livestreamClient.updateChannel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateChannel(); - // [END livestream_v1_generated_LivestreamService_UpdateChannel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js deleted file mode 100644 index 3e5bc7af43a..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/livestream_service.update_input.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(input) { - // [START livestream_v1_generated_LivestreamService_UpdateInput_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Field mask is used to specify the fields to be overwritten in the Input - * resource by the update. You can only update the following fields: - * * `preprocessingConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) - * * `securityRules` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. - * If the mask is not present, then each field from the list above is updated - * if the field appears in the request payload. To unset a field, add the - * field to the update mask and remove it from the request payload. - */ - // const updateMask = {} - /** - * Required. The input resource to be updated. - */ - // const input = {} - /** - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - */ - // const requestId = 'abc123' - - // Imports the Livestream library - const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; - - // Instantiates a client - const livestreamClient = new LivestreamServiceClient(); - - async function callUpdateInput() { - // Construct request - const request = { - input, - }; - - // Run request - const [operation] = await livestreamClient.updateInput(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateInput(); - // [END livestream_v1_generated_LivestreamService_UpdateInput_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json b/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json deleted file mode 100644 index f25a8675879..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json +++ /dev/null @@ -1,779 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-livestream", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.video.livestream.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "livestream_v1_generated_LivestreamService_CreateChannel_async", - "title": "LivestreamService createChannel Sample", - "origin": "API_DEFINITION", - "description": " Creates a channel with the provided unique ID in the specified region.", - "canonical": true, - "file": "livestream_service.create_channel.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "channel", - "type": ".google.cloud.video.livestream.v1.Channel" - }, - { - "name": "channel_id", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "CreateChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_ListChannels_async", - "title": "LivestreamService listChannels Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of all channels in the specified region.", - "canonical": true, - "file": "livestream_service.list_channels.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListChannels", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.video.livestream.v1.ListChannelsResponse", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "ListChannels", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_GetChannel_async", - "title": "LivestreamService getChannel Sample", - "origin": "API_DEFINITION", - "description": " Returns the specified channel.", - "canonical": true, - "file": "livestream_service.get_channel.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.video.livestream.v1.Channel", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "GetChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_DeleteChannel_async", - "title": "LivestreamService deleteChannel Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified channel.", - "canonical": true, - "file": "livestream_service.delete_channel.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "DeleteChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_UpdateChannel_async", - "title": "LivestreamService updateChannel Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified channel.", - "canonical": true, - "file": "livestream_service.update_channel.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 88, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "channel", - "type": ".google.cloud.video.livestream.v1.Channel" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "UpdateChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_StartChannel_async", - "title": "LivestreamService startChannel Sample", - "origin": "API_DEFINITION", - "description": " Starts the specified channel. Part of the video pipeline will be created only when the StartChannel request is received by the server.", - "canonical": true, - "file": "livestream_service.start_channel.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "StartChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_StopChannel_async", - "title": "LivestreamService stopChannel Sample", - "origin": "API_DEFINITION", - "description": " Stops the specified channel. Part of the video pipeline will be released when the StopChannel request is received by the server.", - "canonical": true, - "file": "livestream_service.stop_channel.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StopChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "StopChannel", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_CreateInput_async", - "title": "LivestreamService createInput Sample", - "origin": "API_DEFINITION", - "description": " Creates an input with the provided unique ID in the specified region.", - "canonical": true, - "file": "livestream_service.create_input.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "input", - "type": ".google.cloud.video.livestream.v1.Input" - }, - { - "name": "input_id", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "CreateInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_ListInputs_async", - "title": "LivestreamService listInputs Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of all inputs in the specified region.", - "canonical": true, - "file": "livestream_service.list_inputs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInputs", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.video.livestream.v1.ListInputsResponse", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "ListInputs", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_GetInput_async", - "title": "LivestreamService getInput Sample", - "origin": "API_DEFINITION", - "description": " Returns the specified input.", - "canonical": true, - "file": "livestream_service.get_input.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetInput", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.video.livestream.v1.Input", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "GetInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetInput", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_DeleteInput_async", - "title": "LivestreamService deleteInput Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified input.", - "canonical": true, - "file": "livestream_service.delete_input.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "DeleteInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_UpdateInput_async", - "title": "LivestreamService updateInput Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified input.", - "canonical": true, - "file": "livestream_service.update_input.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "input", - "type": ".google.cloud.video.livestream.v1.Input" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "UpdateInput", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_CreateEvent_async", - "title": "LivestreamService createEvent Sample", - "origin": "API_DEFINITION", - "description": " Creates an event with the provided unique ID in the specified channel.", - "canonical": true, - "file": "livestream_service.create_event.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateEvent", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "event", - "type": ".google.cloud.video.livestream.v1.Event" - }, - { - "name": "event_id", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.video.livestream.v1.Event", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "CreateEvent", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_ListEvents_async", - "title": "LivestreamService listEvents Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of all events in the specified channel.", - "canonical": true, - "file": "livestream_service.list_events.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEvents", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.video.livestream.v1.ListEventsResponse", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "ListEvents", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_GetEvent_async", - "title": "LivestreamService getEvent Sample", - "origin": "API_DEFINITION", - "description": " Returns the specified event.", - "canonical": true, - "file": "livestream_service.get_event.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEvent", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.video.livestream.v1.Event", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "GetEvent", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - }, - { - "regionTag": "livestream_v1_generated_LivestreamService_DeleteEvent_async", - "title": "LivestreamService deleteEvent Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified event.", - "canonical": true, - "file": "livestream_service.delete_event.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteEvent", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "LivestreamServiceClient", - "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" - }, - "method": { - "shortName": "DeleteEvent", - "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", - "service": { - "shortName": "LivestreamService", - "fullName": "google.cloud.video.livestream.v1.LivestreamService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts b/owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts deleted file mode 100644 index c4d9c2546ff..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const LivestreamServiceClient = v1.LivestreamServiceClient; -type LivestreamServiceClient = v1.LivestreamServiceClient; -export {v1, LivestreamServiceClient}; -export default {v1, LivestreamServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 7e4e701773a..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.video.livestream.v1", - "libraryPackage": "@google-cloud/livestream", - "services": { - "LivestreamService": { - "clients": { - "grpc": { - "libraryClient": "LivestreamServiceClient", - "rpcs": { - "GetChannel": { - "methods": [ - "getChannel" - ] - }, - "GetInput": { - "methods": [ - "getInput" - ] - }, - "CreateEvent": { - "methods": [ - "createEvent" - ] - }, - "GetEvent": { - "methods": [ - "getEvent" - ] - }, - "DeleteEvent": { - "methods": [ - "deleteEvent" - ] - }, - "CreateChannel": { - "methods": [ - "createChannel" - ] - }, - "DeleteChannel": { - "methods": [ - "deleteChannel" - ] - }, - "UpdateChannel": { - "methods": [ - "updateChannel" - ] - }, - "StartChannel": { - "methods": [ - "startChannel" - ] - }, - "StopChannel": { - "methods": [ - "stopChannel" - ] - }, - "CreateInput": { - "methods": [ - "createInput" - ] - }, - "DeleteInput": { - "methods": [ - "deleteInput" - ] - }, - "UpdateInput": { - "methods": [ - "updateInput" - ] - }, - "ListChannels": { - "methods": [ - "listChannels", - "listChannelsStream", - "listChannelsAsync" - ] - }, - "ListInputs": { - "methods": [ - "listInputs", - "listInputsStream", - "listInputsAsync" - ] - }, - "ListEvents": { - "methods": [ - "listEvents", - "listEventsStream", - "listEventsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "LivestreamServiceClient", - "rpcs": { - "GetChannel": { - "methods": [ - "getChannel" - ] - }, - "GetInput": { - "methods": [ - "getInput" - ] - }, - "CreateEvent": { - "methods": [ - "createEvent" - ] - }, - "GetEvent": { - "methods": [ - "getEvent" - ] - }, - "DeleteEvent": { - "methods": [ - "deleteEvent" - ] - }, - "CreateChannel": { - "methods": [ - "createChannel" - ] - }, - "DeleteChannel": { - "methods": [ - "deleteChannel" - ] - }, - "UpdateChannel": { - "methods": [ - "updateChannel" - ] - }, - "StartChannel": { - "methods": [ - "startChannel" - ] - }, - "StopChannel": { - "methods": [ - "stopChannel" - ] - }, - "CreateInput": { - "methods": [ - "createInput" - ] - }, - "DeleteInput": { - "methods": [ - "deleteInput" - ] - }, - "UpdateInput": { - "methods": [ - "updateInput" - ] - }, - "ListChannels": { - "methods": [ - "listChannels", - "listChannelsStream", - "listChannelsAsync" - ] - }, - "ListInputs": { - "methods": [ - "listInputs", - "listInputsStream", - "listInputsAsync" - ] - }, - "ListEvents": { - "methods": [ - "listEvents", - "listEventsStream", - "listEventsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts deleted file mode 100644 index 152ae8d5ad5..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {LivestreamServiceClient} from './livestream_service_client'; diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts deleted file mode 100644 index bff25ea570b..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client.ts +++ /dev/null @@ -1,2817 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/livestream_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './livestream_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Using Live Stream API, you can generate live streams in the various - * renditions and streaming formats. The streaming format include HTTP Live - * Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send - * a source stream in the various ways, including Real-Time Messaging - * Protocol (RTMP) and Secure Reliable Transport (SRT). - * @class - * @memberof v1 - */ -export class LivestreamServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - livestreamServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of LivestreamServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new LivestreamServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof LivestreamServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - channelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/channels/{channel}' - ), - eventPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/channels/{channel}/events/{event}' - ), - inputPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/inputs/{input}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listChannels: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'channels'), - listInputs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'inputs'), - listEvents: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'events') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createChannelResponse = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.Channel') as gax.protobuf.Type; - const createChannelMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - const deleteChannelResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteChannelMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - const updateChannelResponse = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.Channel') as gax.protobuf.Type; - const updateChannelMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - const startChannelResponse = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.ChannelOperationResponse') as gax.protobuf.Type; - const startChannelMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - const stopChannelResponse = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.ChannelOperationResponse') as gax.protobuf.Type; - const stopChannelMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - const createInputResponse = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.Input') as gax.protobuf.Type; - const createInputMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - const deleteInputResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteInputMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - const updateInputResponse = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.Input') as gax.protobuf.Type; - const updateInputMetadata = protoFilesRoot.lookup( - '.google.cloud.video.livestream.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createChannel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createChannelResponse.decode.bind(createChannelResponse), - createChannelMetadata.decode.bind(createChannelMetadata)), - deleteChannel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteChannelResponse.decode.bind(deleteChannelResponse), - deleteChannelMetadata.decode.bind(deleteChannelMetadata)), - updateChannel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateChannelResponse.decode.bind(updateChannelResponse), - updateChannelMetadata.decode.bind(updateChannelMetadata)), - startChannel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - startChannelResponse.decode.bind(startChannelResponse), - startChannelMetadata.decode.bind(startChannelMetadata)), - stopChannel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - stopChannelResponse.decode.bind(stopChannelResponse), - stopChannelMetadata.decode.bind(stopChannelMetadata)), - createInput: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInputResponse.decode.bind(createInputResponse), - createInputMetadata.decode.bind(createInputMetadata)), - deleteInput: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteInputResponse.decode.bind(deleteInputResponse), - deleteInputMetadata.decode.bind(deleteInputMetadata)), - updateInput: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInputResponse.decode.bind(updateInputResponse), - updateInputMetadata.decode.bind(updateInputMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.video.livestream.v1.LivestreamService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.livestreamServiceStub) { - return this.livestreamServiceStub; - } - - // Put together the "service stub" for - // google.cloud.video.livestream.v1.LivestreamService. - this.livestreamServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.video.livestream.v1.LivestreamService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.video.livestream.v1.LivestreamService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const livestreamServiceStubMethods = - ['createChannel', 'listChannels', 'getChannel', 'deleteChannel', 'updateChannel', 'startChannel', 'stopChannel', 'createInput', 'listInputs', 'getInput', 'deleteInput', 'updateInput', 'createEvent', 'listEvents', 'getEvent', 'deleteEvent']; - for (const methodName of livestreamServiceStubMethods) { - const callPromise = this.livestreamServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.livestreamServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'livestream.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'livestream.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Returns the specified channel. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Channel | Channel}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.get_channel.js - * region_tag:livestream_v1_generated_LivestreamService_GetChannel_async - */ - getChannel( - request?: protos.google.cloud.video.livestream.v1.IGetChannelRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.video.livestream.v1.IChannel, - protos.google.cloud.video.livestream.v1.IGetChannelRequest|undefined, {}|undefined - ]>; - getChannel( - request: protos.google.cloud.video.livestream.v1.IGetChannelRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.video.livestream.v1.IChannel, - protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, - {}|null|undefined>): void; - getChannel( - request: protos.google.cloud.video.livestream.v1.IGetChannelRequest, - callback: Callback< - protos.google.cloud.video.livestream.v1.IChannel, - protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, - {}|null|undefined>): void; - getChannel( - request?: protos.google.cloud.video.livestream.v1.IGetChannelRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.video.livestream.v1.IChannel, - protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.video.livestream.v1.IChannel, - protos.google.cloud.video.livestream.v1.IGetChannelRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.video.livestream.v1.IChannel, - protos.google.cloud.video.livestream.v1.IGetChannelRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getChannel(request, options, callback); - } -/** - * Returns the specified input. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the input resource, in the form of: - * `projects/{project}/locations/{location}/inputs/{inputId}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Input | Input}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.get_input.js - * region_tag:livestream_v1_generated_LivestreamService_GetInput_async - */ - getInput( - request?: protos.google.cloud.video.livestream.v1.IGetInputRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.video.livestream.v1.IInput, - protos.google.cloud.video.livestream.v1.IGetInputRequest|undefined, {}|undefined - ]>; - getInput( - request: protos.google.cloud.video.livestream.v1.IGetInputRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.video.livestream.v1.IInput, - protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, - {}|null|undefined>): void; - getInput( - request: protos.google.cloud.video.livestream.v1.IGetInputRequest, - callback: Callback< - protos.google.cloud.video.livestream.v1.IInput, - protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, - {}|null|undefined>): void; - getInput( - request?: protos.google.cloud.video.livestream.v1.IGetInputRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.video.livestream.v1.IInput, - protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.video.livestream.v1.IInput, - protos.google.cloud.video.livestream.v1.IGetInputRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.video.livestream.v1.IInput, - protos.google.cloud.video.livestream.v1.IGetInputRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getInput(request, options, callback); - } -/** - * Creates an event with the provided unique ID in the specified channel. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent channel for the resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {google.cloud.video.livestream.v1.Event} request.event - * Required. The event resource to be created. - * @param {string} request.eventId - * Required. The ID of the event resource to be created. - * This value must be 1-63 characters, begin and end with `[a-z0-9]`, - * could contain dashes (-) in between. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Event | Event}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.create_event.js - * region_tag:livestream_v1_generated_LivestreamService_CreateEvent_async - */ - createEvent( - request?: protos.google.cloud.video.livestream.v1.ICreateEventRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.ICreateEventRequest|undefined, {}|undefined - ]>; - createEvent( - request: protos.google.cloud.video.livestream.v1.ICreateEventRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, - {}|null|undefined>): void; - createEvent( - request: protos.google.cloud.video.livestream.v1.ICreateEventRequest, - callback: Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, - {}|null|undefined>): void; - createEvent( - request?: protos.google.cloud.video.livestream.v1.ICreateEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.ICreateEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.ICreateEventRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createEvent(request, options, callback); - } -/** - * Returns the specified event. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the event resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.livestream.v1.Event | Event}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.get_event.js - * region_tag:livestream_v1_generated_LivestreamService_GetEvent_async - */ - getEvent( - request?: protos.google.cloud.video.livestream.v1.IGetEventRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.IGetEventRequest|undefined, {}|undefined - ]>; - getEvent( - request: protos.google.cloud.video.livestream.v1.IGetEventRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, - {}|null|undefined>): void; - getEvent( - request: protos.google.cloud.video.livestream.v1.IGetEventRequest, - callback: Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, - {}|null|undefined>): void; - getEvent( - request?: protos.google.cloud.video.livestream.v1.IGetEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.IGetEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.video.livestream.v1.IEvent, - protos.google.cloud.video.livestream.v1.IGetEventRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getEvent(request, options, callback); - } -/** - * Deletes the specified event. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the event resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.delete_event.js - * region_tag:livestream_v1_generated_LivestreamService_DeleteEvent_async - */ - deleteEvent( - request?: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.video.livestream.v1.IDeleteEventRequest|undefined, {}|undefined - ]>; - deleteEvent( - request: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, - {}|null|undefined>): void; - deleteEvent( - request: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, - {}|null|undefined>): void; - deleteEvent( - request?: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.video.livestream.v1.IDeleteEventRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.video.livestream.v1.IDeleteEventRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteEvent(request, options, callback); - } - -/** - * Creates a channel with the provided unique ID in the specified - * region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {google.cloud.video.livestream.v1.Channel} request.channel - * Required. The channel resource to be created. - * @param {string} request.channelId - * Required. The ID of the channel resource to be created. - * This value must be 1-63 characters, begin and end with `[a-z0-9]`, - * could contain dashes (-) in between. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.create_channel.js - * region_tag:livestream_v1_generated_LivestreamService_CreateChannel_async - */ - createChannel( - request?: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createChannel( - request: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createChannel( - request: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createChannel( - request?: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createChannel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createChannel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.create_channel.js - * region_tag:livestream_v1_generated_LivestreamService_CreateChannel_async - */ - async checkCreateChannelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createChannel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the specified channel. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {boolean} request.force - * If the `force` field is set to the default value of `false`, you must - * delete all of a channel's events before you can delete the channel itself. - * If the field is set to `true`, requests to delete a channel also delete - * associated channel events. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.delete_channel.js - * region_tag:livestream_v1_generated_LivestreamService_DeleteChannel_async - */ - deleteChannel( - request?: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteChannel( - request: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteChannel( - request: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteChannel( - request?: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteChannel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteChannel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.delete_channel.js - * region_tag:livestream_v1_generated_LivestreamService_DeleteChannel_async - */ - async checkDeleteChannelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteChannel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the specified channel. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the Channel - * resource by the update. You can only update the following fields: - * - * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) - * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) - * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) - * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) - * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) - * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) - * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) - * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) - * - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. - * - * If the mask is not present, then each field from the list above is updated - * if the field appears in the request payload. To unset a field, add the - * field to the update mask and remove it from the request payload. - * @param {google.cloud.video.livestream.v1.Channel} request.channel - * Required. The channel resource to be updated. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.update_channel.js - * region_tag:livestream_v1_generated_LivestreamService_UpdateChannel_async - */ - updateChannel( - request?: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateChannel( - request: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateChannel( - request: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateChannel( - request?: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'channel.name': request.channel!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateChannel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateChannel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.update_channel.js - * region_tag:livestream_v1_generated_LivestreamService_UpdateChannel_async - */ - async checkUpdateChannelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateChannel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Starts the specified channel. Part of the video pipeline will be created - * only when the StartChannel request is received by the server. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.start_channel.js - * region_tag:livestream_v1_generated_LivestreamService_StartChannel_async - */ - startChannel( - request?: protos.google.cloud.video.livestream.v1.IStartChannelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - startChannel( - request: protos.google.cloud.video.livestream.v1.IStartChannelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startChannel( - request: protos.google.cloud.video.livestream.v1.IStartChannelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startChannel( - request?: protos.google.cloud.video.livestream.v1.IStartChannelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.startChannel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `startChannel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.start_channel.js - * region_tag:livestream_v1_generated_LivestreamService_StartChannel_async - */ - async checkStartChannelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.startChannel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Stops the specified channel. Part of the video pipeline will be released - * when the StopChannel request is received by the server. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the channel resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.stop_channel.js - * region_tag:livestream_v1_generated_LivestreamService_StopChannel_async - */ - stopChannel( - request?: protos.google.cloud.video.livestream.v1.IStopChannelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - stopChannel( - request: protos.google.cloud.video.livestream.v1.IStopChannelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - stopChannel( - request: protos.google.cloud.video.livestream.v1.IStopChannelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - stopChannel( - request?: protos.google.cloud.video.livestream.v1.IStopChannelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.stopChannel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `stopChannel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.stop_channel.js - * region_tag:livestream_v1_generated_LivestreamService_StopChannel_async - */ - async checkStopChannelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.stopChannel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates an input with the provided unique ID in the specified region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {google.cloud.video.livestream.v1.Input} request.input - * Required. The input resource to be created. - * @param {string} request.inputId - * Required. The ID of the input resource to be created. - * This value must be 1-63 characters, begin and end with `[a-z0-9]`, - * could contain dashes (-) in between. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.create_input.js - * region_tag:livestream_v1_generated_LivestreamService_CreateInput_async - */ - createInput( - request?: protos.google.cloud.video.livestream.v1.ICreateInputRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInput( - request: protos.google.cloud.video.livestream.v1.ICreateInputRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInput( - request: protos.google.cloud.video.livestream.v1.ICreateInputRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInput( - request?: protos.google.cloud.video.livestream.v1.ICreateInputRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createInput(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createInput()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.create_input.js - * region_tag:livestream_v1_generated_LivestreamService_CreateInput_async - */ - async checkCreateInputProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInput, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the specified input. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the input resource, in the form of: - * `projects/{project}/locations/{location}/inputs/{inputId}`. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.delete_input.js - * region_tag:livestream_v1_generated_LivestreamService_DeleteInput_async - */ - deleteInput( - request?: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteInput( - request: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInput( - request: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInput( - request?: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteInput(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteInput()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.delete_input.js - * region_tag:livestream_v1_generated_LivestreamService_DeleteInput_async - */ - async checkDeleteInputProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInput, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the specified input. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the Input - * resource by the update. You can only update the following fields: - * - * * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) - * * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) - * - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. - * - * If the mask is not present, then each field from the list above is updated - * if the field appears in the request payload. To unset a field, add the - * field to the update mask and remove it from the request payload. - * @param {google.cloud.video.livestream.v1.Input} request.input - * Required. The input resource to be updated. - * @param {string} request.requestId - * A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request ID, - * the server can check if original operation with the same request ID was - * received, and if so, will ignore the second request. This prevents clients - * from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported `(00000000-0000-0000-0000-000000000000)`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.update_input.js - * region_tag:livestream_v1_generated_LivestreamService_UpdateInput_async - */ - updateInput( - request?: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInput( - request: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInput( - request: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInput( - request?: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'input.name': request.input!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateInput(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateInput()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.update_input.js - * region_tag:livestream_v1_generated_LivestreamService_UpdateInput_async - */ - async checkUpdateInputProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInput, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Returns a list of all channels in the specified region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.video.livestream.v1.Channel | Channel}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listChannelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listChannels( - request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.video.livestream.v1.IChannel[], - protos.google.cloud.video.livestream.v1.IListChannelsRequest|null, - protos.google.cloud.video.livestream.v1.IListChannelsResponse - ]>; - listChannels( - request: protos.google.cloud.video.livestream.v1.IListChannelsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListChannelsRequest, - protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IChannel>): void; - listChannels( - request: protos.google.cloud.video.livestream.v1.IListChannelsRequest, - callback: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListChannelsRequest, - protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IChannel>): void; - listChannels( - request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.video.livestream.v1.IListChannelsRequest, - protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IChannel>, - callback?: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListChannelsRequest, - protos.google.cloud.video.livestream.v1.IListChannelsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IChannel>): - Promise<[ - protos.google.cloud.video.livestream.v1.IChannel[], - protos.google.cloud.video.livestream.v1.IListChannelsRequest|null, - protos.google.cloud.video.livestream.v1.IListChannelsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listChannels(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.video.livestream.v1.Channel | Channel} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listChannelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listChannelsStream( - request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listChannels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listChannels.createStream( - this.innerApiCalls.listChannels as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listChannels`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.video.livestream.v1.Channel | Channel}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.list_channels.js - * region_tag:livestream_v1_generated_LivestreamService_ListChannels_async - */ - listChannelsAsync( - request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listChannels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listChannels.asyncIterate( - this.innerApiCalls['listChannels'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns a list of all inputs in the specified region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.video.livestream.v1.Input | Input}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInputsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listInputs( - request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.video.livestream.v1.IInput[], - protos.google.cloud.video.livestream.v1.IListInputsRequest|null, - protos.google.cloud.video.livestream.v1.IListInputsResponse - ]>; - listInputs( - request: protos.google.cloud.video.livestream.v1.IListInputsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListInputsRequest, - protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IInput>): void; - listInputs( - request: protos.google.cloud.video.livestream.v1.IListInputsRequest, - callback: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListInputsRequest, - protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IInput>): void; - listInputs( - request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.video.livestream.v1.IListInputsRequest, - protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IInput>, - callback?: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListInputsRequest, - protos.google.cloud.video.livestream.v1.IListInputsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IInput>): - Promise<[ - protos.google.cloud.video.livestream.v1.IInput[], - protos.google.cloud.video.livestream.v1.IListInputsRequest|null, - protos.google.cloud.video.livestream.v1.IListInputsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listInputs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.video.livestream.v1.Input | Input} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInputsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listInputsStream( - request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInputs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInputs.createStream( - this.innerApiCalls.listInputs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInputs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location for the resource, in the form of: - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at [Sorting - * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.video.livestream.v1.Input | Input}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.list_inputs.js - * region_tag:livestream_v1_generated_LivestreamService_ListInputs_async - */ - listInputsAsync( - request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInputs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInputs.asyncIterate( - this.innerApiCalls['listInputs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns a list of all events in the specified channel. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent channel for the resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.video.livestream.v1.Event | Event}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listEventsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEvents( - request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.video.livestream.v1.IEvent[], - protos.google.cloud.video.livestream.v1.IListEventsRequest|null, - protos.google.cloud.video.livestream.v1.IListEventsResponse - ]>; - listEvents( - request: protos.google.cloud.video.livestream.v1.IListEventsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListEventsRequest, - protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IEvent>): void; - listEvents( - request: protos.google.cloud.video.livestream.v1.IListEventsRequest, - callback: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListEventsRequest, - protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IEvent>): void; - listEvents( - request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.video.livestream.v1.IListEventsRequest, - protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IEvent>, - callback?: PaginationCallback< - protos.google.cloud.video.livestream.v1.IListEventsRequest, - protos.google.cloud.video.livestream.v1.IListEventsResponse|null|undefined, - protos.google.cloud.video.livestream.v1.IEvent>): - Promise<[ - protos.google.cloud.video.livestream.v1.IEvent[], - protos.google.cloud.video.livestream.v1.IListEventsRequest|null, - protos.google.cloud.video.livestream.v1.IListEventsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listEvents(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent channel for the resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.video.livestream.v1.Event | Event} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listEventsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEventsStream( - request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEvents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEvents.createStream( - this.innerApiCalls.listEvents as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEvents`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent channel for the resource, in the form of: - * `projects/{project}/locations/{location}/channels/{channelId}`. - * @param {number} request.pageSize - * The maximum number of items to return. If unspecified, server - * will pick an appropriate default. Server may return fewer items than - * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} - * to determine if there are more items left to be queried. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {string} request.filter - * The filter to apply to list results. - * @param {string} request.orderBy - * Specifies the ordering of results following syntax at - * https://cloud.google.com/apis/design/design_patterns#sorting_order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.video.livestream.v1.Event | Event}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/livestream_service.list_events.js - * region_tag:livestream_v1_generated_LivestreamService_ListEvents_async - */ - listEventsAsync( - request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEvents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEvents.asyncIterate( - this.innerApiCalls['listEvents'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified channel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} channel - * @returns {string} Resource name string. - */ - channelPath(project:string,location:string,channel:string) { - return this.pathTemplates.channelPathTemplate.render({ - project: project, - location: location, - channel: channel, - }); - } - - /** - * Parse the project from Channel resource. - * - * @param {string} channelName - * A fully-qualified path representing Channel resource. - * @returns {string} A string representing the project. - */ - matchProjectFromChannelName(channelName: string) { - return this.pathTemplates.channelPathTemplate.match(channelName).project; - } - - /** - * Parse the location from Channel resource. - * - * @param {string} channelName - * A fully-qualified path representing Channel resource. - * @returns {string} A string representing the location. - */ - matchLocationFromChannelName(channelName: string) { - return this.pathTemplates.channelPathTemplate.match(channelName).location; - } - - /** - * Parse the channel from Channel resource. - * - * @param {string} channelName - * A fully-qualified path representing Channel resource. - * @returns {string} A string representing the channel. - */ - matchChannelFromChannelName(channelName: string) { - return this.pathTemplates.channelPathTemplate.match(channelName).channel; - } - - /** - * Return a fully-qualified event resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} channel - * @param {string} event - * @returns {string} Resource name string. - */ - eventPath(project:string,location:string,channel:string,event:string) { - return this.pathTemplates.eventPathTemplate.render({ - project: project, - location: location, - channel: channel, - event: event, - }); - } - - /** - * Parse the project from Event resource. - * - * @param {string} eventName - * A fully-qualified path representing Event resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEventName(eventName: string) { - return this.pathTemplates.eventPathTemplate.match(eventName).project; - } - - /** - * Parse the location from Event resource. - * - * @param {string} eventName - * A fully-qualified path representing Event resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEventName(eventName: string) { - return this.pathTemplates.eventPathTemplate.match(eventName).location; - } - - /** - * Parse the channel from Event resource. - * - * @param {string} eventName - * A fully-qualified path representing Event resource. - * @returns {string} A string representing the channel. - */ - matchChannelFromEventName(eventName: string) { - return this.pathTemplates.eventPathTemplate.match(eventName).channel; - } - - /** - * Parse the event from Event resource. - * - * @param {string} eventName - * A fully-qualified path representing Event resource. - * @returns {string} A string representing the event. - */ - matchEventFromEventName(eventName: string) { - return this.pathTemplates.eventPathTemplate.match(eventName).event; - } - - /** - * Return a fully-qualified input resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} input - * @returns {string} Resource name string. - */ - inputPath(project:string,location:string,input:string) { - return this.pathTemplates.inputPathTemplate.render({ - project: project, - location: location, - input: input, - }); - } - - /** - * Parse the project from Input resource. - * - * @param {string} inputName - * A fully-qualified path representing Input resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInputName(inputName: string) { - return this.pathTemplates.inputPathTemplate.match(inputName).project; - } - - /** - * Parse the location from Input resource. - * - * @param {string} inputName - * A fully-qualified path representing Input resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInputName(inputName: string) { - return this.pathTemplates.inputPathTemplate.match(inputName).location; - } - - /** - * Parse the input from Input resource. - * - * @param {string} inputName - * A fully-qualified path representing Input resource. - * @returns {string} A string representing the input. - */ - matchInputFromInputName(inputName: string) { - return this.pathTemplates.inputPathTemplate.match(inputName).input; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.livestreamServiceStub && !this._terminated) { - return this.livestreamServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json deleted file mode 100644 index 54b1640f293..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_client_config.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "interfaces": { - "google.cloud.video.livestream.v1.LivestreamService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateChannel": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListChannels": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetChannel": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteChannel": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateChannel": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StartChannel": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StopChannel": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateInput": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInputs": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetInput": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteInput": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInput": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateEvent": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEvents": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetEvent": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteEvent": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json b/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json deleted file mode 100644 index 59db12abdff..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/src/v1/livestream_service_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/video/livestream/v1/outputs.proto", - "../../protos/google/cloud/video/livestream/v1/resources.proto", - "../../protos/google/cloud/video/livestream/v1/service.proto" -] diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 162bf42986e..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const livestream = require('@google-cloud/livestream'); - -function main() { - const livestreamServiceClient = new livestream.LivestreamServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 030bd445734..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {LivestreamServiceClient} from '@google-cloud/livestream'; - -// check that the client class type name can be used -function doStuffWithLivestreamServiceClient(client: LivestreamServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const livestreamServiceClient = new LivestreamServiceClient(); - doStuffWithLivestreamServiceClient(livestreamServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts b/owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts b/owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts deleted file mode 100644 index b396752c5c8..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/test/gapic_livestream_service_v1.ts +++ /dev/null @@ -1,3366 +0,0 @@ -// Copyright 2023 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as livestreamserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.LivestreamServiceClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = livestreamserviceModule.v1.LivestreamServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = livestreamserviceModule.v1.LivestreamServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = livestreamserviceModule.v1.LivestreamServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.livestreamServiceStub, undefined); - await client.initialize(); - assert(client.livestreamServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.livestreamServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.livestreamServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getChannel', () => { - it('invokes getChannel without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Channel() - ); - client.innerApiCalls.getChannel = stubSimpleCall(expectedResponse); - const [response] = await client.getChannel(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getChannel without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Channel() - ); - client.innerApiCalls.getChannel = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getChannel( - request, - (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IChannel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getChannel with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getChannel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getChannel(request), expectedError); - const actualRequest = (client.innerApiCalls.getChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getChannel with closed client', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetChannelRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getChannel(request), expectedError); - }); - }); - - describe('getInput', () => { - it('invokes getInput without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Input() - ); - client.innerApiCalls.getInput = stubSimpleCall(expectedResponse); - const [response] = await client.getInput(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInput without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Input() - ); - client.innerApiCalls.getInput = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInput( - request, - (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IInput|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInput with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInput = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInput(request), expectedError); - const actualRequest = (client.innerApiCalls.getInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInput with closed client', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetInputRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getInput(request), expectedError); - }); - }); - - describe('createEvent', () => { - it('invokes createEvent without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Event() - ); - client.innerApiCalls.createEvent = stubSimpleCall(expectedResponse); - const [response] = await client.createEvent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEvent without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Event() - ); - client.innerApiCalls.createEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEvent( - request, - (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IEvent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEvent with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.createEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEvent with closed client', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateEventRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createEvent(request), expectedError); - }); - }); - - describe('getEvent', () => { - it('invokes getEvent without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Event() - ); - client.innerApiCalls.getEvent = stubSimpleCall(expectedResponse); - const [response] = await client.getEvent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvent without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.Event() - ); - client.innerApiCalls.getEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEvent( - request, - (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IEvent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvent with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.getEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvent with closed client', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.GetEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.GetEventRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEvent(request), expectedError); - }); - }); - - describe('deleteEvent', () => { - it('invokes deleteEvent without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteEvent = stubSimpleCall(expectedResponse); - const [response] = await client.deleteEvent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEvent without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteEvent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEvent( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEvent with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEvent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteEvent(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEvent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEvent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEvent with closed client', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteEventRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteEventRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteEvent(request), expectedError); - }); - }); - - describe('createChannel', () => { - it('invokes createChannel without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createChannel = stubLongRunningCall(expectedResponse); - const [operation] = await client.createChannel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createChannel without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createChannel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createChannel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createChannel with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createChannel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createChannel(request), expectedError); - const actualRequest = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createChannel with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateChannelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createChannel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createChannel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateChannelProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateChannelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateChannelProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateChannelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteChannel', () => { - it('invokes deleteChannel without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteChannel = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteChannel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteChannel without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteChannel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteChannel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteChannel with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteChannel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteChannel(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteChannel with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteChannel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteChannel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteChannelProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteChannelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteChannelProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteChannelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateChannel', () => { - it('invokes updateChannel without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() - ); - request.channel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); - request.channel.name = defaultValue1; - const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateChannel = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateChannel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateChannel without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() - ); - request.channel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); - request.channel.name = defaultValue1; - const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateChannel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateChannel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateChannel with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() - ); - request.channel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); - request.channel.name = defaultValue1; - const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateChannel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateChannel(request), expectedError); - const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateChannel with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() - ); - request.channel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateChannelRequest', ['channel', 'name']); - request.channel.name = defaultValue1; - const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateChannel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateChannel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateChannelProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateChannelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateChannelProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateChannelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('startChannel', () => { - it('invokes startChannel without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StartChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.startChannel = stubLongRunningCall(expectedResponse); - const [operation] = await client.startChannel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startChannel without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StartChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.startChannel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.startChannel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startChannel with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StartChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startChannel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.startChannel(request), expectedError); - const actualRequest = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startChannel with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StartChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StartChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startChannel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.startChannel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkStartChannelProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkStartChannelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkStartChannelProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkStartChannelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('stopChannel', () => { - it('invokes stopChannel without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StopChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.stopChannel = stubLongRunningCall(expectedResponse); - const [operation] = await client.stopChannel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopChannel without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StopChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.stopChannel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.stopChannel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopChannel with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StopChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopChannel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.stopChannel(request), expectedError); - const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopChannel with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.StopChannelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.StopChannelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopChannel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.stopChannel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopChannel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkStopChannelProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkStopChannelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkStopChannelProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkStopChannelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createInput', () => { - it('invokes createInput without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInput = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInput(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInput without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInput = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInput( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInput with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInput = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInput(request), expectedError); - const actualRequest = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInput with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.CreateInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.CreateInputRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInput = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInput(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInputProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInputProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInputProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInputProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteInput', () => { - it('invokes deleteInput without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInput = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInput(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInput without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInput = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInput( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInput with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInput = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInput(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInput with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.DeleteInputRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.DeleteInputRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInput = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInput(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteInputProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInputProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteInputProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteInputProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInput', () => { - it('invokes updateInput without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateInputRequest() - ); - request.input ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); - request.input.name = defaultValue1; - const expectedHeaderRequestParams = `input.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInput = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInput(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInput without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateInputRequest() - ); - request.input ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); - request.input.name = defaultValue1; - const expectedHeaderRequestParams = `input.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInput = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInput( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInput with call error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateInputRequest() - ); - request.input ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); - request.input.name = defaultValue1; - const expectedHeaderRequestParams = `input.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInput = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInput(request), expectedError); - const actualRequest = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInput with LRO error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.UpdateInputRequest() - ); - request.input ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.UpdateInputRequest', ['input', 'name']); - request.input.name = defaultValue1; - const expectedHeaderRequestParams = `input.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInput = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInput(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInput as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateInputProgress without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInputProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInputProgress with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInputProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listChannels', () => { - it('invokes listChannels without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListChannelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - ]; - client.innerApiCalls.listChannels = stubSimpleCall(expectedResponse); - const [response] = await client.listChannels(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listChannels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listChannels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listChannels without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListChannelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - ]; - client.innerApiCalls.listChannels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listChannels( - request, - (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IChannel[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listChannels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listChannels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listChannels with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListChannelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listChannels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listChannels(request), expectedError); - const actualRequest = (client.innerApiCalls.listChannels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listChannels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listChannelsStream without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListChannelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - ]; - client.descriptors.page.listChannels.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listChannelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.livestream.v1.Channel[] = []; - stream.on('data', (response: protos.google.cloud.video.livestream.v1.Channel) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listChannels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listChannels, request)); - assert( - (client.descriptors.page.listChannels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listChannelsStream with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListChannelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listChannels.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listChannelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.livestream.v1.Channel[] = []; - stream.on('data', (response: protos.google.cloud.video.livestream.v1.Channel) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listChannels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listChannels, request)); - assert( - (client.descriptors.page.listChannels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listChannels without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListChannelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Channel()), - ]; - client.descriptors.page.listChannels.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.livestream.v1.IChannel[] = []; - const iterable = client.listChannelsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listChannels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listChannels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listChannels with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListChannelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListChannelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listChannels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listChannelsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.video.livestream.v1.IChannel[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listChannels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listChannels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInputs', () => { - it('invokes listInputs without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListInputsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - ]; - client.innerApiCalls.listInputs = stubSimpleCall(expectedResponse); - const [response] = await client.listInputs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInputs without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListInputsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - ]; - client.innerApiCalls.listInputs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInputs( - request, - (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IInput[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInputs with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListInputsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInputs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInputs(request), expectedError); - const actualRequest = (client.innerApiCalls.listInputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInputsStream without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListInputsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - ]; - client.descriptors.page.listInputs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInputsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.livestream.v1.Input[] = []; - stream.on('data', (response: protos.google.cloud.video.livestream.v1.Input) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInputs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInputs, request)); - assert( - (client.descriptors.page.listInputs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInputsStream with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListInputsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listInputs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInputsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.livestream.v1.Input[] = []; - stream.on('data', (response: protos.google.cloud.video.livestream.v1.Input) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInputs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInputs, request)); - assert( - (client.descriptors.page.listInputs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInputs without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListInputsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Input()), - ]; - client.descriptors.page.listInputs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.livestream.v1.IInput[] = []; - const iterable = client.listInputsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInputs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInputs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInputs with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListInputsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListInputsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listInputs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInputsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.video.livestream.v1.IInput[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInputs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInputs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listEvents', () => { - it('invokes listEvents without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - ]; - client.innerApiCalls.listEvents = stubSimpleCall(expectedResponse); - const [response] = await client.listEvents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvents without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - ]; - client.innerApiCalls.listEvents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEvents( - request, - (err?: Error|null, result?: protos.google.cloud.video.livestream.v1.IEvent[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvents with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEvents(request), expectedError); - const actualRequest = (client.innerApiCalls.listEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEventsStream without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - ]; - client.descriptors.page.listEvents.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEventsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.livestream.v1.Event[] = []; - stream.on('data', (response: protos.google.cloud.video.livestream.v1.Event) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listEvents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEvents, request)); - assert( - (client.descriptors.page.listEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEventsStream with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listEvents.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEventsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.livestream.v1.Event[] = []; - stream.on('data', (response: protos.google.cloud.video.livestream.v1.Event) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEvents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEvents, request)); - assert( - (client.descriptors.page.listEvents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEvents without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - generateSampleMessage(new protos.google.cloud.video.livestream.v1.Event()), - ]; - client.descriptors.page.listEvents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.livestream.v1.IEvent[] = []; - const iterable = client.listEventsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEvents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEvents with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.livestream.v1.ListEventsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.video.livestream.v1.ListEventsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEventsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.video.livestream.v1.IEvent[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEvents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEvents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('channel', () => { - const fakePath = "/rendered/path/channel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - channel: "channelValue", - }; - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.channelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.channelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('channelPath', () => { - const result = client.channelPath("projectValue", "locationValue", "channelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.channelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromChannelName', () => { - const result = client.matchProjectFromChannelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.channelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromChannelName', () => { - const result = client.matchLocationFromChannelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.channelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchChannelFromChannelName', () => { - const result = client.matchChannelFromChannelName(fakePath); - assert.strictEqual(result, "channelValue"); - assert((client.pathTemplates.channelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('event', () => { - const fakePath = "/rendered/path/event"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - channel: "channelValue", - event: "eventValue", - }; - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.eventPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.eventPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('eventPath', () => { - const result = client.eventPath("projectValue", "locationValue", "channelValue", "eventValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.eventPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEventName', () => { - const result = client.matchProjectFromEventName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.eventPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEventName', () => { - const result = client.matchLocationFromEventName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.eventPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchChannelFromEventName', () => { - const result = client.matchChannelFromEventName(fakePath); - assert.strictEqual(result, "channelValue"); - assert((client.pathTemplates.eventPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEventFromEventName', () => { - const result = client.matchEventFromEventName(fakePath); - assert.strictEqual(result, "eventValue"); - assert((client.pathTemplates.eventPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('input', () => { - const fakePath = "/rendered/path/input"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - input: "inputValue", - }; - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.inputPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.inputPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('inputPath', () => { - const result = client.inputPath("projectValue", "locationValue", "inputValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.inputPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInputName', () => { - const result = client.matchProjectFromInputName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.inputPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInputName', () => { - const result = client.matchLocationFromInputName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.inputPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInputFromInputName', () => { - const result = client.matchInputFromInputName(fakePath); - assert.strictEqual(result, "inputValue"); - assert((client.pathTemplates.inputPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new livestreamserviceModule.v1.LivestreamServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json b/owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js b/owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js deleted file mode 100644 index 72c9acab0ac..00000000000 --- a/owl-bot-staging/google-cloud-video-livestream/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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 -// -// https://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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'LivestreamService', - filename: './livestream-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/outputs.proto b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/outputs.proto index fb5cc130154..2eceb825ef6 100644 --- a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/outputs.proto +++ b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/outputs.proto @@ -18,6 +18,7 @@ package google.cloud.video.livestream.v1; import "google/api/field_behavior.proto"; import "google/protobuf/duration.proto"; +import "google/type/datetime.proto"; option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb"; @@ -60,8 +61,9 @@ message MuxStream { // - `ts` - the corresponding file extension is `.ts` string container = 3; - // List of `ElementaryStream` [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed in this - // stream. + // List of `ElementaryStream` + // [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed + // in this stream. // // - For `fmp4` container, must contain either one video or one audio stream. // - For `ts` container, must contain exactly one audio stream and up to one @@ -70,6 +72,10 @@ message MuxStream { // Segment settings for `fmp4` and `ts`. SegmentSettings segment_settings = 5; + + // Identifier of the encryption configuration to use. If omitted, output + // will be unencrypted. + string encryption_id = 6; } // Manifest configuration. @@ -87,15 +93,17 @@ message Manifest { } // The name of the generated file. The default is `manifest` with the - // extension suffix corresponding to the `Manifest` [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple + // extension suffix corresponding to the `Manifest` + // [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple // manifests are added to the channel, each must have a unique file name. string file_name = 1; // Required. Type of the manifest, can be `HLS` or `DASH`. ManifestType type = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. List of `MuxStream` [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear in this - // manifest. + // Required. List of `MuxStream` + // [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear + // in this manifest. // // - For HLS, either `fmp4` or `ts` mux streams can be specified but not // mixed. @@ -115,6 +123,15 @@ message Manifest { // player has, but were already deleted from the output Google Cloud Storage // bucket. Default value is `60s`. google.protobuf.Duration segment_keep_duration = 5; + + // Whether to use the timecode, as specified in timecode config, when setting: + // + // - `availabilityStartTime` attribute in DASH manifests. + // - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. + // + // If false, ignore the input timecode and use the time from system clock + // when the manifest is first generated. This is the default behavior. + bool use_timecode_as_timeline = 6; } // Sprite sheet configuration. @@ -161,6 +178,22 @@ message SpriteSheet { // Preprocessing configurations. message PreprocessingConfig { + // Audio preprocessing configuration. + message Audio { + // Specify audio loudness normalization in loudness units relative to full + // scale (LUFS). Enter a value between -24 and 0 according to the following: + // + // - -24 is the Advanced Television Systems Committee (ATSC A/85) + // - -23 is the EU R128 broadcast standard + // - -19 is the prior standard for online mono audio + // - -18 is the ReplayGain standard + // - -16 is the prior standard for stereo audio + // - -14 is the new online audio standard recommended by Spotify, as well as + // Amazon Echo + // - 0 disables normalization. The default is 0. + double lufs = 1; + } + // Video cropping configuration for the input video. The cropped input video // is scaled to match the output resolution. message Crop { @@ -193,6 +226,9 @@ message PreprocessingConfig { int32 right_pixels = 4; } + // Audio preprocessing configuration. + Audio audio = 1; + // Specify the video cropping configuration. Crop crop = 2; @@ -212,8 +248,8 @@ message VideoStream { // Valid range is [180, 1080]. int32 height_pixels = 2; - // Required. The target video frame rate in frames per second (FPS). Must be less - // than or equal to 60. Will default to the input frame rate if larger + // Required. The target video frame rate in frames per second (FPS). Must be + // less than or equal to 60. Will default to the input frame rate if larger // than the input frame rate. The API will generate an output FPS that is // divisible by the input FPS, and smaller or equal to the target FPS. See // [Calculating frame @@ -242,16 +278,18 @@ message VideoStream { // Select the GOP size based on the specified duration. The default is // `2s`. Note that `gopDuration` must be less than or equal to - // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], and - // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] must be divisible - // by `gopDuration`. Valid range is [2s, 20s]. + // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], + // and + // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] + // must be divisible by `gopDuration`. Valid range is [2s, 20s]. // // All video streams in the same channel must have the same GOP size. google.protobuf.Duration gop_duration = 8; } // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be - // greater than zero. The default is equal to [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. + // greater than zero. The default is equal to + // [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. int32 vbv_size_bits = 9; // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. @@ -272,8 +310,9 @@ message VideoStream { bool b_pyramid = 12; // The number of consecutive B-frames. Must be greater than or equal to - // zero. Must be less than [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] if set. The default - // is 0. + // zero. Must be less than + // [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] + // if set. The default is 0. int32 b_frame_count = 13; // Specify the intensity of the adaptive quantizer (AQ). Must be between 0 @@ -291,7 +330,8 @@ message VideoStream { // The available options are [FFmpeg-compatible Profile // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). // Note that certain values for this field may cause the - // transcoder to override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + // transcoder to override other fields you set in the + // [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] // message. string profile = 15; @@ -299,7 +339,9 @@ message VideoStream { // [FFmpeg-compatible Encode // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) // Note that certain values for this field may cause the transcoder to - // override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] message. + // override other fields you set in the + // [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + // message. string tune = 16; } @@ -314,22 +356,30 @@ message VideoStream { message AudioStream { // The mapping for the input streams and audio channels. message AudioMapping { - // Required. The `Channel` [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that identifies the input that this - // audio mapping applies to. If an active input doesn't have an audio - // mapping, the primary audio track in the input stream will be selected. + // Required. The `Channel` + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + // that identifies the input that this audio mapping applies to. If an + // active input doesn't have an audio mapping, the primary audio track in + // the input stream will be selected. string input_key = 6 [(google.api.field_behavior) = REQUIRED]; // Required. The zero-based index of the track in the input stream. - // All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] - // must have the same input track. + // All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in + // the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must + // have the same input track. int32 input_track = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The zero-based index of the channel in the input stream. int32 input_channel = 3 [(google.api.field_behavior) = REQUIRED]; // Required. The zero-based index of the channel in the output audio stream. - // Must be consistent with the [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + // Must be consistent with the + // [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. int32 output_channel = 4 [(google.api.field_behavior) = REQUIRED]; + + // Audio volume control in dB. Negative values decrease volume, + // positive values increase. The default is 0. + double gain_db = 5; } // Specifies whether pass through (transmuxing) is enabled or not. @@ -344,7 +394,8 @@ message AudioStream { // - `aac` string codec = 1; - // Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. + // Required. Audio bitrate in bits per second. Must be between 1 and + // 10,000,000. int32 bitrate_bps = 2 [(google.api.field_behavior) = REQUIRED]; // Number of audio channels. Must be between 1 and 6. The default is 2. @@ -386,12 +437,43 @@ message TextStream { message SegmentSettings { // Duration of the segments in seconds. The default is `6s`. Note that // `segmentDuration` must be greater than or equal to - // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and - // `segmentDuration` must be divisible by + // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], + // and `segmentDuration` must be divisible by // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. // Valid range is [2s, 20s]. // - // All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the - // same segment duration. + // All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in + // the same manifest must have the same segment duration. google.protobuf.Duration segment_duration = 1; } + +// Timecode configuration. +message TimecodeConfig { + // The source of timecode. + enum TimecodeSource { + // The timecode source is not specified. + TIMECODE_SOURCE_UNSPECIFIED = 0; + + // Use input media timestamp. + MEDIA_TIMESTAMP = 1; + + // Use input embedded timecode e.g. picture timing SEI message. + EMBEDDED_TIMECODE = 2; + } + + // The source of the timecode that will later be used in outputs/manifests. + // It determines the initial timecode/timestamp (first frame) of output + // streams. + TimecodeSource source = 1; + + // For EMBEDDED_TIMECODE source only. + // Used to interpret the embedded timecode (which contains only the time part + // and no date). We assume all inputs are live. + oneof time_offset { + // UTC offset. Must be whole seconds, between -18 hours and +18 hours. + google.protobuf.Duration utc_offset = 2; + + // Time zone e.g. "America/Los_Angeles". + google.type.TimeZone time_zone = 3; + } +} diff --git a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/resources.proto b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/resources.proto index a0d29591d8d..1691139e2c4 100644 --- a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/resources.proto +++ b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/resources.proto @@ -81,10 +81,12 @@ message Input { string name = 1; // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The update time. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // User-defined key/value metadata. map labels = 4; @@ -99,7 +101,8 @@ message Input { Tier tier = 14; // Output only. URI to push the input stream to. - // Its format depends on the input [type][google.cloud.video.livestream.v1.Input.type], for example: + // Its format depends on the input + // [type][google.cloud.video.livestream.v1.Input.type], for example: // // * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` // * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` @@ -111,9 +114,10 @@ message Input { // Security rule for access control. SecurityRule security_rules = 12; - // Output only. The information for the input stream. This field will be present only when - // this input receives the input stream. - InputStreamProperty input_stream_property = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The information for the input stream. This field will be + // present only when this input receives the input stream. + InputStreamProperty input_stream_property = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Channel resource represents the processor that does a user-defined @@ -170,10 +174,12 @@ message Channel { string name = 1; // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The update time. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // User-defined key/value metadata. map labels = 4; @@ -183,12 +189,15 @@ message Channel { // input can be selected as the input source at one time. repeated InputAttachment input_attachments = 16; - // Output only. The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that serves as the current input source. The - // first input in the [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] is the initial input source. + // Output only. The + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + // that serves as the current input source. The first input in the + // [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] + // is the initial input source. string active_input = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. Information about the output (that is, the Cloud Storage bucket to store - // the generated live stream). + // Required. Information about the output (that is, the Cloud Storage bucket + // to store the generated live stream). Output output = 9 [(google.api.field_behavior) = REQUIRED]; // List of elementary streams. @@ -204,15 +213,57 @@ message Channel { repeated SpriteSheet sprite_sheets = 13; // Output only. State of the streaming operation. - StreamingState streaming_state = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + StreamingState streaming_state = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A description of the reason for the streaming error. This property is - // always present when [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] is + // Output only. A description of the reason for the streaming error. This + // property is always present when + // [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] + // is // [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. - google.rpc.Status streaming_error = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.rpc.Status streaming_error = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Configuration of platform logs for this channel. LogConfig log_config = 19; + + // Configuration of timecode for this channel. + TimecodeConfig timecode_config = 21; + + // Encryption configurations for this channel. Each configuration has an ID + // which is referred to by each MuxStream to indicate which configuration is + // used for that output. + repeated Encryption encryptions = 24; + + // The configuration for input sources defined in + // [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]. + InputConfig input_config = 25; +} + +// Configuration for the input sources of a channel. +message InputConfig { + // Input switch mode. + enum InputSwitchMode { + // The input switch mode is not specified. + INPUT_SWITCH_MODE_UNSPECIFIED = 0; + + // Automatic failover is enabled. The primary input stream is always + // preferred over its backup input streams configured using the + // [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] + // field. + FAILOVER_PREFER_PRIMARY = 1; + + // Automatic failover is disabled. You must use the + // [inputSwitch][google.cloud.video.livestream.v1.Event.input_switch] event + // to switch the active input source for the channel to stream from. When + // this mode is chosen, the + // [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] + // field is ignored. + MANUAL = 3; + } + + // Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. + InputSwitchMode input_switch_mode = 1; } // Configuration of platform logs. @@ -314,8 +365,10 @@ message AudioFormat { message InputAttachment { // Configurations to follow when automatic failover happens. message AutomaticFailover { - // The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s of inputs to failover to when this input is - // disconnected. Currently, only up to one backup input is supported. + // The + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s + // of inputs to failover to when this input is disconnected. Currently, only + // up to one backup input is supported. repeated string input_keys = 1; } @@ -325,8 +378,8 @@ message InputAttachment { // The resource name of an existing input, in the form of: // `projects/{project}/locations/{location}/inputs/{inputId}`. string input = 2 [(google.api.resource_reference) = { - type: "livestream.googleapis.com/Input" - }]; + type: "livestream.googleapis.com/Input" + }]; // Automatic failover configurations. AutomaticFailover automatic_failover = 3; @@ -340,12 +393,35 @@ message Event { pattern: "projects/{project}/locations/{location}/channels/{channel}/events/{event}" }; + // Switches to another input stream. Automatic failover is then disabled. + message InputSwitchTask { + // The + // [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + // of the input to switch to. + string input_key = 1; + } + // Inserts a new ad opportunity. message AdBreakTask { // Duration of an ad opportunity. Must be greater than 0. google.protobuf.Duration duration = 1; } + // Stops any events which are currently running. This only applies to events + // with a duration. + message ReturnToProgramTask {} + + // Mutes the stream. + message MuteTask { + // Duration for which the stream should be muted. If omitted, the stream + // will be muted until an UnmuteTask event is sent. + google.protobuf.Duration duration = 1; + } + + // Unmutes the stream. The task will fail if the stream is not + // currently muted. + message UnmuteTask {} + // State of the event enum State { // Event state is not specified. @@ -375,28 +451,49 @@ message Event { string name = 1; // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The update time. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // User-defined key/value metadata. map labels = 4; // Required. Operation to be executed by this event. oneof task { + // Required. Switches to another input stream. + InputSwitchTask input_switch = 5 [(google.api.field_behavior) = REQUIRED]; + // Required. Inserts a new ad opportunity. AdBreakTask ad_break = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Stops any running ad break. + ReturnToProgramTask return_to_program = 13 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mutes the stream. + MuteTask mute = 15 [(google.api.field_behavior) = REQUIRED]; + + // Required. Unmutes the stream. + UnmuteTask unmute = 16 [(google.api.field_behavior) = REQUIRED]; } // When this field is set to true, the event will be executed at the earliest - // time that the server can schedule the event and [execution_time][google.cloud.video.livestream.v1.Event.execution_time] will be - // populated with the time that the server actually schedules the event. + // time that the server can schedule the event and + // [execution_time][google.cloud.video.livestream.v1.Event.execution_time] + // will be populated with the time that the server actually schedules the + // event. bool execute_now = 9; - // The time when the event should be executed. When [execute_now][google.cloud.video.livestream.v1.Event.execute_now] is set to - // `true`, this field should not be set in `CreateEvent` request and will be - // populated with the time that the server schedules the event. + // The time to execute the event. If you set + // [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + // `true`, then do not set this field in the `CreateEvent` request. In + // this case, the server schedules the event and populates this field. If you + // set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + // `false`, then you must set this field to at least 10 seconds in the future + // or else the event can't be created. google.protobuf.Timestamp execution_time = 10; // Output only. The state of the event. @@ -406,3 +503,84 @@ message Event { // This property is always present when `state` is `FAILED`. google.rpc.Status error = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Encryption settings. +message Encryption { + // Configuration for secrets stored in Google Secret Manager. + message SecretManagerSource { + // Required. The name of the Secret Version containing the encryption key. + // `projects/{project}/secrets/{secret_id}/versions/{version_number}` + string secret_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // Widevine configuration. + message Widevine {} + + // Fairplay configuration. + message Fairplay {} + + // Playready configuration. + message Playready {} + + // Clearkey configuration. + message Clearkey {} + + // Defines configuration for DRM systems in use. If a field is omitted, + // that DRM system will be considered to be disabled. + message DrmSystems { + // Widevine configuration. + Widevine widevine = 1; + + // Fairplay configuration. + Fairplay fairplay = 2; + + // Playready configuration. + Playready playready = 3; + + // Clearkey configuration. + Clearkey clearkey = 4; + } + + // Configuration for HLS AES-128 encryption. + message Aes128Encryption {} + + // Configuration for HLS SAMPLE-AES encryption. + message SampleAesEncryption {} + + // Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + message MpegCommonEncryption { + // Required. Specify the encryption scheme, supported schemes: + // - `cenc` - AES-CTR subsample + // - `cbcs`- AES-CBC subsample pattern + string scheme = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Identifier for this set of encryption options. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Defines where content keys are stored. + oneof secret_source { + // For keys stored in Google Secret Manager. + SecretManagerSource secret_manager_key_source = 7; + } + + // Required. Configuration for DRM systems. + DrmSystems drm_systems = 3 [(google.api.field_behavior) = REQUIRED]; + + // Encryption modes for HLS and MPEG-Dash. + oneof encryption_mode { + // Configuration for HLS AES-128 encryption. + Aes128Encryption aes128 = 4; + + // Configuration for HLS SAMPLE-AES encryption. + SampleAesEncryption sample_aes = 5; + + // Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + MpegCommonEncryption mpeg_cenc = 6; + } +} diff --git a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/service.proto b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/service.proto index d8c478ec6a8..e424e54a4af 100644 --- a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/service.proto +++ b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/service.proto @@ -33,6 +33,10 @@ option java_outer_classname = "ServiceProto"; option java_package = "com.google.cloud.video.livestream.v1"; option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; option ruby_package = "Google::Cloud::Video::LiveStream::V1"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; // Using Live Stream API, you can generate live streams in the various // renditions and streaming formats. The streaming format include HTTP Live @@ -41,11 +45,13 @@ option ruby_package = "Google::Cloud::Video::LiveStream::V1"; // Protocol (RTMP) and Secure Reliable Transport (SRT). service LivestreamService { option (google.api.default_host) = "livestream.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates a channel with the provided unique ID in the specified // region. - rpc CreateChannel(CreateChannelRequest) returns (google.longrunning.Operation) { + rpc CreateChannel(CreateChannelRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/channels" body: "channel" @@ -74,7 +80,8 @@ service LivestreamService { } // Deletes the specified channel. - rpc DeleteChannel(DeleteChannelRequest) returns (google.longrunning.Operation) { + rpc DeleteChannel(DeleteChannelRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/channels/*}" }; @@ -86,7 +93,8 @@ service LivestreamService { } // Updates the specified channel. - rpc UpdateChannel(UpdateChannelRequest) returns (google.longrunning.Operation) { + rpc UpdateChannel(UpdateChannelRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{channel.name=projects/*/locations/*/channels/*}" body: "channel" @@ -263,8 +271,8 @@ message ListChannelsRequest { // The maximum number of items to return. If unspecified, server // will pick an appropriate default. Server may return fewer items than // requested. A caller should only rely on response's - // [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] to - // determine if there are more items left to be queried. + // [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] + // to determine if there are more items left to be queried. int32 page_size = 2; // The next_page_token value returned from a previous List request, if any. @@ -342,14 +350,22 @@ message UpdateChannelRequest { // resource by the update. You can only update the following fields: // // * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + // * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) // * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - // * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + // * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) // * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - // * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - // * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + // * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + // * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + // * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + // * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + // * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) // // The fields specified in the update_mask are relative to the resource, not // the full request. A field will be overwritten if it is in the mask. + // + // If the mask is not present, then each field from the list above is updated + // if the field appears in the request payload. To unset a field, add the + // field to the update mask and remove it from the request payload. google.protobuf.FieldMask update_mask = 1; // Required. The channel resource to be updated. @@ -474,8 +490,8 @@ message ListInputsRequest { // The maximum number of items to return. If unspecified, server // will pick an appropriate default. Server may return fewer items than // requested. A caller should only rely on response's - // [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] to - // determine if there are more items left to be queried. + // [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] + // to determine if there are more items left to be queried. int32 page_size = 2; // The next_page_token value returned from a previous List request, if any. @@ -551,6 +567,10 @@ message UpdateInputRequest { // // The fields specified in the update_mask are relative to the resource, not // the full request. A field will be overwritten if it is in the mask. + // + // If the mask is not present, then each field from the list above is updated + // if the field appears in the request payload. To unset a field, add the + // field to the update mask and remove it from the request payload. google.protobuf.FieldMask update_mask = 1; // Required. The input resource to be updated. @@ -621,8 +641,8 @@ message ListEventsRequest { // The maximum number of items to return. If unspecified, server // will pick an appropriate default. Server may return fewer items than // requested. A caller should only rely on response's - // [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] to - // determine if there are more items left to be queried. + // [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] + // to determine if there are more items left to be queried. int32 page_size = 2; // The next_page_token value returned from a previous List request, if any. @@ -689,17 +709,17 @@ message DeleteEventRequest { } // Response message for Start/Stop Channel long-running operations. -message ChannelOperationResponse { - -} +message ChannelOperationResponse {} // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-video-livestream/protos/protos.d.ts b/packages/google-cloud-video-livestream/protos/protos.d.ts index d7d4cb2d683..21815a78a2d 100644 --- a/packages/google-cloud-video-livestream/protos/protos.d.ts +++ b/packages/google-cloud-video-livestream/protos/protos.d.ts @@ -161,6 +161,9 @@ export namespace google { /** MuxStream segmentSettings */ segmentSettings?: (google.cloud.video.livestream.v1.ISegmentSettings|null); + + /** MuxStream encryptionId */ + encryptionId?: (string|null); } /** Represents a MuxStream. */ @@ -184,6 +187,9 @@ export namespace google { /** MuxStream segmentSettings. */ public segmentSettings?: (google.cloud.video.livestream.v1.ISegmentSettings|null); + /** MuxStream encryptionId. */ + public encryptionId: string; + /** * Creates a new MuxStream instance using the specified properties. * @param [properties] Properties to set @@ -279,6 +285,9 @@ export namespace google { /** Manifest segmentKeepDuration */ segmentKeepDuration?: (google.protobuf.IDuration|null); + + /** Manifest useTimecodeAsTimeline */ + useTimecodeAsTimeline?: (boolean|null); } /** Represents a Manifest. */ @@ -305,6 +314,9 @@ export namespace google { /** Manifest segmentKeepDuration. */ public segmentKeepDuration?: (google.protobuf.IDuration|null); + /** Manifest useTimecodeAsTimeline. */ + public useTimecodeAsTimeline: boolean; + /** * Creates a new Manifest instance using the specified properties. * @param [properties] Properties to set @@ -535,6 +547,9 @@ export namespace google { /** Properties of a PreprocessingConfig. */ interface IPreprocessingConfig { + /** PreprocessingConfig audio */ + audio?: (google.cloud.video.livestream.v1.PreprocessingConfig.IAudio|null); + /** PreprocessingConfig crop */ crop?: (google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null); @@ -551,6 +566,9 @@ export namespace google { */ constructor(properties?: google.cloud.video.livestream.v1.IPreprocessingConfig); + /** PreprocessingConfig audio. */ + public audio?: (google.cloud.video.livestream.v1.PreprocessingConfig.IAudio|null); + /** PreprocessingConfig crop. */ public crop?: (google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null); @@ -637,6 +655,103 @@ export namespace google { namespace PreprocessingConfig { + /** Properties of an Audio. */ + interface IAudio { + + /** Audio lufs */ + lufs?: (number|null); + } + + /** Represents an Audio. */ + class Audio implements IAudio { + + /** + * Constructs a new Audio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.PreprocessingConfig.IAudio); + + /** Audio lufs. */ + public lufs: number; + + /** + * Creates a new Audio instance using the specified properties. + * @param [properties] Properties to set + * @returns Audio instance + */ + public static create(properties?: google.cloud.video.livestream.v1.PreprocessingConfig.IAudio): google.cloud.video.livestream.v1.PreprocessingConfig.Audio; + + /** + * Encodes the specified Audio message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @param message Audio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.PreprocessingConfig.IAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Audio message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @param message Audio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.PreprocessingConfig.IAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Audio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Audio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.PreprocessingConfig.Audio; + + /** + * Decodes an Audio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Audio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.PreprocessingConfig.Audio; + + /** + * Verifies an Audio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Audio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Audio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.PreprocessingConfig.Audio; + + /** + * Creates a plain object from an Audio message. Also converts values to other types if specified. + * @param message Audio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.PreprocessingConfig.Audio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Audio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Audio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Crop. */ interface ICrop { @@ -1304,6 +1419,9 @@ export namespace google { /** AudioMapping outputChannel */ outputChannel?: (number|null); + + /** AudioMapping gainDb */ + gainDb?: (number|null); } /** Represents an AudioMapping. */ @@ -1327,6 +1445,9 @@ export namespace google { /** AudioMapping outputChannel. */ public outputChannel: number; + /** AudioMapping gainDb. */ + public gainDb: number; + /** * Creates a new AudioMapping instance using the specified properties. * @param [properties] Properties to set @@ -1600,6 +1721,128 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TimecodeConfig. */ + interface ITimecodeConfig { + + /** TimecodeConfig source */ + source?: (google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource|keyof typeof google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource|null); + + /** TimecodeConfig utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** TimecodeConfig timeZone */ + timeZone?: (google.type.ITimeZone|null); + } + + /** Represents a TimecodeConfig. */ + class TimecodeConfig implements ITimecodeConfig { + + /** + * Constructs a new TimecodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ITimecodeConfig); + + /** TimecodeConfig source. */ + public source: (google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource|keyof typeof google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource); + + /** TimecodeConfig utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); + + /** TimecodeConfig timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** TimecodeConfig timeOffset. */ + public timeOffset?: ("utcOffset"|"timeZone"); + + /** + * Creates a new TimecodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TimecodeConfig instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ITimecodeConfig): google.cloud.video.livestream.v1.TimecodeConfig; + + /** + * Encodes the specified TimecodeConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.TimecodeConfig.verify|verify} messages. + * @param message TimecodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ITimecodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimecodeConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.TimecodeConfig.verify|verify} messages. + * @param message TimecodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ITimecodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimecodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimecodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.TimecodeConfig; + + /** + * Decodes a TimecodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimecodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.TimecodeConfig; + + /** + * Verifies a TimecodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimecodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimecodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.TimecodeConfig; + + /** + * Creates a plain object from a TimecodeConfig message. Also converts values to other types if specified. + * @param message TimecodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.TimecodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimecodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimecodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TimecodeConfig { + + /** TimecodeSource enum. */ + enum TimecodeSource { + TIMECODE_SOURCE_UNSPECIFIED = 0, + MEDIA_TIMESTAMP = 1, + EMBEDDED_TIMECODE = 2 + } + } + /** Properties of an Input. */ interface IInput { @@ -1910,6 +2153,15 @@ export namespace google { /** Channel logConfig */ logConfig?: (google.cloud.video.livestream.v1.ILogConfig|null); + + /** Channel timecodeConfig */ + timecodeConfig?: (google.cloud.video.livestream.v1.ITimecodeConfig|null); + + /** Channel encryptions */ + encryptions?: (google.cloud.video.livestream.v1.IEncryption[]|null); + + /** Channel inputConfig */ + inputConfig?: (google.cloud.video.livestream.v1.IInputConfig|null); } /** Represents a Channel. */ @@ -1963,6 +2215,15 @@ export namespace google { /** Channel logConfig. */ public logConfig?: (google.cloud.video.livestream.v1.ILogConfig|null); + /** Channel timecodeConfig. */ + public timecodeConfig?: (google.cloud.video.livestream.v1.ITimecodeConfig|null); + + /** Channel encryptions. */ + public encryptions: google.cloud.video.livestream.v1.IEncryption[]; + + /** Channel inputConfig. */ + public inputConfig?: (google.cloud.video.livestream.v1.IInputConfig|null); + /** * Creates a new Channel instance using the specified properties. * @param [properties] Properties to set @@ -2153,6 +2414,113 @@ export namespace google { } } + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig inputSwitchMode */ + inputSwitchMode?: (google.cloud.video.livestream.v1.InputConfig.InputSwitchMode|keyof typeof google.cloud.video.livestream.v1.InputConfig.InputSwitchMode|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IInputConfig); + + /** InputConfig inputSwitchMode. */ + public inputSwitchMode: (google.cloud.video.livestream.v1.InputConfig.InputSwitchMode|keyof typeof google.cloud.video.livestream.v1.InputConfig.InputSwitchMode); + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IInputConfig): google.cloud.video.livestream.v1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InputConfig { + + /** InputSwitchMode enum. */ + enum InputSwitchMode { + INPUT_SWITCH_MODE_UNSPECIFIED = 0, + FAILOVER_PREFER_PRIMARY = 1, + MANUAL = 3 + } + } + /** Properties of a LogConfig. */ interface ILogConfig { @@ -3026,9 +3394,21 @@ export namespace google { /** Event labels */ labels?: ({ [k: string]: string }|null); + /** Event inputSwitch */ + inputSwitch?: (google.cloud.video.livestream.v1.Event.IInputSwitchTask|null); + /** Event adBreak */ adBreak?: (google.cloud.video.livestream.v1.Event.IAdBreakTask|null); + /** Event returnToProgram */ + returnToProgram?: (google.cloud.video.livestream.v1.Event.IReturnToProgramTask|null); + + /** Event mute */ + mute?: (google.cloud.video.livestream.v1.Event.IMuteTask|null); + + /** Event unmute */ + unmute?: (google.cloud.video.livestream.v1.Event.IUnmuteTask|null); + /** Event executeNow */ executeNow?: (boolean|null); @@ -3063,9 +3443,21 @@ export namespace google { /** Event labels. */ public labels: { [k: string]: string }; + /** Event inputSwitch. */ + public inputSwitch?: (google.cloud.video.livestream.v1.Event.IInputSwitchTask|null); + /** Event adBreak. */ public adBreak?: (google.cloud.video.livestream.v1.Event.IAdBreakTask|null); + /** Event returnToProgram. */ + public returnToProgram?: (google.cloud.video.livestream.v1.Event.IReturnToProgramTask|null); + + /** Event mute. */ + public mute?: (google.cloud.video.livestream.v1.Event.IMuteTask|null); + + /** Event unmute. */ + public unmute?: (google.cloud.video.livestream.v1.Event.IUnmuteTask|null); + /** Event executeNow. */ public executeNow: boolean; @@ -3079,7 +3471,7 @@ export namespace google { public error?: (google.rpc.IStatus|null); /** Event task. */ - public task?: "adBreak"; + public task?: ("inputSwitch"|"adBreak"|"returnToProgram"|"mute"|"unmute"); /** * Creates a new Event instance using the specified properties. @@ -3123,151 +3515,1518 @@ export namespace google { */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event; - /** - * Verifies an Event message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an Event message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Event { + + /** Properties of an InputSwitchTask. */ + interface IInputSwitchTask { + + /** InputSwitchTask inputKey */ + inputKey?: (string|null); + } + + /** Represents an InputSwitchTask. */ + class InputSwitchTask implements IInputSwitchTask { + + /** + * Constructs a new InputSwitchTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Event.IInputSwitchTask); + + /** InputSwitchTask inputKey. */ + public inputKey: string; + + /** + * Creates a new InputSwitchTask instance using the specified properties. + * @param [properties] Properties to set + * @returns InputSwitchTask instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Event.IInputSwitchTask): google.cloud.video.livestream.v1.Event.InputSwitchTask; + + /** + * Encodes the specified InputSwitchTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.InputSwitchTask.verify|verify} messages. + * @param message InputSwitchTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Event.IInputSwitchTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputSwitchTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.InputSwitchTask.verify|verify} messages. + * @param message InputSwitchTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Event.IInputSwitchTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputSwitchTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputSwitchTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event.InputSwitchTask; + + /** + * Decodes an InputSwitchTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputSwitchTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event.InputSwitchTask; + + /** + * Verifies an InputSwitchTask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputSwitchTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputSwitchTask + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event.InputSwitchTask; + + /** + * Creates a plain object from an InputSwitchTask message. Also converts values to other types if specified. + * @param message InputSwitchTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event.InputSwitchTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputSwitchTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputSwitchTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdBreakTask. */ + interface IAdBreakTask { + + /** AdBreakTask duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents an AdBreakTask. */ + class AdBreakTask implements IAdBreakTask { + + /** + * Constructs a new AdBreakTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Event.IAdBreakTask); + + /** AdBreakTask duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new AdBreakTask instance using the specified properties. + * @param [properties] Properties to set + * @returns AdBreakTask instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Event.IAdBreakTask): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Encodes the specified AdBreakTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. + * @param message AdBreakTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Event.IAdBreakTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdBreakTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. + * @param message AdBreakTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Event.IAdBreakTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdBreakTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdBreakTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Decodes an AdBreakTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdBreakTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Verifies an AdBreakTask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdBreakTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdBreakTask + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Creates a plain object from an AdBreakTask message. Also converts values to other types if specified. + * @param message AdBreakTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event.AdBreakTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdBreakTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdBreakTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReturnToProgramTask. */ + interface IReturnToProgramTask { + } + + /** Represents a ReturnToProgramTask. */ + class ReturnToProgramTask implements IReturnToProgramTask { + + /** + * Constructs a new ReturnToProgramTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Event.IReturnToProgramTask); + + /** + * Creates a new ReturnToProgramTask instance using the specified properties. + * @param [properties] Properties to set + * @returns ReturnToProgramTask instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Event.IReturnToProgramTask): google.cloud.video.livestream.v1.Event.ReturnToProgramTask; + + /** + * Encodes the specified ReturnToProgramTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.ReturnToProgramTask.verify|verify} messages. + * @param message ReturnToProgramTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Event.IReturnToProgramTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReturnToProgramTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.ReturnToProgramTask.verify|verify} messages. + * @param message ReturnToProgramTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Event.IReturnToProgramTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReturnToProgramTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReturnToProgramTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event.ReturnToProgramTask; + + /** + * Decodes a ReturnToProgramTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReturnToProgramTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event.ReturnToProgramTask; + + /** + * Verifies a ReturnToProgramTask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReturnToProgramTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReturnToProgramTask + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event.ReturnToProgramTask; + + /** + * Creates a plain object from a ReturnToProgramTask message. Also converts values to other types if specified. + * @param message ReturnToProgramTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event.ReturnToProgramTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReturnToProgramTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReturnToProgramTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MuteTask. */ + interface IMuteTask { + + /** MuteTask duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a MuteTask. */ + class MuteTask implements IMuteTask { + + /** + * Constructs a new MuteTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Event.IMuteTask); + + /** MuteTask duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new MuteTask instance using the specified properties. + * @param [properties] Properties to set + * @returns MuteTask instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Event.IMuteTask): google.cloud.video.livestream.v1.Event.MuteTask; + + /** + * Encodes the specified MuteTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.MuteTask.verify|verify} messages. + * @param message MuteTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Event.IMuteTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuteTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.MuteTask.verify|verify} messages. + * @param message MuteTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Event.IMuteTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MuteTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event.MuteTask; + + /** + * Decodes a MuteTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event.MuteTask; + + /** + * Verifies a MuteTask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MuteTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MuteTask + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event.MuteTask; + + /** + * Creates a plain object from a MuteTask message. Also converts values to other types if specified. + * @param message MuteTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event.MuteTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuteTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MuteTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnmuteTask. */ + interface IUnmuteTask { + } + + /** Represents an UnmuteTask. */ + class UnmuteTask implements IUnmuteTask { + + /** + * Constructs a new UnmuteTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Event.IUnmuteTask); + + /** + * Creates a new UnmuteTask instance using the specified properties. + * @param [properties] Properties to set + * @returns UnmuteTask instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Event.IUnmuteTask): google.cloud.video.livestream.v1.Event.UnmuteTask; + + /** + * Encodes the specified UnmuteTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.UnmuteTask.verify|verify} messages. + * @param message UnmuteTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Event.IUnmuteTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnmuteTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.UnmuteTask.verify|verify} messages. + * @param message UnmuteTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Event.IUnmuteTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnmuteTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnmuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event.UnmuteTask; + + /** + * Decodes an UnmuteTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnmuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event.UnmuteTask; + + /** + * Verifies an UnmuteTask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UnmuteTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnmuteTask + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event.UnmuteTask; + + /** + * Creates a plain object from an UnmuteTask message. Also converts values to other types if specified. + * @param message UnmuteTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event.UnmuteTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnmuteTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnmuteTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SCHEDULED = 1, + RUNNING = 2, + SUCCEEDED = 3, + FAILED = 4, + PENDING = 5, + STOPPED = 6 + } + } + + /** Properties of an Encryption. */ + interface IEncryption { + + /** Encryption id */ + id?: (string|null); + + /** Encryption secretManagerKeySource */ + secretManagerKeySource?: (google.cloud.video.livestream.v1.Encryption.ISecretManagerSource|null); + + /** Encryption drmSystems */ + drmSystems?: (google.cloud.video.livestream.v1.Encryption.IDrmSystems|null); + + /** Encryption aes128 */ + aes128?: (google.cloud.video.livestream.v1.Encryption.IAes128Encryption|null); + + /** Encryption sampleAes */ + sampleAes?: (google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption|null); + + /** Encryption mpegCenc */ + mpegCenc?: (google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption|null); + } + + /** Represents an Encryption. */ + class Encryption implements IEncryption { + + /** + * Constructs a new Encryption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IEncryption); + + /** Encryption id. */ + public id: string; + + /** Encryption secretManagerKeySource. */ + public secretManagerKeySource?: (google.cloud.video.livestream.v1.Encryption.ISecretManagerSource|null); + + /** Encryption drmSystems. */ + public drmSystems?: (google.cloud.video.livestream.v1.Encryption.IDrmSystems|null); + + /** Encryption aes128. */ + public aes128?: (google.cloud.video.livestream.v1.Encryption.IAes128Encryption|null); + + /** Encryption sampleAes. */ + public sampleAes?: (google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption|null); + + /** Encryption mpegCenc. */ + public mpegCenc?: (google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption|null); + + /** Encryption secretSource. */ + public secretSource?: "secretManagerKeySource"; + + /** Encryption encryptionMode. */ + public encryptionMode?: ("aes128"|"sampleAes"|"mpegCenc"); + + /** + * Creates a new Encryption instance using the specified properties. + * @param [properties] Properties to set + * @returns Encryption instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IEncryption): google.cloud.video.livestream.v1.Encryption; + + /** + * Encodes the specified Encryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.verify|verify} messages. + * @param message Encryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Encryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.verify|verify} messages. + * @param message Encryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Encryption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption; + + /** + * Decodes an Encryption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption; + + /** + * Verifies an Encryption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Encryption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Encryption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption; + + /** + * Creates a plain object from an Encryption message. Also converts values to other types if specified. + * @param message Encryption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Encryption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Encryption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Encryption { + + /** Properties of a SecretManagerSource. */ + interface ISecretManagerSource { + + /** SecretManagerSource secretVersion */ + secretVersion?: (string|null); + } + + /** Represents a SecretManagerSource. */ + class SecretManagerSource implements ISecretManagerSource { + + /** + * Constructs a new SecretManagerSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.ISecretManagerSource); + + /** SecretManagerSource secretVersion. */ + public secretVersion: string; + + /** + * Creates a new SecretManagerSource instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretManagerSource instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.ISecretManagerSource): google.cloud.video.livestream.v1.Encryption.SecretManagerSource; + + /** + * Encodes the specified SecretManagerSource message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SecretManagerSource.verify|verify} messages. + * @param message SecretManagerSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.ISecretManagerSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretManagerSource message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SecretManagerSource.verify|verify} messages. + * @param message SecretManagerSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.ISecretManagerSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretManagerSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretManagerSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.SecretManagerSource; + + /** + * Decodes a SecretManagerSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretManagerSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.SecretManagerSource; + + /** + * Verifies a SecretManagerSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecretManagerSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretManagerSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.SecretManagerSource; + + /** + * Creates a plain object from a SecretManagerSource message. Also converts values to other types if specified. + * @param message SecretManagerSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.SecretManagerSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretManagerSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretManagerSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Widevine. */ + interface IWidevine { + } + + /** Represents a Widevine. */ + class Widevine implements IWidevine { + + /** + * Constructs a new Widevine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.IWidevine); + + /** + * Creates a new Widevine instance using the specified properties. + * @param [properties] Properties to set + * @returns Widevine instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.IWidevine): google.cloud.video.livestream.v1.Encryption.Widevine; + + /** + * Encodes the specified Widevine message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Widevine.verify|verify} messages. + * @param message Widevine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.IWidevine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Widevine message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Widevine.verify|verify} messages. + * @param message Widevine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.IWidevine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Widevine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Widevine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.Widevine; + + /** + * Decodes a Widevine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Widevine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.Widevine; + + /** + * Verifies a Widevine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Widevine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Widevine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.Widevine; + + /** + * Creates a plain object from a Widevine message. Also converts values to other types if specified. + * @param message Widevine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.Widevine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Widevine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Widevine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fairplay. */ + interface IFairplay { + } + + /** Represents a Fairplay. */ + class Fairplay implements IFairplay { + + /** + * Constructs a new Fairplay. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.IFairplay); + + /** + * Creates a new Fairplay instance using the specified properties. + * @param [properties] Properties to set + * @returns Fairplay instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.IFairplay): google.cloud.video.livestream.v1.Encryption.Fairplay; + + /** + * Encodes the specified Fairplay message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Fairplay.verify|verify} messages. + * @param message Fairplay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.IFairplay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Fairplay message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Fairplay.verify|verify} messages. + * @param message Fairplay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.IFairplay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fairplay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fairplay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.Fairplay; + + /** + * Decodes a Fairplay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fairplay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.Fairplay; + + /** + * Verifies a Fairplay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Fairplay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fairplay + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.Fairplay; + + /** + * Creates a plain object from a Fairplay message. Also converts values to other types if specified. + * @param message Fairplay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.Fairplay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Fairplay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Fairplay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Playready. */ + interface IPlayready { + } + + /** Represents a Playready. */ + class Playready implements IPlayready { + + /** + * Constructs a new Playready. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.IPlayready); + + /** + * Creates a new Playready instance using the specified properties. + * @param [properties] Properties to set + * @returns Playready instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.IPlayready): google.cloud.video.livestream.v1.Encryption.Playready; + + /** + * Encodes the specified Playready message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Playready.verify|verify} messages. + * @param message Playready message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.IPlayready, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Playready message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Playready.verify|verify} messages. + * @param message Playready message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.IPlayready, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Playready message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Playready + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.Playready; + + /** + * Decodes a Playready message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Playready + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.Playready; + + /** + * Verifies a Playready message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Playready message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Playready + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.Playready; + + /** + * Creates a plain object from a Playready message. Also converts values to other types if specified. + * @param message Playready + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.Playready, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Playready to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Playready + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Clearkey. */ + interface IClearkey { + } + + /** Represents a Clearkey. */ + class Clearkey implements IClearkey { + + /** + * Constructs a new Clearkey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.IClearkey); + + /** + * Creates a new Clearkey instance using the specified properties. + * @param [properties] Properties to set + * @returns Clearkey instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.IClearkey): google.cloud.video.livestream.v1.Encryption.Clearkey; + + /** + * Encodes the specified Clearkey message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Clearkey.verify|verify} messages. + * @param message Clearkey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.IClearkey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Clearkey message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Clearkey.verify|verify} messages. + * @param message Clearkey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.IClearkey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Clearkey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Clearkey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.Clearkey; + + /** + * Decodes a Clearkey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Clearkey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.Clearkey; + + /** + * Verifies a Clearkey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Clearkey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Clearkey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.Clearkey; + + /** + * Creates a plain object from a Clearkey message. Also converts values to other types if specified. + * @param message Clearkey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.Clearkey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Clearkey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Clearkey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DrmSystems. */ + interface IDrmSystems { + + /** DrmSystems widevine */ + widevine?: (google.cloud.video.livestream.v1.Encryption.IWidevine|null); + + /** DrmSystems fairplay */ + fairplay?: (google.cloud.video.livestream.v1.Encryption.IFairplay|null); + + /** DrmSystems playready */ + playready?: (google.cloud.video.livestream.v1.Encryption.IPlayready|null); + + /** DrmSystems clearkey */ + clearkey?: (google.cloud.video.livestream.v1.Encryption.IClearkey|null); + } + + /** Represents a DrmSystems. */ + class DrmSystems implements IDrmSystems { + + /** + * Constructs a new DrmSystems. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.IDrmSystems); + + /** DrmSystems widevine. */ + public widevine?: (google.cloud.video.livestream.v1.Encryption.IWidevine|null); + + /** DrmSystems fairplay. */ + public fairplay?: (google.cloud.video.livestream.v1.Encryption.IFairplay|null); + + /** DrmSystems playready. */ + public playready?: (google.cloud.video.livestream.v1.Encryption.IPlayready|null); + + /** DrmSystems clearkey. */ + public clearkey?: (google.cloud.video.livestream.v1.Encryption.IClearkey|null); + + /** + * Creates a new DrmSystems instance using the specified properties. + * @param [properties] Properties to set + * @returns DrmSystems instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.IDrmSystems): google.cloud.video.livestream.v1.Encryption.DrmSystems; + + /** + * Encodes the specified DrmSystems message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.DrmSystems.verify|verify} messages. + * @param message DrmSystems message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.IDrmSystems, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DrmSystems message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.DrmSystems.verify|verify} messages. + * @param message DrmSystems message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.IDrmSystems, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DrmSystems message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DrmSystems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.DrmSystems; + + /** + * Decodes a DrmSystems message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DrmSystems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.DrmSystems; + + /** + * Verifies a DrmSystems message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DrmSystems message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DrmSystems + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.DrmSystems; + + /** + * Creates a plain object from a DrmSystems message. Also converts values to other types if specified. + * @param message DrmSystems + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.DrmSystems, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DrmSystems to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DrmSystems + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Aes128Encryption. */ + interface IAes128Encryption { + } + + /** Represents an Aes128Encryption. */ + class Aes128Encryption implements IAes128Encryption { + + /** + * Constructs a new Aes128Encryption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.IAes128Encryption); + + /** + * Creates a new Aes128Encryption instance using the specified properties. + * @param [properties] Properties to set + * @returns Aes128Encryption instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.IAes128Encryption): google.cloud.video.livestream.v1.Encryption.Aes128Encryption; + + /** + * Encodes the specified Aes128Encryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Aes128Encryption.verify|verify} messages. + * @param message Aes128Encryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.IAes128Encryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aes128Encryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Aes128Encryption.verify|verify} messages. + * @param message Aes128Encryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.IAes128Encryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aes128Encryption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aes128Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.Aes128Encryption; + + /** + * Decodes an Aes128Encryption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aes128Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.Aes128Encryption; + + /** + * Verifies an Aes128Encryption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Aes128Encryption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aes128Encryption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.Aes128Encryption; + + /** + * Creates a plain object from an Aes128Encryption message. Also converts values to other types if specified. + * @param message Aes128Encryption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.Aes128Encryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Aes128Encryption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Aes128Encryption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SampleAesEncryption. */ + interface ISampleAesEncryption { + } + + /** Represents a SampleAesEncryption. */ + class SampleAesEncryption implements ISampleAesEncryption { + + /** + * Constructs a new SampleAesEncryption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption); + + /** + * Creates a new SampleAesEncryption instance using the specified properties. + * @param [properties] Properties to set + * @returns SampleAesEncryption instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption): google.cloud.video.livestream.v1.Encryption.SampleAesEncryption; + + /** + * Encodes the specified SampleAesEncryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.verify|verify} messages. + * @param message SampleAesEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SampleAesEncryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.verify|verify} messages. + * @param message SampleAesEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SampleAesEncryption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SampleAesEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.SampleAesEncryption; + + /** + * Decodes a SampleAesEncryption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SampleAesEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.SampleAesEncryption; - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Event - */ - public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event; + /** + * Verifies a SampleAesEncryption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @param message Event - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.video.livestream.v1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a SampleAesEncryption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SampleAesEncryption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.SampleAesEncryption; - /** - * Converts this Event to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a SampleAesEncryption message. Also converts values to other types if specified. + * @param message SampleAesEncryption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Encryption.SampleAesEncryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for Event - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this SampleAesEncryption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - namespace Event { + /** + * Gets the default type url for SampleAesEncryption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Properties of an AdBreakTask. */ - interface IAdBreakTask { + /** Properties of a MpegCommonEncryption. */ + interface IMpegCommonEncryption { - /** AdBreakTask duration */ - duration?: (google.protobuf.IDuration|null); + /** MpegCommonEncryption scheme */ + scheme?: (string|null); } - /** Represents an AdBreakTask. */ - class AdBreakTask implements IAdBreakTask { + /** Represents a MpegCommonEncryption. */ + class MpegCommonEncryption implements IMpegCommonEncryption { /** - * Constructs a new AdBreakTask. + * Constructs a new MpegCommonEncryption. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.video.livestream.v1.Event.IAdBreakTask); + constructor(properties?: google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption); - /** AdBreakTask duration. */ - public duration?: (google.protobuf.IDuration|null); + /** MpegCommonEncryption scheme. */ + public scheme: string; /** - * Creates a new AdBreakTask instance using the specified properties. + * Creates a new MpegCommonEncryption instance using the specified properties. * @param [properties] Properties to set - * @returns AdBreakTask instance + * @returns MpegCommonEncryption instance */ - public static create(properties?: google.cloud.video.livestream.v1.Event.IAdBreakTask): google.cloud.video.livestream.v1.Event.AdBreakTask; + public static create(properties?: google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption): google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption; /** - * Encodes the specified AdBreakTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. - * @param message AdBreakTask message or plain object to encode + * Encodes the specified MpegCommonEncryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.verify|verify} messages. + * @param message MpegCommonEncryption message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.video.livestream.v1.Event.IAdBreakTask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AdBreakTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. - * @param message AdBreakTask message or plain object to encode + * Encodes the specified MpegCommonEncryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.verify|verify} messages. + * @param message MpegCommonEncryption message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.video.livestream.v1.Event.IAdBreakTask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AdBreakTask message from the specified reader or buffer. + * Decodes a MpegCommonEncryption message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AdBreakTask + * @returns MpegCommonEncryption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event.AdBreakTask; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption; /** - * Decodes an AdBreakTask message from the specified reader or buffer, length delimited. + * Decodes a MpegCommonEncryption message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AdBreakTask + * @returns MpegCommonEncryption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event.AdBreakTask; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption; /** - * Verifies an AdBreakTask message. + * Verifies a MpegCommonEncryption message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AdBreakTask message from a plain object. Also converts values to their respective internal types. + * Creates a MpegCommonEncryption message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AdBreakTask + * @returns MpegCommonEncryption */ - public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event.AdBreakTask; + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption; /** - * Creates a plain object from an AdBreakTask message. Also converts values to other types if specified. - * @param message AdBreakTask + * Creates a plain object from a MpegCommonEncryption message. Also converts values to other types if specified. + * @param message MpegCommonEncryption * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.video.livestream.v1.Event.AdBreakTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AdBreakTask to JSON. + * Converts this MpegCommonEncryption to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AdBreakTask + * Gets the default type url for MpegCommonEncryption * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - SCHEDULED = 1, - RUNNING = 2, - SUCCEEDED = 3, - FAILED = 4, - PENDING = 5, - STOPPED = 6 - } } /** Represents a LivestreamService */ @@ -10392,6 +12151,261 @@ export namespace google { } } + /** Namespace type. */ + namespace type { + + /** Properties of a DateTime. */ + interface IDateTime { + + /** DateTime year */ + year?: (number|null); + + /** DateTime month */ + month?: (number|null); + + /** DateTime day */ + day?: (number|null); + + /** DateTime hours */ + hours?: (number|null); + + /** DateTime minutes */ + minutes?: (number|null); + + /** DateTime seconds */ + seconds?: (number|null); + + /** DateTime nanos */ + nanos?: (number|null); + + /** DateTime utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone */ + timeZone?: (google.type.ITimeZone|null); + } + + /** Represents a DateTime. */ + class DateTime implements IDateTime { + + /** + * Constructs a new DateTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDateTime); + + /** DateTime year. */ + public year: number; + + /** DateTime month. */ + public month: number; + + /** DateTime day. */ + public day: number; + + /** DateTime hours. */ + public hours: number; + + /** DateTime minutes. */ + public minutes: number; + + /** DateTime seconds. */ + public seconds: number; + + /** DateTime nanos. */ + public nanos: number; + + /** DateTime utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** DateTime timeOffset. */ + public timeOffset?: ("utcOffset"|"timeZone"); + + /** + * Creates a new DateTime instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTime instance + */ + public static create(properties?: google.type.IDateTime): google.type.DateTime; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.DateTime; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.DateTime; + + /** + * Verifies a DateTime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTime + */ + public static fromObject(object: { [k: string]: any }): google.type.DateTime; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @param message DateTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeZone. */ + interface ITimeZone { + + /** TimeZone id */ + id?: (string|null); + + /** TimeZone version */ + version?: (string|null); + } + + /** Represents a TimeZone. */ + class TimeZone implements ITimeZone { + + /** + * Constructs a new TimeZone. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeZone); + + /** TimeZone id. */ + public id: string; + + /** TimeZone version. */ + public version: string; + + /** + * Creates a new TimeZone instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZone instance + */ + public static create(properties?: google.type.ITimeZone): google.type.TimeZone; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeZone; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeZone; + + /** + * Verifies a TimeZone message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZone + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeZone; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @param message TimeZone + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZone + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace rpc. */ namespace rpc { diff --git a/packages/google-cloud-video-livestream/protos/protos.js b/packages/google-cloud-video-livestream/protos/protos.js index 2b291c1460a..dcb01cbdfbf 100644 --- a/packages/google-cloud-video-livestream/protos/protos.js +++ b/packages/google-cloud-video-livestream/protos/protos.js @@ -406,6 +406,7 @@ * @property {string|null} [container] MuxStream container * @property {Array.|null} [elementaryStreams] MuxStream elementaryStreams * @property {google.cloud.video.livestream.v1.ISegmentSettings|null} [segmentSettings] MuxStream segmentSettings + * @property {string|null} [encryptionId] MuxStream encryptionId */ /** @@ -456,6 +457,14 @@ */ MuxStream.prototype.segmentSettings = null; + /** + * MuxStream encryptionId. + * @member {string} encryptionId + * @memberof google.cloud.video.livestream.v1.MuxStream + * @instance + */ + MuxStream.prototype.encryptionId = ""; + /** * Creates a new MuxStream instance using the specified properties. * @function create @@ -489,6 +498,8 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.elementaryStreams[i]); if (message.segmentSettings != null && Object.hasOwnProperty.call(message, "segmentSettings")) $root.google.cloud.video.livestream.v1.SegmentSettings.encode(message.segmentSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.encryptionId != null && Object.hasOwnProperty.call(message, "encryptionId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.encryptionId); return writer; }; @@ -541,6 +552,10 @@ message.segmentSettings = $root.google.cloud.video.livestream.v1.SegmentSettings.decode(reader, reader.uint32()); break; } + case 6: { + message.encryptionId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -594,6 +609,9 @@ if (error) return "segmentSettings." + error; } + if (message.encryptionId != null && message.hasOwnProperty("encryptionId")) + if (!$util.isString(message.encryptionId)) + return "encryptionId: string expected"; return null; }; @@ -625,6 +643,8 @@ throw TypeError(".google.cloud.video.livestream.v1.MuxStream.segmentSettings: object expected"); message.segmentSettings = $root.google.cloud.video.livestream.v1.SegmentSettings.fromObject(object.segmentSettings); } + if (object.encryptionId != null) + message.encryptionId = String(object.encryptionId); return message; }; @@ -647,6 +667,7 @@ object.key = ""; object.container = ""; object.segmentSettings = null; + object.encryptionId = ""; } if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; @@ -659,6 +680,8 @@ } if (message.segmentSettings != null && message.hasOwnProperty("segmentSettings")) object.segmentSettings = $root.google.cloud.video.livestream.v1.SegmentSettings.toObject(message.segmentSettings, options); + if (message.encryptionId != null && message.hasOwnProperty("encryptionId")) + object.encryptionId = message.encryptionId; return object; }; @@ -702,6 +725,7 @@ * @property {Array.|null} [muxStreams] Manifest muxStreams * @property {number|null} [maxSegmentCount] Manifest maxSegmentCount * @property {google.protobuf.IDuration|null} [segmentKeepDuration] Manifest segmentKeepDuration + * @property {boolean|null} [useTimecodeAsTimeline] Manifest useTimecodeAsTimeline */ /** @@ -760,6 +784,14 @@ */ Manifest.prototype.segmentKeepDuration = null; + /** + * Manifest useTimecodeAsTimeline. + * @member {boolean} useTimecodeAsTimeline + * @memberof google.cloud.video.livestream.v1.Manifest + * @instance + */ + Manifest.prototype.useTimecodeAsTimeline = false; + /** * Creates a new Manifest instance using the specified properties. * @function create @@ -795,6 +827,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxSegmentCount); if (message.segmentKeepDuration != null && Object.hasOwnProperty.call(message, "segmentKeepDuration")) $root.google.protobuf.Duration.encode(message.segmentKeepDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.useTimecodeAsTimeline != null && Object.hasOwnProperty.call(message, "useTimecodeAsTimeline")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useTimecodeAsTimeline); return writer; }; @@ -851,6 +885,10 @@ message.segmentKeepDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } + case 6: { + message.useTimecodeAsTimeline = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -913,6 +951,9 @@ if (error) return "segmentKeepDuration." + error; } + if (message.useTimecodeAsTimeline != null && message.hasOwnProperty("useTimecodeAsTimeline")) + if (typeof message.useTimecodeAsTimeline !== "boolean") + return "useTimecodeAsTimeline: boolean expected"; return null; }; @@ -964,6 +1005,8 @@ throw TypeError(".google.cloud.video.livestream.v1.Manifest.segmentKeepDuration: object expected"); message.segmentKeepDuration = $root.google.protobuf.Duration.fromObject(object.segmentKeepDuration); } + if (object.useTimecodeAsTimeline != null) + message.useTimecodeAsTimeline = Boolean(object.useTimecodeAsTimeline); return message; }; @@ -987,6 +1030,7 @@ object.type = options.enums === String ? "MANIFEST_TYPE_UNSPECIFIED" : 0; object.maxSegmentCount = 0; object.segmentKeepDuration = null; + object.useTimecodeAsTimeline = false; } if (message.fileName != null && message.hasOwnProperty("fileName")) object.fileName = message.fileName; @@ -1001,6 +1045,8 @@ object.maxSegmentCount = message.maxSegmentCount; if (message.segmentKeepDuration != null && message.hasOwnProperty("segmentKeepDuration")) object.segmentKeepDuration = $root.google.protobuf.Duration.toObject(message.segmentKeepDuration, options); + if (message.useTimecodeAsTimeline != null && message.hasOwnProperty("useTimecodeAsTimeline")) + object.useTimecodeAsTimeline = message.useTimecodeAsTimeline; return object; }; @@ -1425,6 +1471,7 @@ * Properties of a PreprocessingConfig. * @memberof google.cloud.video.livestream.v1 * @interface IPreprocessingConfig + * @property {google.cloud.video.livestream.v1.PreprocessingConfig.IAudio|null} [audio] PreprocessingConfig audio * @property {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null} [crop] PreprocessingConfig crop * @property {google.cloud.video.livestream.v1.PreprocessingConfig.IPad|null} [pad] PreprocessingConfig pad */ @@ -1444,6 +1491,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * PreprocessingConfig audio. + * @member {google.cloud.video.livestream.v1.PreprocessingConfig.IAudio|null|undefined} audio + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.audio = null; + /** * PreprocessingConfig crop. * @member {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null|undefined} crop @@ -1484,6 +1539,8 @@ PreprocessingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio.encode(message.audio, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.crop != null && Object.hasOwnProperty.call(message, "crop")) $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.encode(message.crop, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.pad != null && Object.hasOwnProperty.call(message, "pad")) @@ -1522,6 +1579,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.audio = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio.decode(reader, reader.uint32()); + break; + } case 2: { message.crop = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.decode(reader, reader.uint32()); break; @@ -1565,6 +1626,11 @@ PreprocessingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio.verify(message.audio); + if (error) + return "audio." + error; + } if (message.crop != null && message.hasOwnProperty("crop")) { var error = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.verify(message.crop); if (error) @@ -1590,6 +1656,11 @@ if (object instanceof $root.google.cloud.video.livestream.v1.PreprocessingConfig) return object; var message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig(); + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.video.livestream.v1.PreprocessingConfig.audio: object expected"); + message.audio = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio.fromObject(object.audio); + } if (object.crop != null) { if (typeof object.crop !== "object") throw TypeError(".google.cloud.video.livestream.v1.PreprocessingConfig.crop: object expected"); @@ -1617,9 +1688,12 @@ options = {}; var object = {}; if (options.defaults) { + object.audio = null; object.crop = null; object.pad = null; } + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio.toObject(message.audio, options); if (message.crop != null && message.hasOwnProperty("crop")) object.crop = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.toObject(message.crop, options); if (message.pad != null && message.hasOwnProperty("pad")) @@ -1653,6 +1727,209 @@ return typeUrlPrefix + "/google.cloud.video.livestream.v1.PreprocessingConfig"; }; + PreprocessingConfig.Audio = (function() { + + /** + * Properties of an Audio. + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @interface IAudio + * @property {number|null} [lufs] Audio lufs + */ + + /** + * Constructs a new Audio. + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @classdesc Represents an Audio. + * @implements IAudio + * @constructor + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IAudio=} [properties] Properties to set + */ + function Audio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Audio lufs. + * @member {number} lufs + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @instance + */ + Audio.prototype.lufs = 0; + + /** + * Creates a new Audio instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IAudio=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Audio} Audio instance + */ + Audio.create = function create(properties) { + return new Audio(properties); + }; + + /** + * Encodes the specified Audio message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IAudio} message Audio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Audio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lufs != null && Object.hasOwnProperty.call(message, "lufs")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.lufs); + return writer; + }; + + /** + * Encodes the specified Audio message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IAudio} message Audio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Audio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Audio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Audio} Audio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Audio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lufs = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Audio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Audio} Audio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Audio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Audio message. + * @function verify + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Audio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lufs != null && message.hasOwnProperty("lufs")) + if (typeof message.lufs !== "number") + return "lufs: number expected"; + return null; + }; + + /** + * Creates an Audio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Audio} Audio + */ + Audio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio) + return object; + var message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig.Audio(); + if (object.lufs != null) + message.lufs = Number(object.lufs); + return message; + }; + + /** + * Creates a plain object from an Audio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.Audio} message Audio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Audio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.lufs = 0; + if (message.lufs != null && message.hasOwnProperty("lufs")) + object.lufs = options.json && !isFinite(message.lufs) ? String(message.lufs) : message.lufs; + return object; + }; + + /** + * Converts this Audio to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @instance + * @returns {Object.} JSON object + */ + Audio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Audio + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Audio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Audio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.PreprocessingConfig.Audio"; + }; + + return Audio; + })(); + PreprocessingConfig.Crop = (function() { /** @@ -3374,6 +3651,7 @@ * @property {number|null} [inputTrack] AudioMapping inputTrack * @property {number|null} [inputChannel] AudioMapping inputChannel * @property {number|null} [outputChannel] AudioMapping outputChannel + * @property {number|null} [gainDb] AudioMapping gainDb */ /** @@ -3423,6 +3701,14 @@ */ AudioMapping.prototype.outputChannel = 0; + /** + * AudioMapping gainDb. + * @member {number} gainDb + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.gainDb = 0; + /** * Creates a new AudioMapping instance using the specified properties. * @function create @@ -3453,6 +3739,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.inputChannel); if (message.outputChannel != null && Object.hasOwnProperty.call(message, "outputChannel")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outputChannel); + if (message.gainDb != null && Object.hasOwnProperty.call(message, "gainDb")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.gainDb); if (message.inputKey != null && Object.hasOwnProperty.call(message, "inputKey")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.inputKey); return writer; @@ -3505,6 +3793,10 @@ message.outputChannel = reader.int32(); break; } + case 5: { + message.gainDb = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -3552,6 +3844,9 @@ if (message.outputChannel != null && message.hasOwnProperty("outputChannel")) if (!$util.isInteger(message.outputChannel)) return "outputChannel: integer expected"; + if (message.gainDb != null && message.hasOwnProperty("gainDb")) + if (typeof message.gainDb !== "number") + return "gainDb: number expected"; return null; }; @@ -3575,6 +3870,8 @@ message.inputChannel = object.inputChannel | 0; if (object.outputChannel != null) message.outputChannel = object.outputChannel | 0; + if (object.gainDb != null) + message.gainDb = Number(object.gainDb); return message; }; @@ -3595,6 +3892,7 @@ object.inputTrack = 0; object.inputChannel = 0; object.outputChannel = 0; + object.gainDb = 0; object.inputKey = ""; } if (message.inputTrack != null && message.hasOwnProperty("inputTrack")) @@ -3603,6 +3901,8 @@ object.inputChannel = message.inputChannel; if (message.outputChannel != null && message.hasOwnProperty("outputChannel")) object.outputChannel = message.outputChannel; + if (message.gainDb != null && message.hasOwnProperty("gainDb")) + object.gainDb = options.json && !isFinite(message.gainDb) ? String(message.gainDb) : message.gainDb; if (message.inputKey != null && message.hasOwnProperty("inputKey")) object.inputKey = message.inputKey; return object; @@ -4051,34 +4351,26 @@ return SegmentSettings; })(); - v1.Input = (function() { + v1.TimecodeConfig = (function() { /** - * Properties of an Input. + * Properties of a TimecodeConfig. * @memberof google.cloud.video.livestream.v1 - * @interface IInput - * @property {string|null} [name] Input name - * @property {google.protobuf.ITimestamp|null} [createTime] Input createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Input updateTime - * @property {Object.|null} [labels] Input labels - * @property {google.cloud.video.livestream.v1.Input.Type|null} [type] Input type - * @property {google.cloud.video.livestream.v1.Input.Tier|null} [tier] Input tier - * @property {string|null} [uri] Input uri - * @property {google.cloud.video.livestream.v1.IPreprocessingConfig|null} [preprocessingConfig] Input preprocessingConfig - * @property {google.cloud.video.livestream.v1.Input.ISecurityRule|null} [securityRules] Input securityRules - * @property {google.cloud.video.livestream.v1.IInputStreamProperty|null} [inputStreamProperty] Input inputStreamProperty + * @interface ITimecodeConfig + * @property {google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource|null} [source] TimecodeConfig source + * @property {google.protobuf.IDuration|null} [utcOffset] TimecodeConfig utcOffset + * @property {google.type.ITimeZone|null} [timeZone] TimecodeConfig timeZone */ /** - * Constructs a new Input. + * Constructs a new TimecodeConfig. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents an Input. - * @implements IInput + * @classdesc Represents a TimecodeConfig. + * @implements ITimecodeConfig * @constructor - * @param {google.cloud.video.livestream.v1.IInput=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.ITimecodeConfig=} [properties] Properties to set */ - function Input(properties) { - this.labels = {}; + function TimecodeConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4086,79 +4378,413 @@ } /** - * Input name. - * @member {string} name - * @memberof google.cloud.video.livestream.v1.Input - * @instance - */ - Input.prototype.name = ""; - - /** - * Input createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.video.livestream.v1.Input + * TimecodeConfig source. + * @member {google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource} source + * @memberof google.cloud.video.livestream.v1.TimecodeConfig * @instance */ - Input.prototype.createTime = null; + TimecodeConfig.prototype.source = 0; /** - * Input updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.video.livestream.v1.Input + * TimecodeConfig utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.cloud.video.livestream.v1.TimecodeConfig * @instance */ - Input.prototype.updateTime = null; + TimecodeConfig.prototype.utcOffset = null; /** - * Input labels. - * @member {Object.} labels - * @memberof google.cloud.video.livestream.v1.Input + * TimecodeConfig timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.cloud.video.livestream.v1.TimecodeConfig * @instance */ - Input.prototype.labels = $util.emptyObject; + TimecodeConfig.prototype.timeZone = null; - /** - * Input type. - * @member {google.cloud.video.livestream.v1.Input.Type} type - * @memberof google.cloud.video.livestream.v1.Input - * @instance - */ - Input.prototype.type = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Input tier. - * @member {google.cloud.video.livestream.v1.Input.Tier} tier - * @memberof google.cloud.video.livestream.v1.Input + * TimecodeConfig timeOffset. + * @member {"utcOffset"|"timeZone"|undefined} timeOffset + * @memberof google.cloud.video.livestream.v1.TimecodeConfig * @instance */ - Input.prototype.tier = 0; + Object.defineProperty(TimecodeConfig.prototype, "timeOffset", { + get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Input uri. - * @member {string} uri - * @memberof google.cloud.video.livestream.v1.Input - * @instance + * Creates a new TimecodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {google.cloud.video.livestream.v1.ITimecodeConfig=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.TimecodeConfig} TimecodeConfig instance */ - Input.prototype.uri = ""; + TimecodeConfig.create = function create(properties) { + return new TimecodeConfig(properties); + }; /** - * Input preprocessingConfig. - * @member {google.cloud.video.livestream.v1.IPreprocessingConfig|null|undefined} preprocessingConfig - * @memberof google.cloud.video.livestream.v1.Input - * @instance + * Encodes the specified TimecodeConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.TimecodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {google.cloud.video.livestream.v1.ITimecodeConfig} message TimecodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Input.prototype.preprocessingConfig = null; + TimecodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.source); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Input securityRules. - * @member {google.cloud.video.livestream.v1.Input.ISecurityRule|null|undefined} securityRules - * @memberof google.cloud.video.livestream.v1.Input - * @instance + * Encodes the specified TimecodeConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.TimecodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {google.cloud.video.livestream.v1.ITimecodeConfig} message TimecodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Input.prototype.securityRules = null; + TimecodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Input inputStreamProperty. + * Decodes a TimecodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.TimecodeConfig} TimecodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimecodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.TimecodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = reader.int32(); + break; + } + case 2: { + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimecodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.TimecodeConfig} TimecodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimecodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimecodeConfig message. + * @function verify + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimecodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + properties.timeOffset = 1; + { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); + if (error) + return "utcOffset." + error; + } + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + if (properties.timeOffset === 1) + return "timeOffset: multiple values"; + properties.timeOffset = 1; + { + var error = $root.google.type.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + } + return null; + }; + + /** + * Creates a TimecodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.TimecodeConfig} TimecodeConfig + */ + TimecodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.TimecodeConfig) + return object; + var message = new $root.google.cloud.video.livestream.v1.TimecodeConfig(); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "TIMECODE_SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "MEDIA_TIMESTAMP": + case 1: + message.source = 1; + break; + case "EMBEDDED_TIMECODE": + case 2: + message.source = 2; + break; + } + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.cloud.video.livestream.v1.TimecodeConfig.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); + } + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.cloud.video.livestream.v1.TimecodeConfig.timeZone: object expected"); + message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); + } + return message; + }; + + /** + * Creates a plain object from a TimecodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {google.cloud.video.livestream.v1.TimecodeConfig} message TimecodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimecodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.source = options.enums === String ? "TIMECODE_SOURCE_UNSPECIFIED" : 0; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource[message.source] === undefined ? message.source : $root.google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource[message.source] : message.source; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (options.oneofs) + object.timeOffset = "utcOffset"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (options.oneofs) + object.timeOffset = "timeZone"; + } + return object; + }; + + /** + * Converts this TimecodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @instance + * @returns {Object.} JSON object + */ + TimecodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimecodeConfig + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.TimecodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimecodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.TimecodeConfig"; + }; + + /** + * TimecodeSource enum. + * @name google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource + * @enum {number} + * @property {number} TIMECODE_SOURCE_UNSPECIFIED=0 TIMECODE_SOURCE_UNSPECIFIED value + * @property {number} MEDIA_TIMESTAMP=1 MEDIA_TIMESTAMP value + * @property {number} EMBEDDED_TIMECODE=2 EMBEDDED_TIMECODE value + */ + TimecodeConfig.TimecodeSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIMECODE_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEDIA_TIMESTAMP"] = 1; + values[valuesById[2] = "EMBEDDED_TIMECODE"] = 2; + return values; + })(); + + return TimecodeConfig; + })(); + + v1.Input = (function() { + + /** + * Properties of an Input. + * @memberof google.cloud.video.livestream.v1 + * @interface IInput + * @property {string|null} [name] Input name + * @property {google.protobuf.ITimestamp|null} [createTime] Input createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Input updateTime + * @property {Object.|null} [labels] Input labels + * @property {google.cloud.video.livestream.v1.Input.Type|null} [type] Input type + * @property {google.cloud.video.livestream.v1.Input.Tier|null} [tier] Input tier + * @property {string|null} [uri] Input uri + * @property {google.cloud.video.livestream.v1.IPreprocessingConfig|null} [preprocessingConfig] Input preprocessingConfig + * @property {google.cloud.video.livestream.v1.Input.ISecurityRule|null} [securityRules] Input securityRules + * @property {google.cloud.video.livestream.v1.IInputStreamProperty|null} [inputStreamProperty] Input inputStreamProperty + */ + + /** + * Constructs a new Input. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an Input. + * @implements IInput + * @constructor + * @param {google.cloud.video.livestream.v1.IInput=} [properties] Properties to set + */ + function Input(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Input name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.name = ""; + + /** + * Input createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.createTime = null; + + /** + * Input updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.updateTime = null; + + /** + * Input labels. + * @member {Object.} labels + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.labels = $util.emptyObject; + + /** + * Input type. + * @member {google.cloud.video.livestream.v1.Input.Type} type + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.type = 0; + + /** + * Input tier. + * @member {google.cloud.video.livestream.v1.Input.Tier} tier + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.tier = 0; + + /** + * Input uri. + * @member {string} uri + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.uri = ""; + + /** + * Input preprocessingConfig. + * @member {google.cloud.video.livestream.v1.IPreprocessingConfig|null|undefined} preprocessingConfig + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.preprocessingConfig = null; + + /** + * Input securityRules. + * @member {google.cloud.video.livestream.v1.Input.ISecurityRule|null|undefined} securityRules + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.securityRules = null; + + /** + * Input inputStreamProperty. * @member {google.cloud.video.livestream.v1.IInputStreamProperty|null|undefined} inputStreamProperty * @memberof google.cloud.video.livestream.v1.Input * @instance @@ -4849,6 +5475,9 @@ * @property {google.cloud.video.livestream.v1.Channel.StreamingState|null} [streamingState] Channel streamingState * @property {google.rpc.IStatus|null} [streamingError] Channel streamingError * @property {google.cloud.video.livestream.v1.ILogConfig|null} [logConfig] Channel logConfig + * @property {google.cloud.video.livestream.v1.ITimecodeConfig|null} [timecodeConfig] Channel timecodeConfig + * @property {Array.|null} [encryptions] Channel encryptions + * @property {google.cloud.video.livestream.v1.IInputConfig|null} [inputConfig] Channel inputConfig */ /** @@ -4866,6 +5495,7 @@ this.muxStreams = []; this.manifests = []; this.spriteSheets = []; + this.encryptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4985,24 +5615,48 @@ Channel.prototype.logConfig = null; /** - * Creates a new Channel instance using the specified properties. - * @function create + * Channel timecodeConfig. + * @member {google.cloud.video.livestream.v1.ITimecodeConfig|null|undefined} timecodeConfig * @memberof google.cloud.video.livestream.v1.Channel - * @static - * @param {google.cloud.video.livestream.v1.IChannel=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.Channel} Channel instance + * @instance */ - Channel.create = function create(properties) { - return new Channel(properties); - }; + Channel.prototype.timecodeConfig = null; /** - * Encodes the specified Channel message. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.verify|verify} messages. - * @function encode + * Channel encryptions. + * @member {Array.} encryptions * @memberof google.cloud.video.livestream.v1.Channel - * @static - * @param {google.cloud.video.livestream.v1.IChannel} message Channel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to + * @instance + */ + Channel.prototype.encryptions = $util.emptyArray; + + /** + * Channel inputConfig. + * @member {google.cloud.video.livestream.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.inputConfig = null; + + /** + * Creates a new Channel instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {google.cloud.video.livestream.v1.IChannel=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Channel} Channel instance + */ + Channel.create = function create(properties) { + return new Channel(properties); + }; + + /** + * Encodes the specified Channel message. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {google.cloud.video.livestream.v1.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Channel.encode = function encode(message, writer) { @@ -5042,6 +5696,13 @@ $root.google.rpc.Status.encode(message.streamingError, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); if (message.logConfig != null && Object.hasOwnProperty.call(message, "logConfig")) $root.google.cloud.video.livestream.v1.LogConfig.encode(message.logConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.timecodeConfig != null && Object.hasOwnProperty.call(message, "timecodeConfig")) + $root.google.cloud.video.livestream.v1.TimecodeConfig.encode(message.timecodeConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.encryptions != null && message.encryptions.length) + for (var i = 0; i < message.encryptions.length; ++i) + $root.google.cloud.video.livestream.v1.Encryption.encode(message.encryptions[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.video.livestream.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); return writer; }; @@ -5161,6 +5822,20 @@ message.logConfig = $root.google.cloud.video.livestream.v1.LogConfig.decode(reader, reader.uint32()); break; } + case 21: { + message.timecodeConfig = $root.google.cloud.video.livestream.v1.TimecodeConfig.decode(reader, reader.uint32()); + break; + } + case 24: { + if (!(message.encryptions && message.encryptions.length)) + message.encryptions = []; + message.encryptions.push($root.google.cloud.video.livestream.v1.Encryption.decode(reader, reader.uint32())); + break; + } + case 25: { + message.inputConfig = $root.google.cloud.video.livestream.v1.InputConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5294,6 +5969,25 @@ if (error) return "logConfig." + error; } + if (message.timecodeConfig != null && message.hasOwnProperty("timecodeConfig")) { + var error = $root.google.cloud.video.livestream.v1.TimecodeConfig.verify(message.timecodeConfig); + if (error) + return "timecodeConfig." + error; + } + if (message.encryptions != null && message.hasOwnProperty("encryptions")) { + if (!Array.isArray(message.encryptions)) + return "encryptions: array expected"; + for (var i = 0; i < message.encryptions.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Encryption.verify(message.encryptions[i]); + if (error) + return "encryptions." + error; + } + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.video.livestream.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } return null; }; @@ -5435,6 +6129,26 @@ throw TypeError(".google.cloud.video.livestream.v1.Channel.logConfig: object expected"); message.logConfig = $root.google.cloud.video.livestream.v1.LogConfig.fromObject(object.logConfig); } + if (object.timecodeConfig != null) { + if (typeof object.timecodeConfig !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.timecodeConfig: object expected"); + message.timecodeConfig = $root.google.cloud.video.livestream.v1.TimecodeConfig.fromObject(object.timecodeConfig); + } + if (object.encryptions) { + if (!Array.isArray(object.encryptions)) + throw TypeError(".google.cloud.video.livestream.v1.Channel.encryptions: array expected"); + message.encryptions = []; + for (var i = 0; i < object.encryptions.length; ++i) { + if (typeof object.encryptions[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.encryptions: object expected"); + message.encryptions[i] = $root.google.cloud.video.livestream.v1.Encryption.fromObject(object.encryptions[i]); + } + } + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.video.livestream.v1.InputConfig.fromObject(object.inputConfig); + } return message; }; @@ -5457,6 +6171,7 @@ object.manifests = []; object.spriteSheets = []; object.inputAttachments = []; + object.encryptions = []; } if (options.objects || options.defaults) object.labels = {}; @@ -5469,6 +6184,8 @@ object.streamingState = options.enums === String ? "STREAMING_STATE_UNSPECIFIED" : 0; object.streamingError = null; object.logConfig = null; + object.timecodeConfig = null; + object.inputConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5517,6 +6234,15 @@ object.streamingError = $root.google.rpc.Status.toObject(message.streamingError, options); if (message.logConfig != null && message.hasOwnProperty("logConfig")) object.logConfig = $root.google.cloud.video.livestream.v1.LogConfig.toObject(message.logConfig, options); + if (message.timecodeConfig != null && message.hasOwnProperty("timecodeConfig")) + object.timecodeConfig = $root.google.cloud.video.livestream.v1.TimecodeConfig.toObject(message.timecodeConfig, options); + if (message.encryptions && message.encryptions.length) { + object.encryptions = []; + for (var j = 0; j < message.encryptions.length; ++j) + object.encryptions[j] = $root.google.cloud.video.livestream.v1.Encryption.toObject(message.encryptions[j], options); + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.video.livestream.v1.InputConfig.toObject(message.inputConfig, options); return object; }; @@ -5778,6 +6504,249 @@ return Channel; })(); + v1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.video.livestream.v1 + * @interface IInputConfig + * @property {google.cloud.video.livestream.v1.InputConfig.InputSwitchMode|null} [inputSwitchMode] InputConfig inputSwitchMode + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.video.livestream.v1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig inputSwitchMode. + * @member {google.cloud.video.livestream.v1.InputConfig.InputSwitchMode} inputSwitchMode + * @memberof google.cloud.video.livestream.v1.InputConfig + * @instance + */ + InputConfig.prototype.inputSwitchMode = 0; + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {google.cloud.video.livestream.v1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {google.cloud.video.livestream.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputSwitchMode != null && Object.hasOwnProperty.call(message, "inputSwitchMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputSwitchMode); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {google.cloud.video.livestream.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputSwitchMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputSwitchMode != null && message.hasOwnProperty("inputSwitchMode")) + switch (message.inputSwitchMode) { + default: + return "inputSwitchMode: enum value expected"; + case 0: + case 1: + case 3: + break; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.InputConfig) + return object; + var message = new $root.google.cloud.video.livestream.v1.InputConfig(); + switch (object.inputSwitchMode) { + default: + if (typeof object.inputSwitchMode === "number") { + message.inputSwitchMode = object.inputSwitchMode; + break; + } + break; + case "INPUT_SWITCH_MODE_UNSPECIFIED": + case 0: + message.inputSwitchMode = 0; + break; + case "FAILOVER_PREFER_PRIMARY": + case 1: + message.inputSwitchMode = 1; + break; + case "MANUAL": + case 3: + message.inputSwitchMode = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {google.cloud.video.livestream.v1.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputSwitchMode = options.enums === String ? "INPUT_SWITCH_MODE_UNSPECIFIED" : 0; + if (message.inputSwitchMode != null && message.hasOwnProperty("inputSwitchMode")) + object.inputSwitchMode = options.enums === String ? $root.google.cloud.video.livestream.v1.InputConfig.InputSwitchMode[message.inputSwitchMode] === undefined ? message.inputSwitchMode : $root.google.cloud.video.livestream.v1.InputConfig.InputSwitchMode[message.inputSwitchMode] : message.inputSwitchMode; + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputConfig + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.InputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.InputConfig"; + }; + + /** + * InputSwitchMode enum. + * @name google.cloud.video.livestream.v1.InputConfig.InputSwitchMode + * @enum {number} + * @property {number} INPUT_SWITCH_MODE_UNSPECIFIED=0 INPUT_SWITCH_MODE_UNSPECIFIED value + * @property {number} FAILOVER_PREFER_PRIMARY=1 FAILOVER_PREFER_PRIMARY value + * @property {number} MANUAL=3 MANUAL value + */ + InputConfig.InputSwitchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INPUT_SWITCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FAILOVER_PREFER_PRIMARY"] = 1; + values[valuesById[3] = "MANUAL"] = 3; + return values; + })(); + + return InputConfig; + })(); + v1.LogConfig = (function() { /** @@ -7828,7 +8797,11 @@ * @property {google.protobuf.ITimestamp|null} [createTime] Event createTime * @property {google.protobuf.ITimestamp|null} [updateTime] Event updateTime * @property {Object.|null} [labels] Event labels + * @property {google.cloud.video.livestream.v1.Event.IInputSwitchTask|null} [inputSwitch] Event inputSwitch * @property {google.cloud.video.livestream.v1.Event.IAdBreakTask|null} [adBreak] Event adBreak + * @property {google.cloud.video.livestream.v1.Event.IReturnToProgramTask|null} [returnToProgram] Event returnToProgram + * @property {google.cloud.video.livestream.v1.Event.IMuteTask|null} [mute] Event mute + * @property {google.cloud.video.livestream.v1.Event.IUnmuteTask|null} [unmute] Event unmute * @property {boolean|null} [executeNow] Event executeNow * @property {google.protobuf.ITimestamp|null} [executionTime] Event executionTime * @property {google.cloud.video.livestream.v1.Event.State|null} [state] Event state @@ -7883,6 +8856,14 @@ */ Event.prototype.labels = $util.emptyObject; + /** + * Event inputSwitch. + * @member {google.cloud.video.livestream.v1.Event.IInputSwitchTask|null|undefined} inputSwitch + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.inputSwitch = null; + /** * Event adBreak. * @member {google.cloud.video.livestream.v1.Event.IAdBreakTask|null|undefined} adBreak @@ -7891,6 +8872,30 @@ */ Event.prototype.adBreak = null; + /** + * Event returnToProgram. + * @member {google.cloud.video.livestream.v1.Event.IReturnToProgramTask|null|undefined} returnToProgram + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.returnToProgram = null; + + /** + * Event mute. + * @member {google.cloud.video.livestream.v1.Event.IMuteTask|null|undefined} mute + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.mute = null; + + /** + * Event unmute. + * @member {google.cloud.video.livestream.v1.Event.IUnmuteTask|null|undefined} unmute + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.unmute = null; + /** * Event executeNow. * @member {boolean} executeNow @@ -7928,12 +8933,12 @@ /** * Event task. - * @member {"adBreak"|undefined} task + * @member {"inputSwitch"|"adBreak"|"returnToProgram"|"mute"|"unmute"|undefined} task * @memberof google.cloud.video.livestream.v1.Event * @instance */ Object.defineProperty(Event.prototype, "task", { - get: $util.oneOfGetter($oneOfFields = ["adBreak"]), + get: $util.oneOfGetter($oneOfFields = ["inputSwitch", "adBreak", "returnToProgram", "mute", "unmute"]), set: $util.oneOfSetter($oneOfFields) }); @@ -7970,6 +8975,8 @@ if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.inputSwitch != null && Object.hasOwnProperty.call(message, "inputSwitch")) + $root.google.cloud.video.livestream.v1.Event.InputSwitchTask.encode(message.inputSwitch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.adBreak != null && Object.hasOwnProperty.call(message, "adBreak")) $root.google.cloud.video.livestream.v1.Event.AdBreakTask.encode(message.adBreak, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.executeNow != null && Object.hasOwnProperty.call(message, "executeNow")) @@ -7980,6 +8987,12 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.returnToProgram != null && Object.hasOwnProperty.call(message, "returnToProgram")) + $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask.encode(message.returnToProgram, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.mute != null && Object.hasOwnProperty.call(message, "mute")) + $root.google.cloud.video.livestream.v1.Event.MuteTask.encode(message.mute, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.unmute != null && Object.hasOwnProperty.call(message, "unmute")) + $root.google.cloud.video.livestream.v1.Event.UnmuteTask.encode(message.unmute, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); return writer; }; @@ -8049,10 +9062,26 @@ message.labels[key] = value; break; } + case 5: { + message.inputSwitch = $root.google.cloud.video.livestream.v1.Event.InputSwitchTask.decode(reader, reader.uint32()); + break; + } case 6: { message.adBreak = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.decode(reader, reader.uint32()); break; } + case 13: { + message.returnToProgram = $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask.decode(reader, reader.uint32()); + break; + } + case 15: { + message.mute = $root.google.cloud.video.livestream.v1.Event.MuteTask.decode(reader, reader.uint32()); + break; + } + case 16: { + message.unmute = $root.google.cloud.video.livestream.v1.Event.UnmuteTask.decode(reader, reader.uint32()); + break; + } case 9: { message.executeNow = reader.bool(); break; @@ -8126,7 +9155,17 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } + if (message.inputSwitch != null && message.hasOwnProperty("inputSwitch")) { + properties.task = 1; + { + var error = $root.google.cloud.video.livestream.v1.Event.InputSwitchTask.verify(message.inputSwitch); + if (error) + return "inputSwitch." + error; + } + } if (message.adBreak != null && message.hasOwnProperty("adBreak")) { + if (properties.task === 1) + return "task: multiple values"; properties.task = 1; { var error = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.verify(message.adBreak); @@ -8134,6 +9173,36 @@ return "adBreak." + error; } } + if (message.returnToProgram != null && message.hasOwnProperty("returnToProgram")) { + if (properties.task === 1) + return "task: multiple values"; + properties.task = 1; + { + var error = $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask.verify(message.returnToProgram); + if (error) + return "returnToProgram." + error; + } + } + if (message.mute != null && message.hasOwnProperty("mute")) { + if (properties.task === 1) + return "task: multiple values"; + properties.task = 1; + { + var error = $root.google.cloud.video.livestream.v1.Event.MuteTask.verify(message.mute); + if (error) + return "mute." + error; + } + } + if (message.unmute != null && message.hasOwnProperty("unmute")) { + if (properties.task === 1) + return "task: multiple values"; + properties.task = 1; + { + var error = $root.google.cloud.video.livestream.v1.Event.UnmuteTask.verify(message.unmute); + if (error) + return "unmute." + error; + } + } if (message.executeNow != null && message.hasOwnProperty("executeNow")) if (typeof message.executeNow !== "boolean") return "executeNow: boolean expected"; @@ -8194,12 +9263,32 @@ for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } + if (object.inputSwitch != null) { + if (typeof object.inputSwitch !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.inputSwitch: object expected"); + message.inputSwitch = $root.google.cloud.video.livestream.v1.Event.InputSwitchTask.fromObject(object.inputSwitch); + } if (object.adBreak != null) { if (typeof object.adBreak !== "object") throw TypeError(".google.cloud.video.livestream.v1.Event.adBreak: object expected"); message.adBreak = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.fromObject(object.adBreak); } - if (object.executeNow != null) + if (object.returnToProgram != null) { + if (typeof object.returnToProgram !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.returnToProgram: object expected"); + message.returnToProgram = $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask.fromObject(object.returnToProgram); + } + if (object.mute != null) { + if (typeof object.mute !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.mute: object expected"); + message.mute = $root.google.cloud.video.livestream.v1.Event.MuteTask.fromObject(object.mute); + } + if (object.unmute != null) { + if (typeof object.unmute !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.unmute: object expected"); + message.unmute = $root.google.cloud.video.livestream.v1.Event.UnmuteTask.fromObject(object.unmute); + } + if (object.executeNow != null) message.executeNow = Boolean(object.executeNow); if (object.executionTime != null) { if (typeof object.executionTime !== "object") @@ -8286,6 +9375,11 @@ for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.inputSwitch != null && message.hasOwnProperty("inputSwitch")) { + object.inputSwitch = $root.google.cloud.video.livestream.v1.Event.InputSwitchTask.toObject(message.inputSwitch, options); + if (options.oneofs) + object.task = "inputSwitch"; + } if (message.adBreak != null && message.hasOwnProperty("adBreak")) { object.adBreak = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.toObject(message.adBreak, options); if (options.oneofs) @@ -8299,6 +9393,21 @@ object.state = options.enums === String ? $root.google.cloud.video.livestream.v1.Event.State[message.state] === undefined ? message.state : $root.google.cloud.video.livestream.v1.Event.State[message.state] : message.state; if (message.error != null && message.hasOwnProperty("error")) object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.returnToProgram != null && message.hasOwnProperty("returnToProgram")) { + object.returnToProgram = $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask.toObject(message.returnToProgram, options); + if (options.oneofs) + object.task = "returnToProgram"; + } + if (message.mute != null && message.hasOwnProperty("mute")) { + object.mute = $root.google.cloud.video.livestream.v1.Event.MuteTask.toObject(message.mute, options); + if (options.oneofs) + object.task = "mute"; + } + if (message.unmute != null && message.hasOwnProperty("unmute")) { + object.unmute = $root.google.cloud.video.livestream.v1.Event.UnmuteTask.toObject(message.unmute, options); + if (options.oneofs) + object.task = "unmute"; + } return object; }; @@ -8328,6 +9437,209 @@ return typeUrlPrefix + "/google.cloud.video.livestream.v1.Event"; }; + Event.InputSwitchTask = (function() { + + /** + * Properties of an InputSwitchTask. + * @memberof google.cloud.video.livestream.v1.Event + * @interface IInputSwitchTask + * @property {string|null} [inputKey] InputSwitchTask inputKey + */ + + /** + * Constructs a new InputSwitchTask. + * @memberof google.cloud.video.livestream.v1.Event + * @classdesc Represents an InputSwitchTask. + * @implements IInputSwitchTask + * @constructor + * @param {google.cloud.video.livestream.v1.Event.IInputSwitchTask=} [properties] Properties to set + */ + function InputSwitchTask(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputSwitchTask inputKey. + * @member {string} inputKey + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @instance + */ + InputSwitchTask.prototype.inputKey = ""; + + /** + * Creates a new InputSwitchTask instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IInputSwitchTask=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Event.InputSwitchTask} InputSwitchTask instance + */ + InputSwitchTask.create = function create(properties) { + return new InputSwitchTask(properties); + }; + + /** + * Encodes the specified InputSwitchTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.InputSwitchTask.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IInputSwitchTask} message InputSwitchTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputSwitchTask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputKey != null && Object.hasOwnProperty.call(message, "inputKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputKey); + return writer; + }; + + /** + * Encodes the specified InputSwitchTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.InputSwitchTask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IInputSwitchTask} message InputSwitchTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputSwitchTask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputSwitchTask message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Event.InputSwitchTask} InputSwitchTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputSwitchTask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Event.InputSwitchTask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputSwitchTask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Event.InputSwitchTask} InputSwitchTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputSwitchTask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputSwitchTask message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputSwitchTask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputKey != null && message.hasOwnProperty("inputKey")) + if (!$util.isString(message.inputKey)) + return "inputKey: string expected"; + return null; + }; + + /** + * Creates an InputSwitchTask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Event.InputSwitchTask} InputSwitchTask + */ + InputSwitchTask.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Event.InputSwitchTask) + return object; + var message = new $root.google.cloud.video.livestream.v1.Event.InputSwitchTask(); + if (object.inputKey != null) + message.inputKey = String(object.inputKey); + return message; + }; + + /** + * Creates a plain object from an InputSwitchTask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {google.cloud.video.livestream.v1.Event.InputSwitchTask} message InputSwitchTask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputSwitchTask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputKey = ""; + if (message.inputKey != null && message.hasOwnProperty("inputKey")) + object.inputKey = message.inputKey; + return object; + }; + + /** + * Converts this InputSwitchTask to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @instance + * @returns {Object.} JSON object + */ + InputSwitchTask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputSwitchTask + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Event.InputSwitchTask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputSwitchTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Event.InputSwitchTask"; + }; + + return InputSwitchTask; + })(); + Event.AdBreakTask = (function() { /** @@ -8536,735 +9848,785 @@ return AdBreakTask; })(); - /** - * State enum. - * @name google.cloud.video.livestream.v1.Event.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} SCHEDULED=1 SCHEDULED value - * @property {number} RUNNING=2 RUNNING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} FAILED=4 FAILED value - * @property {number} PENDING=5 PENDING value - * @property {number} STOPPED=6 STOPPED value - */ - Event.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCHEDULED"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "PENDING"] = 5; - values[valuesById[6] = "STOPPED"] = 6; - return values; - })(); - - return Event; - })(); + Event.ReturnToProgramTask = (function() { - v1.LivestreamService = (function() { + /** + * Properties of a ReturnToProgramTask. + * @memberof google.cloud.video.livestream.v1.Event + * @interface IReturnToProgramTask + */ - /** - * Constructs a new LivestreamService service. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a LivestreamService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function LivestreamService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * Constructs a new ReturnToProgramTask. + * @memberof google.cloud.video.livestream.v1.Event + * @classdesc Represents a ReturnToProgramTask. + * @implements IReturnToProgramTask + * @constructor + * @param {google.cloud.video.livestream.v1.Event.IReturnToProgramTask=} [properties] Properties to set + */ + function ReturnToProgramTask(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - (LivestreamService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LivestreamService; + /** + * Creates a new ReturnToProgramTask instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IReturnToProgramTask=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Event.ReturnToProgramTask} ReturnToProgramTask instance + */ + ReturnToProgramTask.create = function create(properties) { + return new ReturnToProgramTask(properties); + }; - /** - * Creates new LivestreamService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {LivestreamService} RPC service. Useful where requests and/or responses are streamed. - */ - LivestreamService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Encodes the specified ReturnToProgramTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.ReturnToProgramTask.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IReturnToProgramTask} message ReturnToProgramTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReturnToProgramTask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createChannel}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef CreateChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Encodes the specified ReturnToProgramTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.ReturnToProgramTask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IReturnToProgramTask} message ReturnToProgramTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReturnToProgramTask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls CreateChannel. - * @function createChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} request CreateChannelRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.CreateChannelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.createChannel = function createChannel(request, callback) { - return this.rpcCall(createChannel, $root.google.cloud.video.livestream.v1.CreateChannelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateChannel" }); - - /** - * Calls CreateChannel. - * @function createChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} request CreateChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a ReturnToProgramTask message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Event.ReturnToProgramTask} ReturnToProgramTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReturnToProgramTask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listChannels}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef ListChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.livestream.v1.ListChannelsResponse} [response] ListChannelsResponse - */ + /** + * Decodes a ReturnToProgramTask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Event.ReturnToProgramTask} ReturnToProgramTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReturnToProgramTask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls ListChannels. - * @function listChannels - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IListChannelsRequest} request ListChannelsRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.ListChannelsCallback} callback Node-style callback called with the error, if any, and ListChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.listChannels = function listChannels(request, callback) { - return this.rpcCall(listChannels, $root.google.cloud.video.livestream.v1.ListChannelsRequest, $root.google.cloud.video.livestream.v1.ListChannelsResponse, request, callback); - }, "name", { value: "ListChannels" }); + /** + * Verifies a ReturnToProgramTask message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReturnToProgramTask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Calls ListChannels. - * @function listChannels - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IListChannelsRequest} request ListChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a ReturnToProgramTask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Event.ReturnToProgramTask} ReturnToProgramTask + */ + ReturnToProgramTask.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask) + return object; + return new $root.google.cloud.video.livestream.v1.Event.ReturnToProgramTask(); + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getChannel}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef GetChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.livestream.v1.Channel} [response] Channel - */ + /** + * Creates a plain object from a ReturnToProgramTask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {google.cloud.video.livestream.v1.Event.ReturnToProgramTask} message ReturnToProgramTask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReturnToProgramTask.toObject = function toObject() { + return {}; + }; - /** - * Calls GetChannel. - * @function getChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IGetChannelRequest} request GetChannelRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.GetChannelCallback} callback Node-style callback called with the error, if any, and Channel - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.getChannel = function getChannel(request, callback) { - return this.rpcCall(getChannel, $root.google.cloud.video.livestream.v1.GetChannelRequest, $root.google.cloud.video.livestream.v1.Channel, request, callback); - }, "name", { value: "GetChannel" }); + /** + * Converts this ReturnToProgramTask to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @instance + * @returns {Object.} JSON object + */ + ReturnToProgramTask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls GetChannel. - * @function getChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IGetChannelRequest} request GetChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Gets the default type url for ReturnToProgramTask + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Event.ReturnToProgramTask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReturnToProgramTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Event.ReturnToProgramTask"; + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteChannel}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef DeleteChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + return ReturnToProgramTask; + })(); - /** - * Calls DeleteChannel. - * @function deleteChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} request DeleteChannelRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteChannelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.deleteChannel = function deleteChannel(request, callback) { - return this.rpcCall(deleteChannel, $root.google.cloud.video.livestream.v1.DeleteChannelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteChannel" }); + Event.MuteTask = (function() { - /** - * Calls DeleteChannel. - * @function deleteChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} request DeleteChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Properties of a MuteTask. + * @memberof google.cloud.video.livestream.v1.Event + * @interface IMuteTask + * @property {google.protobuf.IDuration|null} [duration] MuteTask duration + */ - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateChannel}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef UpdateChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Constructs a new MuteTask. + * @memberof google.cloud.video.livestream.v1.Event + * @classdesc Represents a MuteTask. + * @implements IMuteTask + * @constructor + * @param {google.cloud.video.livestream.v1.Event.IMuteTask=} [properties] Properties to set + */ + function MuteTask(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls UpdateChannel. - * @function updateChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} request UpdateChannelRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.UpdateChannelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.updateChannel = function updateChannel(request, callback) { - return this.rpcCall(updateChannel, $root.google.cloud.video.livestream.v1.UpdateChannelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateChannel" }); + /** + * MuteTask duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @instance + */ + MuteTask.prototype.duration = null; - /** - * Calls UpdateChannel. - * @function updateChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} request UpdateChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new MuteTask instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IMuteTask=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Event.MuteTask} MuteTask instance + */ + MuteTask.create = function create(properties) { + return new MuteTask(properties); + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|startChannel}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef StartChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Encodes the specified MuteTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.MuteTask.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IMuteTask} message MuteTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteTask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Calls StartChannel. - * @function startChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IStartChannelRequest} request StartChannelRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.StartChannelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.startChannel = function startChannel(request, callback) { - return this.rpcCall(startChannel, $root.google.cloud.video.livestream.v1.StartChannelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StartChannel" }); + /** + * Encodes the specified MuteTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.MuteTask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IMuteTask} message MuteTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuteTask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls StartChannel. - * @function startChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IStartChannelRequest} request StartChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a MuteTask message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Event.MuteTask} MuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteTask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Event.MuteTask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|stopChannel}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef StopChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Decodes a MuteTask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Event.MuteTask} MuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuteTask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls StopChannel. - * @function stopChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IStopChannelRequest} request StopChannelRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.StopChannelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.stopChannel = function stopChannel(request, callback) { - return this.rpcCall(stopChannel, $root.google.cloud.video.livestream.v1.StopChannelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StopChannel" }); + /** + * Verifies a MuteTask message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MuteTask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; - /** - * Calls StopChannel. - * @function stopChannel - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IStopChannelRequest} request StopChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a MuteTask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Event.MuteTask} MuteTask + */ + MuteTask.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Event.MuteTask) + return object; + var message = new $root.google.cloud.video.livestream.v1.Event.MuteTask(); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.MuteTask.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createInput}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef CreateInputCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Creates a plain object from a MuteTask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.MuteTask} message MuteTask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MuteTask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.duration = null; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; - /** - * Calls CreateInput. - * @function createInput - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.ICreateInputRequest} request CreateInputRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.CreateInputCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.createInput = function createInput(request, callback) { - return this.rpcCall(createInput, $root.google.cloud.video.livestream.v1.CreateInputRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInput" }); + /** + * Converts this MuteTask to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @instance + * @returns {Object.} JSON object + */ + MuteTask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls CreateInput. - * @function createInput - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.ICreateInputRequest} request CreateInputRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Gets the default type url for MuteTask + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Event.MuteTask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MuteTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Event.MuteTask"; + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listInputs}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef ListInputsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.livestream.v1.ListInputsResponse} [response] ListInputsResponse - */ + return MuteTask; + })(); - /** - * Calls ListInputs. - * @function listInputs - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IListInputsRequest} request ListInputsRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.ListInputsCallback} callback Node-style callback called with the error, if any, and ListInputsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.listInputs = function listInputs(request, callback) { - return this.rpcCall(listInputs, $root.google.cloud.video.livestream.v1.ListInputsRequest, $root.google.cloud.video.livestream.v1.ListInputsResponse, request, callback); - }, "name", { value: "ListInputs" }); + Event.UnmuteTask = (function() { - /** - * Calls ListInputs. - * @function listInputs - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IListInputsRequest} request ListInputsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Properties of an UnmuteTask. + * @memberof google.cloud.video.livestream.v1.Event + * @interface IUnmuteTask + */ - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getInput}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef GetInputCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.livestream.v1.Input} [response] Input - */ + /** + * Constructs a new UnmuteTask. + * @memberof google.cloud.video.livestream.v1.Event + * @classdesc Represents an UnmuteTask. + * @implements IUnmuteTask + * @constructor + * @param {google.cloud.video.livestream.v1.Event.IUnmuteTask=} [properties] Properties to set + */ + function UnmuteTask(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls GetInput. - * @function getInput - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IGetInputRequest} request GetInputRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.GetInputCallback} callback Node-style callback called with the error, if any, and Input - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.getInput = function getInput(request, callback) { - return this.rpcCall(getInput, $root.google.cloud.video.livestream.v1.GetInputRequest, $root.google.cloud.video.livestream.v1.Input, request, callback); - }, "name", { value: "GetInput" }); + /** + * Creates a new UnmuteTask instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IUnmuteTask=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Event.UnmuteTask} UnmuteTask instance + */ + UnmuteTask.create = function create(properties) { + return new UnmuteTask(properties); + }; - /** - * Calls GetInput. - * @function getInput - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IGetInputRequest} request GetInputRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified UnmuteTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.UnmuteTask.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IUnmuteTask} message UnmuteTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnmuteTask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteInput}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef DeleteInputCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Encodes the specified UnmuteTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.UnmuteTask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IUnmuteTask} message UnmuteTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnmuteTask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnmuteTask message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Event.UnmuteTask} UnmuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnmuteTask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Event.UnmuteTask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnmuteTask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Event.UnmuteTask} UnmuteTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnmuteTask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnmuteTask message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnmuteTask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UnmuteTask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Event.UnmuteTask} UnmuteTask + */ + UnmuteTask.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Event.UnmuteTask) + return object; + return new $root.google.cloud.video.livestream.v1.Event.UnmuteTask(); + }; + + /** + * Creates a plain object from an UnmuteTask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {google.cloud.video.livestream.v1.Event.UnmuteTask} message UnmuteTask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnmuteTask.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UnmuteTask to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @instance + * @returns {Object.} JSON object + */ + UnmuteTask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnmuteTask + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Event.UnmuteTask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnmuteTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Event.UnmuteTask"; + }; + + return UnmuteTask; + })(); /** - * Calls DeleteInput. - * @function deleteInput - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} request DeleteInputRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteInputCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * State enum. + * @name google.cloud.video.livestream.v1.Event.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SCHEDULED=1 SCHEDULED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} PENDING=5 PENDING value + * @property {number} STOPPED=6 STOPPED value */ - Object.defineProperty(LivestreamService.prototype.deleteInput = function deleteInput(request, callback) { - return this.rpcCall(deleteInput, $root.google.cloud.video.livestream.v1.DeleteInputRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInput" }); + Event.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEDULED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "PENDING"] = 5; + values[valuesById[6] = "STOPPED"] = 6; + return values; + })(); + + return Event; + })(); + + v1.Encryption = (function() { /** - * Calls DeleteInput. - * @function deleteInput - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} request DeleteInputRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of an Encryption. + * @memberof google.cloud.video.livestream.v1 + * @interface IEncryption + * @property {string|null} [id] Encryption id + * @property {google.cloud.video.livestream.v1.Encryption.ISecretManagerSource|null} [secretManagerKeySource] Encryption secretManagerKeySource + * @property {google.cloud.video.livestream.v1.Encryption.IDrmSystems|null} [drmSystems] Encryption drmSystems + * @property {google.cloud.video.livestream.v1.Encryption.IAes128Encryption|null} [aes128] Encryption aes128 + * @property {google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption|null} [sampleAes] Encryption sampleAes + * @property {google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption|null} [mpegCenc] Encryption mpegCenc */ /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateInput}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef UpdateInputCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new Encryption. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an Encryption. + * @implements IEncryption + * @constructor + * @param {google.cloud.video.livestream.v1.IEncryption=} [properties] Properties to set */ + function Encryption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateInput. - * @function updateInput - * @memberof google.cloud.video.livestream.v1.LivestreamService + * Encryption id. + * @member {string} id + * @memberof google.cloud.video.livestream.v1.Encryption * @instance - * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} request UpdateInputRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.UpdateInputCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(LivestreamService.prototype.updateInput = function updateInput(request, callback) { - return this.rpcCall(updateInput, $root.google.cloud.video.livestream.v1.UpdateInputRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInput" }); + Encryption.prototype.id = ""; /** - * Calls UpdateInput. - * @function updateInput - * @memberof google.cloud.video.livestream.v1.LivestreamService + * Encryption secretManagerKeySource. + * @member {google.cloud.video.livestream.v1.Encryption.ISecretManagerSource|null|undefined} secretManagerKeySource + * @memberof google.cloud.video.livestream.v1.Encryption * @instance - * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} request UpdateInputRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Encryption.prototype.secretManagerKeySource = null; /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createEvent}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef CreateEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.livestream.v1.Event} [response] Event + * Encryption drmSystems. + * @member {google.cloud.video.livestream.v1.Encryption.IDrmSystems|null|undefined} drmSystems + * @memberof google.cloud.video.livestream.v1.Encryption + * @instance */ + Encryption.prototype.drmSystems = null; /** - * Calls CreateEvent. - * @function createEvent - * @memberof google.cloud.video.livestream.v1.LivestreamService + * Encryption aes128. + * @member {google.cloud.video.livestream.v1.Encryption.IAes128Encryption|null|undefined} aes128 + * @memberof google.cloud.video.livestream.v1.Encryption * @instance - * @param {google.cloud.video.livestream.v1.ICreateEventRequest} request CreateEventRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.CreateEventCallback} callback Node-style callback called with the error, if any, and Event - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(LivestreamService.prototype.createEvent = function createEvent(request, callback) { - return this.rpcCall(createEvent, $root.google.cloud.video.livestream.v1.CreateEventRequest, $root.google.cloud.video.livestream.v1.Event, request, callback); - }, "name", { value: "CreateEvent" }); + Encryption.prototype.aes128 = null; /** - * Calls CreateEvent. - * @function createEvent - * @memberof google.cloud.video.livestream.v1.LivestreamService + * Encryption sampleAes. + * @member {google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption|null|undefined} sampleAes + * @memberof google.cloud.video.livestream.v1.Encryption * @instance - * @param {google.cloud.video.livestream.v1.ICreateEventRequest} request CreateEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Encryption.prototype.sampleAes = null; /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listEvents}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef ListEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.livestream.v1.ListEventsResponse} [response] ListEventsResponse + * Encryption mpegCenc. + * @member {google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption|null|undefined} mpegCenc + * @memberof google.cloud.video.livestream.v1.Encryption + * @instance */ + Encryption.prototype.mpegCenc = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls ListEvents. - * @function listEvents - * @memberof google.cloud.video.livestream.v1.LivestreamService + * Encryption secretSource. + * @member {"secretManagerKeySource"|undefined} secretSource + * @memberof google.cloud.video.livestream.v1.Encryption * @instance - * @param {google.cloud.video.livestream.v1.IListEventsRequest} request ListEventsRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.ListEventsCallback} callback Node-style callback called with the error, if any, and ListEventsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(LivestreamService.prototype.listEvents = function listEvents(request, callback) { - return this.rpcCall(listEvents, $root.google.cloud.video.livestream.v1.ListEventsRequest, $root.google.cloud.video.livestream.v1.ListEventsResponse, request, callback); - }, "name", { value: "ListEvents" }); + Object.defineProperty(Encryption.prototype, "secretSource", { + get: $util.oneOfGetter($oneOfFields = ["secretManagerKeySource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Calls ListEvents. - * @function listEvents - * @memberof google.cloud.video.livestream.v1.LivestreamService + * Encryption encryptionMode. + * @member {"aes128"|"sampleAes"|"mpegCenc"|undefined} encryptionMode + * @memberof google.cloud.video.livestream.v1.Encryption * @instance - * @param {google.cloud.video.livestream.v1.IListEventsRequest} request ListEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Object.defineProperty(Encryption.prototype, "encryptionMode", { + get: $util.oneOfGetter($oneOfFields = ["aes128", "sampleAes", "mpegCenc"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getEvent}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef GetEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.livestream.v1.Event} [response] Event + * Creates a new Encryption instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption + * @static + * @param {google.cloud.video.livestream.v1.IEncryption=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption} Encryption instance */ + Encryption.create = function create(properties) { + return new Encryption(properties); + }; /** - * Calls GetEvent. - * @function getEvent - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IGetEventRequest} request GetEventRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.GetEventCallback} callback Node-style callback called with the error, if any, and Event - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.getEvent = function getEvent(request, callback) { - return this.rpcCall(getEvent, $root.google.cloud.video.livestream.v1.GetEventRequest, $root.google.cloud.video.livestream.v1.Event, request, callback); - }, "name", { value: "GetEvent" }); - - /** - * Calls GetEvent. - * @function getEvent - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IGetEventRequest} request GetEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteEvent}. - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @typedef DeleteEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteEvent. - * @function deleteEvent - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} request DeleteEventRequest message or plain object - * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteEventCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LivestreamService.prototype.deleteEvent = function deleteEvent(request, callback) { - return this.rpcCall(deleteEvent, $root.google.cloud.video.livestream.v1.DeleteEventRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEvent" }); - - /** - * Calls DeleteEvent. - * @function deleteEvent - * @memberof google.cloud.video.livestream.v1.LivestreamService - * @instance - * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} request DeleteEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return LivestreamService; - })(); - - v1.CreateChannelRequest = (function() { - - /** - * Properties of a CreateChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface ICreateChannelRequest - * @property {string|null} [parent] CreateChannelRequest parent - * @property {google.cloud.video.livestream.v1.IChannel|null} [channel] CreateChannelRequest channel - * @property {string|null} [channelId] CreateChannelRequest channelId - * @property {string|null} [requestId] CreateChannelRequest requestId - */ - - /** - * Constructs a new CreateChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a CreateChannelRequest. - * @implements ICreateChannelRequest - * @constructor - * @param {google.cloud.video.livestream.v1.ICreateChannelRequest=} [properties] Properties to set - */ - function CreateChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateChannelRequest parent. - * @member {string} parent - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest - * @instance - */ - CreateChannelRequest.prototype.parent = ""; - - /** - * CreateChannelRequest channel. - * @member {google.cloud.video.livestream.v1.IChannel|null|undefined} channel - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest - * @instance - */ - CreateChannelRequest.prototype.channel = null; - - /** - * CreateChannelRequest channelId. - * @member {string} channelId - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest - * @instance - */ - CreateChannelRequest.prototype.channelId = ""; - - /** - * CreateChannelRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest - * @instance - */ - CreateChannelRequest.prototype.requestId = ""; - - /** - * Creates a new CreateChannelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.ICreateChannelRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest instance - */ - CreateChannelRequest.create = function create(properties) { - return new CreateChannelRequest(properties); - }; - - /** - * Encodes the specified CreateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * Encodes the specified Encryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static - * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} message CreateChannelRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IEncryption} message Encryption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateChannelRequest.encode = function encode(message, writer) { + Encryption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.google.cloud.video.livestream.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.channelId); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.drmSystems != null && Object.hasOwnProperty.call(message, "drmSystems")) + $root.google.cloud.video.livestream.v1.Encryption.DrmSystems.encode(message.drmSystems, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.aes128 != null && Object.hasOwnProperty.call(message, "aes128")) + $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption.encode(message.aes128, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sampleAes != null && Object.hasOwnProperty.call(message, "sampleAes")) + $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.encode(message.sampleAes, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.mpegCenc != null && Object.hasOwnProperty.call(message, "mpegCenc")) + $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.encode(message.mpegCenc, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.secretManagerKeySource != null && Object.hasOwnProperty.call(message, "secretManagerKeySource")) + $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource.encode(message.secretManagerKeySource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * Encodes the specified Encryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static - * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} message CreateChannelRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IEncryption} message Encryption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + Encryption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateChannelRequest message from the specified reader or buffer. + * Decodes an Encryption message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest + * @returns {google.cloud.video.livestream.v1.Encryption} Encryption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateChannelRequest.decode = function decode(reader, length) { + Encryption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateChannelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.id = reader.string(); break; } - case 2: { - message.channel = $root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32()); + case 7: { + message.secretManagerKeySource = $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource.decode(reader, reader.uint32()); break; } case 3: { - message.channelId = reader.string(); + message.drmSystems = $root.google.cloud.video.livestream.v1.Encryption.DrmSystems.decode(reader, reader.uint32()); break; } case 4: { - message.requestId = reader.string(); + message.aes128 = $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sampleAes = $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.decode(reader, reader.uint32()); + break; + } + case 6: { + message.mpegCenc = $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.decode(reader, reader.uint32()); break; } default: @@ -9276,2765 +10638,2528 @@ }; /** - * Decodes a CreateChannelRequest message from the specified reader or buffer, length delimited. + * Decodes an Encryption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest + * @returns {google.cloud.video.livestream.v1.Encryption} Encryption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateChannelRequest.decodeDelimited = function decodeDelimited(reader) { + Encryption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateChannelRequest message. + * Verifies an Encryption message. * @function verify - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateChannelRequest.verify = function verify(message) { + Encryption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channel); + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.secretManagerKeySource != null && message.hasOwnProperty("secretManagerKeySource")) { + properties.secretSource = 1; + { + var error = $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource.verify(message.secretManagerKeySource); + if (error) + return "secretManagerKeySource." + error; + } + } + if (message.drmSystems != null && message.hasOwnProperty("drmSystems")) { + var error = $root.google.cloud.video.livestream.v1.Encryption.DrmSystems.verify(message.drmSystems); if (error) - return "channel." + error; + return "drmSystems." + error; + } + if (message.aes128 != null && message.hasOwnProperty("aes128")) { + properties.encryptionMode = 1; + { + var error = $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption.verify(message.aes128); + if (error) + return "aes128." + error; + } + } + if (message.sampleAes != null && message.hasOwnProperty("sampleAes")) { + if (properties.encryptionMode === 1) + return "encryptionMode: multiple values"; + properties.encryptionMode = 1; + { + var error = $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.verify(message.sampleAes); + if (error) + return "sampleAes." + error; + } + } + if (message.mpegCenc != null && message.hasOwnProperty("mpegCenc")) { + if (properties.encryptionMode === 1) + return "encryptionMode: multiple values"; + properties.encryptionMode = 1; + { + var error = $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.verify(message.mpegCenc); + if (error) + return "mpegCenc." + error; + } } - if (message.channelId != null && message.hasOwnProperty("channelId")) - if (!$util.isString(message.channelId)) - return "channelId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates a CreateChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Encryption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest + * @returns {google.cloud.video.livestream.v1.Encryption} Encryption */ - CreateChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.CreateChannelRequest) + Encryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption) return object; - var message = new $root.google.cloud.video.livestream.v1.CreateChannelRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".google.cloud.video.livestream.v1.CreateChannelRequest.channel: object expected"); - message.channel = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channel); + var message = new $root.google.cloud.video.livestream.v1.Encryption(); + if (object.id != null) + message.id = String(object.id); + if (object.secretManagerKeySource != null) { + if (typeof object.secretManagerKeySource !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.secretManagerKeySource: object expected"); + message.secretManagerKeySource = $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource.fromObject(object.secretManagerKeySource); + } + if (object.drmSystems != null) { + if (typeof object.drmSystems !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.drmSystems: object expected"); + message.drmSystems = $root.google.cloud.video.livestream.v1.Encryption.DrmSystems.fromObject(object.drmSystems); + } + if (object.aes128 != null) { + if (typeof object.aes128 !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.aes128: object expected"); + message.aes128 = $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption.fromObject(object.aes128); + } + if (object.sampleAes != null) { + if (typeof object.sampleAes !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.sampleAes: object expected"); + message.sampleAes = $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.fromObject(object.sampleAes); + } + if (object.mpegCenc != null) { + if (typeof object.mpegCenc !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.mpegCenc: object expected"); + message.mpegCenc = $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.fromObject(object.mpegCenc); } - if (object.channelId != null) - message.channelId = String(object.channelId); - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a CreateChannelRequest message. Also converts values to other types if specified. + * Creates a plain object from an Encryption message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static - * @param {google.cloud.video.livestream.v1.CreateChannelRequest} message CreateChannelRequest + * @param {google.cloud.video.livestream.v1.Encryption} message Encryption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateChannelRequest.toObject = function toObject(message, options) { + Encryption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.channel = null; - object.channelId = ""; - object.requestId = ""; + object.id = ""; + object.drmSystems = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.drmSystems != null && message.hasOwnProperty("drmSystems")) + object.drmSystems = $root.google.cloud.video.livestream.v1.Encryption.DrmSystems.toObject(message.drmSystems, options); + if (message.aes128 != null && message.hasOwnProperty("aes128")) { + object.aes128 = $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption.toObject(message.aes128, options); + if (options.oneofs) + object.encryptionMode = "aes128"; + } + if (message.sampleAes != null && message.hasOwnProperty("sampleAes")) { + object.sampleAes = $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.toObject(message.sampleAes, options); + if (options.oneofs) + object.encryptionMode = "sampleAes"; + } + if (message.mpegCenc != null && message.hasOwnProperty("mpegCenc")) { + object.mpegCenc = $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.toObject(message.mpegCenc, options); + if (options.oneofs) + object.encryptionMode = "mpegCenc"; + } + if (message.secretManagerKeySource != null && message.hasOwnProperty("secretManagerKeySource")) { + object.secretManagerKeySource = $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource.toObject(message.secretManagerKeySource, options); + if (options.oneofs) + object.secretSource = "secretManagerKeySource"; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channel, options); - if (message.channelId != null && message.hasOwnProperty("channelId")) - object.channelId = message.channelId; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this CreateChannelRequest to JSON. + * Converts this Encryption to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @instance * @returns {Object.} JSON object */ - CreateChannelRequest.prototype.toJSON = function toJSON() { + Encryption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateChannelRequest + * Gets the default type url for Encryption * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @memberof google.cloud.video.livestream.v1.Encryption * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Encryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateChannelRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption"; }; - return CreateChannelRequest; - })(); - - v1.ListChannelsRequest = (function() { + Encryption.SecretManagerSource = (function() { - /** - * Properties of a ListChannelsRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface IListChannelsRequest - * @property {string|null} [parent] ListChannelsRequest parent - * @property {number|null} [pageSize] ListChannelsRequest pageSize - * @property {string|null} [pageToken] ListChannelsRequest pageToken - * @property {string|null} [filter] ListChannelsRequest filter - * @property {string|null} [orderBy] ListChannelsRequest orderBy - */ + /** + * Properties of a SecretManagerSource. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface ISecretManagerSource + * @property {string|null} [secretVersion] SecretManagerSource secretVersion + */ - /** - * Constructs a new ListChannelsRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a ListChannelsRequest. - * @implements IListChannelsRequest - * @constructor - * @param {google.cloud.video.livestream.v1.IListChannelsRequest=} [properties] Properties to set - */ - function ListChannelsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new SecretManagerSource. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a SecretManagerSource. + * @implements ISecretManagerSource + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.ISecretManagerSource=} [properties] Properties to set + */ + function SecretManagerSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ListChannelsRequest parent. - * @member {string} parent - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @instance - */ - ListChannelsRequest.prototype.parent = ""; + /** + * SecretManagerSource secretVersion. + * @member {string} secretVersion + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @instance + */ + SecretManagerSource.prototype.secretVersion = ""; - /** - * ListChannelsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @instance - */ - ListChannelsRequest.prototype.pageSize = 0; + /** + * Creates a new SecretManagerSource instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {google.cloud.video.livestream.v1.Encryption.ISecretManagerSource=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.SecretManagerSource} SecretManagerSource instance + */ + SecretManagerSource.create = function create(properties) { + return new SecretManagerSource(properties); + }; - /** - * ListChannelsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @instance - */ - ListChannelsRequest.prototype.pageToken = ""; + /** + * Encodes the specified SecretManagerSource message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SecretManagerSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {google.cloud.video.livestream.v1.Encryption.ISecretManagerSource} message SecretManagerSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretManagerSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secretVersion != null && Object.hasOwnProperty.call(message, "secretVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secretVersion); + return writer; + }; - /** - * ListChannelsRequest filter. - * @member {string} filter - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @instance - */ - ListChannelsRequest.prototype.filter = ""; + /** + * Encodes the specified SecretManagerSource message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SecretManagerSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {google.cloud.video.livestream.v1.Encryption.ISecretManagerSource} message SecretManagerSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretManagerSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ListChannelsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @instance - */ - ListChannelsRequest.prototype.orderBy = ""; + /** + * Decodes a SecretManagerSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.SecretManagerSource} SecretManagerSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretManagerSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.secretVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new ListChannelsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {google.cloud.video.livestream.v1.IListChannelsRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest instance - */ - ListChannelsRequest.create = function create(properties) { - return new ListChannelsRequest(properties); - }; + /** + * Decodes a SecretManagerSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.SecretManagerSource} SecretManagerSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretManagerSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ListChannelsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {google.cloud.video.livestream.v1.IListChannelsRequest} message ListChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChannelsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; + /** + * Verifies a SecretManagerSource message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretManagerSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + if (!$util.isString(message.secretVersion)) + return "secretVersion: string expected"; + return null; + }; - /** - * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {google.cloud.video.livestream.v1.IListChannelsRequest} message ListChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a SecretManagerSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.SecretManagerSource} SecretManagerSource + */ + SecretManagerSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource) + return object; + var message = new $root.google.cloud.video.livestream.v1.Encryption.SecretManagerSource(); + if (object.secretVersion != null) + message.secretVersion = String(object.secretVersion); + return message; + }; - /** - * Decodes a ListChannelsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChannelsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListChannelsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a SecretManagerSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {google.cloud.video.livestream.v1.Encryption.SecretManagerSource} message SecretManagerSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretManagerSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.secretVersion = ""; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + object.secretVersion = message.secretVersion; + return object; + }; + + /** + * Converts this SecretManagerSource to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @instance + * @returns {Object.} JSON object + */ + SecretManagerSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretManagerSource + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.SecretManagerSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretManagerSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - } - return message; - }; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.SecretManagerSource"; + }; - /** - * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChannelsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return SecretManagerSource; + })(); - /** - * Verifies a ListChannelsRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListChannelsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + Encryption.Widevine = (function() { - /** - * Creates a ListChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest - */ - ListChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.ListChannelsRequest) - return object; - var message = new $root.google.cloud.video.livestream.v1.ListChannelsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; + /** + * Properties of a Widevine. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface IWidevine + */ - /** - * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {google.cloud.video.livestream.v1.ListChannelsRequest} message ListChannelsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListChannelsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + /** + * Constructs a new Widevine. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a Widevine. + * @implements IWidevine + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.IWidevine=} [properties] Properties to set + */ + function Widevine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - /** - * Converts this ListChannelsRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @instance - * @returns {Object.} JSON object - */ - ListChannelsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new Widevine instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IWidevine=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.Widevine} Widevine instance + */ + Widevine.create = function create(properties) { + return new Widevine(properties); + }; - /** - * Gets the default type url for ListChannelsRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.ListChannelsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListChannelsRequest"; - }; + /** + * Encodes the specified Widevine message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Widevine.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IWidevine} message Widevine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widevine.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - return ListChannelsRequest; - })(); + /** + * Encodes the specified Widevine message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Widevine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IWidevine} message Widevine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widevine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - v1.ListChannelsResponse = (function() { + /** + * Decodes a Widevine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.Widevine} Widevine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widevine.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.Widevine(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a ListChannelsResponse. - * @memberof google.cloud.video.livestream.v1 - * @interface IListChannelsResponse - * @property {Array.|null} [channels] ListChannelsResponse channels - * @property {string|null} [nextPageToken] ListChannelsResponse nextPageToken - * @property {Array.|null} [unreachable] ListChannelsResponse unreachable - */ + /** + * Decodes a Widevine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.Widevine} Widevine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widevine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new ListChannelsResponse. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a ListChannelsResponse. - * @implements IListChannelsResponse - * @constructor - * @param {google.cloud.video.livestream.v1.IListChannelsResponse=} [properties] Properties to set - */ - function ListChannelsResponse(properties) { - this.channels = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies a Widevine message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Widevine.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * ListChannelsResponse channels. - * @member {Array.} channels - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @instance - */ - ListChannelsResponse.prototype.channels = $util.emptyArray; + /** + * Creates a Widevine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.Widevine} Widevine + */ + Widevine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.Widevine) + return object; + return new $root.google.cloud.video.livestream.v1.Encryption.Widevine(); + }; - /** - * ListChannelsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @instance - */ - ListChannelsResponse.prototype.nextPageToken = ""; + /** + * Creates a plain object from a Widevine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {google.cloud.video.livestream.v1.Encryption.Widevine} message Widevine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Widevine.toObject = function toObject() { + return {}; + }; - /** - * ListChannelsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @instance - */ - ListChannelsResponse.prototype.unreachable = $util.emptyArray; + /** + * Converts this Widevine to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @instance + * @returns {Object.} JSON object + */ + Widevine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new ListChannelsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {google.cloud.video.livestream.v1.IListChannelsResponse=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse instance - */ - ListChannelsResponse.create = function create(properties) { - return new ListChannelsResponse(properties); - }; + /** + * Gets the default type url for Widevine + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.Widevine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Widevine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.Widevine"; + }; - /** - * Encodes the specified ListChannelsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {google.cloud.video.livestream.v1.IListChannelsResponse} message ListChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChannelsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channels != null && message.channels.length) - for (var i = 0; i < message.channels.length; ++i) - $root.google.cloud.video.livestream.v1.Channel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; + return Widevine; + })(); - /** - * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {google.cloud.video.livestream.v1.IListChannelsResponse} message ListChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Encryption.Fairplay = (function() { - /** - * Decodes a ListChannelsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChannelsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListChannelsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.channels && message.channels.length)) - message.channels = []; - message.channels.push($root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } + /** + * Properties of a Fairplay. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface IFairplay + */ + + /** + * Constructs a new Fairplay. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a Fairplay. + * @implements IFairplay + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.IFairplay=} [properties] Properties to set + */ + function Fairplay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChannelsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new Fairplay instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IFairplay=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.Fairplay} Fairplay instance + */ + Fairplay.create = function create(properties) { + return new Fairplay(properties); + }; - /** - * Verifies a ListChannelsResponse message. - * @function verify - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListChannelsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channels != null && message.hasOwnProperty("channels")) { - if (!Array.isArray(message.channels)) - return "channels: array expected"; - for (var i = 0; i < message.channels.length; ++i) { - var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channels[i]); - if (error) - return "channels." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; + /** + * Encodes the specified Fairplay message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Fairplay.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IFairplay} message Fairplay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fairplay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Creates a ListChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse - */ - ListChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.ListChannelsResponse) - return object; - var message = new $root.google.cloud.video.livestream.v1.ListChannelsResponse(); - if (object.channels) { - if (!Array.isArray(object.channels)) - throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.channels: array expected"); - message.channels = []; - for (var i = 0; i < object.channels.length; ++i) { - if (typeof object.channels[i] !== "object") - throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.channels: object expected"); - message.channels[i] = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channels[i]); + /** + * Encodes the specified Fairplay message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Fairplay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IFairplay} message Fairplay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fairplay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fairplay message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.Fairplay} Fairplay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fairplay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.Fairplay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; + return message; + }; - /** - * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {google.cloud.video.livestream.v1.ListChannelsResponse} message ListChannelsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListChannelsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.channels = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.channels && message.channels.length) { - object.channels = []; - for (var j = 0; j < message.channels.length; ++j) - object.channels[j] = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channels[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; + /** + * Decodes a Fairplay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.Fairplay} Fairplay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fairplay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this ListChannelsResponse to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @instance - * @returns {Object.} JSON object - */ - ListChannelsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a Fairplay message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fairplay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Gets the default type url for ListChannelsResponse - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.ListChannelsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListChannelsResponse"; - }; + /** + * Creates a Fairplay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.Fairplay} Fairplay + */ + Fairplay.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.Fairplay) + return object; + return new $root.google.cloud.video.livestream.v1.Encryption.Fairplay(); + }; - return ListChannelsResponse; - })(); + /** + * Creates a plain object from a Fairplay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {google.cloud.video.livestream.v1.Encryption.Fairplay} message Fairplay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fairplay.toObject = function toObject() { + return {}; + }; - v1.GetChannelRequest = (function() { + /** + * Converts this Fairplay to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @instance + * @returns {Object.} JSON object + */ + Fairplay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a GetChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface IGetChannelRequest - * @property {string|null} [name] GetChannelRequest name - */ + /** + * Gets the default type url for Fairplay + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.Fairplay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fairplay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.Fairplay"; + }; - /** - * Constructs a new GetChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a GetChannelRequest. - * @implements IGetChannelRequest - * @constructor - * @param {google.cloud.video.livestream.v1.IGetChannelRequest=} [properties] Properties to set - */ - function GetChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return Fairplay; + })(); - /** - * GetChannelRequest name. - * @member {string} name - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @instance - */ - GetChannelRequest.prototype.name = ""; + Encryption.Playready = (function() { - /** - * Creates a new GetChannelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IGetChannelRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest instance - */ - GetChannelRequest.create = function create(properties) { - return new GetChannelRequest(properties); - }; + /** + * Properties of a Playready. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface IPlayready + */ - /** - * Encodes the specified GetChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IGetChannelRequest} message GetChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Constructs a new Playready. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a Playready. + * @implements IPlayready + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.IPlayready=} [properties] Properties to set + */ + function Playready(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified GetChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IGetChannelRequest} message GetChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new Playready instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IPlayready=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.Playready} Playready instance + */ + Playready.create = function create(properties) { + return new Playready(properties); + }; - /** - * Decodes a GetChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + /** + * Encodes the specified Playready message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Playready.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IPlayready} message Playready message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Playready.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Playready message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Playready.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IPlayready} message Playready message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Playready.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Playready message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.Playready} Playready + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Playready.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.Playready(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes a GetChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a GetChannelRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Decodes a Playready message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.Playready} Playready + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Playready.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a GetChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest - */ - GetChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.GetChannelRequest) - return object; - var message = new $root.google.cloud.video.livestream.v1.GetChannelRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Verifies a Playready message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Playready.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Creates a plain object from a GetChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.GetChannelRequest} message GetChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Creates a Playready message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.Playready} Playready + */ + Playready.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.Playready) + return object; + return new $root.google.cloud.video.livestream.v1.Encryption.Playready(); + }; - /** - * Converts this GetChannelRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @instance - * @returns {Object.} JSON object - */ - GetChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a Playready message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {google.cloud.video.livestream.v1.Encryption.Playready} message Playready + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Playready.toObject = function toObject() { + return {}; + }; - /** - * Gets the default type url for GetChannelRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.GetChannelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetChannelRequest"; - }; + /** + * Converts this Playready to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @instance + * @returns {Object.} JSON object + */ + Playready.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return GetChannelRequest; - })(); + /** + * Gets the default type url for Playready + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.Playready + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Playready.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.Playready"; + }; - v1.DeleteChannelRequest = (function() { + return Playready; + })(); - /** - * Properties of a DeleteChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface IDeleteChannelRequest - * @property {string|null} [name] DeleteChannelRequest name - * @property {string|null} [requestId] DeleteChannelRequest requestId - * @property {boolean|null} [force] DeleteChannelRequest force - */ + Encryption.Clearkey = (function() { - /** - * Constructs a new DeleteChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a DeleteChannelRequest. - * @implements IDeleteChannelRequest - * @constructor - * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest=} [properties] Properties to set - */ - function DeleteChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a Clearkey. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface IClearkey + */ - /** - * DeleteChannelRequest name. - * @member {string} name - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @instance - */ - DeleteChannelRequest.prototype.name = ""; + /** + * Constructs a new Clearkey. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a Clearkey. + * @implements IClearkey + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.IClearkey=} [properties] Properties to set + */ + function Clearkey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * DeleteChannelRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @instance - */ - DeleteChannelRequest.prototype.requestId = ""; + /** + * Creates a new Clearkey instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IClearkey=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.Clearkey} Clearkey instance + */ + Clearkey.create = function create(properties) { + return new Clearkey(properties); + }; - /** - * DeleteChannelRequest force. - * @member {boolean} force - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @instance - */ - DeleteChannelRequest.prototype.force = false; + /** + * Encodes the specified Clearkey message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Clearkey.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IClearkey} message Clearkey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Clearkey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Creates a new DeleteChannelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest instance - */ - DeleteChannelRequest.create = function create(properties) { - return new DeleteChannelRequest(properties); - }; + /** + * Encodes the specified Clearkey message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Clearkey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IClearkey} message Clearkey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Clearkey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified DeleteChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} message DeleteChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); - return writer; - }; + /** + * Decodes a Clearkey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.Clearkey} Clearkey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Clearkey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.Clearkey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified DeleteChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} message DeleteChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Clearkey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.Clearkey} Clearkey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Clearkey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a DeleteChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a Clearkey message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Clearkey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Decodes a DeleteChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a Clearkey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.Clearkey} Clearkey + */ + Clearkey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.Clearkey) + return object; + return new $root.google.cloud.video.livestream.v1.Encryption.Clearkey(); + }; - /** - * Verifies a DeleteChannelRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; + /** + * Creates a plain object from a Clearkey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {google.cloud.video.livestream.v1.Encryption.Clearkey} message Clearkey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Clearkey.toObject = function toObject() { + return {}; + }; - /** - * Creates a DeleteChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest - */ - DeleteChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.DeleteChannelRequest) - return object; - var message = new $root.google.cloud.video.livestream.v1.DeleteChannelRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; + /** + * Converts this Clearkey to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @instance + * @returns {Object.} JSON object + */ + Clearkey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a DeleteChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.DeleteChannelRequest} message DeleteChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.force = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; - }; + /** + * Gets the default type url for Clearkey + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.Clearkey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Clearkey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.Clearkey"; + }; - /** - * Converts this DeleteChannelRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Clearkey; + })(); - /** - * Gets the default type url for DeleteChannelRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + Encryption.DrmSystems = (function() { + + /** + * Properties of a DrmSystems. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface IDrmSystems + * @property {google.cloud.video.livestream.v1.Encryption.IWidevine|null} [widevine] DrmSystems widevine + * @property {google.cloud.video.livestream.v1.Encryption.IFairplay|null} [fairplay] DrmSystems fairplay + * @property {google.cloud.video.livestream.v1.Encryption.IPlayready|null} [playready] DrmSystems playready + * @property {google.cloud.video.livestream.v1.Encryption.IClearkey|null} [clearkey] DrmSystems clearkey + */ + + /** + * Constructs a new DrmSystems. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a DrmSystems. + * @implements IDrmSystems + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.IDrmSystems=} [properties] Properties to set + */ + function DrmSystems(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteChannelRequest"; - }; - return DeleteChannelRequest; - })(); + /** + * DrmSystems widevine. + * @member {google.cloud.video.livestream.v1.Encryption.IWidevine|null|undefined} widevine + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @instance + */ + DrmSystems.prototype.widevine = null; - v1.UpdateChannelRequest = (function() { + /** + * DrmSystems fairplay. + * @member {google.cloud.video.livestream.v1.Encryption.IFairplay|null|undefined} fairplay + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @instance + */ + DrmSystems.prototype.fairplay = null; - /** - * Properties of an UpdateChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface IUpdateChannelRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateChannelRequest updateMask - * @property {google.cloud.video.livestream.v1.IChannel|null} [channel] UpdateChannelRequest channel - * @property {string|null} [requestId] UpdateChannelRequest requestId - */ + /** + * DrmSystems playready. + * @member {google.cloud.video.livestream.v1.Encryption.IPlayready|null|undefined} playready + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @instance + */ + DrmSystems.prototype.playready = null; - /** - * Constructs a new UpdateChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents an UpdateChannelRequest. - * @implements IUpdateChannelRequest - * @constructor - * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest=} [properties] Properties to set - */ - function UpdateChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * DrmSystems clearkey. + * @member {google.cloud.video.livestream.v1.Encryption.IClearkey|null|undefined} clearkey + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @instance + */ + DrmSystems.prototype.clearkey = null; - /** - * UpdateChannelRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @instance - */ - UpdateChannelRequest.prototype.updateMask = null; - - /** - * UpdateChannelRequest channel. - * @member {google.cloud.video.livestream.v1.IChannel|null|undefined} channel - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @instance - */ - UpdateChannelRequest.prototype.channel = null; - - /** - * UpdateChannelRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @instance - */ - UpdateChannelRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateChannelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest instance - */ - UpdateChannelRequest.create = function create(properties) { - return new UpdateChannelRequest(properties); - }; + /** + * Creates a new DrmSystems instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IDrmSystems=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.DrmSystems} DrmSystems instance + */ + DrmSystems.create = function create(properties) { + return new DrmSystems(properties); + }; - /** - * Encodes the specified UpdateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} message UpdateChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.google.cloud.video.livestream.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; + /** + * Encodes the specified DrmSystems message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.DrmSystems.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IDrmSystems} message DrmSystems message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DrmSystems.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.widevine != null && Object.hasOwnProperty.call(message, "widevine")) + $root.google.cloud.video.livestream.v1.Encryption.Widevine.encode(message.widevine, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fairplay != null && Object.hasOwnProperty.call(message, "fairplay")) + $root.google.cloud.video.livestream.v1.Encryption.Fairplay.encode(message.fairplay, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.playready != null && Object.hasOwnProperty.call(message, "playready")) + $root.google.cloud.video.livestream.v1.Encryption.Playready.encode(message.playready, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clearkey != null && Object.hasOwnProperty.call(message, "clearkey")) + $root.google.cloud.video.livestream.v1.Encryption.Clearkey.encode(message.clearkey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified UpdateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} message UpdateChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified DrmSystems message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.DrmSystems.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IDrmSystems} message DrmSystems message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DrmSystems.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an UpdateChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.UpdateChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.channel = $root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); + /** + * Decodes a DrmSystems message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.DrmSystems} DrmSystems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DrmSystems.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.DrmSystems(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.widevine = $root.google.cloud.video.livestream.v1.Encryption.Widevine.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fairplay = $root.google.cloud.video.livestream.v1.Encryption.Fairplay.decode(reader, reader.uint32()); + break; + } + case 3: { + message.playready = $root.google.cloud.video.livestream.v1.Encryption.Playready.decode(reader, reader.uint32()); + break; + } + case 4: { + message.clearkey = $root.google.cloud.video.livestream.v1.Encryption.Clearkey.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes an UpdateChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a DrmSystems message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.DrmSystems} DrmSystems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DrmSystems.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an UpdateChannelRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.channel != null && message.hasOwnProperty("channel")) { - var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; + /** + * Verifies a DrmSystems message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DrmSystems.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.widevine != null && message.hasOwnProperty("widevine")) { + var error = $root.google.cloud.video.livestream.v1.Encryption.Widevine.verify(message.widevine); + if (error) + return "widevine." + error; + } + if (message.fairplay != null && message.hasOwnProperty("fairplay")) { + var error = $root.google.cloud.video.livestream.v1.Encryption.Fairplay.verify(message.fairplay); + if (error) + return "fairplay." + error; + } + if (message.playready != null && message.hasOwnProperty("playready")) { + var error = $root.google.cloud.video.livestream.v1.Encryption.Playready.verify(message.playready); + if (error) + return "playready." + error; + } + if (message.clearkey != null && message.hasOwnProperty("clearkey")) { + var error = $root.google.cloud.video.livestream.v1.Encryption.Clearkey.verify(message.clearkey); + if (error) + return "clearkey." + error; + } + return null; + }; - /** - * Creates an UpdateChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest - */ - UpdateChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.UpdateChannelRequest) + /** + * Creates a DrmSystems message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.DrmSystems} DrmSystems + */ + DrmSystems.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.DrmSystems) + return object; + var message = new $root.google.cloud.video.livestream.v1.Encryption.DrmSystems(); + if (object.widevine != null) { + if (typeof object.widevine !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.DrmSystems.widevine: object expected"); + message.widevine = $root.google.cloud.video.livestream.v1.Encryption.Widevine.fromObject(object.widevine); + } + if (object.fairplay != null) { + if (typeof object.fairplay !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.DrmSystems.fairplay: object expected"); + message.fairplay = $root.google.cloud.video.livestream.v1.Encryption.Fairplay.fromObject(object.fairplay); + } + if (object.playready != null) { + if (typeof object.playready !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.DrmSystems.playready: object expected"); + message.playready = $root.google.cloud.video.livestream.v1.Encryption.Playready.fromObject(object.playready); + } + if (object.clearkey != null) { + if (typeof object.clearkey !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Encryption.DrmSystems.clearkey: object expected"); + message.clearkey = $root.google.cloud.video.livestream.v1.Encryption.Clearkey.fromObject(object.clearkey); + } + return message; + }; + + /** + * Creates a plain object from a DrmSystems message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {google.cloud.video.livestream.v1.Encryption.DrmSystems} message DrmSystems + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DrmSystems.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.widevine = null; + object.fairplay = null; + object.playready = null; + object.clearkey = null; + } + if (message.widevine != null && message.hasOwnProperty("widevine")) + object.widevine = $root.google.cloud.video.livestream.v1.Encryption.Widevine.toObject(message.widevine, options); + if (message.fairplay != null && message.hasOwnProperty("fairplay")) + object.fairplay = $root.google.cloud.video.livestream.v1.Encryption.Fairplay.toObject(message.fairplay, options); + if (message.playready != null && message.hasOwnProperty("playready")) + object.playready = $root.google.cloud.video.livestream.v1.Encryption.Playready.toObject(message.playready, options); + if (message.clearkey != null && message.hasOwnProperty("clearkey")) + object.clearkey = $root.google.cloud.video.livestream.v1.Encryption.Clearkey.toObject(message.clearkey, options); return object; - var message = new $root.google.cloud.video.livestream.v1.UpdateChannelRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.video.livestream.v1.UpdateChannelRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".google.cloud.video.livestream.v1.UpdateChannelRequest.channel: object expected"); - message.channel = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channel); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.UpdateChannelRequest} message UpdateChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.channel = null; - object.requestId = ""; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channel, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateChannelRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateChannelRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.UpdateChannelRequest"; - }; + }; - return UpdateChannelRequest; - })(); + /** + * Converts this DrmSystems to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @instance + * @returns {Object.} JSON object + */ + DrmSystems.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.StartChannelRequest = (function() { + /** + * Gets the default type url for DrmSystems + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.DrmSystems + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DrmSystems.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.DrmSystems"; + }; - /** - * Properties of a StartChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface IStartChannelRequest - * @property {string|null} [name] StartChannelRequest name - * @property {string|null} [requestId] StartChannelRequest requestId - */ + return DrmSystems; + })(); - /** - * Constructs a new StartChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a StartChannelRequest. - * @implements IStartChannelRequest - * @constructor - * @param {google.cloud.video.livestream.v1.IStartChannelRequest=} [properties] Properties to set - */ - function StartChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Encryption.Aes128Encryption = (function() { - /** - * StartChannelRequest name. - * @member {string} name - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @instance - */ - StartChannelRequest.prototype.name = ""; + /** + * Properties of an Aes128Encryption. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface IAes128Encryption + */ - /** - * StartChannelRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @instance - */ - StartChannelRequest.prototype.requestId = ""; + /** + * Constructs a new Aes128Encryption. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents an Aes128Encryption. + * @implements IAes128Encryption + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.IAes128Encryption=} [properties] Properties to set + */ + function Aes128Encryption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new StartChannelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IStartChannelRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest instance - */ - StartChannelRequest.create = function create(properties) { - return new StartChannelRequest(properties); - }; + /** + * Creates a new Aes128Encryption instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IAes128Encryption=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.Aes128Encryption} Aes128Encryption instance + */ + Aes128Encryption.create = function create(properties) { + return new Aes128Encryption(properties); + }; - /** - * Encodes the specified StartChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IStartChannelRequest} message StartChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; + /** + * Encodes the specified Aes128Encryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Aes128Encryption.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IAes128Encryption} message Aes128Encryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aes128Encryption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Encodes the specified StartChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IStartChannelRequest} message StartChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Aes128Encryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.Aes128Encryption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IAes128Encryption} message Aes128Encryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aes128Encryption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a StartChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.StartChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); + /** + * Decodes an Aes128Encryption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.Aes128Encryption} Aes128Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aes128Encryption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a StartChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartChannelRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a StartChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest - */ - StartChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.StartChannelRequest) - return object; - var message = new $root.google.cloud.video.livestream.v1.StartChannelRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; + /** + * Decodes an Aes128Encryption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.Aes128Encryption} Aes128Encryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aes128Encryption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a StartChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.StartChannelRequest} message StartChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; + /** + * Verifies an Aes128Encryption message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aes128Encryption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Converts this StartChannelRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @instance - * @returns {Object.} JSON object - */ - StartChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates an Aes128Encryption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.Aes128Encryption} Aes128Encryption + */ + Aes128Encryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption) + return object; + return new $root.google.cloud.video.livestream.v1.Encryption.Aes128Encryption(); + }; - /** - * Gets the default type url for StartChannelRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.StartChannelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StartChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.StartChannelRequest"; - }; + /** + * Creates a plain object from an Aes128Encryption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.Aes128Encryption} message Aes128Encryption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aes128Encryption.toObject = function toObject() { + return {}; + }; - return StartChannelRequest; - })(); + /** + * Converts this Aes128Encryption to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @instance + * @returns {Object.} JSON object + */ + Aes128Encryption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.StopChannelRequest = (function() { + /** + * Gets the default type url for Aes128Encryption + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.Aes128Encryption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aes128Encryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.Aes128Encryption"; + }; - /** - * Properties of a StopChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface IStopChannelRequest - * @property {string|null} [name] StopChannelRequest name - * @property {string|null} [requestId] StopChannelRequest requestId - */ + return Aes128Encryption; + })(); - /** - * Constructs a new StopChannelRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a StopChannelRequest. - * @implements IStopChannelRequest - * @constructor - * @param {google.cloud.video.livestream.v1.IStopChannelRequest=} [properties] Properties to set - */ - function StopChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Encryption.SampleAesEncryption = (function() { - /** - * StopChannelRequest name. - * @member {string} name - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @instance - */ - StopChannelRequest.prototype.name = ""; + /** + * Properties of a SampleAesEncryption. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface ISampleAesEncryption + */ - /** - * StopChannelRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @instance - */ - StopChannelRequest.prototype.requestId = ""; + /** + * Constructs a new SampleAesEncryption. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a SampleAesEncryption. + * @implements ISampleAesEncryption + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption=} [properties] Properties to set + */ + function SampleAesEncryption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new StopChannelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IStopChannelRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest instance - */ - StopChannelRequest.create = function create(properties) { - return new StopChannelRequest(properties); - }; + /** + * Creates a new SampleAesEncryption instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.SampleAesEncryption} SampleAesEncryption instance + */ + SampleAesEncryption.create = function create(properties) { + return new SampleAesEncryption(properties); + }; - /** - * Encodes the specified StopChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IStopChannelRequest} message StopChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; + /** + * Encodes the specified SampleAesEncryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption} message SampleAesEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleAesEncryption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Encodes the specified StopChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.IStopChannelRequest} message StopChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SampleAesEncryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.SampleAesEncryption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.ISampleAesEncryption} message SampleAesEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SampleAesEncryption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a StopChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.StopChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); + /** + * Decodes a SampleAesEncryption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.SampleAesEncryption} SampleAesEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleAesEncryption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a StopChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SampleAesEncryption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.SampleAesEncryption} SampleAesEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SampleAesEncryption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a StopChannelRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StopChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; + /** + * Verifies a SampleAesEncryption message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SampleAesEncryption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Creates a StopChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest - */ - StopChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.StopChannelRequest) - return object; - var message = new $root.google.cloud.video.livestream.v1.StopChannelRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; + /** + * Creates a SampleAesEncryption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.SampleAesEncryption} SampleAesEncryption + */ + SampleAesEncryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption) + return object; + return new $root.google.cloud.video.livestream.v1.Encryption.SampleAesEncryption(); + }; - /** - * Creates a plain object from a StopChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {google.cloud.video.livestream.v1.StopChannelRequest} message StopChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StopChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; + /** + * Creates a plain object from a SampleAesEncryption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.SampleAesEncryption} message SampleAesEncryption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SampleAesEncryption.toObject = function toObject() { + return {}; + }; - /** - * Converts this StopChannelRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @instance - * @returns {Object.} JSON object - */ - StopChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this SampleAesEncryption to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @instance + * @returns {Object.} JSON object + */ + SampleAesEncryption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for StopChannelRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.StopChannelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StopChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.StopChannelRequest"; - }; + /** + * Gets the default type url for SampleAesEncryption + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SampleAesEncryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.SampleAesEncryption"; + }; - return StopChannelRequest; - })(); + return SampleAesEncryption; + })(); - v1.CreateInputRequest = (function() { + Encryption.MpegCommonEncryption = (function() { - /** - * Properties of a CreateInputRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface ICreateInputRequest - * @property {string|null} [parent] CreateInputRequest parent - * @property {google.cloud.video.livestream.v1.IInput|null} [input] CreateInputRequest input - * @property {string|null} [inputId] CreateInputRequest inputId - * @property {string|null} [requestId] CreateInputRequest requestId - */ + /** + * Properties of a MpegCommonEncryption. + * @memberof google.cloud.video.livestream.v1.Encryption + * @interface IMpegCommonEncryption + * @property {string|null} [scheme] MpegCommonEncryption scheme + */ - /** - * Constructs a new CreateInputRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a CreateInputRequest. - * @implements ICreateInputRequest - * @constructor - * @param {google.cloud.video.livestream.v1.ICreateInputRequest=} [properties] Properties to set - */ - function CreateInputRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new MpegCommonEncryption. + * @memberof google.cloud.video.livestream.v1.Encryption + * @classdesc Represents a MpegCommonEncryption. + * @implements IMpegCommonEncryption + * @constructor + * @param {google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption=} [properties] Properties to set + */ + function MpegCommonEncryption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * CreateInputRequest parent. - * @member {string} parent - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @instance - */ - CreateInputRequest.prototype.parent = ""; + /** + * MpegCommonEncryption scheme. + * @member {string} scheme + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @instance + */ + MpegCommonEncryption.prototype.scheme = ""; - /** - * CreateInputRequest input. - * @member {google.cloud.video.livestream.v1.IInput|null|undefined} input - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @instance - */ - CreateInputRequest.prototype.input = null; + /** + * Creates a new MpegCommonEncryption instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption} MpegCommonEncryption instance + */ + MpegCommonEncryption.create = function create(properties) { + return new MpegCommonEncryption(properties); + }; - /** - * CreateInputRequest inputId. - * @member {string} inputId - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @instance - */ - CreateInputRequest.prototype.inputId = ""; + /** + * Encodes the specified MpegCommonEncryption message. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption} message MpegCommonEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MpegCommonEncryption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheme != null && Object.hasOwnProperty.call(message, "scheme")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scheme); + return writer; + }; + + /** + * Encodes the specified MpegCommonEncryption message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.IMpegCommonEncryption} message MpegCommonEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MpegCommonEncryption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MpegCommonEncryption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption} MpegCommonEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MpegCommonEncryption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheme = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MpegCommonEncryption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption} MpegCommonEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MpegCommonEncryption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MpegCommonEncryption message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MpegCommonEncryption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheme != null && message.hasOwnProperty("scheme")) + if (!$util.isString(message.scheme)) + return "scheme: string expected"; + return null; + }; + + /** + * Creates a MpegCommonEncryption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption} MpegCommonEncryption + */ + MpegCommonEncryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption) + return object; + var message = new $root.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption(); + if (object.scheme != null) + message.scheme = String(object.scheme); + return message; + }; + + /** + * Creates a plain object from a MpegCommonEncryption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption} message MpegCommonEncryption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MpegCommonEncryption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.scheme = ""; + if (message.scheme != null && message.hasOwnProperty("scheme")) + object.scheme = message.scheme; + return object; + }; + + /** + * Converts this MpegCommonEncryption to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @instance + * @returns {Object.} JSON object + */ + MpegCommonEncryption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MpegCommonEncryption + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MpegCommonEncryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption"; + }; + + return MpegCommonEncryption; + })(); + + return Encryption; + })(); + + v1.LivestreamService = (function() { /** - * CreateInputRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @instance + * Constructs a new LivestreamService service. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a LivestreamService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - CreateInputRequest.prototype.requestId = ""; + function LivestreamService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LivestreamService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LivestreamService; /** - * Creates a new CreateInputRequest instance using the specified properties. + * Creates new LivestreamService service using the specified rpc implementation. * @function create - * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @memberof google.cloud.video.livestream.v1.LivestreamService * @static - * @param {google.cloud.video.livestream.v1.ICreateInputRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest instance + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {LivestreamService} RPC service. Useful where requests and/or responses are streamed. */ - CreateInputRequest.create = function create(properties) { - return new CreateInputRequest(properties); + LivestreamService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified CreateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {google.cloud.video.livestream.v1.ICreateInputRequest} message CreateInputRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef CreateChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - CreateInputRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.input != null && Object.hasOwnProperty.call(message, "input")) - $root.google.cloud.video.livestream.v1.Input.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inputId != null && Object.hasOwnProperty.call(message, "inputId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputId); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; /** - * Encodes the specified CreateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {google.cloud.video.livestream.v1.ICreateInputRequest} message CreateInputRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateChannel. + * @function createChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} request CreateChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.CreateChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CreateInputRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(LivestreamService.prototype.createChannel = function createChannel(request, callback) { + return this.rpcCall(createChannel, $root.google.cloud.video.livestream.v1.CreateChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateChannel" }); /** - * Decodes a CreateInputRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateChannel. + * @function createChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} request CreateChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateInputRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateInputRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.input = $root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32()); - break; - } - case 3: { - message.inputId = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a CreateInputRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInputRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInputRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listChannels}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef ListChannelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.ListChannelsResponse} [response] ListChannelsResponse */ - CreateInputRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.input != null && message.hasOwnProperty("input")) { - var error = $root.google.cloud.video.livestream.v1.Input.verify(message.input); - if (error) - return "input." + error; - } - if (message.inputId != null && message.hasOwnProperty("inputId")) - if (!$util.isString(message.inputId)) - return "inputId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; /** - * Creates a CreateInputRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest + * Calls ListChannels. + * @function listChannels + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} request ListChannelsRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.ListChannelsCallback} callback Node-style callback called with the error, if any, and ListChannelsResponse + * @returns {undefined} + * @variation 1 */ - CreateInputRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.CreateInputRequest) - return object; - var message = new $root.google.cloud.video.livestream.v1.CreateInputRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.input != null) { - if (typeof object.input !== "object") - throw TypeError(".google.cloud.video.livestream.v1.CreateInputRequest.input: object expected"); - message.input = $root.google.cloud.video.livestream.v1.Input.fromObject(object.input); - } - if (object.inputId != null) - message.inputId = String(object.inputId); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; + Object.defineProperty(LivestreamService.prototype.listChannels = function listChannels(request, callback) { + return this.rpcCall(listChannels, $root.google.cloud.video.livestream.v1.ListChannelsRequest, $root.google.cloud.video.livestream.v1.ListChannelsResponse, request, callback); + }, "name", { value: "ListChannels" }); /** - * Creates a plain object from a CreateInputRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {google.cloud.video.livestream.v1.CreateInputRequest} message CreateInputRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ListChannels. + * @function listChannels + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} request ListChannelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateInputRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.input = null; - object.inputId = ""; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.input != null && message.hasOwnProperty("input")) - object.input = $root.google.cloud.video.livestream.v1.Input.toObject(message.input, options); - if (message.inputId != null && message.hasOwnProperty("inputId")) - object.inputId = message.inputId; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; /** - * Converts this CreateInputRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @instance - * @returns {Object.} JSON object + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef GetChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Channel} [response] Channel */ - CreateInputRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for CreateInputRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.CreateInputRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls GetChannel. + * @function getChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} request GetChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.GetChannelCallback} callback Node-style callback called with the error, if any, and Channel + * @returns {undefined} + * @variation 1 */ - CreateInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateInputRequest"; - }; - - return CreateInputRequest; - })(); - - v1.ListInputsRequest = (function() { + Object.defineProperty(LivestreamService.prototype.getChannel = function getChannel(request, callback) { + return this.rpcCall(getChannel, $root.google.cloud.video.livestream.v1.GetChannelRequest, $root.google.cloud.video.livestream.v1.Channel, request, callback); + }, "name", { value: "GetChannel" }); /** - * Properties of a ListInputsRequest. - * @memberof google.cloud.video.livestream.v1 - * @interface IListInputsRequest - * @property {string|null} [parent] ListInputsRequest parent - * @property {number|null} [pageSize] ListInputsRequest pageSize - * @property {string|null} [pageToken] ListInputsRequest pageToken - * @property {string|null} [filter] ListInputsRequest filter - * @property {string|null} [orderBy] ListInputsRequest orderBy + * Calls GetChannel. + * @function getChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} request GetChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListInputsRequest. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a ListInputsRequest. - * @implements IListInputsRequest - * @constructor - * @param {google.cloud.video.livestream.v1.IListInputsRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef DeleteChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function ListInputsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ListInputsRequest parent. - * @member {string} parent - * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * Calls DeleteChannel. + * @function deleteChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} request DeleteChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInputsRequest.prototype.parent = ""; + Object.defineProperty(LivestreamService.prototype.deleteChannel = function deleteChannel(request, callback) { + return this.rpcCall(deleteChannel, $root.google.cloud.video.livestream.v1.DeleteChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteChannel" }); /** - * ListInputsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * Calls DeleteChannel. + * @function deleteChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} request DeleteChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsRequest.prototype.pageSize = 0; /** - * ListInputsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @instance + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef UpdateChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInputsRequest.prototype.pageToken = ""; /** - * ListInputsRequest filter. - * @member {string} filter - * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * Calls UpdateChannel. + * @function updateChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} request UpdateChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.UpdateChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInputsRequest.prototype.filter = ""; + Object.defineProperty(LivestreamService.prototype.updateChannel = function updateChannel(request, callback) { + return this.rpcCall(updateChannel, $root.google.cloud.video.livestream.v1.UpdateChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateChannel" }); /** - * ListInputsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * Calls UpdateChannel. + * @function updateChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} request UpdateChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsRequest.prototype.orderBy = ""; /** - * Creates a new ListInputsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {google.cloud.video.livestream.v1.IListInputsRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest instance + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|startChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef StartChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInputsRequest.create = function create(properties) { - return new ListInputsRequest(properties); - }; /** - * Encodes the specified ListInputsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {google.cloud.video.livestream.v1.IListInputsRequest} message ListInputsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls StartChannel. + * @function startChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} request StartChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.StartChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInputsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; + Object.defineProperty(LivestreamService.prototype.startChannel = function startChannel(request, callback) { + return this.rpcCall(startChannel, $root.google.cloud.video.livestream.v1.StartChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartChannel" }); /** - * Encodes the specified ListInputsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {google.cloud.video.livestream.v1.IListInputsRequest} message ListInputsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls StartChannel. + * @function startChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} request StartChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListInputsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|stopChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef StopChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInputsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListInputsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListInputsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls StopChannel. + * @function stopChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} request StopChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.StopChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInputsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(LivestreamService.prototype.stopChannel = function stopChannel(request, callback) { + return this.rpcCall(stopChannel, $root.google.cloud.video.livestream.v1.StopChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopChannel" }); /** - * Verifies a ListInputsRequest message. - * @function verify - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls StopChannel. + * @function stopChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} request StopChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; /** - * Creates a ListInputsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef CreateInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInputsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.ListInputsRequest) - return object; - var message = new $root.google.cloud.video.livestream.v1.ListInputsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; /** - * Creates a plain object from a ListInputsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {google.cloud.video.livestream.v1.ListInputsRequest} message ListInputsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls CreateInput. + * @function createInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} request CreateInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.CreateInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInputsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; + Object.defineProperty(LivestreamService.prototype.createInput = function createInput(request, callback) { + return this.rpcCall(createInput, $root.google.cloud.video.livestream.v1.CreateInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInput" }); /** - * Converts this ListInputsRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * Calls CreateInput. + * @function createInput + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} request CreateInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListInputsRequest - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.ListInputsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listInputs}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef ListInputsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.ListInputsResponse} [response] ListInputsResponse */ - ListInputsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListInputsRequest"; - }; - - return ListInputsRequest; - })(); - - v1.ListInputsResponse = (function() { /** - * Properties of a ListInputsResponse. - * @memberof google.cloud.video.livestream.v1 - * @interface IListInputsResponse - * @property {Array.|null} [inputs] ListInputsResponse inputs - * @property {string|null} [nextPageToken] ListInputsResponse nextPageToken - * @property {Array.|null} [unreachable] ListInputsResponse unreachable + * Calls ListInputs. + * @function listInputs + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListInputsRequest} request ListInputsRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.ListInputsCallback} callback Node-style callback called with the error, if any, and ListInputsResponse + * @returns {undefined} + * @variation 1 */ + Object.defineProperty(LivestreamService.prototype.listInputs = function listInputs(request, callback) { + return this.rpcCall(listInputs, $root.google.cloud.video.livestream.v1.ListInputsRequest, $root.google.cloud.video.livestream.v1.ListInputsResponse, request, callback); + }, "name", { value: "ListInputs" }); /** - * Constructs a new ListInputsResponse. - * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a ListInputsResponse. - * @implements IListInputsResponse - * @constructor - * @param {google.cloud.video.livestream.v1.IListInputsResponse=} [properties] Properties to set + * Calls ListInputs. + * @function listInputs + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListInputsRequest} request ListInputsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - function ListInputsResponse(properties) { - this.inputs = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ListInputsResponse inputs. - * @member {Array.} inputs - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @instance + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef GetInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Input} [response] Input */ - ListInputsResponse.prototype.inputs = $util.emptyArray; /** - * ListInputsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * Calls GetInput. + * @function getInput + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance + * @param {google.cloud.video.livestream.v1.IGetInputRequest} request GetInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.GetInputCallback} callback Node-style callback called with the error, if any, and Input + * @returns {undefined} + * @variation 1 */ - ListInputsResponse.prototype.nextPageToken = ""; + Object.defineProperty(LivestreamService.prototype.getInput = function getInput(request, callback) { + return this.rpcCall(getInput, $root.google.cloud.video.livestream.v1.GetInputRequest, $root.google.cloud.video.livestream.v1.Input, request, callback); + }, "name", { value: "GetInput" }); /** - * ListInputsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * Calls GetInput. + * @function getInput + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance + * @param {google.cloud.video.livestream.v1.IGetInputRequest} request GetInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new ListInputsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {google.cloud.video.livestream.v1.IListInputsResponse=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse instance + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef DeleteInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInputsResponse.create = function create(properties) { - return new ListInputsResponse(properties); - }; /** - * Encodes the specified ListInputsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {google.cloud.video.livestream.v1.IListInputsResponse} message ListInputsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteInput. + * @function deleteInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} request DeleteInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInputsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputs != null && message.inputs.length) - for (var i = 0; i < message.inputs.length; ++i) - $root.google.cloud.video.livestream.v1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; + Object.defineProperty(LivestreamService.prototype.deleteInput = function deleteInput(request, callback) { + return this.rpcCall(deleteInput, $root.google.cloud.video.livestream.v1.DeleteInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInput" }); /** - * Encodes the specified ListInputsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {google.cloud.video.livestream.v1.IListInputsResponse} message ListInputsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteInput. + * @function deleteInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} request DeleteInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListInputsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef UpdateInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInputsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListInputsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.inputs && message.inputs.length)) - message.inputs = []; - message.inputs.push($root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListInputsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateInput. + * @function updateInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} request UpdateInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.UpdateInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInputsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(LivestreamService.prototype.updateInput = function updateInput(request, callback) { + return this.rpcCall(updateInput, $root.google.cloud.video.livestream.v1.UpdateInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInput" }); /** - * Verifies a ListInputsResponse message. - * @function verify - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateInput. + * @function updateInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} request UpdateInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputs != null && message.hasOwnProperty("inputs")) { - if (!Array.isArray(message.inputs)) - return "inputs: array expected"; - for (var i = 0; i < message.inputs.length; ++i) { - var error = $root.google.cloud.video.livestream.v1.Input.verify(message.inputs[i]); - if (error) - return "inputs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; /** - * Creates a ListInputsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createEvent}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef CreateEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Event} [response] Event */ - ListInputsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.ListInputsResponse) - return object; - var message = new $root.google.cloud.video.livestream.v1.ListInputsResponse(); - if (object.inputs) { - if (!Array.isArray(object.inputs)) - throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.inputs: array expected"); - message.inputs = []; - for (var i = 0; i < object.inputs.length; ++i) { - if (typeof object.inputs[i] !== "object") - throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.inputs: object expected"); - message.inputs[i] = $root.google.cloud.video.livestream.v1.Input.fromObject(object.inputs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; /** - * Creates a plain object from a ListInputsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {google.cloud.video.livestream.v1.ListInputsResponse} message ListInputsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls CreateEvent. + * @function createEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} request CreateEventRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.CreateEventCallback} callback Node-style callback called with the error, if any, and Event + * @returns {undefined} + * @variation 1 */ - ListInputsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.inputs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.inputs && message.inputs.length) { - object.inputs = []; - for (var j = 0; j < message.inputs.length; ++j) - object.inputs[j] = $root.google.cloud.video.livestream.v1.Input.toObject(message.inputs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; + Object.defineProperty(LivestreamService.prototype.createEvent = function createEvent(request, callback) { + return this.rpcCall(createEvent, $root.google.cloud.video.livestream.v1.CreateEventRequest, $root.google.cloud.video.livestream.v1.Event, request, callback); + }, "name", { value: "CreateEvent" }); /** - * Converts this ListInputsResponse to JSON. - * @function toJSON - * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * Calls CreateEvent. + * @function createEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} request CreateEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInputsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListInputsResponse - * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.ListInputsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listEvents}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef ListEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.ListEventsResponse} [response] ListEventsResponse */ - ListInputsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListInputsResponse"; - }; - return ListInputsResponse; + /** + * Calls ListEvents. + * @function listEvents + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListEventsRequest} request ListEventsRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.ListEventsCallback} callback Node-style callback called with the error, if any, and ListEventsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.listEvents = function listEvents(request, callback) { + return this.rpcCall(listEvents, $root.google.cloud.video.livestream.v1.ListEventsRequest, $root.google.cloud.video.livestream.v1.ListEventsResponse, request, callback); + }, "name", { value: "ListEvents" }); + + /** + * Calls ListEvents. + * @function listEvents + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListEventsRequest} request ListEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getEvent}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef GetEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Event} [response] Event + */ + + /** + * Calls GetEvent. + * @function getEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetEventRequest} request GetEventRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.GetEventCallback} callback Node-style callback called with the error, if any, and Event + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.getEvent = function getEvent(request, callback) { + return this.rpcCall(getEvent, $root.google.cloud.video.livestream.v1.GetEventRequest, $root.google.cloud.video.livestream.v1.Event, request, callback); + }, "name", { value: "GetEvent" }); + + /** + * Calls GetEvent. + * @function getEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetEventRequest} request GetEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteEvent}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef DeleteEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvent. + * @function deleteEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} request DeleteEventRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteEventCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.deleteEvent = function deleteEvent(request, callback) { + return this.rpcCall(deleteEvent, $root.google.cloud.video.livestream.v1.DeleteEventRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvent" }); + + /** + * Calls DeleteEvent. + * @function deleteEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} request DeleteEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LivestreamService; })(); - v1.GetInputRequest = (function() { + v1.CreateChannelRequest = (function() { /** - * Properties of a GetInputRequest. + * Properties of a CreateChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IGetInputRequest - * @property {string|null} [name] GetInputRequest name + * @interface ICreateChannelRequest + * @property {string|null} [parent] CreateChannelRequest parent + * @property {google.cloud.video.livestream.v1.IChannel|null} [channel] CreateChannelRequest channel + * @property {string|null} [channelId] CreateChannelRequest channelId + * @property {string|null} [requestId] CreateChannelRequest requestId */ /** - * Constructs a new GetInputRequest. + * Constructs a new CreateChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a GetInputRequest. - * @implements IGetInputRequest + * @classdesc Represents a CreateChannelRequest. + * @implements ICreateChannelRequest * @constructor - * @param {google.cloud.video.livestream.v1.IGetInputRequest=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest=} [properties] Properties to set */ - function GetInputRequest(properties) { + function CreateChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12042,75 +13167,117 @@ } /** - * GetInputRequest name. - * @member {string} name - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * CreateChannelRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @instance */ - GetInputRequest.prototype.name = ""; + CreateChannelRequest.prototype.parent = ""; /** - * Creates a new GetInputRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.livestream.v1.GetInputRequest - * @static - * @param {google.cloud.video.livestream.v1.IGetInputRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest instance + * CreateChannelRequest channel. + * @member {google.cloud.video.livestream.v1.IChannel|null|undefined} channel + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance */ - GetInputRequest.create = function create(properties) { - return new GetInputRequest(properties); - }; + CreateChannelRequest.prototype.channel = null; /** - * Encodes the specified GetInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.livestream.v1.GetInputRequest - * @static - * @param {google.cloud.video.livestream.v1.IGetInputRequest} message GetInputRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * CreateChannelRequest channelId. + * @member {string} channelId + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance */ - GetInputRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + CreateChannelRequest.prototype.channelId = ""; /** - * Encodes the specified GetInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.GetInputRequest - * @static - * @param {google.cloud.video.livestream.v1.IGetInputRequest} message GetInputRequest message or plain object to encode + * CreateChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance + */ + CreateChannelRequest.prototype.requestId = ""; + + /** + * Creates a new CreateChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest instance + */ + CreateChannelRequest.create = function create(properties) { + return new CreateChannelRequest(properties); + }; + + /** + * Encodes the specified CreateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} message CreateChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.google.cloud.video.livestream.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.channelId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} message CreateChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetInputRequest message from the specified reader or buffer. + * Decodes a CreateChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetInputRequest.decode = function decode(reader, length) { + CreateChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetInputRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.channel = $root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32()); + break; + } + case 3: { + message.channelId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); break; } default: @@ -12122,123 +13289,156 @@ }; /** - * Decodes a GetInputRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetInputRequest.decodeDelimited = function decodeDelimited(reader) { + CreateChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetInputRequest message. + * Verifies a CreateChannelRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetInputRequest.verify = function verify(message) { + CreateChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channel); + if (error) + return "channel." + error; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a GetInputRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest */ - GetInputRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.GetInputRequest) + CreateChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.CreateChannelRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.GetInputRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.livestream.v1.CreateChannelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".google.cloud.video.livestream.v1.CreateChannelRequest.channel: object expected"); + message.channel = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channel); + } + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a GetInputRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @static - * @param {google.cloud.video.livestream.v1.GetInputRequest} message GetInputRequest + * @param {google.cloud.video.livestream.v1.CreateChannelRequest} message CreateChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInputRequest.toObject = function toObject(message, options) { + CreateChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.channel = null; + object.channelId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channel, options); + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this GetInputRequest to JSON. + * Converts this CreateChannelRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @instance * @returns {Object.} JSON object */ - GetInputRequest.prototype.toJSON = function toJSON() { + CreateChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetInputRequest + * Gets the default type url for CreateChannelRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetInputRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateChannelRequest"; }; - return GetInputRequest; + return CreateChannelRequest; })(); - v1.DeleteInputRequest = (function() { + v1.ListChannelsRequest = (function() { /** - * Properties of a DeleteInputRequest. + * Properties of a ListChannelsRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IDeleteInputRequest - * @property {string|null} [name] DeleteInputRequest name - * @property {string|null} [requestId] DeleteInputRequest requestId + * @interface IListChannelsRequest + * @property {string|null} [parent] ListChannelsRequest parent + * @property {number|null} [pageSize] ListChannelsRequest pageSize + * @property {string|null} [pageToken] ListChannelsRequest pageToken + * @property {string|null} [filter] ListChannelsRequest filter + * @property {string|null} [orderBy] ListChannelsRequest orderBy */ /** - * Constructs a new DeleteInputRequest. + * Constructs a new ListChannelsRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a DeleteInputRequest. - * @implements IDeleteInputRequest + * @classdesc Represents a ListChannelsRequest. + * @implements IListChannelsRequest * @constructor - * @param {google.cloud.video.livestream.v1.IDeleteInputRequest=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IListChannelsRequest=} [properties] Properties to set */ - function DeleteInputRequest(properties) { + function ListChannelsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12246,89 +13446,131 @@ } /** - * DeleteInputRequest name. - * @member {string} name - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * ListChannelsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @instance */ - DeleteInputRequest.prototype.name = ""; + ListChannelsRequest.prototype.parent = ""; /** - * DeleteInputRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * ListChannelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @instance */ - DeleteInputRequest.prototype.requestId = ""; + ListChannelsRequest.prototype.pageSize = 0; /** - * Creates a new DeleteInputRequest instance using the specified properties. + * ListChannelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.pageToken = ""; + + /** + * ListChannelsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.filter = ""; + + /** + * ListChannelsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListChannelsRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static - * @param {google.cloud.video.livestream.v1.IDeleteInputRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest instance + * @param {google.cloud.video.livestream.v1.IListChannelsRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest instance */ - DeleteInputRequest.create = function create(properties) { - return new DeleteInputRequest(properties); + ListChannelsRequest.create = function create(properties) { + return new ListChannelsRequest(properties); }; /** - * Encodes the specified DeleteInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * Encodes the specified ListChannelsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static - * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} message DeleteInputRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} message ListChannelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInputRequest.encode = function encode(message, writer) { + ListChannelsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified DeleteInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static - * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} message DeleteInputRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} message ListChannelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInputRequest message from the specified reader or buffer. + * Decodes a ListChannelsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteInputRequest.decode = function decode(reader, length) { + ListChannelsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteInputRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListChannelsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -12340,133 +13582,159 @@ }; /** - * Decodes a DeleteInputRequest message from the specified reader or buffer, length delimited. + * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteInputRequest.decodeDelimited = function decodeDelimited(reader) { + ListChannelsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInputRequest message. + * Verifies a ListChannelsRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteInputRequest.verify = function verify(message) { + ListChannelsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a DeleteInputRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListChannelsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest */ - DeleteInputRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.DeleteInputRequest) + ListChannelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListChannelsRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.DeleteInputRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); + var message = new $root.google.cloud.video.livestream.v1.ListChannelsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a DeleteInputRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static - * @param {google.cloud.video.livestream.v1.DeleteInputRequest} message DeleteInputRequest + * @param {google.cloud.video.livestream.v1.ListChannelsRequest} message ListChannelsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInputRequest.toObject = function toObject(message, options) { + ListChannelsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.requestId = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this DeleteInputRequest to JSON. + * Converts this ListChannelsRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @instance * @returns {Object.} JSON object */ - DeleteInputRequest.prototype.toJSON = function toJSON() { + ListChannelsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInputRequest + * Gets the default type url for ListChannelsRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteInputRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListChannelsRequest"; }; - return DeleteInputRequest; + return ListChannelsRequest; })(); - v1.UpdateInputRequest = (function() { + v1.ListChannelsResponse = (function() { /** - * Properties of an UpdateInputRequest. + * Properties of a ListChannelsResponse. * @memberof google.cloud.video.livestream.v1 - * @interface IUpdateInputRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInputRequest updateMask - * @property {google.cloud.video.livestream.v1.IInput|null} [input] UpdateInputRequest input - * @property {string|null} [requestId] UpdateInputRequest requestId + * @interface IListChannelsResponse + * @property {Array.|null} [channels] ListChannelsResponse channels + * @property {string|null} [nextPageToken] ListChannelsResponse nextPageToken + * @property {Array.|null} [unreachable] ListChannelsResponse unreachable */ /** - * Constructs a new UpdateInputRequest. + * Constructs a new ListChannelsResponse. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents an UpdateInputRequest. - * @implements IUpdateInputRequest + * @classdesc Represents a ListChannelsResponse. + * @implements IListChannelsResponse * @constructor - * @param {google.cloud.video.livestream.v1.IUpdateInputRequest=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IListChannelsResponse=} [properties] Properties to set */ - function UpdateInputRequest(properties) { + function ListChannelsResponse(properties) { + this.channels = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12474,103 +13742,109 @@ } /** - * UpdateInputRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * ListChannelsResponse channels. + * @member {Array.} channels + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @instance */ - UpdateInputRequest.prototype.updateMask = null; + ListChannelsResponse.prototype.channels = $util.emptyArray; /** - * UpdateInputRequest input. - * @member {google.cloud.video.livestream.v1.IInput|null|undefined} input - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * ListChannelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @instance */ - UpdateInputRequest.prototype.input = null; + ListChannelsResponse.prototype.nextPageToken = ""; /** - * UpdateInputRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * ListChannelsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @instance */ - UpdateInputRequest.prototype.requestId = ""; + ListChannelsResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new UpdateInputRequest instance using the specified properties. + * Creates a new ListChannelsResponse instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static - * @param {google.cloud.video.livestream.v1.IUpdateInputRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest instance + * @param {google.cloud.video.livestream.v1.IListChannelsResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse instance */ - UpdateInputRequest.create = function create(properties) { - return new UpdateInputRequest(properties); + ListChannelsResponse.create = function create(properties) { + return new ListChannelsResponse(properties); }; /** - * Encodes the specified UpdateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * Encodes the specified ListChannelsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static - * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} message UpdateInputRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IListChannelsResponse} message ListChannelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInputRequest.encode = function encode(message, writer) { + ListChannelsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.input != null && Object.hasOwnProperty.call(message, "input")) - $root.google.cloud.video.livestream.v1.Input.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.channels != null && message.channels.length) + for (var i = 0; i < message.channels.length; ++i) + $root.google.cloud.video.livestream.v1.Channel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified UpdateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static - * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} message UpdateInputRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IListChannelsResponse} message ListChannelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateInputRequest message from the specified reader or buffer. + * Decodes a ListChannelsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInputRequest.decode = function decode(reader, length) { + ListChannelsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.UpdateInputRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListChannelsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32())); + break; } case 2: { - message.input = $root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } case 3: { - message.requestId = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -12582,152 +13856,169 @@ }; /** - * Decodes an UpdateInputRequest message from the specified reader or buffer, length delimited. + * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInputRequest.decodeDelimited = function decodeDelimited(reader) { + ListChannelsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateInputRequest message. + * Verifies a ListChannelsResponse message. * @function verify - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateInputRequest.verify = function verify(message) { + ListChannelsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (var i = 0; i < message.channels.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channels[i]); + if (error) + return "channels." + error; + } } - if (message.input != null && message.hasOwnProperty("input")) { - var error = $root.google.cloud.video.livestream.v1.Input.verify(message.input); - if (error) - return "input." + error; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates an UpdateInputRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListChannelsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse */ - UpdateInputRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.UpdateInputRequest) + ListChannelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListChannelsResponse) return object; - var message = new $root.google.cloud.video.livestream.v1.UpdateInputRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.video.livestream.v1.UpdateInputRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.video.livestream.v1.ListChannelsResponse(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.channels: array expected"); + message.channels = []; + for (var i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.channels: object expected"); + message.channels[i] = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channels[i]); + } } - if (object.input != null) { - if (typeof object.input !== "object") - throw TypeError(".google.cloud.video.livestream.v1.UpdateInputRequest.input: object expected"); - message.input = $root.google.cloud.video.livestream.v1.Input.fromObject(object.input); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from an UpdateInputRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static - * @param {google.cloud.video.livestream.v1.UpdateInputRequest} message UpdateInputRequest + * @param {google.cloud.video.livestream.v1.ListChannelsResponse} message ListChannelsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInputRequest.toObject = function toObject(message, options) { + ListChannelsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.input = null; - object.requestId = ""; + if (options.arrays || options.defaults) { + object.channels = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.channels && message.channels.length) { + object.channels = []; + for (var j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channels[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.input != null && message.hasOwnProperty("input")) - object.input = $root.google.cloud.video.livestream.v1.Input.toObject(message.input, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this UpdateInputRequest to JSON. + * Converts this ListChannelsResponse to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @instance * @returns {Object.} JSON object */ - UpdateInputRequest.prototype.toJSON = function toJSON() { + ListChannelsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateInputRequest + * Gets the default type url for ListChannelsResponse * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.UpdateInputRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListChannelsResponse"; }; - return UpdateInputRequest; + return ListChannelsResponse; })(); - v1.CreateEventRequest = (function() { + v1.GetChannelRequest = (function() { /** - * Properties of a CreateEventRequest. + * Properties of a GetChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @interface ICreateEventRequest - * @property {string|null} [parent] CreateEventRequest parent - * @property {google.cloud.video.livestream.v1.IEvent|null} [event] CreateEventRequest event - * @property {string|null} [eventId] CreateEventRequest eventId - * @property {string|null} [requestId] CreateEventRequest requestId + * @interface IGetChannelRequest + * @property {string|null} [name] GetChannelRequest name */ /** - * Constructs a new CreateEventRequest. + * Constructs a new GetChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a CreateEventRequest. - * @implements ICreateEventRequest + * @classdesc Represents a GetChannelRequest. + * @implements IGetChannelRequest * @constructor - * @param {google.cloud.video.livestream.v1.ICreateEventRequest=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IGetChannelRequest=} [properties] Properties to set */ - function CreateEventRequest(properties) { + function GetChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12735,117 +14026,75 @@ } /** - * CreateEventRequest parent. - * @member {string} parent - * @memberof google.cloud.video.livestream.v1.CreateEventRequest - * @instance - */ - CreateEventRequest.prototype.parent = ""; - - /** - * CreateEventRequest event. - * @member {google.cloud.video.livestream.v1.IEvent|null|undefined} event - * @memberof google.cloud.video.livestream.v1.CreateEventRequest - * @instance - */ - CreateEventRequest.prototype.event = null; - - /** - * CreateEventRequest eventId. - * @member {string} eventId - * @memberof google.cloud.video.livestream.v1.CreateEventRequest - * @instance - */ - CreateEventRequest.prototype.eventId = ""; - - /** - * CreateEventRequest requestId. - * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * GetChannelRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @instance */ - CreateEventRequest.prototype.requestId = ""; + GetChannelRequest.prototype.name = ""; /** - * Creates a new CreateEventRequest instance using the specified properties. + * Creates a new GetChannelRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static - * @param {google.cloud.video.livestream.v1.ICreateEventRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest instance + * @param {google.cloud.video.livestream.v1.IGetChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest instance */ - CreateEventRequest.create = function create(properties) { - return new CreateEventRequest(properties); + GetChannelRequest.create = function create(properties) { + return new GetChannelRequest(properties); }; /** - * Encodes the specified CreateEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * Encodes the specified GetChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static - * @param {google.cloud.video.livestream.v1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} message GetChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEventRequest.encode = function encode(message, writer) { + GetChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.google.cloud.video.livestream.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.eventId); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * Encodes the specified GetChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static - * @param {google.cloud.video.livestream.v1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} message GetChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateEventRequest message from the specified reader or buffer. + * Decodes a GetChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEventRequest.decode = function decode(reader, length) { + GetChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateEventRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.event = $root.google.cloud.video.livestream.v1.Event.decode(reader, reader.uint32()); - break; - } - case 3: { - message.eventId = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); + message.name = reader.string(); break; } default: @@ -12857,156 +14106,124 @@ }; /** - * Decodes a CreateEventRequest message from the specified reader or buffer, length delimited. + * Decodes a GetChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEventRequest.decodeDelimited = function decodeDelimited(reader) { + GetChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateEventRequest message. + * Verifies a GetChannelRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateEventRequest.verify = function verify(message) { + GetChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.event != null && message.hasOwnProperty("event")) { - var error = $root.google.cloud.video.livestream.v1.Event.verify(message.event); - if (error) - return "event." + error; - } - if (message.eventId != null && message.hasOwnProperty("eventId")) - if (!$util.isString(message.eventId)) - return "eventId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest */ - CreateEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.CreateEventRequest) + GetChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.GetChannelRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.CreateEventRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".google.cloud.video.livestream.v1.CreateEventRequest.event: object expected"); - message.event = $root.google.cloud.video.livestream.v1.Event.fromObject(object.event); - } - if (object.eventId != null) - message.eventId = String(object.eventId); - if (object.requestId != null) - message.requestId = String(object.requestId); + var message = new $root.google.cloud.video.livestream.v1.GetChannelRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateEventRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static - * @param {google.cloud.video.livestream.v1.CreateEventRequest} message CreateEventRequest + * @param {google.cloud.video.livestream.v1.GetChannelRequest} message GetChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateEventRequest.toObject = function toObject(message, options) { + GetChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.event = null; - object.eventId = ""; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.event != null && message.hasOwnProperty("event")) - object.event = $root.google.cloud.video.livestream.v1.Event.toObject(message.event, options); - if (message.eventId != null && message.hasOwnProperty("eventId")) - object.eventId = message.eventId; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateEventRequest to JSON. + * Converts this GetChannelRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @instance * @returns {Object.} JSON object */ - CreateEventRequest.prototype.toJSON = function toJSON() { + GetChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateEventRequest + * Gets the default type url for GetChannelRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @memberof google.cloud.video.livestream.v1.GetChannelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateEventRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetChannelRequest"; }; - return CreateEventRequest; + return GetChannelRequest; })(); - v1.ListEventsRequest = (function() { + v1.DeleteChannelRequest = (function() { /** - * Properties of a ListEventsRequest. + * Properties of a DeleteChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IListEventsRequest - * @property {string|null} [parent] ListEventsRequest parent - * @property {number|null} [pageSize] ListEventsRequest pageSize - * @property {string|null} [pageToken] ListEventsRequest pageToken - * @property {string|null} [filter] ListEventsRequest filter - * @property {string|null} [orderBy] ListEventsRequest orderBy + * @interface IDeleteChannelRequest + * @property {string|null} [name] DeleteChannelRequest name + * @property {string|null} [requestId] DeleteChannelRequest requestId + * @property {boolean|null} [force] DeleteChannelRequest force */ /** - * Constructs a new ListEventsRequest. + * Constructs a new DeleteChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a ListEventsRequest. - * @implements IListEventsRequest + * @classdesc Represents a DeleteChannelRequest. + * @implements IDeleteChannelRequest * @constructor - * @param {google.cloud.video.livestream.v1.IListEventsRequest=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest=} [properties] Properties to set */ - function ListEventsRequest(properties) { + function DeleteChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13014,131 +14231,103 @@ } /** - * ListEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.video.livestream.v1.ListEventsRequest - * @instance - */ - ListEventsRequest.prototype.parent = ""; - - /** - * ListEventsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.livestream.v1.ListEventsRequest - * @instance - */ - ListEventsRequest.prototype.pageSize = 0; - - /** - * ListEventsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * DeleteChannelRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @instance */ - ListEventsRequest.prototype.pageToken = ""; + DeleteChannelRequest.prototype.name = ""; /** - * ListEventsRequest filter. - * @member {string} filter - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * DeleteChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @instance */ - ListEventsRequest.prototype.filter = ""; + DeleteChannelRequest.prototype.requestId = ""; /** - * ListEventsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * DeleteChannelRequest force. + * @member {boolean} force + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @instance */ - ListEventsRequest.prototype.orderBy = ""; + DeleteChannelRequest.prototype.force = false; /** - * Creates a new ListEventsRequest instance using the specified properties. + * Creates a new DeleteChannelRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IListEventsRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest instance + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest instance */ - ListEventsRequest.create = function create(properties) { - return new ListEventsRequest(properties); + DeleteChannelRequest.create = function create(properties) { + return new DeleteChannelRequest(properties); }; /** - * Encodes the specified ListEventsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * Encodes the specified DeleteChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} message DeleteChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEventsRequest.encode = function encode(message, writer) { + DeleteChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified ListEventsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * Encodes the specified DeleteChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} message DeleteChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEventsRequest message from the specified reader or buffer. + * Decodes a DeleteChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEventsRequest.decode = function decode(reader, length) { + DeleteChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.requestId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.force = reader.bool(); break; } default: @@ -13150,159 +14339,141 @@ }; /** - * Decodes a ListEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEventsRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEventsRequest message. + * Verifies a DeleteChannelRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEventsRequest.verify = function verify(message) { + DeleteChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a ListEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest */ - ListEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.ListEventsRequest) + DeleteChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.DeleteChannelRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.ListEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.video.livestream.v1.DeleteChannelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a ListEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static - * @param {google.cloud.video.livestream.v1.ListEventsRequest} message ListEventsRequest + * @param {google.cloud.video.livestream.v1.DeleteChannelRequest} message DeleteChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEventsRequest.toObject = function toObject(message, options) { + DeleteChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.name = ""; + object.requestId = ""; + object.force = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this ListEventsRequest to JSON. + * Converts this DeleteChannelRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @instance * @returns {Object.} JSON object */ - ListEventsRequest.prototype.toJSON = function toJSON() { + DeleteChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListEventsRequest + * Gets the default type url for DeleteChannelRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListEventsRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteChannelRequest"; }; - return ListEventsRequest; + return DeleteChannelRequest; })(); - v1.ListEventsResponse = (function() { + v1.UpdateChannelRequest = (function() { /** - * Properties of a ListEventsResponse. + * Properties of an UpdateChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IListEventsResponse - * @property {Array.|null} [events] ListEventsResponse events - * @property {string|null} [nextPageToken] ListEventsResponse nextPageToken - * @property {Array.|null} [unreachable] ListEventsResponse unreachable + * @interface IUpdateChannelRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateChannelRequest updateMask + * @property {google.cloud.video.livestream.v1.IChannel|null} [channel] UpdateChannelRequest channel + * @property {string|null} [requestId] UpdateChannelRequest requestId */ /** - * Constructs a new ListEventsResponse. + * Constructs a new UpdateChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a ListEventsResponse. - * @implements IListEventsResponse + * @classdesc Represents an UpdateChannelRequest. + * @implements IUpdateChannelRequest * @constructor - * @param {google.cloud.video.livestream.v1.IListEventsResponse=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest=} [properties] Properties to set */ - function ListEventsResponse(properties) { - this.events = []; - this.unreachable = []; + function UpdateChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13310,109 +14481,103 @@ } /** - * ListEventsResponse events. - * @member {Array.} events - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * UpdateChannelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @instance */ - ListEventsResponse.prototype.events = $util.emptyArray; + UpdateChannelRequest.prototype.updateMask = null; /** - * ListEventsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * UpdateChannelRequest channel. + * @member {google.cloud.video.livestream.v1.IChannel|null|undefined} channel + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @instance */ - ListEventsResponse.prototype.nextPageToken = ""; + UpdateChannelRequest.prototype.channel = null; /** - * ListEventsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * UpdateChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @instance */ - ListEventsResponse.prototype.unreachable = $util.emptyArray; + UpdateChannelRequest.prototype.requestId = ""; /** - * Creates a new ListEventsResponse instance using the specified properties. + * Creates a new UpdateChannelRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IListEventsResponse=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse instance + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest instance */ - ListEventsResponse.create = function create(properties) { - return new ListEventsResponse(properties); + UpdateChannelRequest.create = function create(properties) { + return new UpdateChannelRequest(properties); }; /** - * Encodes the specified ListEventsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * Encodes the specified UpdateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} message UpdateChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEventsResponse.encode = function encode(message, writer) { + UpdateChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.events != null && message.events.length) - for (var i = 0; i < message.events.length; ++i) - $root.google.cloud.video.livestream.v1.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.google.cloud.video.livestream.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified ListEventsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * Encodes the specified UpdateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} message UpdateChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEventsResponse message from the specified reader or buffer. + * Decodes an UpdateChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEventsResponse.decode = function decode(reader, length) { + UpdateChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.UpdateChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.events && message.events.length)) - message.events = []; - message.events.push($root.google.cloud.video.livestream.v1.Event.decode(reader, reader.uint32())); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.nextPageToken = reader.string(); + message.channel = $root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.requestId = reader.string(); break; } default: @@ -13424,169 +14589,150 @@ }; /** - * Decodes a ListEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEventsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEventsResponse message. + * Verifies an UpdateChannelRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEventsResponse.verify = function verify(message) { + UpdateChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) - return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) { - var error = $root.google.cloud.video.livestream.v1.Event.verify(message.events[i]); - if (error) - return "events." + error; - } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channel); + if (error) + return "channel." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest */ - ListEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.ListEventsResponse) + UpdateChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.UpdateChannelRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.ListEventsResponse(); - if (object.events) { - if (!Array.isArray(object.events)) - throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.events: array expected"); - message.events = []; - for (var i = 0; i < object.events.length; ++i) { - if (typeof object.events[i] !== "object") - throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.events: object expected"); - message.events[i] = $root.google.cloud.video.livestream.v1.Event.fromObject(object.events[i]); - } + var message = new $root.google.cloud.video.livestream.v1.UpdateChannelRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateChannelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateChannelRequest.channel: object expected"); + message.channel = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channel); } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static - * @param {google.cloud.video.livestream.v1.ListEventsResponse} message ListEventsResponse + * @param {google.cloud.video.livestream.v1.UpdateChannelRequest} message UpdateChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEventsResponse.toObject = function toObject(message, options) { + UpdateChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.events = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.events && message.events.length) { - object.events = []; - for (var j = 0; j < message.events.length; ++j) - object.events[j] = $root.google.cloud.video.livestream.v1.Event.toObject(message.events[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.defaults) { + object.updateMask = null; + object.channel = null; + object.requestId = ""; } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channel, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListEventsResponse to JSON. + * Converts this UpdateChannelRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @instance * @returns {Object.} JSON object */ - ListEventsResponse.prototype.toJSON = function toJSON() { + UpdateChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListEventsResponse + * Gets the default type url for UpdateChannelRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListEventsResponse"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.UpdateChannelRequest"; }; - return ListEventsResponse; + return UpdateChannelRequest; })(); - v1.GetEventRequest = (function() { + v1.StartChannelRequest = (function() { /** - * Properties of a GetEventRequest. + * Properties of a StartChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IGetEventRequest - * @property {string|null} [name] GetEventRequest name + * @interface IStartChannelRequest + * @property {string|null} [name] StartChannelRequest name + * @property {string|null} [requestId] StartChannelRequest requestId */ /** - * Constructs a new GetEventRequest. + * Constructs a new StartChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a GetEventRequest. - * @implements IGetEventRequest + * @classdesc Represents a StartChannelRequest. + * @implements IStartChannelRequest * @constructor - * @param {google.cloud.video.livestream.v1.IGetEventRequest=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IStartChannelRequest=} [properties] Properties to set */ - function GetEventRequest(properties) { + function StartChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13594,70 +14740,80 @@ } /** - * GetEventRequest name. + * StartChannelRequest name. * @member {string} name - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @instance */ - GetEventRequest.prototype.name = ""; + StartChannelRequest.prototype.name = ""; /** - * Creates a new GetEventRequest instance using the specified properties. + * StartChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @instance + */ + StartChannelRequest.prototype.requestId = ""; + + /** + * Creates a new StartChannelRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IGetEventRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest instance + * @param {google.cloud.video.livestream.v1.IStartChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest instance */ - GetEventRequest.create = function create(properties) { - return new GetEventRequest(properties); + StartChannelRequest.create = function create(properties) { + return new StartChannelRequest(properties); }; /** - * Encodes the specified GetEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * Encodes the specified StartChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} message StartChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEventRequest.encode = function encode(message, writer) { + StartChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified GetEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * Encodes the specified StartChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} message StartChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + StartChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetEventRequest message from the specified reader or buffer. + * Decodes a StartChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEventRequest.decode = function decode(reader, length) { + StartChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetEventRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.StartChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13665,6 +14821,10 @@ message.name = reader.string(); break; } + case 2: { + message.requestId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13674,123 +14834,132 @@ }; /** - * Decodes a GetEventRequest message from the specified reader or buffer, length delimited. + * Decodes a StartChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEventRequest.decodeDelimited = function decodeDelimited(reader) { + StartChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetEventRequest message. + * Verifies a StartChannelRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetEventRequest.verify = function verify(message) { + StartChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a GetEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StartChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest */ - GetEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.GetEventRequest) + StartChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.StartChannelRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.GetEventRequest(); + var message = new $root.google.cloud.video.livestream.v1.StartChannelRequest(); if (object.name != null) message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a GetEventRequest message. Also converts values to other types if specified. + * Creates a plain object from a StartChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static - * @param {google.cloud.video.livestream.v1.GetEventRequest} message GetEventRequest + * @param {google.cloud.video.livestream.v1.StartChannelRequest} message StartChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetEventRequest.toObject = function toObject(message, options) { + StartChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.requestId = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this GetEventRequest to JSON. + * Converts this StartChannelRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @instance * @returns {Object.} JSON object */ - GetEventRequest.prototype.toJSON = function toJSON() { + StartChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetEventRequest + * Gets the default type url for StartChannelRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @memberof google.cloud.video.livestream.v1.StartChannelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StartChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetEventRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.StartChannelRequest"; }; - return GetEventRequest; + return StartChannelRequest; })(); - v1.DeleteEventRequest = (function() { + v1.StopChannelRequest = (function() { /** - * Properties of a DeleteEventRequest. + * Properties of a StopChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IDeleteEventRequest - * @property {string|null} [name] DeleteEventRequest name - * @property {string|null} [requestId] DeleteEventRequest requestId + * @interface IStopChannelRequest + * @property {string|null} [name] StopChannelRequest name + * @property {string|null} [requestId] StopChannelRequest requestId */ /** - * Constructs a new DeleteEventRequest. + * Constructs a new StopChannelRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a DeleteEventRequest. - * @implements IDeleteEventRequest + * @classdesc Represents a StopChannelRequest. + * @implements IStopChannelRequest * @constructor - * @param {google.cloud.video.livestream.v1.IDeleteEventRequest=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IStopChannelRequest=} [properties] Properties to set */ - function DeleteEventRequest(properties) { + function StopChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13798,43 +14967,43 @@ } /** - * DeleteEventRequest name. + * StopChannelRequest name. * @member {string} name - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @instance */ - DeleteEventRequest.prototype.name = ""; + StopChannelRequest.prototype.name = ""; /** - * DeleteEventRequest requestId. + * StopChannelRequest requestId. * @member {string} requestId - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @instance */ - DeleteEventRequest.prototype.requestId = ""; + StopChannelRequest.prototype.requestId = ""; /** - * Creates a new DeleteEventRequest instance using the specified properties. + * Creates a new StopChannelRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IDeleteEventRequest=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest instance + * @param {google.cloud.video.livestream.v1.IStopChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest instance */ - DeleteEventRequest.create = function create(properties) { - return new DeleteEventRequest(properties); - }; + StopChannelRequest.create = function create(properties) { + return new StopChannelRequest(properties); + }; /** - * Encodes the specified DeleteEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * Encodes the specified StopChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} message StopChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEventRequest.encode = function encode(message, writer) { + StopChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -13845,33 +15014,33 @@ }; /** - * Encodes the specified DeleteEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * Encodes the specified StopChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static - * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} message StopChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + StopChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteEventRequest message from the specified reader or buffer. + * Decodes a StopChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEventRequest.decode = function decode(reader, length) { + StopChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteEventRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.StopChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13892,30 +15061,30 @@ }; /** - * Decodes a DeleteEventRequest message from the specified reader or buffer, length delimited. + * Decodes a StopChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEventRequest.decodeDelimited = function decodeDelimited(reader) { + StopChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteEventRequest message. + * Verifies a StopChannelRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteEventRequest.verify = function verify(message) { + StopChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -13928,17 +15097,17 @@ }; /** - * Creates a DeleteEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StopChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest */ - DeleteEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.DeleteEventRequest) + StopChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.StopChannelRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.DeleteEventRequest(); + var message = new $root.google.cloud.video.livestream.v1.StopChannelRequest(); if (object.name != null) message.name = String(object.name); if (object.requestId != null) @@ -13947,15 +15116,15 @@ }; /** - * Creates a plain object from a DeleteEventRequest message. Also converts values to other types if specified. + * Creates a plain object from a StopChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static - * @param {google.cloud.video.livestream.v1.DeleteEventRequest} message DeleteEventRequest + * @param {google.cloud.video.livestream.v1.StopChannelRequest} message StopChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteEventRequest.toObject = function toObject(message, options) { + StopChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -13971,51 +15140,55 @@ }; /** - * Converts this DeleteEventRequest to JSON. + * Converts this StopChannelRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @instance * @returns {Object.} JSON object */ - DeleteEventRequest.prototype.toJSON = function toJSON() { + StopChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteEventRequest + * Gets the default type url for StopChannelRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @memberof google.cloud.video.livestream.v1.StopChannelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StopChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteEventRequest"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.StopChannelRequest"; }; - return DeleteEventRequest; + return StopChannelRequest; })(); - v1.ChannelOperationResponse = (function() { + v1.CreateInputRequest = (function() { /** - * Properties of a ChannelOperationResponse. + * Properties of a CreateInputRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IChannelOperationResponse + * @interface ICreateInputRequest + * @property {string|null} [parent] CreateInputRequest parent + * @property {google.cloud.video.livestream.v1.IInput|null} [input] CreateInputRequest input + * @property {string|null} [inputId] CreateInputRequest inputId + * @property {string|null} [requestId] CreateInputRequest requestId */ /** - * Constructs a new ChannelOperationResponse. + * Constructs a new CreateInputRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents a ChannelOperationResponse. - * @implements IChannelOperationResponse + * @classdesc Represents a CreateInputRequest. + * @implements ICreateInputRequest * @constructor - * @param {google.cloud.video.livestream.v1.IChannelOperationResponse=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.ICreateInputRequest=} [properties] Properties to set */ - function ChannelOperationResponse(properties) { + function CreateInputRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14023,63 +15196,119 @@ } /** - * Creates a new ChannelOperationResponse instance using the specified properties. + * CreateInputRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.parent = ""; + + /** + * CreateInputRequest input. + * @member {google.cloud.video.livestream.v1.IInput|null|undefined} input + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.input = null; + + /** + * CreateInputRequest inputId. + * @member {string} inputId + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.inputId = ""; + + /** + * CreateInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.requestId = ""; + + /** + * Creates a new CreateInputRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static - * @param {google.cloud.video.livestream.v1.IChannelOperationResponse=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse instance + * @param {google.cloud.video.livestream.v1.ICreateInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest instance */ - ChannelOperationResponse.create = function create(properties) { - return new ChannelOperationResponse(properties); + CreateInputRequest.create = function create(properties) { + return new CreateInputRequest(properties); }; /** - * Encodes the specified ChannelOperationResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * Encodes the specified CreateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static - * @param {google.cloud.video.livestream.v1.IChannelOperationResponse} message ChannelOperationResponse message or plain object to encode + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} message CreateInputRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChannelOperationResponse.encode = function encode(message, writer) { + CreateInputRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.cloud.video.livestream.v1.Input.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputId != null && Object.hasOwnProperty.call(message, "inputId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified ChannelOperationResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * Encodes the specified CreateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static - * @param {google.cloud.video.livestream.v1.IChannelOperationResponse} message ChannelOperationResponse message or plain object to encode + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} message CreateInputRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChannelOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateInputRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ChannelOperationResponse message from the specified reader or buffer. + * Decodes a CreateInputRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ChannelOperationResponse.decode = function decode(reader, length) { + CreateInputRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ChannelOperationResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateInputRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.input = $root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inputId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -14089,114 +15318,156 @@ }; /** - * Decodes a ChannelOperationResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateInputRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ChannelOperationResponse.decodeDelimited = function decodeDelimited(reader) { + CreateInputRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ChannelOperationResponse message. + * Verifies a CreateInputRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ChannelOperationResponse.verify = function verify(message) { + CreateInputRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.cloud.video.livestream.v1.Input.verify(message.input); + if (error) + return "input." + error; + } + if (message.inputId != null && message.hasOwnProperty("inputId")) + if (!$util.isString(message.inputId)) + return "inputId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ChannelOperationResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInputRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest */ - ChannelOperationResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.ChannelOperationResponse) + CreateInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.CreateInputRequest) return object; - return new $root.google.cloud.video.livestream.v1.ChannelOperationResponse(); + var message = new $root.google.cloud.video.livestream.v1.CreateInputRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.video.livestream.v1.CreateInputRequest.input: object expected"); + message.input = $root.google.cloud.video.livestream.v1.Input.fromObject(object.input); + } + if (object.inputId != null) + message.inputId = String(object.inputId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; }; /** - * Creates a plain object from a ChannelOperationResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateInputRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static - * @param {google.cloud.video.livestream.v1.ChannelOperationResponse} message ChannelOperationResponse + * @param {google.cloud.video.livestream.v1.CreateInputRequest} message CreateInputRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChannelOperationResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ChannelOperationResponse to JSON. + CreateInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.input = null; + object.inputId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.cloud.video.livestream.v1.Input.toObject(message.input, options); + if (message.inputId != null && message.hasOwnProperty("inputId")) + object.inputId = message.inputId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateInputRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @instance * @returns {Object.} JSON object */ - ChannelOperationResponse.prototype.toJSON = function toJSON() { + CreateInputRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ChannelOperationResponse + * Gets the default type url for CreateInputRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @memberof google.cloud.video.livestream.v1.CreateInputRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ChannelOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.ChannelOperationResponse"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateInputRequest"; }; - return ChannelOperationResponse; + return CreateInputRequest; })(); - v1.OperationMetadata = (function() { + v1.ListInputsRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a ListInputsRequest. * @memberof google.cloud.video.livestream.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface IListInputsRequest + * @property {string|null} [parent] ListInputsRequest parent + * @property {number|null} [pageSize] ListInputsRequest pageSize + * @property {string|null} [pageToken] ListInputsRequest pageToken + * @property {string|null} [filter] ListInputsRequest filter + * @property {string|null} [orderBy] ListInputsRequest orderBy */ /** - * Constructs a new OperationMetadata. + * Constructs a new ListInputsRequest. * @memberof google.cloud.video.livestream.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a ListInputsRequest. + * @implements IListInputsRequest * @constructor - * @param {google.cloud.video.livestream.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.video.livestream.v1.IListInputsRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function ListInputsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14204,145 +15475,131 @@ } /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.video.livestream.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * ListInputsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @instance */ - OperationMetadata.prototype.endTime = null; + ListInputsRequest.prototype.parent = ""; /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * ListInputsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @instance */ - OperationMetadata.prototype.target = ""; + ListInputsRequest.prototype.pageSize = 0; /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * ListInputsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @instance */ - OperationMetadata.prototype.verb = ""; + ListInputsRequest.prototype.pageToken = ""; /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * ListInputsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @instance */ - OperationMetadata.prototype.requestedCancellation = false; + ListInputsRequest.prototype.filter = ""; /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * ListInputsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @instance */ - OperationMetadata.prototype.apiVersion = ""; + ListInputsRequest.prototype.orderBy = ""; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new ListInputsRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static - * @param {google.cloud.video.livestream.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.video.livestream.v1.IListInputsRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + ListInputsRequest.create = function create(properties) { + return new ListInputsRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified ListInputsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static - * @param {google.cloud.video.livestream.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.video.livestream.v1.IListInputsRequest} message ListInputsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + ListInputsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.apiVersion); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified ListInputsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static - * @param {google.cloud.video.livestream.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.video.livestream.v1.IListInputsRequest} message ListInputsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListInputsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a ListInputsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decode = function decode(reader, length) { + ListInputsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListInputsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; } case 3: { - message.target = reader.string(); + message.pageToken = reader.string(); break; } case 4: { - message.verb = reader.string(); + message.filter = reader.string(); break; } case 5: { - message.requestedCancellation = reader.bool(); - break; - } - case 6: { - message.apiVersion = reader.string(); + message.orderBy = reader.string(); break; } default: @@ -14354,249 +15611,3005 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListInputsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + ListInputsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a ListInputsRequest message. * @function verify - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OperationMetadata.verify = function verify(message) { + ListInputsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListInputsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.livestream.v1.OperationMetadata) + ListInputsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListInputsRequest) return object; - var message = new $root.google.cloud.video.livestream.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.video.livestream.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.video.livestream.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); + var message = new $root.google.cloud.video.livestream.v1.ListInputsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListInputsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static - * @param {google.cloud.video.livestream.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.video.livestream.v1.ListInputsRequest} message ListInputsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + ListInputsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.requestedCancellation = false; - object.apiVersion = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this ListInputsRequest to JSON. * @function toJSON - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + ListInputsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for ListInputsRequest * @function getTypeUrl - * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @memberof google.cloud.video.livestream.v1.ListInputsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInputsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.livestream.v1.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListInputsRequest"; }; - return OperationMetadata; + return ListInputsRequest; })(); - return v1; - })(); - - return livestream; - })(); - - return video; - })(); - - return cloud; - })(); + v1.ListInputsResponse = (function() { - google.api = (function() { + /** + * Properties of a ListInputsResponse. + * @memberof google.cloud.video.livestream.v1 + * @interface IListInputsResponse + * @property {Array.|null} [inputs] ListInputsResponse inputs + * @property {string|null} [nextPageToken] ListInputsResponse nextPageToken + * @property {Array.|null} [unreachable] ListInputsResponse unreachable + */ - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Constructs a new ListInputsResponse. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListInputsResponse. + * @implements IListInputsResponse + * @constructor + * @param {google.cloud.video.livestream.v1.IListInputsResponse=} [properties] Properties to set + */ + function ListInputsResponse(properties) { + this.inputs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - return values; - })(); + /** + * ListInputsResponse inputs. + * @member {Array.} inputs + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + */ + ListInputsResponse.prototype.inputs = $util.emptyArray; - api.ResourceDescriptor = (function() { + /** + * ListInputsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + */ + ListInputsResponse.prototype.nextPageToken = ""; - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ + /** + * ListInputsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + */ + ListInputsResponse.prototype.unreachable = $util.emptyArray; - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new ListInputsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListInputsResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse instance + */ + ListInputsResponse.create = function create(properties) { + return new ListInputsResponse(properties); + }; - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; + /** + * Encodes the specified ListInputsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListInputsResponse} message ListInputsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInputsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.google.cloud.video.livestream.v1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + /** + * Encodes the specified ListInputsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListInputsResponse} message ListInputsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInputsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInputsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInputsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListInputsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInputsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInputsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInputsResponse message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInputsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Input.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInputsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse + */ + ListInputsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListInputsResponse) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListInputsResponse(); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.inputs: object expected"); + message.inputs[i] = $root.google.cloud.video.livestream.v1.Input.fromObject(object.inputs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInputsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.ListInputsResponse} message ListInputsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInputsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.cloud.video.livestream.v1.Input.toObject(message.inputs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInputsResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInputsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInputsResponse + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInputsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListInputsResponse"; + }; + + return ListInputsResponse; + })(); + + v1.GetInputRequest = (function() { + + /** + * Properties of a GetInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IGetInputRequest + * @property {string|null} [name] GetInputRequest name + */ + + /** + * Constructs a new GetInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a GetInputRequest. + * @implements IGetInputRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IGetInputRequest=} [properties] Properties to set + */ + function GetInputRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInputRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @instance + */ + GetInputRequest.prototype.name = ""; + + /** + * Creates a new GetInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest instance + */ + GetInputRequest.create = function create(properties) { + return new GetInputRequest(properties); + }; + + /** + * Encodes the specified GetInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetInputRequest} message GetInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetInputRequest} message GetInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInputRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInputRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInputRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + */ + GetInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.GetInputRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.GetInputRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.GetInputRequest} message GetInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @instance + * @returns {Object.} JSON object + */ + GetInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInputRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetInputRequest"; + }; + + return GetInputRequest; + })(); + + v1.DeleteInputRequest = (function() { + + /** + * Properties of a DeleteInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IDeleteInputRequest + * @property {string|null} [name] DeleteInputRequest name + * @property {string|null} [requestId] DeleteInputRequest requestId + */ + + /** + * Constructs a new DeleteInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a DeleteInputRequest. + * @implements IDeleteInputRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest=} [properties] Properties to set + */ + function DeleteInputRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInputRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @instance + */ + DeleteInputRequest.prototype.name = ""; + + /** + * DeleteInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @instance + */ + DeleteInputRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest instance + */ + DeleteInputRequest.create = function create(properties) { + return new DeleteInputRequest(properties); + }; + + /** + * Encodes the specified DeleteInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} message DeleteInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} message DeleteInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInputRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInputRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInputRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + */ + DeleteInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.DeleteInputRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.DeleteInputRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.DeleteInputRequest} message DeleteInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInputRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteInputRequest"; + }; + + return DeleteInputRequest; + })(); + + v1.UpdateInputRequest = (function() { + + /** + * Properties of an UpdateInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IUpdateInputRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInputRequest updateMask + * @property {google.cloud.video.livestream.v1.IInput|null} [input] UpdateInputRequest input + * @property {string|null} [requestId] UpdateInputRequest requestId + */ + + /** + * Constructs a new UpdateInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an UpdateInputRequest. + * @implements IUpdateInputRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest=} [properties] Properties to set + */ + function UpdateInputRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInputRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + */ + UpdateInputRequest.prototype.updateMask = null; + + /** + * UpdateInputRequest input. + * @member {google.cloud.video.livestream.v1.IInput|null|undefined} input + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + */ + UpdateInputRequest.prototype.input = null; + + /** + * UpdateInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + */ + UpdateInputRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest instance + */ + UpdateInputRequest.create = function create(properties) { + return new UpdateInputRequest(properties); + }; + + /** + * Encodes the specified UpdateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} message UpdateInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.cloud.video.livestream.v1.Input.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} message UpdateInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInputRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.UpdateInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.input = $root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInputRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInputRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.cloud.video.livestream.v1.Input.verify(message.input); + if (error) + return "input." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + */ + UpdateInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.UpdateInputRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.UpdateInputRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateInputRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateInputRequest.input: object expected"); + message.input = $root.google.cloud.video.livestream.v1.Input.fromObject(object.input); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.UpdateInputRequest} message UpdateInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.input = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.cloud.video.livestream.v1.Input.toObject(message.input, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInputRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.UpdateInputRequest"; + }; + + return UpdateInputRequest; + })(); + + v1.CreateEventRequest = (function() { + + /** + * Properties of a CreateEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface ICreateEventRequest + * @property {string|null} [parent] CreateEventRequest parent + * @property {google.cloud.video.livestream.v1.IEvent|null} [event] CreateEventRequest event + * @property {string|null} [eventId] CreateEventRequest eventId + * @property {string|null} [requestId] CreateEventRequest requestId + */ + + /** + * Constructs a new CreateEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a CreateEventRequest. + * @implements ICreateEventRequest + * @constructor + * @param {google.cloud.video.livestream.v1.ICreateEventRequest=} [properties] Properties to set + */ + function CreateEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEventRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.parent = ""; + + /** + * CreateEventRequest event. + * @member {google.cloud.video.livestream.v1.IEvent|null|undefined} event + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.event = null; + + /** + * CreateEventRequest eventId. + * @member {string} eventId + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.eventId = ""; + + /** + * CreateEventRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.requestId = ""; + + /** + * Creates a new CreateEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateEventRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest instance + */ + CreateEventRequest.create = function create(properties) { + return new CreateEventRequest(properties); + }; + + /** + * Encodes the specified CreateEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.video.livestream.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.eventId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.event = $root.google.cloud.video.livestream.v1.Event.decode(reader, reader.uint32()); + break; + } + case 3: { + message.eventId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEventRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.video.livestream.v1.Event.verify(message.event); + if (error) + return "event." + error; + } + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + */ + CreateEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.CreateEventRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.CreateEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.video.livestream.v1.CreateEventRequest.event: object expected"); + message.event = $root.google.cloud.video.livestream.v1.Event.fromObject(object.event); + } + if (object.eventId != null) + message.eventId = String(object.eventId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.CreateEventRequest} message CreateEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.event = null; + object.eventId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.video.livestream.v1.Event.toObject(message.event, options); + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEventRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateEventRequest"; + }; + + return CreateEventRequest; + })(); + + v1.ListEventsRequest = (function() { + + /** + * Properties of a ListEventsRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IListEventsRequest + * @property {string|null} [parent] ListEventsRequest parent + * @property {number|null} [pageSize] ListEventsRequest pageSize + * @property {string|null} [pageToken] ListEventsRequest pageToken + * @property {string|null} [filter] ListEventsRequest filter + * @property {string|null} [orderBy] ListEventsRequest orderBy + */ + + /** + * Constructs a new ListEventsRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListEventsRequest. + * @implements IListEventsRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IListEventsRequest=} [properties] Properties to set + */ + function ListEventsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.parent = ""; + + /** + * ListEventsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.pageSize = 0; + + /** + * ListEventsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.pageToken = ""; + + /** + * ListEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.filter = ""; + + /** + * ListEventsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListEventsRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest instance + */ + ListEventsRequest.create = function create(properties) { + return new ListEventsRequest(properties); + }; + + /** + * Encodes the specified ListEventsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListEventsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventsRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + */ + ListEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListEventsRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.ListEventsRequest} message ListEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventsRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListEventsRequest"; + }; + + return ListEventsRequest; + })(); + + v1.ListEventsResponse = (function() { + + /** + * Properties of a ListEventsResponse. + * @memberof google.cloud.video.livestream.v1 + * @interface IListEventsResponse + * @property {Array.|null} [events] ListEventsResponse events + * @property {string|null} [nextPageToken] ListEventsResponse nextPageToken + * @property {Array.|null} [unreachable] ListEventsResponse unreachable + */ + + /** + * Constructs a new ListEventsResponse. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListEventsResponse. + * @implements IListEventsResponse + * @constructor + * @param {google.cloud.video.livestream.v1.IListEventsResponse=} [properties] Properties to set + */ + function ListEventsResponse(properties) { + this.events = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventsResponse events. + * @member {Array.} events + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.events = $util.emptyArray; + + /** + * ListEventsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.nextPageToken = ""; + + /** + * ListEventsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListEventsResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse instance + */ + ListEventsResponse.create = function create(properties) { + return new ListEventsResponse(properties); + }; + + /** + * Encodes the specified ListEventsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.google.cloud.video.livestream.v1.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListEventsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.google.cloud.video.livestream.v1.Event.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventsResponse message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + */ + ListEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListEventsResponse) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListEventsResponse(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.events: object expected"); + message.events[i] = $root.google.cloud.video.livestream.v1.Event.fromObject(object.events[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.ListEventsResponse} message ListEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.events = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.google.cloud.video.livestream.v1.Event.toObject(message.events[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventsResponse + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListEventsResponse"; + }; + + return ListEventsResponse; + })(); + + v1.GetEventRequest = (function() { + + /** + * Properties of a GetEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IGetEventRequest + * @property {string|null} [name] GetEventRequest name + */ + + /** + * Constructs a new GetEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a GetEventRequest. + * @implements IGetEventRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IGetEventRequest=} [properties] Properties to set + */ + function GetEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEventRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @instance + */ + GetEventRequest.prototype.name = ""; + + /** + * Creates a new GetEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetEventRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest instance + */ + GetEventRequest.create = function create(properties) { + return new GetEventRequest(properties); + }; + + /** + * Encodes the specified GetEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEventRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + */ + GetEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.GetEventRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.GetEventRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.GetEventRequest} message GetEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @instance + * @returns {Object.} JSON object + */ + GetEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEventRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetEventRequest"; + }; + + return GetEventRequest; + })(); + + v1.DeleteEventRequest = (function() { + + /** + * Properties of a DeleteEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IDeleteEventRequest + * @property {string|null} [name] DeleteEventRequest name + * @property {string|null} [requestId] DeleteEventRequest requestId + */ + + /** + * Constructs a new DeleteEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a DeleteEventRequest. + * @implements IDeleteEventRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest=} [properties] Properties to set + */ + function DeleteEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEventRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @instance + */ + DeleteEventRequest.prototype.name = ""; + + /** + * DeleteEventRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @instance + */ + DeleteEventRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest instance + */ + DeleteEventRequest.create = function create(properties) { + return new DeleteEventRequest(properties); + }; + + /** + * Encodes the specified DeleteEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEventRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + */ + DeleteEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.DeleteEventRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.DeleteEventRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.DeleteEventRequest} message DeleteEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEventRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteEventRequest"; + }; + + return DeleteEventRequest; + })(); + + v1.ChannelOperationResponse = (function() { + + /** + * Properties of a ChannelOperationResponse. + * @memberof google.cloud.video.livestream.v1 + * @interface IChannelOperationResponse + */ + + /** + * Constructs a new ChannelOperationResponse. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ChannelOperationResponse. + * @implements IChannelOperationResponse + * @constructor + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse=} [properties] Properties to set + */ + function ChannelOperationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ChannelOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse instance + */ + ChannelOperationResponse.create = function create(properties) { + return new ChannelOperationResponse(properties); + }; + + /** + * Encodes the specified ChannelOperationResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse} message ChannelOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ChannelOperationResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse} message ChannelOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ChannelOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelOperationResponse message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ChannelOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + */ + ChannelOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ChannelOperationResponse) + return object; + return new $root.google.cloud.video.livestream.v1.ChannelOperationResponse(); + }; + + /** + * Creates a plain object from a ChannelOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.ChannelOperationResponse} message ChannelOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ChannelOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @instance + * @returns {Object.} JSON object + */ + ChannelOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelOperationResponse + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ChannelOperationResponse"; + }; + + return ChannelOperationResponse; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.video.livestream.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.video.livestream.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.requestedCancellation = reader.bool(); + break; + } + case 6: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.video.livestream.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + return v1; + })(); + + return livestream; + })(); + + return video; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** * ResourceDescriptor nameField. @@ -20718,347 +24731,876 @@ FileOptions.prototype.javaOuterClassname = ""; /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.javaMultipleFiles = false; + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash + * Creates a new FileOptions instance using the specified properties. + * @function create * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - FileOptions.prototype.javaStringCheckUtf8 = false; + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - FileOptions.prototype.optimizeFor = 1; + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * FileOptions goPackage. - * @member {string} goPackage + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileOptions.prototype.goPackage = ""; + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileOptions.prototype.ccGenericServices = false; + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices + * Verifies a FileOptions message. + * @function verify * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileOptions.prototype.javaGenericServices = false; + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions */ - FileOptions.prototype.pyGenericServices = false; + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - FileOptions.prototype.phpGenericServices = false; + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; - /** - * FileOptions deprecated. - * @member {boolean} deprecated + /** + * Converts this FileOptions to JSON. + * @function toJSON * @memberof google.protobuf.FileOptions * @instance + * @returns {Object.} JSON object */ - FileOptions.prototype.deprecated = false; + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas + * Gets the default type url for FileOptions + * @function getTypeUrl * @memberof google.protobuf.FileOptions - * @instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - FileOptions.prototype.ccEnableArenas = true; + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value */ - FileOptions.prototype.objcClassPrefix = ""; + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ - FileOptions.prototype.csharpNamespace = ""; /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ - FileOptions.prototype.swiftPrefix = ""; + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions * @instance */ - FileOptions.prototype.phpClassPrefix = ""; + MessageOptions.prototype.messageSetWireFormat = false; /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions * @instance */ - FileOptions.prototype.phpNamespace = ""; + MessageOptions.prototype.noStandardDescriptorAccessor = false; /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions * @instance */ - FileOptions.prototype.phpMetadataNamespace = ""; + MessageOptions.prototype.deprecated = false; /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions * @instance */ - FileOptions.prototype.rubyPackage = ""; + MessageOptions.prototype.mapEntry = false; /** - * FileOptions uninterpretedOption. + * MessageOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @instance */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions * @instance */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + MessageOptions.prototype[".google.api.resource"] = null; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new MessageOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); }; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encode = function encode(message, writer) { + MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes a MessageOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); break; } - case 42: { - message.phpGenericServices = reader.bool(); + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); break; } - case 23: { + case 3: { message.deprecated = reader.bool(); break; } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); + case 7: { + message.mapEntry = reader.bool(); break; } case 999: { @@ -21068,9 +25610,7 @@ break; } case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); break; } default: @@ -21082,98 +25622,44 @@ }; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { + MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileOptions message. + * Verifies a MessageOptions message. * @function verify - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileOptions.verify = function verify(message) { + MessageOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -21183,272 +25669,150 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; } return null; }; /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.MessageOptions} MessageOptions */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); } return message; }; /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.FileOptions} message FileOptions + * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options) { + MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { + if (options.arrays || options.defaults) object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; + object.mapEntry = false; + object[".google.api.resource"] = null; } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; /** - * Converts this FileOptions to JSON. + * Converts this MessageOptions to JSON. * @function toJSON - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ - FileOptions.prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FileOptions + * Gets the default type url for MessageOptions * @function getTypeUrl - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.MessageOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FileOptions"; + return typeUrlPrefix + "/google.protobuf.MessageOptions"; }; - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; + return MessageOptions; })(); - protobuf.MessageOptions = (function() { + protobuf.FieldOptions = (function() { /** - * Properties of a MessageOptions. + * Properties of a FieldOptions. * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** - * Constructs a new MessageOptions. + * Constructs a new FieldOptions. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ - function MessageOptions(properties) { + function FieldOptions(properties) { this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21456,138 +25820,194 @@ } /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions * @instance */ - MessageOptions.prototype.messageSetWireFormat = false; + FieldOptions.prototype.ctype = 0; /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions * @instance */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; + FieldOptions.prototype.packed = false; /** - * MessageOptions deprecated. + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @instance */ - MessageOptions.prototype.deprecated = false; + FieldOptions.prototype.deprecated = false; /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions * @instance */ - MessageOptions.prototype.mapEntry = false; + FieldOptions.prototype.weak = false; /** - * MessageOptions uninterpretedOption. + * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @instance */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions * @instance */ - MessageOptions.prototype[".google.api.resource"] = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * Creates a new MessageOptions instance using the specified properties. + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. * @function create - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); }; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer) { + FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * Decodes a FieldOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageOptions.decode = function decode(reader, length) { + FieldOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.messageSetWireFormat = reader.bool(); + message.ctype = reader.int32(); break; } case 2: { - message.noStandardDescriptorAccessor = reader.bool(); + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); break; } case 3: { message.deprecated = reader.bool(); break; } - case 7: { - message.mapEntry = reader.bool(); + case 10: { + message.weak = reader.bool(); break; } case 999: { @@ -21596,8 +26016,19 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); break; } default: @@ -21609,44 +26040,65 @@ }; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { + FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageOptions message. + * Verifies a FieldOptions message. * @function verify - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageOptions.verify = function verify(message) { + FieldOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -21656,150 +26108,293 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); if (error) - return ".google.api.resource." + error; + return ".google.api.resourceReference." + error; } return null; }; /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.FieldOptions} FieldOptions */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); + if (object.weak != null) + message.weak = Boolean(object.weak); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); } return message; }; /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options) { + FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; object.deprecated = false; - object.mapEntry = false; - object[".google.api.resource"] = null; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); return object; }; /** - * Converts this MessageOptions to JSON. + * Converts this FieldOptions to JSON. * @function toJSON - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @instance * @returns {Object.} JSON object */ - MessageOptions.prototype.toJSON = function toJSON() { + FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageOptions + * Gets the default type url for FieldOptions * @function getTypeUrl - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.FieldOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; + return typeUrlPrefix + "/google.protobuf.FieldOptions"; }; - return MessageOptions; + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; })(); - protobuf.FieldOptions = (function() { + protobuf.OneofOptions = (function() { /** - * Properties of a FieldOptions. + * Properties of an OneofOptions. * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** - * Constructs a new FieldOptions. + * Constructs a new OneofOptions. * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ - function FieldOptions(properties) { + function OneofOptions(properties) { this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21807,217 +26402,80 @@ } /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpretedOption. + * OneofOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); }; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes an OneofOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldOptions.decode = function decode(reader, length) { + OneofOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -22027,65 +26485,32 @@ }; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { + OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldOptions message. + * Verifies an OneofOptions message. * @function verify - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FieldOptions.verify = function verify(message) { + OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -22095,292 +26520,106 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } return null; }; /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.OneofOptions} OneofOptions */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); + var message = new $root.google.protobuf.OneofOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } return message; }; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOptions.toObject = function toObject(message, options) { + OneofOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { + if (options.arrays || options.defaults) object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); return object; }; /** - * Converts this FieldOptions to JSON. + * Converts this OneofOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ - FieldOptions.prototype.toJSON = function toJSON() { + OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldOptions + * Gets the default type url for OneofOptions * @function getTypeUrl - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.OneofOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; + return typeUrlPrefix + "/google.protobuf.OneofOptions"; }; - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; + return OneofOptions; })(); - protobuf.OneofOptions = (function() { + protobuf.EnumOptions = (function() { /** - * Properties of an OneofOptions. + * Properties of an EnumOptions. * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** - * Constructs a new OneofOptions. + * Constructs a new EnumOptions. * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ - function OneofOptions(properties) { + function EnumOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -22389,37 +26628,57 @@ } /** - * OneofOptions uninterpretedOption. + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @instance */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new OneofOptions instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @function create - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); }; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, writer) { + EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -22427,36 +26686,44 @@ }; /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes an EnumOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OneofOptions.decode = function decode(reader, length) { + EnumOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -22472,32 +26739,38 @@ }; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { + EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofOptions message. + * Verifies an EnumOptions message. * @function verify - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OneofOptions.verify = function verify(message) { + EnumOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -22511,24 +26784,28 @@ }; /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.EnumOptions} EnumOptions */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) return object; - var message = new $root.google.protobuf.OneofOptions(); + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } @@ -22536,20 +26813,28 @@ }; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -22559,54 +26844,53 @@ }; /** - * Converts this OneofOptions to JSON. + * Converts this EnumOptions to JSON. * @function toJSON - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ - OneofOptions.prototype.toJSON = function toJSON() { + EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OneofOptions + * Gets the default type url for EnumOptions * @function getTypeUrl - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.EnumOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; + return typeUrlPrefix + "/google.protobuf.EnumOptions"; }; - return OneofOptions; + return EnumOptions; })(); - protobuf.EnumOptions = (function() { + protobuf.EnumValueOptions = (function() { /** - * Properties of an EnumOptions. + * Properties of an EnumValueOptions. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** - * Constructs a new EnumOptions. + * Constructs a new EnumValueOptions. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ - function EnumOptions(properties) { + function EnumValueOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -22615,57 +26899,47 @@ } /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. + * EnumValueOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @instance */ - EnumOptions.prototype.deprecated = false; + EnumValueOptions.prototype.deprecated = false; /** - * EnumOptions uninterpretedOption. + * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @instance */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); }; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -22673,41 +26947,37 @@ }; /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumOptions.decode = function decode(reader, length) { + EnumValueOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { + case 1: { message.deprecated = reader.bool(); break; } @@ -22726,35 +26996,32 @@ }; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumOptions message. + * Verifies an EnumValueOptions message. * @function verify - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnumOptions.verify = function verify(message) { + EnumValueOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; @@ -22771,28 +27038,26 @@ }; /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); + var message = new $root.google.protobuf.EnumValueOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } @@ -22800,26 +27065,22 @@ }; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; + if (options.defaults) object.deprecated = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { @@ -22831,53 +27092,55 @@ }; /** - * Converts this EnumOptions to JSON. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for EnumValueOptions * @function getTypeUrl - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; }; - return EnumOptions; + return EnumValueOptions; })(); - protobuf.EnumValueOptions = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of an EnumValueOptions. + * Properties of a ServiceOptions. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ /** - * Constructs a new EnumValueOptions. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function EnumValueOptions(properties) { + function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -22886,85 +27149,105 @@ } /** - * EnumValueOptions deprecated. + * ServiceOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumValueOptions.prototype.deprecated = false; + ServiceOptions.prototype.deprecated = false; /** - * EnumValueOptions uninterpretedOption. + * ServiceOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new EnumValueOptions instance using the specified properties. + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumValueOptions.decode = function decode(reader, length) { + ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { + case 33: { message.deprecated = reader.bool(); break; } @@ -22974,6 +27257,14 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -22983,30 +27274,30 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnumValueOptions.verify = function verify(message) { + ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -23021,53 +27312,66 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; return null; }; /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) return object; - var message = new $root.google.protobuf.EnumValueOptions(); + var message = new $root.google.protobuf.ServiceOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; - if (options.defaults) + if (options.defaults) { object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { @@ -23075,60 +27379,67 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; /** - * Converts this EnumValueOptions to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for ServiceOptions * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; - return EnumValueOptions; + return ServiceOptions; })(); - protobuf.ServiceOptions = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a ServiceOptions. + * Properties of a MethodOptions. * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo */ /** - * Constructs a new ServiceOptions. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function ServiceOptions(properties) { + function MethodOptions(properties) { this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23136,101 +27447,122 @@ } /** - * ServiceOptions deprecated. + * MethodOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype.deprecated = false; + MethodOptions.prototype.deprecated = false; /** - * ServiceOptions uninterpretedOption. + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + MethodOptions.prototype[".google.api.http"] = null; /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * Creates a new ServiceOptions instance using the specified properties. + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceOptions.decode = function decode(reader, length) { + MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -23238,18 +27570,28 @@ message.deprecated = reader.bool(); break; } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); break; } default: @@ -23261,35 +27603,44 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServiceOptions.verify = function verify(message) { + MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -23299,134 +27650,204 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } return null; }; /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.MethodOptions} MethodOptions */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) return object; - var message = new $root.google.protobuf.ServiceOptions(); + var message = new $root.google.protobuf.MethodOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } return message; }; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } if (options.defaults) { object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** - * Converts this ServiceOptions to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceOptions + * Gets the default type url for MethodOptions * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + return typeUrlPrefix + "/google.protobuf.MethodOptions"; }; - return ServiceOptions; + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; })(); - protobuf.MethodOptions = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of a MethodOptions. + * Properties of an UninterpretedOption. * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue */ /** - * Constructs a new MethodOptions. + * Constructs a new UninterpretedOption. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; + function UninterpretedOption(properties) { + this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23434,151 +27855,162 @@ } /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype.deprecated = false; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype.idempotencyLevel = 0; + UninterpretedOption.prototype.identifierValue = ""; /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype[".google.api.http"] = null; + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + UninterpretedOption.prototype.doubleValue = 0; /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** - * Creates a new MethodOptions instance using the specified properties. + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. * @function create - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); }; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MethodOptions.decode = function decode(reader, length) { + UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; } - case 34: { - message.idempotencyLevel = reader.int32(); + case 3: { + message.identifierValue = reader.string(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 4: { + message.positiveIntValue = reader.uint64(); break; } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + case 5: { + message.negativeIntValue = reader.int64(); break; } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); + case 6: { + message.doubleValue = reader.double(); break; } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); break; } default: @@ -23590,251 +28022,454 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies an UninterpretedOption message. * @function verify - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MethodOptions.verify = function verify(message) { + UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); if (error) - return "uninterpretedOption." + error; + return "name." + error; } } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; return null; }; /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); } } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); return message; }; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } + if (options.arrays || options.defaults) + object.name = []; if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; return object; }; /** - * Converts this MethodOptions to JSON. + * Converts this UninterpretedOption to JSON. * @function toJSON - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ - MethodOptions.prototype.toJSON = function toJSON() { + UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodOptions + * Gets the default type url for UninterpretedOption * @function getTypeUrl - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; }; - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; })(); - return MethodOptions; + return UninterpretedOption; })(); - protobuf.UninterpretedOption = (function() { + protobuf.SourceCodeInfo = (function() { /** - * Properties of an UninterpretedOption. + * Properties of a SourceCodeInfo. * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ /** - * Constructs a new UninterpretedOption. + * Constructs a new SourceCodeInfo. * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - function UninterpretedOption(properties) { - this.name = []; + function SourceCodeInfo(properties) { + this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23842,162 +28477,78 @@ } /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - UninterpretedOption.prototype.aggregateValue = ""; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UninterpretedOption.decode = function decode(reader, length) { + SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; } default: @@ -24009,224 +28560,143 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies a SourceCodeInfo message. * @function verify - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } return null; }; /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); } } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); return message; }; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UninterpretedOption.toObject = function toObject(message, options) { + SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; return object; }; /** - * Converts this UninterpretedOption to JSON. + * Converts this SourceCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ - UninterpretedOption.prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UninterpretedOption + * Gets the default type url for SourceCodeInfo * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; }; - UninterpretedOption.NamePart = (function() { + SourceCodeInfo.Location = (function() { /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments */ /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ - function NamePart(properties) { + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24234,87 +28704,156 @@ } /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - NamePart.prototype.namePart = ""; + Location.prototype.path = $util.emptyArray; /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - NamePart.prototype.isExtension = false; + Location.prototype.span = $util.emptyArray; /** - * Creates a new NamePart instance using the specified properties. + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ - NamePart.create = function create(properties) { - return new NamePart(properties); + Location.create = function create(properties) { + return new Location(properties); }; /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encode = function encode(message, writer) { + Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); return writer; }; /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { + Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NamePart message from the specified reader or buffer. + * Decodes a Location message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NamePart.decode = function decode(reader, length) { + Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.namePart = reader.string(); + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); break; } case 2: { - message.isExtension = reader.bool(); + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); break; } default: @@ -24322,141 +28861,201 @@ break; } } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NamePart.decodeDelimited = function decodeDelimited(reader) { + Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NamePart message. + * Verifies a Location message. * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NamePart.verify = function verify(message) { + Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } return null; }; /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.SourceCodeInfo.Location} Location */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } return message; }; /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = function toObject(message, options) { + Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } if (options.defaults) { - object.namePart = ""; - object.isExtension = false; + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; return object; }; /** - * Converts this NamePart to JSON. + * Converts this Location to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ - NamePart.prototype.toJSON = function toJSON() { + Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NamePart + * Gets the default type url for Location * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; }; - return NamePart; + return Location; })(); - return UninterpretedOption; + return SourceCodeInfo; })(); - protobuf.SourceCodeInfo = (function() { + protobuf.GeneratedCodeInfo = (function() { /** - * Properties of a SourceCodeInfo. + * Properties of a GeneratedCodeInfo. * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** - * Constructs a new SourceCodeInfo. + * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + function GeneratedCodeInfo(properties) { + this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24464,78 +29063,78 @@ } /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SourceCodeInfo.decode = function decode(reader, length) { + GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; } default: @@ -24547,143 +29146,141 @@ }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceCodeInfo message. + * Verifies a GeneratedCodeInfo message. * @function verify - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SourceCodeInfo.verify = function verify(message) { + GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); if (error) - return "location." + error; + return "annotation." + error; } } return null; }; /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); } } return message; }; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); } return object; }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this GeneratedCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ - SourceCodeInfo.prototype.toJSON = function toJSON() { + GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SourceCodeInfo + * Gets the default type url for GeneratedCodeInfo * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; }; - SourceCodeInfo.Location = (function() { + GeneratedCodeInfo.Annotation = (function() { /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic */ /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */ - function Location(properties) { + function Annotation(properties) { this.path = []; - this.span = []; - this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24691,67 +29288,67 @@ } /** - * Location path. + * Annotation path. * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.path = $util.emptyArray; + Annotation.prototype.path = $util.emptyArray; /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.span = $util.emptyArray; + Annotation.prototype.sourceFile = ""; /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.leadingComments = ""; + Annotation.prototype.begin = 0; /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.trailingComments = ""; + Annotation.prototype.end = 0; /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.leadingDetachedComments = $util.emptyArray; + Annotation.prototype.semantic = 0; /** - * Creates a new Location instance using the specified properties. + * Creates a new Annotation instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance */ - Location.create = function create(properties) { - return new Location(properties); + Annotation.create = function create(properties) { + return new Annotation(properties); }; /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer) { + Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { @@ -24760,50 +29357,45 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); return writer; }; /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encodeDelimited = function encodeDelimited(message, writer) { + Annotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes an Annotation message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decode = function decode(reader, length) { + Annotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -24819,28 +29411,19 @@ break; } case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); + message.sourceFile = reader.string(); break; } case 3: { - message.leadingComments = reader.string(); + message.begin = reader.int32(); break; } case 4: { - message.trailingComments = reader.string(); + message.end = reader.int32(); break; } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); + case 5: { + message.semantic = reader.int32(); break; } default: @@ -24852,30 +29435,30 @@ }; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decodeDelimited = function decodeDelimited(reader) { + Annotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Location message. + * Verifies an Annotation message. * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Location.verify = function verify(message) { + Annotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { @@ -24885,164 +29468,179 @@ if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); if (object.path) { if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; } return message; }; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. + * Creates a plain object from an Annotation message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = function toObject(message, options) { + Annotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { + if (options.arrays || options.defaults) object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; /** - * Converts this Location to JSON. + * Converts this Annotation to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance * @returns {Object.} JSON object */ - Location.prototype.toJSON = function toJSON() { + Annotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Location + * Gets the default type url for Annotation * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; }; - return Location; + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; })(); - return SourceCodeInfo; + return GeneratedCodeInfo; })(); - protobuf.GeneratedCodeInfo = (function() { + protobuf.Duration = (function() { /** - * Properties of a GeneratedCodeInfo. + * Properties of a Duration. * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new Duration. * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo + * @classdesc Represents a Duration. + * @implements IDuration * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - function GeneratedCodeInfo(properties) { - this.annotation = []; + function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25050,78 +29648,89 @@ } /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration * @instance */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. * @function create - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GeneratedCodeInfo.decode = function decode(reader, length) { + Duration.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); break; } default: @@ -25133,501 +29742,387 @@ }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GeneratedCodeInfo message. + * Verifies a Duration message. * @function verify - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GeneratedCodeInfo.verify = function verify(message) { + Duration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; return null; }; /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.protobuf.Duration} Duration */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; return message; }; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeneratedCodeInfo.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; return object; }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this Duration to JSON. * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { + Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GeneratedCodeInfo + * Gets the default type url for Duration * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Duration * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + return typeUrlPrefix + "/google.protobuf.Duration"; }; - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; + return Duration; + })(); - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; + protobuf.Timestamp = (function() { - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); break; } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; + case 2: { + message.nanos = reader.int32(); break; } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Annotation; - })(); + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; - return GeneratedCodeInfo; + return Timestamp; })(); - protobuf.Duration = (function() { + protobuf.Any = (function() { /** - * Properties of a Duration. + * Properties of an Any. * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new Duration. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function Duration(properties) { + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25635,89 +30130,89 @@ } /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Any.prototype.type_url = ""; /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any * @instance */ - Duration.prototype.nanos = 0; + Any.prototype.value = $util.newBuffer([]); /** - * Creates a new Duration instance using the specified properties. + * Creates a new Any instance using the specified properties. * @function create - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - Duration.create = function create(properties) { - return new Duration(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Duration.decode = function decode(reader, length) { + Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.seconds = reader.int64(); + message.type_url = reader.string(); break; } case 2: { - message.nanos = reader.int32(); + message.value = reader.bytes(); break; } default: @@ -25729,146 +30224,139 @@ }; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Duration.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Duration message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Duration.verify = function verify(message) { + Any.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; return null; }; /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Any} Any */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; return message; }; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + Any.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this Duration to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for Any * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Any * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.Any"; }; - return Duration; + return Any; })(); - protobuf.Timestamp = (function() { + protobuf.Empty = (function() { /** - * Properties of a Timestamp. + * Properties of an Empty. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IEmpty */ /** - * Constructs a new Timestamp. + * Constructs a new Empty. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents an Empty. + * @implements IEmpty * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - function Timestamp(properties) { + function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25876,91 +30364,63 @@ } /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decode = function decode(reader, length) { + Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } default: reader.skipType(tag & 7); break; @@ -25970,146 +30430,110 @@ }; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Timestamp message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Timestamp.verify = function verify(message) { + Empty.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; return null; }; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; }; /** - * Converts this Timestamp to JSON. + * Converts this Empty to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Empty * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return typeUrlPrefix + "/google.protobuf.Empty"; }; - return Timestamp; + return Empty; })(); - protobuf.Any = (function() { + protobuf.FieldMask = (function() { /** - * Properties of an Any. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new Any. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function Any(properties) { + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26117,89 +30541,78 @@ } /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask * @instance */ - Any.prototype.value = $util.newBuffer([]); + FieldMask.prototype.paths = $util.emptyArray; /** - * Creates a new Any instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @function create - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - Any.create = function create(properties) { - return new Any(properties); + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encode = function encode(message, writer) { + FieldMask.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); return writer; }; /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encodeDelimited = function encodeDelimited(message, writer) { + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Any message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Any.decode = function decode(reader, length) { + FieldMask.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); break; } default: @@ -26211,203 +30624,358 @@ }; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Any.decodeDelimited = function decodeDelimited(reader) { + FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Any message. + * Verifies a FieldMask message. * @function verify - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Any.verify = function verify(message) { + FieldMask.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } return null; }; /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.FieldMask} FieldMask */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } return message; }; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.Any} message Any + * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Any.toObject = function toObject(message, options) { + FieldMask.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.DateTime = (function() { + + /** + * Properties of a DateTime. + * @memberof google.type + * @interface IDateTime + * @property {number|null} [year] DateTime year + * @property {number|null} [month] DateTime month + * @property {number|null} [day] DateTime day + * @property {number|null} [hours] DateTime hours + * @property {number|null} [minutes] DateTime minutes + * @property {number|null} [seconds] DateTime seconds + * @property {number|null} [nanos] DateTime nanos + * @property {google.protobuf.IDuration|null} [utcOffset] DateTime utcOffset + * @property {google.type.ITimeZone|null} [timeZone] DateTime timeZone + */ + + /** + * Constructs a new DateTime. + * @memberof google.type + * @classdesc Represents a DateTime. + * @implements IDateTime + * @constructor + * @param {google.type.IDateTime=} [properties] Properties to set + */ + function DateTime(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTime year. + * @member {number} year + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.year = 0; + + /** + * DateTime month. + * @member {number} month + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.month = 0; + + /** + * DateTime day. + * @member {number} day + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.day = 0; + + /** + * DateTime hours. + * @member {number} hours + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.hours = 0; + + /** + * DateTime minutes. + * @member {number} minutes + * @memberof google.type.DateTime * @instance - * @returns {Object.} JSON object */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + DateTime.prototype.minutes = 0; /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * DateTime seconds. + * @member {number} seconds + * @memberof google.type.DateTime + * @instance */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; + DateTime.prototype.seconds = 0; - return Any; - })(); + /** + * DateTime nanos. + * @member {number} nanos + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.nanos = 0; - protobuf.Empty = (function() { + /** + * DateTime utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.utcOffset = null; /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty + * DateTime timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.type.DateTime + * @instance */ + DateTime.prototype.timeZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * DateTime timeOffset. + * @member {"utcOffset"|"timeZone"|undefined} timeOffset + * @memberof google.type.DateTime + * @instance */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(DateTime.prototype, "timeOffset", { + get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Empty instance using the specified properties. + * Creates a new DateTime instance using the specified properties. * @function create - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance + * @param {google.type.IDateTime=} [properties] Properties to set + * @returns {google.type.DateTime} DateTime instance */ - Empty.create = function create(properties) { - return new Empty(properties); + DateTime.create = function create(properties) { + return new DateTime(properties); }; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. * @function encode - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.type.IDateTime} message DateTime message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, writer) { + DateTime.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.nanos); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.type.IDateTime} message DateTime message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { + DateTime.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a DateTime message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty + * @returns {google.type.DateTime} DateTime * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decode = function decode(reader, length) { + DateTime.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.DateTime(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + case 4: { + message.hours = reader.int32(); + break; + } + case 5: { + message.minutes = reader.int32(); + break; + } + case 6: { + message.seconds = reader.int32(); + break; + } + case 7: { + message.nanos = reader.int32(); + break; + } + case 8: { + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26417,110 +30985,211 @@ }; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a DateTime message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty + * @returns {google.type.DateTime} DateTime * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decodeDelimited = function decodeDelimited(reader) { + DateTime.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Empty message. + * Verifies a DateTime message. * @function verify - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Empty.verify = function verify(message) { + DateTime.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + properties.timeOffset = 1; + { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); + if (error) + return "utcOffset." + error; + } + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + if (properties.timeOffset === 1) + return "timeOffset: multiple values"; + properties.timeOffset = 1; + { + var error = $root.google.type.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + } return null; }; /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.type.DateTime} DateTime */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + DateTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.DateTime) return object; - return new $root.google.protobuf.Empty(); + var message = new $root.google.type.DateTime(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.type.DateTime.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); + } + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.type.DateTime.timeZone: object expected"); + message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); + } + return message; }; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. + * Creates a plain object from a DateTime message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.type.DateTime} message DateTime * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + DateTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (options.oneofs) + object.timeOffset = "utcOffset"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (options.oneofs) + object.timeOffset = "timeZone"; + } + return object; }; /** - * Converts this Empty to JSON. + * Converts this DateTime to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + DateTime.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Empty + * Gets the default type url for DateTime * @function getTypeUrl - * @memberof google.protobuf.Empty + * @memberof google.type.DateTime * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Empty"; + return typeUrlPrefix + "/google.type.DateTime"; }; - return Empty; + return DateTime; })(); - protobuf.FieldMask = (function() { + type.TimeZone = (function() { /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths + * Properties of a TimeZone. + * @memberof google.type + * @interface ITimeZone + * @property {string|null} [id] TimeZone id + * @property {string|null} [version] TimeZone version */ /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask + * Constructs a new TimeZone. + * @memberof google.type + * @classdesc Represents a TimeZone. + * @implements ITimeZone * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @param {google.type.ITimeZone=} [properties] Properties to set */ - function FieldMask(properties) { - this.paths = []; + function TimeZone(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26528,78 +31197,89 @@ } /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask + * TimeZone id. + * @member {string} id + * @memberof google.type.TimeZone * @instance */ - FieldMask.prototype.paths = $util.emptyArray; + TimeZone.prototype.id = ""; /** - * Creates a new FieldMask instance using the specified properties. + * TimeZone version. + * @member {string} version + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.version = ""; + + /** + * Creates a new TimeZone instance using the specified properties. * @function create - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance + * @param {google.type.ITimeZone=} [properties] Properties to set + * @returns {google.type.TimeZone} TimeZone instance */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); + TimeZone.create = function create(properties) { + return new TimeZone(properties); }; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encode = function encode(message, writer) { + TimeZone.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); return writer; }; /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + TimeZone.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes a TimeZone message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.type.TimeZone} TimeZone * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldMask.decode = function decode(reader, length) { + TimeZone.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeZone(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); + message.id = reader.string(); + break; + } + case 2: { + message.version = reader.string(); break; } default: @@ -26611,117 +31291,114 @@ }; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes a TimeZone message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.type.TimeZone} TimeZone * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { + TimeZone.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldMask message. + * Verifies a TimeZone message. * @function verify - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FieldMask.verify = function verify(message) { + TimeZone.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; return null; }; /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.type.TimeZone} TimeZone */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) + TimeZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeZone) return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } + var message = new $root.google.type.TimeZone(); + if (object.id != null) + message.id = String(object.id); + if (object.version != null) + message.version = String(object.version); return message; }; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static - * @param {google.protobuf.FieldMask} message FieldMask + * @param {google.type.TimeZone} message TimeZone * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldMask.toObject = function toObject(message, options) { + TimeZone.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; + if (options.defaults) { + object.id = ""; + object.version = ""; } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; /** - * Converts this FieldMask to JSON. + * Converts this TimeZone to JSON. * @function toJSON - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @instance * @returns {Object.} JSON object */ - FieldMask.prototype.toJSON = function toJSON() { + TimeZone.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldMask + * Gets the default type url for TimeZone * @function getTypeUrl - * @memberof google.protobuf.FieldMask + * @memberof google.type.TimeZone * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TimeZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldMask"; + return typeUrlPrefix + "/google.type.TimeZone"; }; - return FieldMask; + return TimeZone; })(); - return protobuf; + return type; })(); google.rpc = (function() { diff --git a/packages/google-cloud-video-livestream/protos/protos.json b/packages/google-cloud-video-livestream/protos/protos.json index 81e97a4abcc..4d288b354c8 100644 --- a/packages/google-cloud-video-livestream/protos/protos.json +++ b/packages/google-cloud-video-livestream/protos/protos.json @@ -16,7 +16,9 @@ "java_outer_classname": "ServiceProto", "java_package": "com.google.cloud.video.livestream.v1", "php_namespace": "Google\\Cloud\\Video\\LiveStream\\V1", - "ruby_package": "Google::Cloud::Video::LiveStream::V1" + "ruby_package": "Google::Cloud::Video::LiveStream::V1", + "(google.api.resource_definition).type": "secretmanager.googleapis.com/SecretVersion", + "(google.api.resource_definition).pattern": "projects/{project}/secrets/{secret}/versions/{version}" }, "nested": { "ElementaryStream": { @@ -66,6 +68,10 @@ "segmentSettings": { "type": "SegmentSettings", "id": 5 + }, + "encryptionId": { + "type": "string", + "id": 6 } } }, @@ -97,6 +103,10 @@ "segmentKeepDuration": { "type": "google.protobuf.Duration", "id": 5 + }, + "useTimecodeAsTimeline": { + "type": "bool", + "id": 6 } }, "nested": { @@ -156,6 +166,10 @@ }, "PreprocessingConfig": { "fields": { + "audio": { + "type": "Audio", + "id": 1 + }, "crop": { "type": "Crop", "id": 2 @@ -166,6 +180,14 @@ } }, "nested": { + "Audio": { + "fields": { + "lufs": { + "type": "double", + "id": 1 + } + } + }, "Crop": { "fields": { "topPixels": { @@ -369,6 +391,10 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "gainDb": { + "type": "double", + "id": 5 } } } @@ -393,6 +419,39 @@ } } }, + "TimecodeConfig": { + "oneofs": { + "timeOffset": { + "oneof": [ + "utcOffset", + "timeZone" + ] + } + }, + "fields": { + "source": { + "type": "TimecodeSource", + "id": 1 + }, + "utcOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "timeZone": { + "type": "google.type.TimeZone", + "id": 3 + } + }, + "nested": { + "TimecodeSource": { + "values": { + "TIMECODE_SOURCE_UNSPECIFIED": 0, + "MEDIA_TIMESTAMP": 1, + "EMBEDDED_TIMECODE": 2 + } + } + } + }, "Input": { "options": { "(google.api.resource).type": "livestream.googleapis.com/Input", @@ -565,6 +624,19 @@ "logConfig": { "type": "LogConfig", "id": 19 + }, + "timecodeConfig": { + "type": "TimecodeConfig", + "id": 21 + }, + "encryptions": { + "rule": "repeated", + "type": "Encryption", + "id": 24 + }, + "inputConfig": { + "type": "InputConfig", + "id": 25 } }, "nested": { @@ -590,6 +662,23 @@ } } }, + "InputConfig": { + "fields": { + "inputSwitchMode": { + "type": "InputSwitchMode", + "id": 1 + } + }, + "nested": { + "InputSwitchMode": { + "values": { + "INPUT_SWITCH_MODE_UNSPECIFIED": 0, + "FAILOVER_PREFER_PRIMARY": 1, + "MANUAL": 3 + } + } + } + }, "LogConfig": { "fields": { "logSeverity": { @@ -727,7 +816,11 @@ "oneofs": { "task": { "oneof": [ - "adBreak" + "inputSwitch", + "adBreak", + "returnToProgram", + "mute", + "unmute" ] } }, @@ -755,6 +848,13 @@ "type": "string", "id": 4 }, + "inputSwitch": { + "type": "InputSwitchTask", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, "adBreak": { "type": "AdBreakTask", "id": 6, @@ -762,6 +862,27 @@ "(google.api.field_behavior)": "REQUIRED" } }, + "returnToProgram": { + "type": "ReturnToProgramTask", + "id": 13, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mute": { + "type": "MuteTask", + "id": 15, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "unmute": { + "type": "UnmuteTask", + "id": 16, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, "executeNow": { "type": "bool", "id": 9 @@ -786,6 +907,14 @@ } }, "nested": { + "InputSwitchTask": { + "fields": { + "inputKey": { + "type": "string", + "id": 1 + } + } + }, "AdBreakTask": { "fields": { "duration": { @@ -794,6 +923,20 @@ } } }, + "ReturnToProgramTask": { + "fields": {} + }, + "MuteTask": { + "fields": { + "duration": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "UnmuteTask": { + "fields": {} + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -807,6 +950,117 @@ } } }, + "Encryption": { + "oneofs": { + "secretSource": { + "oneof": [ + "secretManagerKeySource" + ] + }, + "encryptionMode": { + "oneof": [ + "aes128", + "sampleAes", + "mpegCenc" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "secretManagerKeySource": { + "type": "SecretManagerSource", + "id": 7 + }, + "drmSystems": { + "type": "DrmSystems", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "aes128": { + "type": "Aes128Encryption", + "id": 4 + }, + "sampleAes": { + "type": "SampleAesEncryption", + "id": 5 + }, + "mpegCenc": { + "type": "MpegCommonEncryption", + "id": 6 + } + }, + "nested": { + "SecretManagerSource": { + "fields": { + "secretVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "Widevine": { + "fields": {} + }, + "Fairplay": { + "fields": {} + }, + "Playready": { + "fields": {} + }, + "Clearkey": { + "fields": {} + }, + "DrmSystems": { + "fields": { + "widevine": { + "type": "Widevine", + "id": 1 + }, + "fairplay": { + "type": "Fairplay", + "id": 2 + }, + "playready": { + "type": "Playready", + "id": 3 + }, + "clearkey": { + "type": "Clearkey", + "id": 4 + } + } + }, + "Aes128Encryption": { + "fields": {} + }, + "SampleAesEncryption": { + "fields": {} + }, + "MpegCommonEncryption": { + "fields": { + "scheme": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, "LivestreamService": { "options": { "(google.api.default_host)": "livestream.googleapis.com", @@ -2815,6 +3069,78 @@ } } }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/datetime;datetime", + "java_multiple_files": true, + "java_outer_classname": "DateTimeProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "DateTime": { + "oneofs": { + "timeOffset": { + "oneof": [ + "utcOffset", + "timeZone" + ] + } + }, + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + }, + "hours": { + "type": "int32", + "id": 4 + }, + "minutes": { + "type": "int32", + "id": 5 + }, + "seconds": { + "type": "int32", + "id": 6 + }, + "nanos": { + "type": "int32", + "id": 7 + }, + "utcOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "timeZone": { + "type": "TimeZone", + "id": 9 + } + } + }, + "TimeZone": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + } + } + }, "rpc": { "options": { "cc_enable_arenas": true, diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js index a7c4a500426..ae51e11b30a 100644 --- a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js @@ -37,8 +37,8 @@ function main(parent) { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * next_page_token google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token to - * determine if there are more items left to be queried. + * next_page_token google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token + * to determine if there are more items left to be queried. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js index 82d3f0ab203..6af569412f4 100644 --- a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js @@ -37,8 +37,8 @@ function main(parent) { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * next_page_token google.cloud.video.livestream.v1.ListEventsResponse.next_page_token to - * determine if there are more items left to be queried. + * next_page_token google.cloud.video.livestream.v1.ListEventsResponse.next_page_token + * to determine if there are more items left to be queried. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js index a7d76865fe0..bb79d657055 100644 --- a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js @@ -37,8 +37,8 @@ function main(parent) { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * next_page_token google.cloud.video.livestream.v1.ListInputsResponse.next_page_token to - * determine if there are more items left to be queried. + * next_page_token google.cloud.video.livestream.v1.ListInputsResponse.next_page_token + * to determine if there are more items left to be queried. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js index f33073b004b..a31d32a1a8e 100644 --- a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js @@ -32,13 +32,20 @@ function main(channel) { * Field mask is used to specify the fields to be overwritten in the Channel * resource by the update. You can only update the following fields: * * `inputAttachments` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * `inputConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) * * `output` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * `elementaryStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * `elementaryStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) * * `muxStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * `manifests` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - * * `spritesheets` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * `manifests` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * `spriteSheets` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * `logConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * `timecodeConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * `encryptions` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. */ // const updateMask = {} /** diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js index adda01e638b..3e5bc7af43a 100644 --- a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js @@ -35,6 +35,9 @@ function main(input) { * * `securityRules` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. */ // const updateMask = {} /** diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json b/packages/google-cloud-video-livestream/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json index 999e0282071..2911a2bf002 100644 --- a/packages/google-cloud-video-livestream/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json +++ b/packages/google-cloud-video-livestream/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-livestream", - "version": "0.4.0", + "version": "0.4.1", "language": "TYPESCRIPT", "apis": [ { @@ -218,7 +218,7 @@ "segments": [ { "start": 25, - "end": 81, + "end": 88, "type": "FULL" } ], @@ -546,7 +546,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 80, "type": "FULL" } ], diff --git a/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts b/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts index 4ccfcd3b87f..80996dcef9c 100644 --- a/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts +++ b/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts @@ -27,6 +27,8 @@ import type { LROperation, PaginationCallback, GaxCall, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -65,6 +67,7 @@ export class LivestreamServiceClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; livestreamServiceStub?: Promise<{[name: string]: Function}>; @@ -162,6 +165,10 @@ export class LivestreamServiceClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -1332,14 +1339,22 @@ export class LivestreamServiceClient { * resource by the update. You can only update the following fields: * * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - * * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) * * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * @param {google.cloud.video.livestream.v1.Channel} request.channel * Required. The channel resource to be updated. * @param {string} request.requestId @@ -2121,6 +2136,10 @@ export class LivestreamServiceClient { * * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * @param {google.cloud.video.livestream.v1.Input} request.input * Required. The input resource to be updated. * @param {string} request.requestId @@ -2280,8 +2299,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2388,8 +2407,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2444,8 +2463,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2499,8 +2518,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2607,8 +2626,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2663,8 +2682,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2718,8 +2737,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2826,8 +2845,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2882,8 +2901,8 @@ export class LivestreamServiceClient { * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} to - * determine if there are more items left to be queried. + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} + * to determine if there are more items left to be queried. * @param {string} request.pageToken * The next_page_token value returned from a previous List request, if any. * @param {string} request.filter @@ -2925,6 +2944,261 @@ export class LivestreamServiceClient { callSettings ) as AsyncIterable; } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -3159,6 +3433,7 @@ export class LivestreamServiceClient { return this.livestreamServiceStub.then(stub => { this._terminated = true; stub.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-cloud-video-livestream/test/gapic_livestream_service_v1.ts b/packages/google-cloud-video-livestream/test/gapic_livestream_service_v1.ts index 11aca917e97..5681c7843c1 100644 --- a/packages/google-cloud-video-livestream/test/gapic_livestream_service_v1.ts +++ b/packages/google-cloud-video-livestream/test/gapic_livestream_service_v1.ts @@ -25,7 +25,12 @@ import * as livestreamserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -3428,6 +3433,509 @@ describe('v1.LivestreamServiceClient', () => { ); }); }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('channel', () => {