From 88c91baae9d9d0639319350414f8af36c816f797 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 4 Apr 2022 22:48:41 +0000 Subject: [PATCH 1/2] feat: add support for Agent Pools feat: add support for transfers between file systems feat: add support for metadata preservation feat: add support for transferring a specific list of objects (manifest) feat: add support for Cloud Logging PiperOrigin-RevId: 439424192 Source-Link: https://github.com/googleapis/googleapis/commit/bf6982693e7f5f250199705c7cd99a4700cb3c0a Source-Link: https://github.com/googleapis/googleapis-gen/commit/eae2013bf0086475df25f96371a4ca7e75f20fab Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWFlMjAxM2JmMDA4NjQ3NWRmMjVmOTYzNzFhNGNhN2U3NWYyMGZhYiJ9 --- owl-bot-staging/v1/.eslintignore | 7 + owl-bot-staging/v1/.eslintrc.json | 3 + owl-bot-staging/v1/.gitignore | 14 + owl-bot-staging/v1/.jsdoc.js | 55 + owl-bot-staging/v1/.mocharc.js | 33 + owl-bot-staging/v1/.prettierrc.js | 22 + owl-bot-staging/v1/README.md | 1 + owl-bot-staging/v1/linkinator.config.json | 16 + owl-bot-staging/v1/package.json | 64 + .../google/storagetransfer/v1/transfer.proto | 369 ++++ .../storagetransfer/v1/transfer_types.proto | 1121 +++++++++++ ...et_metadata.google.storagetransfer.v1.json | 587 ++++++ ...rage_transfer_service.create_agent_pool.js | 78 + ...ge_transfer_service.create_transfer_job.js | 58 + ...rage_transfer_service.delete_agent_pool.js | 58 + ...storage_transfer_service.get_agent_pool.js | 58 + ...sfer_service.get_google_service_account.js | 59 + ...orage_transfer_service.get_transfer_job.js | 64 + ...orage_transfer_service.list_agent_pools.js | 77 + ...age_transfer_service.list_transfer_jobs.js | 78 + ...ansfer_service.pause_transfer_operation.js | 58 + ...nsfer_service.resume_transfer_operation.js | 58 + ...orage_transfer_service.run_transfer_job.js | 65 + ...rage_transfer_service.update_agent_pool.js | 73 + ...ge_transfer_service.update_transfer_job.js | 91 + owl-bot-staging/v1/src/index.ts | 25 + owl-bot-staging/v1/src/v1/gapic_metadata.json | 161 ++ owl-bot-staging/v1/src/v1/index.ts | 19 + .../src/v1/storage_transfer_service_client.ts | 1652 ++++++++++++++++ ...torage_transfer_service_client_config.json | 91 + .../storage_transfer_service_proto_list.json | 4 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + owl-bot-staging/v1/system-test/install.ts | 49 + .../test/gapic_storage_transfer_service_v1.ts | 1726 +++++++++++++++++ owl-bot-staging/v1/tsconfig.json | 19 + owl-bot-staging/v1/webpack.config.js | 64 + 37 files changed, 7036 insertions(+) create mode 100644 owl-bot-staging/v1/.eslintignore create mode 100644 owl-bot-staging/v1/.eslintrc.json create mode 100644 owl-bot-staging/v1/.gitignore create mode 100644 owl-bot-staging/v1/.jsdoc.js create mode 100644 owl-bot-staging/v1/.mocharc.js create mode 100644 owl-bot-staging/v1/.prettierrc.js create mode 100644 owl-bot-staging/v1/README.md create mode 100644 owl-bot-staging/v1/linkinator.config.json create mode 100644 owl-bot-staging/v1/package.json create mode 100644 owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto create mode 100644 owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto create mode 100644 owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js create mode 100644 owl-bot-staging/v1/src/index.ts create mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/v1/src/v1/index.ts create mode 100644 owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json create mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1/system-test/install.ts create mode 100644 owl-bot-staging/v1/test/gapic_storage_transfer_service_v1.ts create mode 100644 owl-bot-staging/v1/tsconfig.json create mode 100644 owl-bot-staging/v1/webpack.config.js diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore new file mode 100644 index 0000000..cfc348e --- /dev/null +++ b/owl-bot-staging/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json new file mode 100644 index 0000000..7821534 --- /dev/null +++ b/owl-bot-staging/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore new file mode 100644 index 0000000..5d32b23 --- /dev/null +++ b/owl-bot-staging/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/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js new file mode 100644 index 0000000..0ffbf58 --- /dev/null +++ b/owl-bot-staging/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/storage-transfer', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js new file mode 100644 index 0000000..481c522 --- /dev/null +++ b/owl-bot-staging/v1/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// 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/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js new file mode 100644 index 0000000..494e147 --- /dev/null +++ b/owl-bot-staging/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// 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/v1/README.md b/owl-bot-staging/v1/README.md new file mode 100644 index 0000000..dc9f51c --- /dev/null +++ b/owl-bot-staging/v1/README.md @@ -0,0 +1 @@ +Storagetransfer: Nodejs Client diff --git a/owl-bot-staging/v1/linkinator.config.json b/owl-bot-staging/v1/linkinator.config.json new file mode 100644 index 0000000..befd23c --- /dev/null +++ b/owl-bot-staging/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/v1/package.json b/owl-bot-staging/v1/package.json new file mode 100644 index 0000000..bdfcfec --- /dev/null +++ b/owl-bot-staging/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/storage-transfer", + "version": "0.1.0", + "description": "Storagetransfer client for Node.js", + "repository": "googleapis/nodejs-storagetransfer", + "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 storagetransfer", + "storagetransfer", + "storage transfer service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "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": "^2.29.4" + }, + "devDependencies": { + "@types/mocha": "^9.1.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.8", + "c8": "^7.11.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.1", + "jsdoc-region-tag": "^1.3.1", + "linkinator": "^3.0.0", + "mocha": "^9.1.4", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^13.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.5.5", + "webpack": "^5.67.0", + "webpack-cli": "^4.9.1" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto b/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto new file mode 100644 index 0000000..5ee7211 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto @@ -0,0 +1,369 @@ +// 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.storagetransfer.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/storagetransfer/v1/transfer_types.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.StorageTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer"; +option java_outer_classname = "TransferProto"; +option java_package = "com.google.storagetransfer.v1.proto"; +option php_namespace = "Google\\Cloud\\StorageTransfer\\V1"; +option ruby_package = "Google::Cloud::StorageTransfer::V1"; + +// Storage Transfer Service and its protos. +// Transfers data between between Google Cloud Storage buckets or from a data +// source external to Google to a Cloud Storage bucket. +service StorageTransferService { + option (google.api.default_host) = "storagetransfer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the Google service account that is used by Storage Transfer + // Service to access buckets in the project where transfers + // run or in other projects. Each Google service account is associated + // with one Google Cloud project. Users + // should add this service account to the Google Cloud Storage bucket + // ACLs to grant access to Storage Transfer Service. This service + // account is created and owned by Storage Transfer Service and can + // only be used by Storage Transfer Service. + rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) returns (GoogleServiceAccount) { + option (google.api.http) = { + get: "/v1/googleServiceAccounts/{project_id}" + }; + } + + // Creates a transfer job that runs periodically. + rpc CreateTransferJob(CreateTransferJobRequest) returns (TransferJob) { + option (google.api.http) = { + post: "/v1/transferJobs" + body: "transfer_job" + }; + } + + // Updates a transfer job. Updating a job's transfer spec does not affect + // transfer operations that are running already. + // + // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified + // using this RPC (for example, to set a job's status to + // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], + // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or + // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]). + rpc UpdateTransferJob(UpdateTransferJobRequest) returns (TransferJob) { + option (google.api.http) = { + patch: "/v1/{job_name=transferJobs/**}" + body: "*" + }; + } + + // Gets a transfer job. + rpc GetTransferJob(GetTransferJobRequest) returns (TransferJob) { + option (google.api.http) = { + get: "/v1/{job_name=transferJobs/**}" + }; + } + + // Lists transfer jobs. + rpc ListTransferJobs(ListTransferJobsRequest) returns (ListTransferJobsResponse) { + option (google.api.http) = { + get: "/v1/transferJobs" + }; + } + + // Pauses a transfer operation. + rpc PauseTransferOperation(PauseTransferOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=transferOperations/**}:pause" + body: "*" + }; + } + + // Resumes a transfer operation that is paused. + rpc ResumeTransferOperation(ResumeTransferOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=transferOperations/**}:resume" + body: "*" + }; + } + + // Attempts to start a new TransferOperation for the current TransferJob. A + // TransferJob has a maximum of one active TransferOperation. If this method + // is called while a TransferOperation is active, an error will be returned. + rpc RunTransferJob(RunTransferJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{job_name=transferJobs/**}:run" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "TransferOperation" + }; + } + + // Creates an agent pool resource. + rpc CreateAgentPool(CreateAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + post: "/v1/projects/{project_id=*}/agentPools" + body: "agent_pool" + }; + option (google.api.method_signature) = "project_id,agent_pool,agent_pool_id"; + } + + // Updates an existing agent pool resource. + rpc UpdateAgentPool(UpdateAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + patch: "/v1/{agent_pool.name=projects/*/agentPools/*}" + body: "agent_pool" + }; + option (google.api.method_signature) = "agent_pool,update_mask"; + } + + // Gets an agent pool. + rpc GetAgentPool(GetAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/agentPools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists agent pools. + rpc ListAgentPools(ListAgentPoolsRequest) returns (ListAgentPoolsResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id=*}/agentPools" + }; + option (google.api.method_signature) = "project_id"; + } + + // Deletes an agent pool. + rpc DeleteAgentPool(DeleteAgentPoolRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/agentPools/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request passed to GetGoogleServiceAccount. +message GetGoogleServiceAccountRequest { + // Required. The ID of the Google Cloud project that the Google service + // account is associated with. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to CreateTransferJob. +message CreateTransferJobRequest { + // Required. The job to create. + TransferJob transfer_job = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to UpdateTransferJob. +message UpdateTransferJobRequest { + // Required. The name of job to update. + string job_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Cloud project that owns the + // job. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job to update. `transferJob` is expected to specify one or more of + // five fields: [description][google.storagetransfer.v1.TransferJob.description], + // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], + // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], + // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and + // [status][google.storagetransfer.v1.TransferJob.status]. An `UpdateTransferJobRequest` that specifies + // other fields are rejected with the error + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a job status + // to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires + // `storagetransfer.jobs.delete` permissions. + TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED]; + + // The field mask of the fields in `transferJob` that are to be updated in + // this request. Fields in `transferJob` that can be updated are: + // [description][google.storagetransfer.v1.TransferJob.description], + // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], + // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], + // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and + // [status][google.storagetransfer.v1.TransferJob.status]. To update the `transfer_spec` of the job, a + // complete transfer specification must be provided. An incomplete + // specification missing any required fields is rejected with the error + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + google.protobuf.FieldMask update_transfer_job_field_mask = 4; +} + +// Request passed to GetTransferJob. +message GetTransferJobRequest { + // Required. The job to get. + string job_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Cloud project that owns the + // job. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `projectId`, `jobNames`, and `jobStatuses` are query parameters that can +// be specified when listing transfer jobs. +message ListTransferJobsRequest { + // Required. A list of query parameters specified as JSON text in the form of: + // `{"projectId":"my_project_id", + // "jobNames":["jobid1","jobid2",...], + // "jobStatuses":["status1","status2",...]}` + // + // Since `jobNames` and `jobStatuses` support multiple values, their values + // must be specified with array notation. `projectId` is required. + // `jobNames` and `jobStatuses` are optional. The valid values for + // `jobStatuses` are case-insensitive: + // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED], + // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and + // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. + string filter = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list page size. The max allowed value is 256. + int32 page_size = 4; + + // The list page token. + string page_token = 5; +} + +// Response from ListTransferJobs. +message ListTransferJobsResponse { + // A list of transfer jobs. + repeated TransferJob transfer_jobs = 1; + + // The list next page token. + string next_page_token = 2; +} + +// Request passed to PauseTransferOperation. +message PauseTransferOperationRequest { + // Required. The name of the transfer operation. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to ResumeTransferOperation. +message ResumeTransferOperationRequest { + // Required. The name of the transfer operation. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to RunTransferJob. +message RunTransferJobRequest { + // Required. The name of the transfer job. + string job_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Cloud project that owns the transfer + // job. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to CreateAgentPool. +message CreateAgentPoolRequest { + // Required. The ID of the Google Cloud project that owns the + // agent pool. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The agent pool to create. + AgentPool agent_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the agent pool to create. + // + // The `agent_pool_id` must meet the following requirements: + // + // * Length of 128 characters or less. + // * Not start with the string `goog`. + // * Start with a lowercase ASCII character, followed by: + // * Zero or more: lowercase Latin alphabet characters, numerals, + // hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + // * One or more numerals or lowercase ASCII characters. + // + // As expressed by the regular expression: + // `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + string agent_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to UpdateAgentPool. +message UpdateAgentPoolRequest { + // Required. The agent pool to update. `agent_pool` is expected to specify following + // fields: + // + // * [name][google.storagetransfer.v1.AgentPool.name] + // + // * [display_name][google.storagetransfer.v1.AgentPool.display_name] + // + // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] + // An `UpdateAgentPoolRequest` with any other fields is rejected + // with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + AgentPool agent_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // The [field mask] + // (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + // of the fields in `agentPool` to update in this request. + // The following `agentPool` fields can be updated: + // + // * [display_name][google.storagetransfer.v1.AgentPool.display_name] + // + // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] + google.protobuf.FieldMask update_mask = 2; +} + +// Specifies the request passed to GetAgentPool. +message GetAgentPoolRequest { + // Required. The name of the agent pool to get. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to DeleteAgentPool. +message DeleteAgentPoolRequest { + // Required. The name of the agent pool to delete. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request passed to ListAgentPools. +message ListAgentPoolsRequest { + // Required. The ID of the Google Cloud project that owns the job. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // An optional list of query parameters specified as JSON text in the + // form of: + // + // `{"agentPoolNames":["agentpool1","agentpool2",...]}` + // + // Since `agentPoolNames` support multiple values, its values must be + // specified with array notation. When the filter is either empty or not + // provided, the list returns all agent pools for the project. + string filter = 2; + + // The list page size. The max allowed value is `256`. + int32 page_size = 3; + + // The list page token. + string page_token = 4; +} + +// Response from ListAgentPools. +message ListAgentPoolsResponse { + // A list of agent pools. + repeated AgentPool agent_pools = 1; + + // The list next page token. + string next_page_token = 2; +} diff --git a/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto b/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto new file mode 100644 index 0000000..cfb87a6 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto @@ -0,0 +1,1121 @@ +// 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.storagetransfer.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/code.proto"; +import "google/type/date.proto"; +import "google/type/timeofday.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.StorageTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer"; +option java_outer_classname = "TransferTypes"; +option java_package = "com.google.storagetransfer.v1.proto"; +option php_namespace = "Google\\Cloud\\StorageTransfer\\V1"; +option ruby_package = "Google::Cloud::StorageTransfer::V1"; + +// Google service account +message GoogleServiceAccount { + // Email address of the service account. + string account_email = 1; + + // Unique identifier for the service account. + string subject_id = 2; +} + +// AWS access key (see +// [AWS Security +// Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). +// +// For information on our data retention policy for user credentials, see +// [User credentials](/storage-transfer/docs/data-retention#user-credentials). +message AwsAccessKey { + // Required. AWS access key ID. + string access_key_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. AWS secret access key. This field is not returned in RPC + // responses. + string secret_access_key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Azure credentials +// +// For information on our data retention policy for user credentials, see +// [User credentials](/storage-transfer/docs/data-retention#user-credentials). +message AzureCredentials { + // Required. Azure shared access signature (SAS). + // + // For more information about SAS, see + // [Grant limited access to Azure Storage resources using shared access + // signatures + // (SAS)](https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview). + string sas_token = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Conditions that determine which objects are transferred. Applies only +// to Cloud Data Sources such as S3, Azure, and Cloud Storage. +// +// The "last modification time" refers to the time of the +// last change to the object's content or metadata — specifically, this is +// the `updated` property of Cloud Storage objects, the `LastModified` field +// of S3 objects, and the `Last-Modified` header of Azure blobs. +// +// Transfers with a [PosixFilesystem][google.storagetransfer.v1.PosixFilesystem] source or destination don't support +// `ObjectConditions`. +message ObjectConditions { + // Ensures that objects are not transferred until a specific minimum time + // has elapsed after the "last modification time". When a + // [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a "last modification time" are + // transferred only if the elapsed time between the + // [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the `TransferOperation` + // and the "last modification time" of the object is equal to or + // greater than the value of min_time_elapsed_since_last_modification`. + // Objects that do not have a "last modification time" are also transferred. + google.protobuf.Duration min_time_elapsed_since_last_modification = 1; + + // Ensures that objects are not transferred if a specific maximum time + // has elapsed since the "last modification time". + // When a [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a + // "last modification time" are transferred only if the elapsed time + // between the [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the + // `TransferOperation`and the "last modification time" of the object + // is less than the value of max_time_elapsed_since_last_modification`. + // Objects that do not have a "last modification time" are also transferred. + google.protobuf.Duration max_time_elapsed_since_last_modification = 2; + + // If you specify `include_prefixes`, Storage Transfer Service uses the items + // in the `include_prefixes` array to determine which objects to include in a + // transfer. Objects must start with one of the matching `include_prefixes` + // for inclusion in the transfer. If [exclude_prefixes][google.storagetransfer.v1.ObjectConditions.exclude_prefixes] is specified, + // objects must not start with any of the `exclude_prefixes` specified for + // inclusion in the transfer. + // + // The following are requirements of `include_prefixes`: + // + // * Each include-prefix can contain any sequence of Unicode characters, to + // a max length of 1024 bytes when UTF8-encoded, and must not contain + // Carriage Return or Line Feed characters. Wildcard matching and regular + // expression matching are not supported. + // + // * Each include-prefix must omit the leading slash. For example, to + // include the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, + // specify the include-prefix as `logs/y=2015/requests.gz`. + // + // * None of the include-prefix values can be empty, if specified. + // + // * Each include-prefix must include a distinct portion of the object + // namespace. No include-prefix may be a prefix of another + // include-prefix. + // + // The max size of `include_prefixes` is 1000. + // + // For more information, see [Filtering objects from + // transfers](/storage-transfer/docs/filtering-objects-from-transfers). + repeated string include_prefixes = 3; + + // If you specify `exclude_prefixes`, Storage Transfer Service uses the items + // in the `exclude_prefixes` array to determine which objects to exclude from + // a transfer. Objects must not start with one of the matching + // `exclude_prefixes` for inclusion in a transfer. + // + // The following are requirements of `exclude_prefixes`: + // + // * Each exclude-prefix can contain any sequence of Unicode characters, to + // a max length of 1024 bytes when UTF8-encoded, and must not contain + // Carriage Return or Line Feed characters. Wildcard matching and regular + // expression matching are not supported. + // + // * Each exclude-prefix must omit the leading slash. For example, to + // exclude the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, + // specify the exclude-prefix as `logs/y=2015/requests.gz`. + // + // * None of the exclude-prefix values can be empty, if specified. + // + // * Each exclude-prefix must exclude a distinct portion of the object + // namespace. No exclude-prefix may be a prefix of another + // exclude-prefix. + // + // * If [include_prefixes][google.storagetransfer.v1.ObjectConditions.include_prefixes] is specified, then each exclude-prefix must + // start with the value of a path explicitly included by `include_prefixes`. + // + // The max size of `exclude_prefixes` is 1000. + // + // For more information, see [Filtering objects from + // transfers](/storage-transfer/docs/filtering-objects-from-transfers). + repeated string exclude_prefixes = 4; + + // If specified, only objects with a "last modification time" on or after + // this timestamp and objects that don't have a "last modification time" are + // transferred. + // + // The `last_modified_since` and `last_modified_before` fields can be used + // together for chunked data processing. For example, consider a script that + // processes each day's worth of data at a time. For that you'd set each + // of the fields as follows: + // + // * `last_modified_since` to the start of the day + // + // * `last_modified_before` to the end of the day + google.protobuf.Timestamp last_modified_since = 5; + + // If specified, only objects with a "last modification time" before this + // timestamp and objects that don't have a "last modification time" are + // transferred. + google.protobuf.Timestamp last_modified_before = 6; +} + +// In a GcsData resource, an object's name is the Cloud Storage object's +// name and its "last modification time" refers to the object's `updated` +// property of Cloud Storage objects, which changes when the content or the +// metadata of the object is updated. +message GcsData { + // Required. Cloud Storage bucket name. Must meet + // [Bucket Name Requirements](/storage/docs/naming#requirements). + string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Root path to transfer objects. + // + // Must be an empty string or full path name that ends with a '/'. This field + // is treated as an object prefix. As such, it should generally not begin with + // a '/'. + // + // The root path value must meet + // [Object Name Requirements](/storage/docs/naming#objectnames). + string path = 3; +} + +// An AwsS3Data resource can be a data source, but not a data sink. +// In an AwsS3Data resource, an object's name is the S3 object's key name. +message AwsS3Data { + // Required. S3 Bucket name (see + // [Creating a + // bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). + string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Input only. AWS access key used to sign the API requests to the AWS S3 bucket. + // Permissions on the bucket must be granted to the access ID of the AWS + // access key. + // + // For information on our data retention policy for user credentials, see + // [User credentials](/storage-transfer/docs/data-retention#user-credentials). + AwsAccessKey aws_access_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Root path to transfer objects. + // + // Must be an empty string or full path name that ends with a '/'. This field + // is treated as an object prefix. As such, it should generally not begin with + // a '/'. + string path = 3; + + // The Amazon Resource Name (ARN) of the role to support temporary + // credentials via `AssumeRoleWithWebIdentity`. For more information about + // ARNs, see [IAM + // ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). + // + // When a role ARN is provided, Transfer Service fetches temporary + // credentials for the session using a `AssumeRoleWithWebIdentity` call for + // the provided role using the [GoogleServiceAccount][google.storagetransfer.v1.GoogleServiceAccount] for this project. + string role_arn = 4; +} + +// An AzureBlobStorageData resource can be a data source, but not a data sink. +// An AzureBlobStorageData resource represents one Azure container. The storage +// account determines the [Azure +// endpoint](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints). +// In an AzureBlobStorageData resource, a blobs's name is the [Azure Blob +// Storage blob's key +// name](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names). +message AzureBlobStorageData { + // Required. The name of the Azure Storage account. + string storage_account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. Credentials used to authenticate API requests to Azure. + // + // For information on our data retention policy for user credentials, see + // [User credentials](/storage-transfer/docs/data-retention#user-credentials). + AzureCredentials azure_credentials = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Required. The container to transfer from the Azure Storage account. + string container = 4 [(google.api.field_behavior) = REQUIRED]; + + // Root path to transfer objects. + // + // Must be an empty string or full path name that ends with a '/'. This field + // is treated as an object prefix. As such, it should generally not begin with + // a '/'. + string path = 5; +} + +// An HttpData resource specifies a list of objects on the web to be transferred +// over HTTP. The information of the objects to be transferred is contained in +// a file referenced by a URL. The first line in the file must be +// `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent +// lines specify the information of the list of objects, one object per list +// entry. Each entry has the following tab-delimited fields: +// +// * **HTTP URL** — The location of the object. +// +// * **Length** — The size of the object in bytes. +// +// * **MD5** — The base64-encoded MD5 hash of the object. +// +// For an example of a valid TSV file, see +// [Transferring data from +// URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). +// +// When transferring data based on a URL list, keep the following in mind: +// +// * When an object located at `http(s)://hostname:port/` is +// transferred to a data sink, the name of the object at the data sink is +// `/`. +// +// * If the specified size of an object does not match the actual size of the +// object fetched, the object is not transferred. +// +// * If the specified MD5 does not match the MD5 computed from the transferred +// bytes, the object transfer fails. +// +// * Ensure that each URL you specify is publicly accessible. For +// example, in Cloud Storage you can +// [share an object publicly] +// (/storage/docs/cloud-console#_sharingdata) and get a link to it. +// +// * Storage Transfer Service obeys `robots.txt` rules and requires the source +// HTTP server to support `Range` requests and to return a `Content-Length` +// header in each response. +// +// * [ObjectConditions][google.storagetransfer.v1.ObjectConditions] have no effect when filtering objects to transfer. +message HttpData { + // Required. The URL that points to the file that stores the object list + // entries. This file must allow public access. Currently, only URLs with + // HTTP and HTTPS schemes are supported. + string list_url = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A POSIX filesystem resource. +message PosixFilesystem { + // Root directory path to the filesystem. + string root_directory = 1; +} + +// Represents an On-Premises Agent pool. +message AgentPool { + option (google.api.resource) = { + type: "storagetransfer.googleapis.com/agentPools" + pattern: "projects/{project_id}/agentPools/{agent_pool_id}" + }; + + // The state of an AgentPool. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // This is an initialization state. During this stage, the resources such as + // Pub/Sub topics are allocated for the AgentPool. + CREATING = 1; + + // Determines that the AgentPool is created for use. At this state, Agents + // can join the AgentPool and participate in the transfer jobs in that pool. + CREATED = 2; + + // Determines that the AgentPool deletion has been initiated, and all the + // resources are scheduled to be cleaned up and freed. + DELETING = 3; + } + + // Specifies a bandwidth limit for an agent pool. + message BandwidthLimit { + // Bandwidth rate in megabytes per second, distributed across all the agents + // in the pool. + int64 limit_mbps = 1; + } + + // Required. Specifies a unique string that identifies the agent pool. + // + // Format: `projects/{project_id}/agentPools/{agent_pool_id}` + string name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the client-specified AgentPool description. + string display_name = 3; + + // Output only. Specifies the state of the AgentPool. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Specifies the bandwidth limit details. If this field is unspecified, the + // default value is set as 'No Limit'. + BandwidthLimit bandwidth_limit = 5; +} + +// TransferOptions define the actions to be performed on objects in a transfer. +message TransferOptions { + // Specifies when to overwrite an object in the sink when an object with + // matching name is found in the source. + enum OverwriteWhen { + // Indicate the option is not set. + OVERWRITE_WHEN_UNSPECIFIED = 0; + + // Overwrite destination object with source if the two objects are + // different. + DIFFERENT = 1; + + // Never overwrite destination object. + NEVER = 2; + + // Always overwrite destination object. + ALWAYS = 3; + } + + // When to overwrite objects that already exist in the sink. The default is + // that only objects that are different from the source are ovewritten. If + // true, all objects in the sink whose name matches an object in the source + // are overwritten with the source object. + bool overwrite_objects_already_existing_in_sink = 1; + + // Whether objects that exist only in the sink should be deleted. + // + // **Note:** This option and [delete_objects_from_source_after_transfer][google.storagetransfer.v1.TransferOptions.delete_objects_from_source_after_transfer] are + // mutually exclusive. + bool delete_objects_unique_in_sink = 2; + + // Whether objects should be deleted from the source after they are + // transferred to the sink. + // + // **Note:** This option and [delete_objects_unique_in_sink][google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] are mutually + // exclusive. + bool delete_objects_from_source_after_transfer = 3; + + // When to overwrite objects that already exist in the sink. If not set + // overwrite behavior is determined by + // [overwrite_objects_already_existing_in_sink][google.storagetransfer.v1.TransferOptions.overwrite_objects_already_existing_in_sink]. + OverwriteWhen overwrite_when = 4; + + // Represents the selected metadata options for a transfer job. This feature + // is in Preview. + MetadataOptions metadata_options = 5; +} + +// Configuration for running a transfer. +message TransferSpec { + // The write sink for the data. + oneof data_sink { + // A Cloud Storage data sink. + GcsData gcs_data_sink = 4; + + // A POSIX Filesystem data sink. + PosixFilesystem posix_data_sink = 13; + } + + // The read source of the data. + oneof data_source { + // A Cloud Storage data source. + GcsData gcs_data_source = 1; + + // An AWS S3 data source. + AwsS3Data aws_s3_data_source = 2; + + // An HTTP URL data source. + HttpData http_data_source = 3; + + // A POSIX Filesystem data source. + PosixFilesystem posix_data_source = 14; + + // An Azure Blob Storage data source. + AzureBlobStorageData azure_blob_storage_data_source = 8; + } + + // Represents a supported data container type which is required for transfer + // jobs which needs a data source, a data sink and an intermediate location to + // transfer data through. This is validated on TransferJob creation. + oneof intermediate_data_location { + // Cloud Storage intermediate data location. + GcsData gcs_intermediate_data_location = 16; + } + + // Only objects that satisfy these object conditions are included in the set + // of data source and data sink objects. Object conditions based on + // objects' "last modification time" do not exclude objects in a data sink. + ObjectConditions object_conditions = 5; + + // If the option + // [delete_objects_unique_in_sink][google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] + // is `true` and time-based object conditions such as 'last modification time' + // are specified, the request fails with an + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. + TransferOptions transfer_options = 6; + + // A manifest file provides a list of objects to be transferred from the data + // source. This field points to the location of the manifest file. + // Otherwise, the entire source bucket is used. ObjectConditions still apply. + TransferManifest transfer_manifest = 15; + + // Specifies the agent pool name associated with the posix data source. When + // unspecified, the default name is used. + string source_agent_pool_name = 17; + + // Specifies the agent pool name associated with the posix data sink. When + // unspecified, the default name is used. + string sink_agent_pool_name = 18; +} + +// Specifies the metadata options for running a transfer. +message MetadataOptions { + // Whether symlinks should be skipped or preserved during a transfer job. + enum Symlink { + // Symlink behavior is unspecified. + SYMLINK_UNSPECIFIED = 0; + + // Do not preserve symlinks during a transfer job. + SYMLINK_SKIP = 1; + + // Preserve symlinks during a transfer job. + SYMLINK_PRESERVE = 2; + } + + // Options for handling file mode attribute. + enum Mode { + // Mode behavior is unspecified. + MODE_UNSPECIFIED = 0; + + // Do not preserve mode during a transfer job. + MODE_SKIP = 1; + + // Preserve mode during a transfer job. + MODE_PRESERVE = 2; + } + + // Options for handling file GID attribute. + enum GID { + // GID behavior is unspecified. + GID_UNSPECIFIED = 0; + + // Do not preserve GID during a transfer job. + GID_SKIP = 1; + + // Preserve GID during a transfer job. + GID_NUMBER = 2; + } + + // Options for handling file UID attribute. + enum UID { + // UID behavior is unspecified. + UID_UNSPECIFIED = 0; + + // Do not preserve UID during a transfer job. + UID_SKIP = 1; + + // Preserve UID during a transfer job. + UID_NUMBER = 2; + } + + // Options for handling Cloud Storage object ACLs. + enum Acl { + // ACL behavior is unspecified. + ACL_UNSPECIFIED = 0; + + // Use the destination bucket's default object ACLS, if applicable. + ACL_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original ACLs. This requires the service account + // to have `storage.objects.getIamPolicy` permission for the source object. + // [Uniform bucket-level + // access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) + // must not be enabled on either the source or destination buckets. + ACL_PRESERVE = 2; + } + + // Options for handling Google Cloud Storage object storage class. + enum StorageClass { + // Storage class behavior is unspecified. + STORAGE_CLASS_UNSPECIFIED = 0; + + // Use the destination bucket's default storage class. + STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original storage class. This is only supported for + // transfers from Google Cloud Storage buckets. + STORAGE_CLASS_PRESERVE = 2; + + // Set the storage class to STANDARD. + STORAGE_CLASS_STANDARD = 3; + + // Set the storage class to NEARLINE. + STORAGE_CLASS_NEARLINE = 4; + + // Set the storage class to COLDLINE. + STORAGE_CLASS_COLDLINE = 5; + + // Set the storage class to ARCHIVE. + STORAGE_CLASS_ARCHIVE = 6; + } + + // Options for handling temporary holds for Google Cloud Storage objects. + enum TemporaryHold { + // Temporary hold behavior is unspecified. + TEMPORARY_HOLD_UNSPECIFIED = 0; + + // Do not set a temporary hold on the destination object. + TEMPORARY_HOLD_SKIP = 1; + + // Preserve the object's original temporary hold status. + TEMPORARY_HOLD_PRESERVE = 2; + } + + // Options for handling the KmsKey setting for Google Cloud Storage objects. + enum KmsKey { + // KmsKey behavior is unspecified. + KMS_KEY_UNSPECIFIED = 0; + + // Use the destination bucket's default encryption settings. + KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original Cloud KMS customer-managed encryption key + // (CMEK) if present. Objects that do not use a Cloud KMS encryption key + // will be encrypted using the destination bucket's encryption settings. + KMS_KEY_PRESERVE = 2; + } + + // Options for handling `timeCreated` metadata for Google Cloud Storage + // objects. + enum TimeCreated { + // TimeCreated behavior is unspecified. + TIME_CREATED_UNSPECIFIED = 0; + + // Do not preserve the `timeCreated` metadata from the source object. + TIME_CREATED_SKIP = 1; + + // Preserves the source object's `timeCreated` metadata in the `customTime` + // field in the destination object. Note that any value stored in the + // source object's `customTime` field will not be propagated to the + // destination object. + TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2; + } + + // Specifies how symlinks should be handled by the transfer. By default, + // symlinks are not preserved. Only applicable to transfers involving + // POSIX file systems, and ignored for other transfers. + Symlink symlink = 1; + + // Specifies how each file's mode attribute should be handled by the transfer. + // By default, mode is not preserved. Only applicable to transfers involving + // POSIX file systems, and ignored for other transfers. + Mode mode = 2; + + // Specifies how each file's POSIX group ID (GID) attribute should be handled + // by the transfer. By default, GID is not preserved. Only applicable to + // transfers involving POSIX file systems, and ignored for other transfers. + GID gid = 3; + + // Specifies how each file's POSIX user ID (UID) attribute should be handled + // by the transfer. By default, UID is not preserved. Only applicable to + // transfers involving POSIX file systems, and ignored for other transfers. + UID uid = 4; + + // Specifies how each object's ACLs should be preserved for transfers between + // Google Cloud Storage buckets. If unspecified, the default behavior is the + // same as ACL_DESTINATION_BUCKET_DEFAULT. + Acl acl = 5; + + // Specifies the storage class to set on objects being transferred to Google + // Cloud Storage buckets. If unspecified, the default behavior is the same as + // [STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.StorageClass.STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT]. + StorageClass storage_class = 6; + + // Specifies how each object's temporary hold status should be preserved for + // transfers between Google Cloud Storage buckets. If unspecified, the + // default behavior is the same as + // [TEMPORARY_HOLD_PRESERVE][google.storagetransfer.v1.MetadataOptions.TemporaryHold.TEMPORARY_HOLD_PRESERVE]. + TemporaryHold temporary_hold = 7; + + // Specifies how each object's Cloud KMS customer-managed encryption key + // (CMEK) is preserved for transfers between Google Cloud Storage buckets. If + // unspecified, the default behavior is the same as + // [KMS_KEY_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.KmsKey.KMS_KEY_DESTINATION_BUCKET_DEFAULT]. + KmsKey kms_key = 8; + + // Specifies how each object's `timeCreated` metadata is preserved for + // transfers between Google Cloud Storage buckets. If unspecified, the + // default behavior is the same as + // [TIME_CREATED_SKIP][google.storagetransfer.v1.MetadataOptions.TimeCreated.TIME_CREATED_SKIP]. + TimeCreated time_created = 9; +} + +// Specifies where the manifest is located. +message TransferManifest { + // Specifies the path to the manifest in Cloud Storage. The Google-managed + // service account for the transfer must have `storage.objects.get` + // permission for this object. An example path is + // `gs://bucket_name/path/manifest.csv`. + string location = 1; +} + +// Transfers can be scheduled to recur or to run just once. +message Schedule { + // Required. The start date of a transfer. Date boundaries are determined + // relative to UTC time. If `schedule_start_date` and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] + // are in the past relative to the job's creation time, the transfer starts + // the day after you schedule the transfer request. + // + // **Note:** When starting jobs at or near midnight UTC it is possible that + // a job starts later than expected. For example, if you send an outbound + // request on June 1 one millisecond prior to midnight UTC and the Storage + // Transfer Service server receives the request on June 2, then it creates + // a TransferJob with `schedule_start_date` set to June 2 and a + // `start_time_of_day` set to midnight UTC. The first scheduled + // [TransferOperation][google.storagetransfer.v1.TransferOperation] takes place on June 3 at midnight UTC. + google.type.Date schedule_start_date = 1 [(google.api.field_behavior) = REQUIRED]; + + // The last day a transfer runs. Date boundaries are determined relative to + // UTC time. A job runs once per 24 hours within the following guidelines: + // + // * If `schedule_end_date` and [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] are the same and in + // the future relative to UTC, the transfer is executed only one time. + // * If `schedule_end_date` is later than `schedule_start_date` and + // `schedule_end_date` is in the future relative to UTC, the job runs each + // day at [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] through `schedule_end_date`. + google.type.Date schedule_end_date = 2; + + // The time in UTC that a transfer job is scheduled to run. Transfers may + // start later than this time. + // + // If `start_time_of_day` is not specified: + // + // * One-time transfers run immediately. + // * Recurring transfers run immediately, and each day at midnight UTC, + // through [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date]. + // + // If `start_time_of_day` is specified: + // + // * One-time transfers run at the specified time. + // * Recurring transfers run at the specified time each day, through + // `schedule_end_date`. + google.type.TimeOfDay start_time_of_day = 3; + + // The time in UTC that no further transfer operations are scheduled. Combined + // with [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date], `end_time_of_day` specifies the end date and + // time for starting new transfer operations. This field must be greater than + // or equal to the timestamp corresponding to the combintation of + // [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day], and is subject to the + // following: + // + // * If `end_time_of_day` is not set and `schedule_end_date` is set, then + // a default value of `23:59:59` is used for `end_time_of_day`. + // + // * If `end_time_of_day` is set and `schedule_end_date` is not set, then + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] is returned. + google.type.TimeOfDay end_time_of_day = 4; + + // Interval between the start of each scheduled TransferOperation. If + // unspecified, the default value is 24 hours. This value may not be less than + // 1 hour. + google.protobuf.Duration repeat_interval = 5; +} + +// This resource represents the configuration of a transfer job that runs +// periodically. +message TransferJob { + // The status of the transfer job. + enum Status { + // Zero is an illegal value. + STATUS_UNSPECIFIED = 0; + + // New transfers are performed based on the schedule. + ENABLED = 1; + + // New transfers are not scheduled. + DISABLED = 2; + + // This is a soft delete state. After a transfer job is set to this + // state, the job and all the transfer executions are subject to + // garbage collection. Transfer jobs become eligible for garbage collection + // 30 days after their status is set to `DELETED`. + DELETED = 3; + } + + // A unique name (within the transfer project) assigned when the job is + // created. If this field is empty in a CreateTransferJobRequest, Storage + // Transfer Service assigns a unique name. Otherwise, the specified name + // is used as the unique name for this job. + // + // If the specified name is in use by a job, the creation request fails with + // an [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + // + // This name must start with `"transferJobs/"` prefix and end with a letter or + // a number, and should be no more than 128 characters. For transfers + // involving PosixFilesystem, this name must start with `transferJobs/OPI` + // specifically. For all other transfer types, this name must not start with + // `transferJobs/OPI`. + // + // Non-PosixFilesystem example: + // `"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + // + // PosixFilesystem example: + // `"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + // + // Applications must not rely on the enforcement of naming requirements + // involving OPI. + // + // Invalid job names fail with an + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. + string name = 1; + + // A description provided by the user for the job. Its max length is 1024 + // bytes when Unicode-encoded. + string description = 2; + + // The ID of the Google Cloud project that owns the job. + string project_id = 3; + + // Transfer specification. + TransferSpec transfer_spec = 4; + + // Notification configuration. This is not supported for transfers involving + // PosixFilesystem. + NotificationConfig notification_config = 11; + + // Logging configuration. + LoggingConfig logging_config = 14; + + // Specifies schedule for the transfer job. + // This is an optional field. When the field is not set, the job never + // executes a transfer, unless you invoke RunTransferJob or update the job to + // have a non-empty schedule. + Schedule schedule = 5; + + // Status of the job. This value MUST be specified for + // `CreateTransferJobRequests`. + // + // **Note:** The effect of the new job status takes place during a subsequent + // job run. For example, if you change the job status from + // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED] to [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and an operation + // spawned by the transfer is running, the status change would not affect the + // current operation. + Status status = 6; + + // Output only. The time that the transfer job was created. + google.protobuf.Timestamp creation_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time that the transfer job was last modified. + google.protobuf.Timestamp last_modification_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time that the transfer job was deleted. + google.protobuf.Timestamp deletion_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The name of the most recently started TransferOperation of this JobConfig. + // Present if a TransferOperation has been created for this JobConfig. + string latest_operation_name = 12; +} + +// An entry describing an error that has occurred. +message ErrorLogEntry { + // Required. A URL that refers to the target (a data source, a data sink, + // or an object) with which the error is associated. + string url = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of messages that carry the error details. + repeated string error_details = 3; +} + +// A summary of errors by error code, plus a count and sample error log +// entries. +message ErrorSummary { + // Required. + google.rpc.Code error_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Count of this type of error. + int64 error_count = 2 [(google.api.field_behavior) = REQUIRED]; + + // Error samples. + // + // At most 5 error log entries are recorded for a given + // error code for a single transfer operation. + repeated ErrorLogEntry error_log_entries = 3; +} + +// A collection of counters that report the progress of a transfer operation. +message TransferCounters { + // Objects found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + int64 objects_found_from_source = 1; + + // Bytes found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + int64 bytes_found_from_source = 2; + + // Objects found only in the data sink that are scheduled to be deleted. + int64 objects_found_only_from_sink = 3; + + // Bytes found only in the data sink that are scheduled to be deleted. + int64 bytes_found_only_from_sink = 4; + + // Objects in the data source that are not transferred because they already + // exist in the data sink. + int64 objects_from_source_skipped_by_sync = 5; + + // Bytes in the data source that are not transferred because they already + // exist in the data sink. + int64 bytes_from_source_skipped_by_sync = 6; + + // Objects that are copied to the data sink. + int64 objects_copied_to_sink = 7; + + // Bytes that are copied to the data sink. + int64 bytes_copied_to_sink = 8; + + // Objects that are deleted from the data source. + int64 objects_deleted_from_source = 9; + + // Bytes that are deleted from the data source. + int64 bytes_deleted_from_source = 10; + + // Objects that are deleted from the data sink. + int64 objects_deleted_from_sink = 11; + + // Bytes that are deleted from the data sink. + int64 bytes_deleted_from_sink = 12; + + // Objects in the data source that failed to be transferred or that failed + // to be deleted after being transferred. + int64 objects_from_source_failed = 13; + + // Bytes in the data source that failed to be transferred or that failed to + // be deleted after being transferred. + int64 bytes_from_source_failed = 14; + + // Objects that failed to be deleted from the data sink. + int64 objects_failed_to_delete_from_sink = 15; + + // Bytes that failed to be deleted from the data sink. + int64 bytes_failed_to_delete_from_sink = 16; + + // For transfers involving PosixFilesystem only. + // + // Number of directories found while listing. For example, if the root + // directory of the transfer is `base/` and there are two other directories, + // `a/` and `b/` under this directory, the count after listing `base/`, + // `base/a/` and `base/b/` is 3. + int64 directories_found_from_source = 17; + + // For transfers involving PosixFilesystem only. + // + // Number of listing failures for each directory found at the source. + // Potential failures when listing a directory include permission failure or + // block failure. If listing a directory fails, no files in the directory are + // transferred. + int64 directories_failed_to_list_from_source = 18; + + // For transfers involving PosixFilesystem only. + // + // Number of successful listings for each directory found at the source. + int64 directories_successfully_listed_from_source = 19; + + // Number of successfully cleaned up intermediate objects. + int64 intermediate_objects_cleaned_up = 22; + + // Number of intermediate objects failed cleaned up. + int64 intermediate_objects_failed_cleaned_up = 23; +} + +// Specification to configure notifications published to Pub/Sub. +// Notifications are published to the customer-provided topic using the +// following `PubsubMessage.attributes`: +// +// * `"eventType"`: one of the [EventType][google.storagetransfer.v1.NotificationConfig.EventType] values +// * `"payloadFormat"`: one of the [PayloadFormat][google.storagetransfer.v1.NotificationConfig.PayloadFormat] values +// * `"projectId"`: the [project_id][google.storagetransfer.v1.TransferOperation.project_id] of the +// `TransferOperation` +// * `"transferJobName"`: the +// [transfer_job_name][google.storagetransfer.v1.TransferOperation.transfer_job_name] of the +// `TransferOperation` +// * `"transferOperationName"`: the [name][google.storagetransfer.v1.TransferOperation.name] of the +// `TransferOperation` +// +// The `PubsubMessage.data` contains a [TransferOperation][google.storagetransfer.v1.TransferOperation] resource +// formatted according to the specified `PayloadFormat`. +message NotificationConfig { + // Enum for specifying event types for which notifications are to be + // published. + // + // Additional event types may be added in the future. Clients should either + // safely ignore unrecognized event types or explicitly specify which event + // types they are prepared to accept. + enum EventType { + // Illegal value, to avoid allowing a default. + EVENT_TYPE_UNSPECIFIED = 0; + + // `TransferOperation` completed with status + // [SUCCESS][google.storagetransfer.v1.TransferOperation.Status.SUCCESS]. + TRANSFER_OPERATION_SUCCESS = 1; + + // `TransferOperation` completed with status + // [FAILED][google.storagetransfer.v1.TransferOperation.Status.FAILED]. + TRANSFER_OPERATION_FAILED = 2; + + // `TransferOperation` completed with status + // [ABORTED][google.storagetransfer.v1.TransferOperation.Status.ABORTED]. + TRANSFER_OPERATION_ABORTED = 3; + } + + // Enum for specifying the format of a notification message's payload. + enum PayloadFormat { + // Illegal value, to avoid allowing a default. + PAYLOAD_FORMAT_UNSPECIFIED = 0; + + // No payload is included with the notification. + NONE = 1; + + // `TransferOperation` is [formatted as a JSON + // response](https://developers.google.com/protocol-buffers/docs/proto3#json), + // in application/json. + JSON = 2; + } + + // Required. The `Topic.name` of the Pub/Sub topic to which to publish + // notifications. Must be of the format: `projects/{project}/topics/{topic}`. + // Not matching this format results in an + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. + string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; + + // Event types for which a notification is desired. If empty, send + // notifications for all event types. + repeated EventType event_types = 2; + + // Required. The desired format of the notification message payloads. + PayloadFormat payload_format = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the logging behavior for transfer operations. +// +// For cloud-to-cloud transfers, logs are sent to Cloud Logging. See +// [Read transfer +// logs](https://cloud.google.com/storage-transfer/docs/read-transfer-logs) for +// details. +// +// For transfers to or from a POSIX file system, logs are stored in the +// Cloud Storage bucket that is the source or sink of the transfer. +// See [Managing Transfer for on-premises jobs] +// (https://cloud.google.com/storage-transfer/docs/managing-on-prem-jobs#viewing-logs) +// for details. +message LoggingConfig { + // Loggable actions. + enum LoggableAction { + // Default value. This value is unused. + LOGGABLE_ACTION_UNSPECIFIED = 0; + + // Listing objects in a bucket. + FIND = 1; + + // Deleting objects at the source or the destination. + DELETE = 2; + + // Copying objects to Google Cloud Storage. + COPY = 3; + } + + // Loggable action states. + enum LoggableActionState { + // Default value. This value is unused. + LOGGABLE_ACTION_STATE_UNSPECIFIED = 0; + + // `LoggableAction` completed successfully. `SUCCEEDED` actions are + // logged as [INFO][google.logging.type.LogSeverity.INFO]. + SUCCEEDED = 1; + + // `LoggableAction` terminated in an error state. `FAILED` actions are + // logged as [ERROR][google.logging.type.LogSeverity.ERROR]. + FAILED = 2; + } + + // Specifies the actions to be logged. If empty, no logs are generated. + // Not supported for transfers with PosixFilesystem data sources; use + // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. + repeated LoggableAction log_actions = 1; + + // States in which `log_actions` are logged. If empty, no logs are generated. + // Not supported for transfers with PosixFilesystem data sources; use + // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. + repeated LoggableActionState log_action_states = 2; + + // For transfers with a PosixFilesystem source, this option enables the Cloud + // Storage transfer logs for this transfer. + bool enable_onprem_gcs_transfer_logs = 3; +} + +// A description of the execution of a transfer. +message TransferOperation { + // The status of a TransferOperation. + enum Status { + // Zero is an illegal value. + STATUS_UNSPECIFIED = 0; + + // In progress. + IN_PROGRESS = 1; + + // Paused. + PAUSED = 2; + + // Completed successfully. + SUCCESS = 3; + + // Terminated due to an unrecoverable failure. + FAILED = 4; + + // Aborted by the user. + ABORTED = 5; + + // Temporarily delayed by the system. No user action is required. + QUEUED = 6; + } + + // A globally unique ID assigned by the system. + string name = 1; + + // The ID of the Google Cloud project that owns the operation. + string project_id = 2; + + // Transfer specification. + TransferSpec transfer_spec = 3; + + // Notification configuration. + NotificationConfig notification_config = 10; + + // Start time of this transfer execution. + google.protobuf.Timestamp start_time = 4; + + // End time of this transfer execution. + google.protobuf.Timestamp end_time = 5; + + // Status of the transfer operation. + Status status = 6; + + // Information about the progress of the transfer operation. + TransferCounters counters = 7; + + // Summarizes errors encountered with sample error log entries. + repeated ErrorSummary error_breakdowns = 8; + + // The name of the transfer job that triggers this transfer operation. + string transfer_job_name = 9; +} diff --git a/owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json b/owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json new file mode 100644 index 0000000..8bf69ae --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json @@ -0,0 +1,587 @@ +{ + "clientLibrary": { + "name": "nodejs-storagetransfer", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.storagetransfer.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async", + "title": "StorageTransferService getGoogleServiceAccount Sample", + "origin": "API_DEFINITION", + "description": " Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", + "canonical": true, + "file": "storage_transfer_service.get_google_service_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGoogleServiceAccount", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.GoogleServiceAccount", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "GetGoogleServiceAccount", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async", + "title": "StorageTransferService createTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a transfer job that runs periodically.", + "canonical": true, + "file": "storage_transfer_service.create_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", + "async": true, + "parameters": [ + { + "name": "transfer_job", + "type": ".google.storagetransfer.v1.TransferJob" + } + ], + "resultType": ".google.storagetransfer.v1.TransferJob", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "CreateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async", + "title": "StorageTransferService updateTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).", + "canonical": true, + "file": "storage_transfer_service.update_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", + "async": true, + "parameters": [ + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "transfer_job", + "type": ".google.storagetransfer.v1.TransferJob" + }, + { + "name": "update_transfer_job_field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.storagetransfer.v1.TransferJob", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "UpdateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async", + "title": "StorageTransferService getTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Gets a transfer job.", + "canonical": true, + "file": "storage_transfer_service.get_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", + "async": true, + "parameters": [ + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.TransferJob", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "GetTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async", + "title": "StorageTransferService listTransferJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists transfer jobs.", + "canonical": true, + "file": "storage_transfer_service.list_transfer_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferJobs", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", + "async": true, + "parameters": [ + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.ListTransferJobsResponse", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "ListTransferJobs", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async", + "title": "StorageTransferService pauseTransferOperation Sample", + "origin": "API_DEFINITION", + "description": " Pauses a transfer operation.", + "canonical": true, + "file": "storage_transfer_service.pause_transfer_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PauseTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "PauseTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async", + "title": "StorageTransferService resumeTransferOperation Sample", + "origin": "API_DEFINITION", + "description": " Resumes a transfer operation that is paused.", + "canonical": true, + "file": "storage_transfer_service.resume_transfer_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "ResumeTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async", + "title": "StorageTransferService runTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.", + "canonical": true, + "file": "storage_transfer_service.run_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", + "async": true, + "parameters": [ + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "RunTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async", + "title": "StorageTransferService createAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Creates an agent pool resource.", + "canonical": true, + "file": "storage_transfer_service.create_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "agent_pool", + "type": ".google.storagetransfer.v1.AgentPool" + }, + { + "name": "agent_pool_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "CreateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async", + "title": "StorageTransferService updateAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing agent pool resource.", + "canonical": true, + "file": "storage_transfer_service.update_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", + "async": true, + "parameters": [ + { + "name": "agent_pool", + "type": ".google.storagetransfer.v1.AgentPool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "UpdateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async", + "title": "StorageTransferService getAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Gets an agent pool.", + "canonical": true, + "file": "storage_transfer_service.get_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "GetAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async", + "title": "StorageTransferService listAgentPools Sample", + "origin": "API_DEFINITION", + "description": " Lists agent pools.", + "canonical": true, + "file": "storage_transfer_service.list_agent_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAgentPools", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.ListAgentPoolsResponse", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "ListAgentPools", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async", + "title": "StorageTransferService deleteAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Deletes an agent pool.", + "canonical": true, + "file": "storage_transfer_service.delete_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "DeleteAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js new file mode 100644 index 0000000..b8ab5e8 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js @@ -0,0 +1,78 @@ +// 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 +// +// 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(projectId, agentPool, agentPoolId) { + // [START storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the Google Cloud project that owns the + * agent pool. + */ + // const projectId = 'abc123' + /** + * Required. The agent pool to create. + */ + // const agentPool = {} + /** + * Required. The ID of the agent pool to create. + * The `agent_pool_id` must meet the following requirements: + * * Length of 128 characters or less. + * * Not start with the string `goog`. + * * Start with a lowercase ASCII character, followed by: + * * Zero or more: lowercase Latin alphabet characters, numerals, + * hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + * * One or more numerals or lowercase ASCII characters. + * As expressed by the regular expression: + * `^(?!goog)a-z(a-z0-9-._~*a-z0-9)?$`. + */ + // const agentPoolId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callCreateAgentPool() { + // Construct request + const request = { + projectId, + agentPool, + agentPoolId, + }; + + // Run request + const response = await storagetransferClient.createAgentPool(request); + console.log(response); + } + + callCreateAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js new file mode 100644 index 0000000..60f7402 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js @@ -0,0 +1,58 @@ +// 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 +// +// 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(transferJob) { + // [START storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The job to create. + */ + // const transferJob = {} + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callCreateTransferJob() { + // Construct request + const request = { + transferJob, + }; + + // Run request + const response = await storagetransferClient.createTransferJob(request); + console.log(response); + } + + callCreateTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js new file mode 100644 index 0000000..2435903 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js @@ -0,0 +1,58 @@ +// 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 +// +// 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 storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent pool to delete. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callDeleteAgentPool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.deleteAgentPool(request); + console.log(response); + } + + callDeleteAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js new file mode 100644 index 0000000..fa2a1ef --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js @@ -0,0 +1,58 @@ +// 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 +// +// 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 storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent pool to get. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callGetAgentPool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.getAgentPool(request); + console.log(response); + } + + callGetAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js new file mode 100644 index 0000000..7c588b9 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js @@ -0,0 +1,59 @@ +// 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 +// +// 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(projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the Google Cloud project that the Google service + * account is associated with. + */ + // const projectId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callGetGoogleServiceAccount() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await storagetransferClient.getGoogleServiceAccount(request); + console.log(response); + } + + callGetGoogleServiceAccount(); + // [END storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js new file mode 100644 index 0000000..46ff036 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js @@ -0,0 +1,64 @@ +// 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 +// +// 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(jobName, projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The job to get. + */ + // const jobName = 'abc123' + /** + * Required. The ID of the Google Cloud project that owns the + * job. + */ + // const projectId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callGetTransferJob() { + // Construct request + const request = { + jobName, + projectId, + }; + + // Run request + const response = await storagetransferClient.getTransferJob(request); + console.log(response); + } + + callGetTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js new file mode 100644 index 0000000..2fadae1 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js @@ -0,0 +1,77 @@ +// 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 +// +// 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(projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the Google Cloud project that owns the job. + */ + // const projectId = 'abc123' + /** + * An optional list of query parameters specified as JSON text in the + * form of: + * `{"agentPoolNames":"agentpool1","agentpool2",... }` + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + */ + // const filter = 'abc123' + /** + * The list page size. The max allowed value is `256`. + */ + // const pageSize = 1234 + /** + * The list page token. + */ + // const pageToken = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callListAgentPools() { + // Construct request + const request = { + projectId, + }; + + // Run request + const iterable = await storagetransferClient.listAgentPoolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAgentPools(); + // [END storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js new file mode 100644 index 0000000..09b0a5a --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js @@ -0,0 +1,78 @@ +// 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 +// +// 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(filter) { + // [START storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":"jobid1","jobid2",..., + * "jobStatuses":"status1","status2",... }` + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * ENABLED google.storagetransfer.v1.TransferJob.Status.ENABLED, + * DISABLED google.storagetransfer.v1.TransferJob.Status.DISABLED, and + * DELETED google.storagetransfer.v1.TransferJob.Status.DELETED. + */ + // const filter = 'abc123' + /** + * The list page size. The max allowed value is 256. + */ + // const pageSize = 1234 + /** + * The list page token. + */ + // const pageToken = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callListTransferJobs() { + // Construct request + const request = { + filter, + }; + + // Run request + const iterable = await storagetransferClient.listTransferJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferJobs(); + // [END storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js new file mode 100644 index 0000000..8c92715 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js @@ -0,0 +1,58 @@ +// 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 +// +// 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 storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the transfer operation. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callPauseTransferOperation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.pauseTransferOperation(request); + console.log(response); + } + + callPauseTransferOperation(); + // [END storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js new file mode 100644 index 0000000..826857f --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js @@ -0,0 +1,58 @@ +// 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 +// +// 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 storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the transfer operation. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callResumeTransferOperation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.resumeTransferOperation(request); + console.log(response); + } + + callResumeTransferOperation(); + // [END storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js new file mode 100644 index 0000000..ef1e7da --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js @@ -0,0 +1,65 @@ +// 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 +// +// 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(jobName, projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the transfer job. + */ + // const jobName = 'abc123' + /** + * Required. The ID of the Google Cloud project that owns the transfer + * job. + */ + // const projectId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callRunTransferJob() { + // Construct request + const request = { + jobName, + projectId, + }; + + // Run request + const [operation] = await storagetransferClient.runTransferJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js new file mode 100644 index 0000000..5b9d842 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js @@ -0,0 +1,73 @@ +// 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 +// +// 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(agentPool) { + // [START storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The agent pool to update. `agent_pool` is expected to specify following + * fields: + * * name google.storagetransfer.v1.AgentPool.name + * * display_name google.storagetransfer.v1.AgentPool.display_name + * * bandwidth_limit google.storagetransfer.v1.AgentPool.bandwidth_limit + * An `UpdateAgentPoolRequest` with any other fields is rejected + * with the error INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. + */ + // const agentPool = {} + /** + * The field mask + * (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + * of the fields in `agentPool` to update in this request. + * The following `agentPool` fields can be updated: + * * display_name google.storagetransfer.v1.AgentPool.display_name + * * bandwidth_limit google.storagetransfer.v1.AgentPool.bandwidth_limit + */ + // const updateMask = {} + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callUpdateAgentPool() { + // Construct request + const request = { + agentPool, + }; + + // Run request + const response = await storagetransferClient.updateAgentPool(request); + console.log(response); + } + + callUpdateAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js new file mode 100644 index 0000000..161e303 --- /dev/null +++ b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js @@ -0,0 +1,91 @@ +// 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 +// +// 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(jobName, projectId, transferJob) { + // [START storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of job to update. + */ + // const jobName = 'abc123' + /** + * Required. The ID of the Google Cloud project that owns the + * job. + */ + // const projectId = 'abc123' + /** + * Required. The job to update. `transferJob` is expected to specify one or more of + * five fields: description google.storagetransfer.v1.TransferJob.description, + * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, + * notification_config google.storagetransfer.v1.TransferJob.notification_config, + * logging_config google.storagetransfer.v1.TransferJob.logging_config, and + * status google.storagetransfer.v1.TransferJob.status. An `UpdateTransferJobRequest` that specifies + * other fields are rejected with the error + * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. Updating a job status + * to DELETED google.storagetransfer.v1.TransferJob.Status.DELETED requires + * `storagetransfer.jobs.delete` permissions. + */ + // const transferJob = {} + /** + * The field mask of the fields in `transferJob` that are to be updated in + * this request. Fields in `transferJob` that can be updated are: + * description google.storagetransfer.v1.TransferJob.description, + * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, + * notification_config google.storagetransfer.v1.TransferJob.notification_config, + * logging_config google.storagetransfer.v1.TransferJob.logging_config, and + * status google.storagetransfer.v1.TransferJob.status. To update the `transfer_spec` of the job, a + * complete transfer specification must be provided. An incomplete + * specification missing any required fields is rejected with the error + * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. + */ + // const updateTransferJobFieldMask = {} + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callUpdateTransferJob() { + // Construct request + const request = { + jobName, + projectId, + transferJob, + }; + + // Run request + const response = await storagetransferClient.updateTransferJob(request); + console.log(response); + } + + callUpdateTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts new file mode 100644 index 0000000..b2ff704 --- /dev/null +++ b/owl-bot-staging/v1/src/index.ts @@ -0,0 +1,25 @@ +// 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 +// +// 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 StorageTransferServiceClient = v1.StorageTransferServiceClient; +type StorageTransferServiceClient = v1.StorageTransferServiceClient; +export {v1, StorageTransferServiceClient}; +export default {v1, StorageTransferServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json new file mode 100644 index 0000000..7f8bdf9 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/gapic_metadata.json @@ -0,0 +1,161 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.storagetransfer.v1", + "libraryPackage": "@google-cloud/storage-transfer", + "services": { + "StorageTransferService": { + "clients": { + "grpc": { + "libraryClient": "StorageTransferServiceClient", + "rpcs": { + "GetGoogleServiceAccount": { + "methods": [ + "getGoogleServiceAccount" + ] + }, + "CreateTransferJob": { + "methods": [ + "createTransferJob" + ] + }, + "UpdateTransferJob": { + "methods": [ + "updateTransferJob" + ] + }, + "GetTransferJob": { + "methods": [ + "getTransferJob" + ] + }, + "PauseTransferOperation": { + "methods": [ + "pauseTransferOperation" + ] + }, + "ResumeTransferOperation": { + "methods": [ + "resumeTransferOperation" + ] + }, + "CreateAgentPool": { + "methods": [ + "createAgentPool" + ] + }, + "UpdateAgentPool": { + "methods": [ + "updateAgentPool" + ] + }, + "GetAgentPool": { + "methods": [ + "getAgentPool" + ] + }, + "DeleteAgentPool": { + "methods": [ + "deleteAgentPool" + ] + }, + "RunTransferJob": { + "methods": [ + "runTransferJob" + ] + }, + "ListTransferJobs": { + "methods": [ + "listTransferJobs", + "listTransferJobsStream", + "listTransferJobsAsync" + ] + }, + "ListAgentPools": { + "methods": [ + "listAgentPools", + "listAgentPoolsStream", + "listAgentPoolsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "StorageTransferServiceClient", + "rpcs": { + "GetGoogleServiceAccount": { + "methods": [ + "getGoogleServiceAccount" + ] + }, + "CreateTransferJob": { + "methods": [ + "createTransferJob" + ] + }, + "UpdateTransferJob": { + "methods": [ + "updateTransferJob" + ] + }, + "GetTransferJob": { + "methods": [ + "getTransferJob" + ] + }, + "PauseTransferOperation": { + "methods": [ + "pauseTransferOperation" + ] + }, + "ResumeTransferOperation": { + "methods": [ + "resumeTransferOperation" + ] + }, + "CreateAgentPool": { + "methods": [ + "createAgentPool" + ] + }, + "UpdateAgentPool": { + "methods": [ + "updateAgentPool" + ] + }, + "GetAgentPool": { + "methods": [ + "getAgentPool" + ] + }, + "DeleteAgentPool": { + "methods": [ + "deleteAgentPool" + ] + }, + "RunTransferJob": { + "methods": [ + "runTransferJob" + ] + }, + "ListTransferJobs": { + "methods": [ + "listTransferJobs", + "listTransferJobsStream", + "listTransferJobsAsync" + ] + }, + "ListAgentPools": { + "methods": [ + "listAgentPools", + "listAgentPoolsStream", + "listAgentPoolsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts new file mode 100644 index 0000000..f0a69d4 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// 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 +// +// 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 {StorageTransferServiceClient} from './storage_transfer_service_client'; diff --git a/owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts b/owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts new file mode 100644 index 0000000..2ac4396 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts @@ -0,0 +1,1652 @@ +// 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 +// +// 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 * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/storage_transfer_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './storage_transfer_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Storage Transfer Service and its protos. + * Transfers data between between Google Cloud Storage buckets or from a data + * source external to Google to a Cloud Storage bucket. + * @class + * @memberof v1 + */ +export class StorageTransferServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + storageTransferServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of StorageTransferServiceClient. + * + * @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/master/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} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof StorageTransferServiceClient; + 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); + + // 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; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // 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; + } + + // 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 = { + agentPoolsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_id}/agentPools/{agent_pool_id}' + ), + }; + + // 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 = { + listTransferJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'transferJobs'), + listAgentPools: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'agentPools') + }; + + 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. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const runTransferJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const runTransferJobMetadata = protoFilesRoot.lookup( + '.google.storagetransfer.v1.TransferOperation') as gax.protobuf.Type; + + this.descriptors.longrunning = { + runTransferJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runTransferJobResponse.decode.bind(runTransferJobResponse), + runTransferJobMetadata.decode.bind(runTransferJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.storagetransfer.v1.StorageTransferService', 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 = gax.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.storageTransferServiceStub) { + return this.storageTransferServiceStub; + } + + // Put together the "service stub" for + // google.storagetransfer.v1.StorageTransferService. + this.storageTransferServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.storagetransfer.v1.StorageTransferService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.storagetransfer.v1.StorageTransferService, + 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 storageTransferServiceStubMethods = + ['getGoogleServiceAccount', 'createTransferJob', 'updateTransferJob', 'getTransferJob', 'listTransferJobs', 'pauseTransferOperation', 'resumeTransferOperation', 'runTransferJob', 'createAgentPool', 'updateAgentPool', 'getAgentPool', 'listAgentPools', 'deleteAgentPool']; + for (const methodName of storageTransferServiceStubMethods) { + const callPromise = this.storageTransferServiceStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.storageTransferServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'storagetransfer.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 'storagetransfer.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 Google service account that is used by Storage Transfer + * Service to access buckets in the project where transfers + * run or in other projects. Each Google service account is associated + * with one Google Cloud project. Users + * should add this service account to the Google Cloud Storage bucket + * ACLs to grant access to Storage Transfer Service. This service + * account is created and owned by Storage Transfer Service and can + * only be used by Storage Transfer Service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that the Google service + * account is associated with. + * @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 [GoogleServiceAccount]{@link google.storagetransfer.v1.GoogleServiceAccount}. + * 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/storage_transfer_service.get_google_service_account.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async + */ + getGoogleServiceAccount( + request?: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.IGoogleServiceAccount, + protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|undefined, {}|undefined + ]>; + getGoogleServiceAccount( + request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, + {}|null|undefined>): void; + getGoogleServiceAccount( + request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + callback: Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, + {}|null|undefined>): void; + getGoogleServiceAccount( + request?: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storagetransfer.v1.IGoogleServiceAccount, + protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|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' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); + this.initialize(); + return this.innerApiCalls.getGoogleServiceAccount(request, options, callback); + } +/** + * Creates a transfer job that runs periodically. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storagetransfer.v1.TransferJob} request.transferJob + * Required. The job to create. + * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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/storage_transfer_service.create_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async + */ + createTransferJob( + request?: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest|undefined, {}|undefined + ]>; + createTransferJob( + request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, + {}|null|undefined>): void; + createTransferJob( + request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, + {}|null|undefined>): void; + createTransferJob( + request?: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest|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 || {}; + this.initialize(); + return this.innerApiCalls.createTransferJob(request, options, callback); + } +/** + * Updates a transfer job. Updating a job's transfer spec does not affect + * transfer operations that are running already. + * + * **Note:** The job's {@link google.storagetransfer.v1.TransferJob.status|status} field can be modified + * using this RPC (for example, to set a job's status to + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, or + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.jobName + * Required. The name of job to update. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * job. + * @param {google.storagetransfer.v1.TransferJob} request.transferJob + * Required. The job to update. `transferJob` is expected to specify one or more of + * five fields: {@link google.storagetransfer.v1.TransferJob.description|description}, + * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, + * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, + * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and + * {@link google.storagetransfer.v1.TransferJob.status|status}. An `UpdateTransferJobRequest` that specifies + * other fields are rejected with the error + * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. Updating a job status + * to {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED} requires + * `storagetransfer.jobs.delete` permissions. + * @param {google.protobuf.FieldMask} request.updateTransferJobFieldMask + * The field mask of the fields in `transferJob` that are to be updated in + * this request. Fields in `transferJob` that can be updated are: + * {@link google.storagetransfer.v1.TransferJob.description|description}, + * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, + * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, + * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and + * {@link google.storagetransfer.v1.TransferJob.status|status}. To update the `transfer_spec` of the job, a + * complete transfer specification must be provided. An incomplete + * specification missing any required fields is rejected with the error + * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. + * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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/storage_transfer_service.update_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async + */ + updateTransferJob( + request?: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest|undefined, {}|undefined + ]>; + updateTransferJob( + request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, + {}|null|undefined>): void; + updateTransferJob( + request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, + {}|null|undefined>): void; + updateTransferJob( + request?: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest|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' + ] = gax.routingHeader.fromParams({ + 'job_name': request.jobName || '', + }); + this.initialize(); + return this.innerApiCalls.updateTransferJob(request, options, callback); + } +/** + * Gets a transfer job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.jobName + * Required. The job to get. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * job. + * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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/storage_transfer_service.get_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async + */ + getTransferJob( + request?: protos.google.storagetransfer.v1.IGetTransferJobRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest|undefined, {}|undefined + ]>; + getTransferJob( + request: protos.google.storagetransfer.v1.IGetTransferJobRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, + {}|null|undefined>): void; + getTransferJob( + request: protos.google.storagetransfer.v1.IGetTransferJobRequest, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, + {}|null|undefined>): void; + getTransferJob( + request?: protos.google.storagetransfer.v1.IGetTransferJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest|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' + ] = gax.routingHeader.fromParams({ + 'job_name': request.jobName || '', + }); + this.initialize(); + return this.innerApiCalls.getTransferJob(request, options, callback); + } +/** + * Pauses a transfer operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the transfer operation. + * @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 [Empty]{@link google.protobuf.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/storage_transfer_service.pause_transfer_operation.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async + */ + pauseTransferOperation( + request?: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IPauseTransferOperationRequest|undefined, {}|undefined + ]>; + pauseTransferOperation( + request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, + {}|null|undefined>): void; + pauseTransferOperation( + request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, + {}|null|undefined>): void; + pauseTransferOperation( + request?: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IPauseTransferOperationRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.pauseTransferOperation(request, options, callback); + } +/** + * Resumes a transfer operation that is paused. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the transfer operation. + * @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 [Empty]{@link google.protobuf.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/storage_transfer_service.resume_transfer_operation.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async + */ + resumeTransferOperation( + request?: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IResumeTransferOperationRequest|undefined, {}|undefined + ]>; + resumeTransferOperation( + request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, + {}|null|undefined>): void; + resumeTransferOperation( + request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, + {}|null|undefined>): void; + resumeTransferOperation( + request?: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IResumeTransferOperationRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.resumeTransferOperation(request, options, callback); + } +/** + * Creates an agent pool resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * agent pool. + * @param {google.storagetransfer.v1.AgentPool} request.agentPool + * Required. The agent pool to create. + * @param {string} request.agentPoolId + * Required. The ID of the agent pool to create. + * + * The `agent_pool_id` must meet the following requirements: + * + * * Length of 128 characters or less. + * * Not start with the string `goog`. + * * Start with a lowercase ASCII character, followed by: + * * Zero or more: lowercase Latin alphabet characters, numerals, + * hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + * * One or more numerals or lowercase ASCII characters. + * + * As expressed by the regular expression: + * `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.create_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async + */ + createAgentPool( + request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest|undefined, {}|undefined + ]>; + createAgentPool( + request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + createAgentPool( + request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + createAgentPool( + request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest|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' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); + this.initialize(); + return this.innerApiCalls.createAgentPool(request, options, callback); + } +/** + * Updates an existing agent pool resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storagetransfer.v1.AgentPool} request.agentPool + * Required. The agent pool to update. `agent_pool` is expected to specify following + * fields: + * + * * {@link google.storagetransfer.v1.AgentPool.name|name} + * + * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} + * + * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} + * An `UpdateAgentPoolRequest` with any other fields is rejected + * with the error {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. + * @param {google.protobuf.FieldMask} request.updateMask + * The [field mask] + * (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + * of the fields in `agentPool` to update in this request. + * The following `agentPool` fields can be updated: + * + * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} + * + * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.update_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async + */ + updateAgentPool( + request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|undefined, {}|undefined + ]>; + updateAgentPool( + request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + updateAgentPool( + request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + updateAgentPool( + request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|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' + ] = gax.routingHeader.fromParams({ + 'agent_pool.name': request.agentPool!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateAgentPool(request, options, callback); + } +/** + * Gets an agent pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent pool to get. + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.get_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async + */ + getAgentPool( + request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest|undefined, {}|undefined + ]>; + getAgentPool( + request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + getAgentPool( + request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + getAgentPool( + request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getAgentPool(request, options, callback); + } +/** + * Deletes an agent pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent pool to delete. + * @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 [Empty]{@link google.protobuf.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/storage_transfer_service.delete_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async + */ + deleteAgentPool( + request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|undefined, {}|undefined + ]>; + deleteAgentPool( + request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + deleteAgentPool( + request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, + {}|null|undefined>): void; + deleteAgentPool( + request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteAgentPool(request, options, callback); + } + +/** + * Attempts to start a new TransferOperation for the current TransferJob. A + * TransferJob has a maximum of one active TransferOperation. If this method + * is called while a TransferOperation is active, an error will be returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.jobName + * Required. The name of the transfer job. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the transfer + * job. + * @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/storage_transfer_service.run_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async + */ + runTransferJob( + request?: protos.google.storagetransfer.v1.IRunTransferJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + runTransferJob( + request: protos.google.storagetransfer.v1.IRunTransferJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runTransferJob( + request: protos.google.storagetransfer.v1.IRunTransferJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runTransferJob( + request?: protos.google.storagetransfer.v1.IRunTransferJobRequest, + 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' + ] = gax.routingHeader.fromParams({ + 'job_name': request.jobName || '', + }); + this.initialize(); + return this.innerApiCalls.runTransferJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `runTransferJob()`. + * @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/storage_transfer_service.run_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async + */ + async checkRunTransferJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.runTransferJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists transfer jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * Required. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":["jobid1","jobid2",...], + * "jobStatuses":["status1","status2",...]}` + * + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. + * @param {number} request.pageSize + * The list page size. The max allowed value is 256. + * @param {string} request.pageToken + * The 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 {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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 `listTransferJobsAsync()` + * 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. + */ + listTransferJobs( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob[], + protos.google.storagetransfer.v1.IListTransferJobsRequest|null, + protos.google.storagetransfer.v1.IListTransferJobsResponse + ]>; + listTransferJobs( + request: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, + protos.google.storagetransfer.v1.ITransferJob>): void; + listTransferJobs( + request: protos.google.storagetransfer.v1.IListTransferJobsRequest, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, + protos.google.storagetransfer.v1.ITransferJob>): void; + listTransferJobs( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, + protos.google.storagetransfer.v1.ITransferJob>, + callback?: PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, + protos.google.storagetransfer.v1.ITransferJob>): + Promise<[ + protos.google.storagetransfer.v1.ITransferJob[], + protos.google.storagetransfer.v1.IListTransferJobsRequest|null, + protos.google.storagetransfer.v1.IListTransferJobsResponse + ]>|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 || {}; + this.initialize(); + return this.innerApiCalls.listTransferJobs(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.filter + * Required. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":["jobid1","jobid2",...], + * "jobStatuses":["status1","status2",...]}` + * + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. + * @param {number} request.pageSize + * The list page size. The max allowed value is 256. + * @param {string} request.pageToken + * The 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 {Stream} + * An object stream which emits an object representing [TransferJob]{@link google.storagetransfer.v1.TransferJob} 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 `listTransferJobsAsync()` + * 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. + */ + listTransferJobsStream( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTransferJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferJobs.createStream( + this.innerApiCalls.listTransferJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTransferJobs`, 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.filter + * Required. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":["jobid1","jobid2",...], + * "jobStatuses":["status1","status2",...]}` + * + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. + * @param {number} request.pageSize + * The list page size. The max allowed value is 256. + * @param {string} request.pageToken + * The 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 + * [TransferJob]{@link google.storagetransfer.v1.TransferJob}. 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/storage_transfer_service.list_transfer_jobs.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async + */ + listTransferJobsAsync( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTransferJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferJobs.asyncIterate( + this.innerApiCalls['listTransferJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists agent pools. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The 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 {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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 `listAgentPoolsAsync()` + * 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. + */ + listAgentPools( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool[], + protos.google.storagetransfer.v1.IListAgentPoolsRequest|null, + protos.google.storagetransfer.v1.IListAgentPoolsResponse + ]>; + listAgentPools( + request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, + protos.google.storagetransfer.v1.IAgentPool>): void; + listAgentPools( + request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, + protos.google.storagetransfer.v1.IAgentPool>): void; + listAgentPools( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, + protos.google.storagetransfer.v1.IAgentPool>, + callback?: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, + protos.google.storagetransfer.v1.IAgentPool>): + Promise<[ + protos.google.storagetransfer.v1.IAgentPool[], + protos.google.storagetransfer.v1.IListAgentPoolsRequest|null, + protos.google.storagetransfer.v1.IListAgentPoolsResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); + this.initialize(); + return this.innerApiCalls.listAgentPools(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.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The 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 {Stream} + * An object stream which emits an object representing [AgentPool]{@link google.storagetransfer.v1.AgentPool} 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 `listAgentPoolsAsync()` + * 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. + */ + listAgentPoolsStream( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); + const defaultCallSettings = this._defaults['listAgentPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAgentPools.createStream( + this.innerApiCalls.listAgentPools as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAgentPools`, 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.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The 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 + * [AgentPool]{@link google.storagetransfer.v1.AgentPool}. 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/storage_transfer_service.list_agent_pools.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async + */ + listAgentPoolsAsync( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); + const defaultCallSettings = this._defaults['listAgentPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAgentPools.asyncIterate( + this.innerApiCalls['listAgentPools'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agentPools resource name string. + * + * @param {string} project_id + * @param {string} agent_pool_id + * @returns {string} Resource name string. + */ + agentPoolsPath(projectId:string,agentPoolId:string) { + return this.pathTemplates.agentPoolsPathTemplate.render({ + project_id: projectId, + agent_pool_id: agentPoolId, + }); + } + + /** + * Parse the project_id from AgentPools resource. + * + * @param {string} agentPoolsName + * A fully-qualified path representing agentPools resource. + * @returns {string} A string representing the project_id. + */ + matchProjectIdFromAgentPoolsName(agentPoolsName: string) { + return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName).project_id; + } + + /** + * Parse the agent_pool_id from AgentPools resource. + * + * @param {string} agentPoolsName + * A fully-qualified path representing agentPools resource. + * @returns {string} A string representing the agent_pool_id. + */ + matchAgentPoolIdFromAgentPoolsName(agentPoolsName: string) { + return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName).agent_pool_id; + } + + /** + * 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.storageTransferServiceStub && !this._terminated) { + return this.storageTransferServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json b/owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json new file mode 100644 index 0000000..6e42410 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.storagetransfer.v1.StorageTransferService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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 + } + }, + "methods": { + "GetGoogleServiceAccount": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTransferJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTransferJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTransferJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTransferJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PauseTransferOperation": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeTransferOperation": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RunTransferJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAgentPool": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAgentPool": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAgentPool": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAgentPools": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAgentPool": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json b/owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json new file mode 100644 index 0000000..ea755b4 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/storagetransfer/v1/transfer.proto", + "../../protos/google/storagetransfer/v1/transfer_types.proto" +] diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 0000000..842da4d --- /dev/null +++ b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// 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 +// +// 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 storagetransfer = require('@google-cloud/storage-transfer'); + +function main() { + const storageTransferServiceClient = new storagetransfer.StorageTransferServiceClient(); +} + +main(); diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 0000000..458ee50 --- /dev/null +++ b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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 +// +// 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 {StorageTransferServiceClient} from '@google-cloud/storage-transfer'; + +// check that the client class type name can be used +function doStuffWithStorageTransferServiceClient(client: StorageTransferServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const storageTransferServiceClient = new StorageTransferServiceClient(); + doStuffWithStorageTransferServiceClient(storageTransferServiceClient); +} + +main(); diff --git a/owl-bot-staging/v1/system-test/install.ts b/owl-bot-staging/v1/system-test/install.ts new file mode 100644 index 0000000..8ec4522 --- /dev/null +++ b/owl-bot-staging/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// 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/v1/test/gapic_storage_transfer_service_v1.ts b/owl-bot-staging/v1/test/gapic_storage_transfer_service_v1.ts new file mode 100644 index 0000000..3783e3e --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_storage_transfer_service_v1.ts @@ -0,0 +1,1726 @@ +// 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 +// +// 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 storagetransferserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +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.StorageTransferServiceClient', () => { + it('has servicePath', () => { + const servicePath = storagetransferserviceModule.v1.StorageTransferServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = storagetransferserviceModule.v1.StorageTransferServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = storagetransferserviceModule.v1.StorageTransferServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageTransferServiceStub, undefined); + await client.initialize(); + assert(client.storageTransferServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.storageTransferServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageTransferServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + 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 storagetransferserviceModule.v1.StorageTransferServiceClient({ + 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('getGoogleServiceAccount', () => { + it('invokes getGoogleServiceAccount without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.GoogleServiceAccount()); + client.innerApiCalls.getGoogleServiceAccount = stubSimpleCall(expectedResponse); + const [response] = await client.getGoogleServiceAccount(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGoogleServiceAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getGoogleServiceAccount without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.GoogleServiceAccount()); + client.innerApiCalls.getGoogleServiceAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGoogleServiceAccount( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.IGoogleServiceAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getGoogleServiceAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getGoogleServiceAccount with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGoogleServiceAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGoogleServiceAccount(request), expectedError); + assert((client.innerApiCalls.getGoogleServiceAccount as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getGoogleServiceAccount with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGoogleServiceAccount(request), expectedError); + }); + }); + + describe('createTransferJob', () => { + it('invokes createTransferJob without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); + client.innerApiCalls.createTransferJob = stubSimpleCall(expectedResponse); + const [response] = await client.createTransferJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTransferJob without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); + client.innerApiCalls.createTransferJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTransferJob( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTransferJob with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedError = new Error('expected'); + client.innerApiCalls.createTransferJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTransferJob(request), expectedError); + assert((client.innerApiCalls.createTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTransferJob with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTransferJob(request), expectedError); + }); + }); + + describe('updateTransferJob', () => { + it('invokes updateTransferJob without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); + client.innerApiCalls.updateTransferJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateTransferJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTransferJob without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); + client.innerApiCalls.updateTransferJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTransferJob( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTransferJob with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTransferJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTransferJob(request), expectedError); + assert((client.innerApiCalls.updateTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTransferJob with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); + request.jobName = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTransferJob(request), expectedError); + }); + }); + + describe('getTransferJob', () => { + it('invokes getTransferJob without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); + client.innerApiCalls.getTransferJob = stubSimpleCall(expectedResponse); + const [response] = await client.getTransferJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTransferJob without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); + client.innerApiCalls.getTransferJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransferJob( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTransferJob with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransferJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTransferJob(request), expectedError); + assert((client.innerApiCalls.getTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTransferJob with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); + request.jobName = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTransferJob(request), expectedError); + }); + }); + + describe('pauseTransferOperation', () => { + it('invokes pauseTransferOperation without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pauseTransferOperation = stubSimpleCall(expectedResponse); + const [response] = await client.pauseTransferOperation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pauseTransferOperation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pauseTransferOperation without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pauseTransferOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseTransferOperation( + 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); + assert((client.innerApiCalls.pauseTransferOperation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes pauseTransferOperation with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseTransferOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pauseTransferOperation(request), expectedError); + assert((client.innerApiCalls.pauseTransferOperation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pauseTransferOperation with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pauseTransferOperation(request), expectedError); + }); + }); + + describe('resumeTransferOperation', () => { + it('invokes resumeTransferOperation without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resumeTransferOperation = stubSimpleCall(expectedResponse); + const [response] = await client.resumeTransferOperation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resumeTransferOperation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resumeTransferOperation without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resumeTransferOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeTransferOperation( + 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); + assert((client.innerApiCalls.resumeTransferOperation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes resumeTransferOperation with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeTransferOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resumeTransferOperation(request), expectedError); + assert((client.innerApiCalls.resumeTransferOperation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resumeTransferOperation with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.resumeTransferOperation(request), expectedError); + }); + }); + + describe('createAgentPool', () => { + it('invokes createAgentPool without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); + client.innerApiCalls.createAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.createAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createAgentPool without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); + client.innerApiCalls.createAgentPool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAgentPool( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createAgentPool with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAgentPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAgentPool(request), expectedError); + assert((client.innerApiCalls.createAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createAgentPool with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAgentPool(request), expectedError); + }); + }); + + describe('updateAgentPool', () => { + it('invokes updateAgentPool without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedHeaderRequestParams = "agent_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); + client.innerApiCalls.updateAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.updateAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateAgentPool without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedHeaderRequestParams = "agent_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); + client.innerApiCalls.updateAgentPool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAgentPool( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateAgentPool with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedHeaderRequestParams = "agent_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAgentPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAgentPool(request), expectedError); + assert((client.innerApiCalls.updateAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateAgentPool with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAgentPool(request), expectedError); + }); + }); + + describe('getAgentPool', () => { + it('invokes getAgentPool without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); + client.innerApiCalls.getAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.getAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAgentPool without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); + client.innerApiCalls.getAgentPool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgentPool( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getAgentPool with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgentPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAgentPool(request), expectedError); + assert((client.innerApiCalls.getAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAgentPool with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAgentPool(request), expectedError); + }); + }); + + describe('deleteAgentPool', () => { + it('invokes deleteAgentPool without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteAgentPool without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteAgentPool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAgentPool( + 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); + assert((client.innerApiCalls.deleteAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteAgentPool with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAgentPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAgentPool(request), expectedError); + assert((client.innerApiCalls.deleteAgentPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteAgentPool with closed client', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAgentPool(request), expectedError); + }); + }); + + describe('runTransferJob', () => { + it('invokes runTransferJob without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.runTransferJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.runTransferJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runTransferJob without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.runTransferJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runTransferJob( + 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); + assert((client.innerApiCalls.runTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes runTransferJob with call error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runTransferJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.runTransferJob(request), expectedError); + assert((client.innerApiCalls.runTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runTransferJob with LRO error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); + request.jobName = ''; + const expectedHeaderRequestParams = "job_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runTransferJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.runTransferJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.runTransferJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkRunTransferJobProgress without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + 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.checkRunTransferJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunTransferJobProgress with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + 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.checkRunTransferJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listTransferJobs', () => { + it('invokes listTransferJobs without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + ]; + client.innerApiCalls.listTransferJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listTransferJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTransferJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTransferJobs without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + ]; + client.innerApiCalls.listTransferJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferJobs( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTransferJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTransferJobs with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); + const expectedOptions = {otherArgs: {headers: {}}};; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTransferJobs(request), expectedError); + assert((client.innerApiCalls.listTransferJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTransferJobsStream without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + ]; + client.descriptors.page.listTransferJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTransferJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.TransferJob[] = []; + stream.on('data', (response: protos.google.storagetransfer.v1.TransferJob) => { + 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.listTransferJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTransferJobs, request)); + }); + + it('invokes listTransferJobsStream with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); + const expectedError = new Error('expected'); + client.descriptors.page.listTransferJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.TransferJob[] = []; + stream.on('data', (response: protos.google.storagetransfer.v1.TransferJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTransferJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTransferJobs, request)); + }); + + it('uses async iteration with listTransferJobs without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), + ]; + client.descriptors.page.listTransferJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storagetransfer.v1.ITransferJob[] = []; + const iterable = client.listTransferJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTransferJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with listTransferJobs with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest());const expectedError = new Error('expected'); + client.descriptors.page.listTransferJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storagetransfer.v1.ITransferJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTransferJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('listAgentPools', () => { + it('invokes listAgentPools without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.innerApiCalls.listAgentPools = stubSimpleCall(expectedResponse); + const [response] = await client.listAgentPools(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAgentPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAgentPools without error using callback', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.innerApiCalls.listAgentPools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAgentPools( + request, + (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAgentPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAgentPools with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAgentPools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAgentPools(request), expectedError); + assert((client.innerApiCalls.listAgentPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAgentPoolsStream without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.descriptors.page.listAgentPools.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAgentPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.AgentPool[] = []; + stream.on('data', (response: protos.google.storagetransfer.v1.AgentPool) => { + 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.listAgentPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAgentPools, request)); + assert.strictEqual( + (client.descriptors.page.listAgentPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAgentPoolsStream with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedError = new Error('expected'); + client.descriptors.page.listAgentPools.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAgentPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.AgentPool[] = []; + stream.on('data', (response: protos.google.storagetransfer.v1.AgentPool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAgentPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAgentPools, request)); + assert.strictEqual( + (client.descriptors.page.listAgentPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAgentPools without error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.descriptors.page.listAgentPools.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; + const iterable = client.listAgentPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAgentPools with error', async () => { + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id=";const expectedError = new Error('expected'); + client.descriptors.page.listAgentPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAgentPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('agentPools', () => { + const fakePath = "/rendered/path/agentPools"; + const expectedParameters = { + project_id: "projectIdValue", + agent_pool_id: "agentPoolIdValue", + }; + const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPoolsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPoolsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPoolsPath', () => { + const result = client.agentPoolsPath("projectIdValue", "agentPoolIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPoolsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectIdFromAgentPoolsName', () => { + const result = client.matchProjectIdFromAgentPoolsName(fakePath); + assert.strictEqual(result, "projectIdValue"); + assert((client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentPoolIdFromAgentPoolsName', () => { + const result = client.matchAgentPoolIdFromAgentPoolsName(fakePath); + assert.strictEqual(result, "agentPoolIdValue"); + assert((client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json new file mode 100644 index 0000000..c78f1c8 --- /dev/null +++ b/owl-bot-staging/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/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js new file mode 100644 index 0000000..08a3efc --- /dev/null +++ b/owl-bot-staging/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: 'StorageTransferService', + filename: './storage-transfer-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 eeb623365ebdb0e6dfd923cd1bdb920b7f07fca7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 4 Apr 2022 22:50:22 +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 --- owl-bot-staging/v1/.eslintignore | 7 - owl-bot-staging/v1/.eslintrc.json | 3 - owl-bot-staging/v1/.gitignore | 14 - owl-bot-staging/v1/.jsdoc.js | 55 - owl-bot-staging/v1/.mocharc.js | 33 - owl-bot-staging/v1/.prettierrc.js | 22 - owl-bot-staging/v1/README.md | 1 - owl-bot-staging/v1/linkinator.config.json | 16 - owl-bot-staging/v1/package.json | 64 - .../google/storagetransfer/v1/transfer.proto | 369 - .../storagetransfer/v1/transfer_types.proto | 1121 -- ...et_metadata.google.storagetransfer.v1.json | 587 - ...ge_transfer_service.create_transfer_job.js | 58 - ...sfer_service.get_google_service_account.js | 59 - ...orage_transfer_service.get_transfer_job.js | 64 - ...age_transfer_service.list_transfer_jobs.js | 78 - ...ansfer_service.pause_transfer_operation.js | 58 - ...nsfer_service.resume_transfer_operation.js | 58 - ...orage_transfer_service.run_transfer_job.js | 65 - ...ge_transfer_service.update_transfer_job.js | 91 - owl-bot-staging/v1/src/index.ts | 25 - owl-bot-staging/v1/src/v1/gapic_metadata.json | 161 - owl-bot-staging/v1/src/v1/index.ts | 19 - .../src/v1/storage_transfer_service_client.ts | 1652 --- ...torage_transfer_service_client_config.json | 91 - .../storage_transfer_service_proto_list.json | 4 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - owl-bot-staging/v1/system-test/install.ts | 49 - .../test/gapic_storage_transfer_service_v1.ts | 1726 --- owl-bot-staging/v1/tsconfig.json | 19 - owl-bot-staging/v1/webpack.config.js | 64 - .../google/storagetransfer/v1/transfer.proto | 202 +- .../storagetransfer/v1/transfer_types.proto | 611 +- protos/protos.d.ts | 2521 +++- protos/protos.js | 11872 +++++++++++----- protos/protos.json | 559 +- ...et_metadata.google.storagetransfer.v1.json | 232 +- ...rage_transfer_service.create_agent_pool.js | 0 ...rage_transfer_service.delete_agent_pool.js | 0 ...storage_transfer_service.get_agent_pool.js | 0 ...sfer_service.get_google_service_account.js | 4 +- ...orage_transfer_service.get_transfer_job.js | 5 +- ...orage_transfer_service.list_agent_pools.js | 0 ...orage_transfer_service.run_transfer_job.js | 4 +- ...rage_transfer_service.update_agent_pool.js | 0 ...ge_transfer_service.update_transfer_job.js | 25 +- src/v1/gapic_metadata.json | 54 + src/v1/storage_transfer_service_client.ts | 716 +- ...torage_transfer_service_client_config.json | 41 +- test/gapic_storage_transfer_service_v1.ts | 867 ++ 51 files changed, 13479 insertions(+), 10926 deletions(-) delete mode 100644 owl-bot-staging/v1/.eslintignore delete mode 100644 owl-bot-staging/v1/.eslintrc.json delete mode 100644 owl-bot-staging/v1/.gitignore delete mode 100644 owl-bot-staging/v1/.jsdoc.js delete mode 100644 owl-bot-staging/v1/.mocharc.js delete mode 100644 owl-bot-staging/v1/.prettierrc.js delete mode 100644 owl-bot-staging/v1/README.md delete mode 100644 owl-bot-staging/v1/linkinator.config.json delete mode 100644 owl-bot-staging/v1/package.json delete mode 100644 owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto delete mode 100644 owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto delete mode 100644 owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js delete mode 100644 owl-bot-staging/v1/src/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1/system-test/install.ts delete mode 100644 owl-bot-staging/v1/test/gapic_storage_transfer_service_v1.ts delete mode 100644 owl-bot-staging/v1/tsconfig.json delete mode 100644 owl-bot-staging/v1/webpack.config.js rename {owl-bot-staging/v1/samples => samples}/generated/v1/storage_transfer_service.create_agent_pool.js (100%) rename {owl-bot-staging/v1/samples => samples}/generated/v1/storage_transfer_service.delete_agent_pool.js (100%) rename {owl-bot-staging/v1/samples => samples}/generated/v1/storage_transfer_service.get_agent_pool.js (100%) rename {owl-bot-staging/v1/samples => samples}/generated/v1/storage_transfer_service.list_agent_pools.js (100%) rename {owl-bot-staging/v1/samples => samples}/generated/v1/storage_transfer_service.update_agent_pool.js (100%) diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore deleted file mode 100644 index cfc348e..0000000 --- a/owl-bot-staging/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json deleted file mode 100644 index 7821534..0000000 --- a/owl-bot-staging/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore deleted file mode 100644 index 5d32b23..0000000 --- a/owl-bot-staging/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/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js deleted file mode 100644 index 0ffbf58..0000000 --- a/owl-bot-staging/v1/.jsdoc.js +++ /dev/null @@ -1,55 +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 -// -// 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 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/storage-transfer', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js deleted file mode 100644 index 481c522..0000000 --- a/owl-bot-staging/v1/.mocharc.js +++ /dev/null @@ -1,33 +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 -// -// 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/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js deleted file mode 100644 index 494e147..0000000 --- a/owl-bot-staging/v1/.prettierrc.js +++ /dev/null @@ -1,22 +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 -// -// 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/v1/README.md b/owl-bot-staging/v1/README.md deleted file mode 100644 index dc9f51c..0000000 --- a/owl-bot-staging/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Storagetransfer: Nodejs Client diff --git a/owl-bot-staging/v1/linkinator.config.json b/owl-bot-staging/v1/linkinator.config.json deleted file mode 100644 index befd23c..0000000 --- a/owl-bot-staging/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/v1/package.json b/owl-bot-staging/v1/package.json deleted file mode 100644 index bdfcfec..0000000 --- a/owl-bot-staging/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/storage-transfer", - "version": "0.1.0", - "description": "Storagetransfer client for Node.js", - "repository": "googleapis/nodejs-storagetransfer", - "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 storagetransfer", - "storagetransfer", - "storage transfer service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "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": "^2.29.4" - }, - "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.0.0", - "@types/sinon": "^10.0.8", - "c8": "^7.11.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.1", - "jsdoc-region-tag": "^1.3.1", - "linkinator": "^3.0.0", - "mocha": "^9.1.4", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.67.0", - "webpack-cli": "^4.9.1" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto b/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto deleted file mode 100644 index 5ee7211..0000000 --- a/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer.proto +++ /dev/null @@ -1,369 +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.storagetransfer.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/storagetransfer/v1/transfer_types.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.StorageTransfer.V1"; -option go_package = "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer"; -option java_outer_classname = "TransferProto"; -option java_package = "com.google.storagetransfer.v1.proto"; -option php_namespace = "Google\\Cloud\\StorageTransfer\\V1"; -option ruby_package = "Google::Cloud::StorageTransfer::V1"; - -// Storage Transfer Service and its protos. -// Transfers data between between Google Cloud Storage buckets or from a data -// source external to Google to a Cloud Storage bucket. -service StorageTransferService { - option (google.api.default_host) = "storagetransfer.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Returns the Google service account that is used by Storage Transfer - // Service to access buckets in the project where transfers - // run or in other projects. Each Google service account is associated - // with one Google Cloud project. Users - // should add this service account to the Google Cloud Storage bucket - // ACLs to grant access to Storage Transfer Service. This service - // account is created and owned by Storage Transfer Service and can - // only be used by Storage Transfer Service. - rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) returns (GoogleServiceAccount) { - option (google.api.http) = { - get: "/v1/googleServiceAccounts/{project_id}" - }; - } - - // Creates a transfer job that runs periodically. - rpc CreateTransferJob(CreateTransferJobRequest) returns (TransferJob) { - option (google.api.http) = { - post: "/v1/transferJobs" - body: "transfer_job" - }; - } - - // Updates a transfer job. Updating a job's transfer spec does not affect - // transfer operations that are running already. - // - // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified - // using this RPC (for example, to set a job's status to - // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], - // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or - // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]). - rpc UpdateTransferJob(UpdateTransferJobRequest) returns (TransferJob) { - option (google.api.http) = { - patch: "/v1/{job_name=transferJobs/**}" - body: "*" - }; - } - - // Gets a transfer job. - rpc GetTransferJob(GetTransferJobRequest) returns (TransferJob) { - option (google.api.http) = { - get: "/v1/{job_name=transferJobs/**}" - }; - } - - // Lists transfer jobs. - rpc ListTransferJobs(ListTransferJobsRequest) returns (ListTransferJobsResponse) { - option (google.api.http) = { - get: "/v1/transferJobs" - }; - } - - // Pauses a transfer operation. - rpc PauseTransferOperation(PauseTransferOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=transferOperations/**}:pause" - body: "*" - }; - } - - // Resumes a transfer operation that is paused. - rpc ResumeTransferOperation(ResumeTransferOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=transferOperations/**}:resume" - body: "*" - }; - } - - // Attempts to start a new TransferOperation for the current TransferJob. A - // TransferJob has a maximum of one active TransferOperation. If this method - // is called while a TransferOperation is active, an error will be returned. - rpc RunTransferJob(RunTransferJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{job_name=transferJobs/**}:run" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "TransferOperation" - }; - } - - // Creates an agent pool resource. - rpc CreateAgentPool(CreateAgentPoolRequest) returns (AgentPool) { - option (google.api.http) = { - post: "/v1/projects/{project_id=*}/agentPools" - body: "agent_pool" - }; - option (google.api.method_signature) = "project_id,agent_pool,agent_pool_id"; - } - - // Updates an existing agent pool resource. - rpc UpdateAgentPool(UpdateAgentPoolRequest) returns (AgentPool) { - option (google.api.http) = { - patch: "/v1/{agent_pool.name=projects/*/agentPools/*}" - body: "agent_pool" - }; - option (google.api.method_signature) = "agent_pool,update_mask"; - } - - // Gets an agent pool. - rpc GetAgentPool(GetAgentPoolRequest) returns (AgentPool) { - option (google.api.http) = { - get: "/v1/{name=projects/*/agentPools/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists agent pools. - rpc ListAgentPools(ListAgentPoolsRequest) returns (ListAgentPoolsResponse) { - option (google.api.http) = { - get: "/v1/projects/{project_id=*}/agentPools" - }; - option (google.api.method_signature) = "project_id"; - } - - // Deletes an agent pool. - rpc DeleteAgentPool(DeleteAgentPoolRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/agentPools/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request passed to GetGoogleServiceAccount. -message GetGoogleServiceAccountRequest { - // Required. The ID of the Google Cloud project that the Google service - // account is associated with. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request passed to CreateTransferJob. -message CreateTransferJobRequest { - // Required. The job to create. - TransferJob transfer_job = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request passed to UpdateTransferJob. -message UpdateTransferJobRequest { - // Required. The name of job to update. - string job_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID of the Google Cloud project that owns the - // job. - string project_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The job to update. `transferJob` is expected to specify one or more of - // five fields: [description][google.storagetransfer.v1.TransferJob.description], - // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], - // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], - // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and - // [status][google.storagetransfer.v1.TransferJob.status]. An `UpdateTransferJobRequest` that specifies - // other fields are rejected with the error - // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a job status - // to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires - // `storagetransfer.jobs.delete` permissions. - TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED]; - - // The field mask of the fields in `transferJob` that are to be updated in - // this request. Fields in `transferJob` that can be updated are: - // [description][google.storagetransfer.v1.TransferJob.description], - // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], - // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], - // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and - // [status][google.storagetransfer.v1.TransferJob.status]. To update the `transfer_spec` of the job, a - // complete transfer specification must be provided. An incomplete - // specification missing any required fields is rejected with the error - // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - google.protobuf.FieldMask update_transfer_job_field_mask = 4; -} - -// Request passed to GetTransferJob. -message GetTransferJobRequest { - // Required. The job to get. - string job_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID of the Google Cloud project that owns the - // job. - string project_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `projectId`, `jobNames`, and `jobStatuses` are query parameters that can -// be specified when listing transfer jobs. -message ListTransferJobsRequest { - // Required. A list of query parameters specified as JSON text in the form of: - // `{"projectId":"my_project_id", - // "jobNames":["jobid1","jobid2",...], - // "jobStatuses":["status1","status2",...]}` - // - // Since `jobNames` and `jobStatuses` support multiple values, their values - // must be specified with array notation. `projectId` is required. - // `jobNames` and `jobStatuses` are optional. The valid values for - // `jobStatuses` are case-insensitive: - // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED], - // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and - // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. - string filter = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list page size. The max allowed value is 256. - int32 page_size = 4; - - // The list page token. - string page_token = 5; -} - -// Response from ListTransferJobs. -message ListTransferJobsResponse { - // A list of transfer jobs. - repeated TransferJob transfer_jobs = 1; - - // The list next page token. - string next_page_token = 2; -} - -// Request passed to PauseTransferOperation. -message PauseTransferOperationRequest { - // Required. The name of the transfer operation. - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request passed to ResumeTransferOperation. -message ResumeTransferOperationRequest { - // Required. The name of the transfer operation. - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request passed to RunTransferJob. -message RunTransferJobRequest { - // Required. The name of the transfer job. - string job_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID of the Google Cloud project that owns the transfer - // job. - string project_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies the request passed to CreateAgentPool. -message CreateAgentPoolRequest { - // Required. The ID of the Google Cloud project that owns the - // agent pool. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The agent pool to create. - AgentPool agent_pool = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID of the agent pool to create. - // - // The `agent_pool_id` must meet the following requirements: - // - // * Length of 128 characters or less. - // * Not start with the string `goog`. - // * Start with a lowercase ASCII character, followed by: - // * Zero or more: lowercase Latin alphabet characters, numerals, - // hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). - // * One or more numerals or lowercase ASCII characters. - // - // As expressed by the regular expression: - // `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. - string agent_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies the request passed to UpdateAgentPool. -message UpdateAgentPoolRequest { - // Required. The agent pool to update. `agent_pool` is expected to specify following - // fields: - // - // * [name][google.storagetransfer.v1.AgentPool.name] - // - // * [display_name][google.storagetransfer.v1.AgentPool.display_name] - // - // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] - // An `UpdateAgentPoolRequest` with any other fields is rejected - // with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - AgentPool agent_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // The [field mask] - // (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) - // of the fields in `agentPool` to update in this request. - // The following `agentPool` fields can be updated: - // - // * [display_name][google.storagetransfer.v1.AgentPool.display_name] - // - // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] - google.protobuf.FieldMask update_mask = 2; -} - -// Specifies the request passed to GetAgentPool. -message GetAgentPoolRequest { - // Required. The name of the agent pool to get. - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies the request passed to DeleteAgentPool. -message DeleteAgentPoolRequest { - // Required. The name of the agent pool to delete. - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The request passed to ListAgentPools. -message ListAgentPoolsRequest { - // Required. The ID of the Google Cloud project that owns the job. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // An optional list of query parameters specified as JSON text in the - // form of: - // - // `{"agentPoolNames":["agentpool1","agentpool2",...]}` - // - // Since `agentPoolNames` support multiple values, its values must be - // specified with array notation. When the filter is either empty or not - // provided, the list returns all agent pools for the project. - string filter = 2; - - // The list page size. The max allowed value is `256`. - int32 page_size = 3; - - // The list page token. - string page_token = 4; -} - -// Response from ListAgentPools. -message ListAgentPoolsResponse { - // A list of agent pools. - repeated AgentPool agent_pools = 1; - - // The list next page token. - string next_page_token = 2; -} diff --git a/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto b/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto deleted file mode 100644 index cfb87a6..0000000 --- a/owl-bot-staging/v1/protos/google/storagetransfer/v1/transfer_types.proto +++ /dev/null @@ -1,1121 +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.storagetransfer.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/code.proto"; -import "google/type/date.proto"; -import "google/type/timeofday.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.StorageTransfer.V1"; -option go_package = "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer"; -option java_outer_classname = "TransferTypes"; -option java_package = "com.google.storagetransfer.v1.proto"; -option php_namespace = "Google\\Cloud\\StorageTransfer\\V1"; -option ruby_package = "Google::Cloud::StorageTransfer::V1"; - -// Google service account -message GoogleServiceAccount { - // Email address of the service account. - string account_email = 1; - - // Unique identifier for the service account. - string subject_id = 2; -} - -// AWS access key (see -// [AWS Security -// Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). -// -// For information on our data retention policy for user credentials, see -// [User credentials](/storage-transfer/docs/data-retention#user-credentials). -message AwsAccessKey { - // Required. AWS access key ID. - string access_key_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. AWS secret access key. This field is not returned in RPC - // responses. - string secret_access_key = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Azure credentials -// -// For information on our data retention policy for user credentials, see -// [User credentials](/storage-transfer/docs/data-retention#user-credentials). -message AzureCredentials { - // Required. Azure shared access signature (SAS). - // - // For more information about SAS, see - // [Grant limited access to Azure Storage resources using shared access - // signatures - // (SAS)](https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview). - string sas_token = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Conditions that determine which objects are transferred. Applies only -// to Cloud Data Sources such as S3, Azure, and Cloud Storage. -// -// The "last modification time" refers to the time of the -// last change to the object's content or metadata — specifically, this is -// the `updated` property of Cloud Storage objects, the `LastModified` field -// of S3 objects, and the `Last-Modified` header of Azure blobs. -// -// Transfers with a [PosixFilesystem][google.storagetransfer.v1.PosixFilesystem] source or destination don't support -// `ObjectConditions`. -message ObjectConditions { - // Ensures that objects are not transferred until a specific minimum time - // has elapsed after the "last modification time". When a - // [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a "last modification time" are - // transferred only if the elapsed time between the - // [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the `TransferOperation` - // and the "last modification time" of the object is equal to or - // greater than the value of min_time_elapsed_since_last_modification`. - // Objects that do not have a "last modification time" are also transferred. - google.protobuf.Duration min_time_elapsed_since_last_modification = 1; - - // Ensures that objects are not transferred if a specific maximum time - // has elapsed since the "last modification time". - // When a [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a - // "last modification time" are transferred only if the elapsed time - // between the [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the - // `TransferOperation`and the "last modification time" of the object - // is less than the value of max_time_elapsed_since_last_modification`. - // Objects that do not have a "last modification time" are also transferred. - google.protobuf.Duration max_time_elapsed_since_last_modification = 2; - - // If you specify `include_prefixes`, Storage Transfer Service uses the items - // in the `include_prefixes` array to determine which objects to include in a - // transfer. Objects must start with one of the matching `include_prefixes` - // for inclusion in the transfer. If [exclude_prefixes][google.storagetransfer.v1.ObjectConditions.exclude_prefixes] is specified, - // objects must not start with any of the `exclude_prefixes` specified for - // inclusion in the transfer. - // - // The following are requirements of `include_prefixes`: - // - // * Each include-prefix can contain any sequence of Unicode characters, to - // a max length of 1024 bytes when UTF8-encoded, and must not contain - // Carriage Return or Line Feed characters. Wildcard matching and regular - // expression matching are not supported. - // - // * Each include-prefix must omit the leading slash. For example, to - // include the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, - // specify the include-prefix as `logs/y=2015/requests.gz`. - // - // * None of the include-prefix values can be empty, if specified. - // - // * Each include-prefix must include a distinct portion of the object - // namespace. No include-prefix may be a prefix of another - // include-prefix. - // - // The max size of `include_prefixes` is 1000. - // - // For more information, see [Filtering objects from - // transfers](/storage-transfer/docs/filtering-objects-from-transfers). - repeated string include_prefixes = 3; - - // If you specify `exclude_prefixes`, Storage Transfer Service uses the items - // in the `exclude_prefixes` array to determine which objects to exclude from - // a transfer. Objects must not start with one of the matching - // `exclude_prefixes` for inclusion in a transfer. - // - // The following are requirements of `exclude_prefixes`: - // - // * Each exclude-prefix can contain any sequence of Unicode characters, to - // a max length of 1024 bytes when UTF8-encoded, and must not contain - // Carriage Return or Line Feed characters. Wildcard matching and regular - // expression matching are not supported. - // - // * Each exclude-prefix must omit the leading slash. For example, to - // exclude the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, - // specify the exclude-prefix as `logs/y=2015/requests.gz`. - // - // * None of the exclude-prefix values can be empty, if specified. - // - // * Each exclude-prefix must exclude a distinct portion of the object - // namespace. No exclude-prefix may be a prefix of another - // exclude-prefix. - // - // * If [include_prefixes][google.storagetransfer.v1.ObjectConditions.include_prefixes] is specified, then each exclude-prefix must - // start with the value of a path explicitly included by `include_prefixes`. - // - // The max size of `exclude_prefixes` is 1000. - // - // For more information, see [Filtering objects from - // transfers](/storage-transfer/docs/filtering-objects-from-transfers). - repeated string exclude_prefixes = 4; - - // If specified, only objects with a "last modification time" on or after - // this timestamp and objects that don't have a "last modification time" are - // transferred. - // - // The `last_modified_since` and `last_modified_before` fields can be used - // together for chunked data processing. For example, consider a script that - // processes each day's worth of data at a time. For that you'd set each - // of the fields as follows: - // - // * `last_modified_since` to the start of the day - // - // * `last_modified_before` to the end of the day - google.protobuf.Timestamp last_modified_since = 5; - - // If specified, only objects with a "last modification time" before this - // timestamp and objects that don't have a "last modification time" are - // transferred. - google.protobuf.Timestamp last_modified_before = 6; -} - -// In a GcsData resource, an object's name is the Cloud Storage object's -// name and its "last modification time" refers to the object's `updated` -// property of Cloud Storage objects, which changes when the content or the -// metadata of the object is updated. -message GcsData { - // Required. Cloud Storage bucket name. Must meet - // [Bucket Name Requirements](/storage/docs/naming#requirements). - string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Root path to transfer objects. - // - // Must be an empty string or full path name that ends with a '/'. This field - // is treated as an object prefix. As such, it should generally not begin with - // a '/'. - // - // The root path value must meet - // [Object Name Requirements](/storage/docs/naming#objectnames). - string path = 3; -} - -// An AwsS3Data resource can be a data source, but not a data sink. -// In an AwsS3Data resource, an object's name is the S3 object's key name. -message AwsS3Data { - // Required. S3 Bucket name (see - // [Creating a - // bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). - string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Input only. AWS access key used to sign the API requests to the AWS S3 bucket. - // Permissions on the bucket must be granted to the access ID of the AWS - // access key. - // - // For information on our data retention policy for user credentials, see - // [User credentials](/storage-transfer/docs/data-retention#user-credentials). - AwsAccessKey aws_access_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; - - // Root path to transfer objects. - // - // Must be an empty string or full path name that ends with a '/'. This field - // is treated as an object prefix. As such, it should generally not begin with - // a '/'. - string path = 3; - - // The Amazon Resource Name (ARN) of the role to support temporary - // credentials via `AssumeRoleWithWebIdentity`. For more information about - // ARNs, see [IAM - // ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). - // - // When a role ARN is provided, Transfer Service fetches temporary - // credentials for the session using a `AssumeRoleWithWebIdentity` call for - // the provided role using the [GoogleServiceAccount][google.storagetransfer.v1.GoogleServiceAccount] for this project. - string role_arn = 4; -} - -// An AzureBlobStorageData resource can be a data source, but not a data sink. -// An AzureBlobStorageData resource represents one Azure container. The storage -// account determines the [Azure -// endpoint](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints). -// In an AzureBlobStorageData resource, a blobs's name is the [Azure Blob -// Storage blob's key -// name](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names). -message AzureBlobStorageData { - // Required. The name of the Azure Storage account. - string storage_account = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. Credentials used to authenticate API requests to Azure. - // - // For information on our data retention policy for user credentials, see - // [User credentials](/storage-transfer/docs/data-retention#user-credentials). - AzureCredentials azure_credentials = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; - - // Required. The container to transfer from the Azure Storage account. - string container = 4 [(google.api.field_behavior) = REQUIRED]; - - // Root path to transfer objects. - // - // Must be an empty string or full path name that ends with a '/'. This field - // is treated as an object prefix. As such, it should generally not begin with - // a '/'. - string path = 5; -} - -// An HttpData resource specifies a list of objects on the web to be transferred -// over HTTP. The information of the objects to be transferred is contained in -// a file referenced by a URL. The first line in the file must be -// `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent -// lines specify the information of the list of objects, one object per list -// entry. Each entry has the following tab-delimited fields: -// -// * **HTTP URL** — The location of the object. -// -// * **Length** — The size of the object in bytes. -// -// * **MD5** — The base64-encoded MD5 hash of the object. -// -// For an example of a valid TSV file, see -// [Transferring data from -// URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). -// -// When transferring data based on a URL list, keep the following in mind: -// -// * When an object located at `http(s)://hostname:port/` is -// transferred to a data sink, the name of the object at the data sink is -// `/`. -// -// * If the specified size of an object does not match the actual size of the -// object fetched, the object is not transferred. -// -// * If the specified MD5 does not match the MD5 computed from the transferred -// bytes, the object transfer fails. -// -// * Ensure that each URL you specify is publicly accessible. For -// example, in Cloud Storage you can -// [share an object publicly] -// (/storage/docs/cloud-console#_sharingdata) and get a link to it. -// -// * Storage Transfer Service obeys `robots.txt` rules and requires the source -// HTTP server to support `Range` requests and to return a `Content-Length` -// header in each response. -// -// * [ObjectConditions][google.storagetransfer.v1.ObjectConditions] have no effect when filtering objects to transfer. -message HttpData { - // Required. The URL that points to the file that stores the object list - // entries. This file must allow public access. Currently, only URLs with - // HTTP and HTTPS schemes are supported. - string list_url = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A POSIX filesystem resource. -message PosixFilesystem { - // Root directory path to the filesystem. - string root_directory = 1; -} - -// Represents an On-Premises Agent pool. -message AgentPool { - option (google.api.resource) = { - type: "storagetransfer.googleapis.com/agentPools" - pattern: "projects/{project_id}/agentPools/{agent_pool_id}" - }; - - // The state of an AgentPool. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // This is an initialization state. During this stage, the resources such as - // Pub/Sub topics are allocated for the AgentPool. - CREATING = 1; - - // Determines that the AgentPool is created for use. At this state, Agents - // can join the AgentPool and participate in the transfer jobs in that pool. - CREATED = 2; - - // Determines that the AgentPool deletion has been initiated, and all the - // resources are scheduled to be cleaned up and freed. - DELETING = 3; - } - - // Specifies a bandwidth limit for an agent pool. - message BandwidthLimit { - // Bandwidth rate in megabytes per second, distributed across all the agents - // in the pool. - int64 limit_mbps = 1; - } - - // Required. Specifies a unique string that identifies the agent pool. - // - // Format: `projects/{project_id}/agentPools/{agent_pool_id}` - string name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Specifies the client-specified AgentPool description. - string display_name = 3; - - // Output only. Specifies the state of the AgentPool. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Specifies the bandwidth limit details. If this field is unspecified, the - // default value is set as 'No Limit'. - BandwidthLimit bandwidth_limit = 5; -} - -// TransferOptions define the actions to be performed on objects in a transfer. -message TransferOptions { - // Specifies when to overwrite an object in the sink when an object with - // matching name is found in the source. - enum OverwriteWhen { - // Indicate the option is not set. - OVERWRITE_WHEN_UNSPECIFIED = 0; - - // Overwrite destination object with source if the two objects are - // different. - DIFFERENT = 1; - - // Never overwrite destination object. - NEVER = 2; - - // Always overwrite destination object. - ALWAYS = 3; - } - - // When to overwrite objects that already exist in the sink. The default is - // that only objects that are different from the source are ovewritten. If - // true, all objects in the sink whose name matches an object in the source - // are overwritten with the source object. - bool overwrite_objects_already_existing_in_sink = 1; - - // Whether objects that exist only in the sink should be deleted. - // - // **Note:** This option and [delete_objects_from_source_after_transfer][google.storagetransfer.v1.TransferOptions.delete_objects_from_source_after_transfer] are - // mutually exclusive. - bool delete_objects_unique_in_sink = 2; - - // Whether objects should be deleted from the source after they are - // transferred to the sink. - // - // **Note:** This option and [delete_objects_unique_in_sink][google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] are mutually - // exclusive. - bool delete_objects_from_source_after_transfer = 3; - - // When to overwrite objects that already exist in the sink. If not set - // overwrite behavior is determined by - // [overwrite_objects_already_existing_in_sink][google.storagetransfer.v1.TransferOptions.overwrite_objects_already_existing_in_sink]. - OverwriteWhen overwrite_when = 4; - - // Represents the selected metadata options for a transfer job. This feature - // is in Preview. - MetadataOptions metadata_options = 5; -} - -// Configuration for running a transfer. -message TransferSpec { - // The write sink for the data. - oneof data_sink { - // A Cloud Storage data sink. - GcsData gcs_data_sink = 4; - - // A POSIX Filesystem data sink. - PosixFilesystem posix_data_sink = 13; - } - - // The read source of the data. - oneof data_source { - // A Cloud Storage data source. - GcsData gcs_data_source = 1; - - // An AWS S3 data source. - AwsS3Data aws_s3_data_source = 2; - - // An HTTP URL data source. - HttpData http_data_source = 3; - - // A POSIX Filesystem data source. - PosixFilesystem posix_data_source = 14; - - // An Azure Blob Storage data source. - AzureBlobStorageData azure_blob_storage_data_source = 8; - } - - // Represents a supported data container type which is required for transfer - // jobs which needs a data source, a data sink and an intermediate location to - // transfer data through. This is validated on TransferJob creation. - oneof intermediate_data_location { - // Cloud Storage intermediate data location. - GcsData gcs_intermediate_data_location = 16; - } - - // Only objects that satisfy these object conditions are included in the set - // of data source and data sink objects. Object conditions based on - // objects' "last modification time" do not exclude objects in a data sink. - ObjectConditions object_conditions = 5; - - // If the option - // [delete_objects_unique_in_sink][google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] - // is `true` and time-based object conditions such as 'last modification time' - // are specified, the request fails with an - // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. - TransferOptions transfer_options = 6; - - // A manifest file provides a list of objects to be transferred from the data - // source. This field points to the location of the manifest file. - // Otherwise, the entire source bucket is used. ObjectConditions still apply. - TransferManifest transfer_manifest = 15; - - // Specifies the agent pool name associated with the posix data source. When - // unspecified, the default name is used. - string source_agent_pool_name = 17; - - // Specifies the agent pool name associated with the posix data sink. When - // unspecified, the default name is used. - string sink_agent_pool_name = 18; -} - -// Specifies the metadata options for running a transfer. -message MetadataOptions { - // Whether symlinks should be skipped or preserved during a transfer job. - enum Symlink { - // Symlink behavior is unspecified. - SYMLINK_UNSPECIFIED = 0; - - // Do not preserve symlinks during a transfer job. - SYMLINK_SKIP = 1; - - // Preserve symlinks during a transfer job. - SYMLINK_PRESERVE = 2; - } - - // Options for handling file mode attribute. - enum Mode { - // Mode behavior is unspecified. - MODE_UNSPECIFIED = 0; - - // Do not preserve mode during a transfer job. - MODE_SKIP = 1; - - // Preserve mode during a transfer job. - MODE_PRESERVE = 2; - } - - // Options for handling file GID attribute. - enum GID { - // GID behavior is unspecified. - GID_UNSPECIFIED = 0; - - // Do not preserve GID during a transfer job. - GID_SKIP = 1; - - // Preserve GID during a transfer job. - GID_NUMBER = 2; - } - - // Options for handling file UID attribute. - enum UID { - // UID behavior is unspecified. - UID_UNSPECIFIED = 0; - - // Do not preserve UID during a transfer job. - UID_SKIP = 1; - - // Preserve UID during a transfer job. - UID_NUMBER = 2; - } - - // Options for handling Cloud Storage object ACLs. - enum Acl { - // ACL behavior is unspecified. - ACL_UNSPECIFIED = 0; - - // Use the destination bucket's default object ACLS, if applicable. - ACL_DESTINATION_BUCKET_DEFAULT = 1; - - // Preserve the object's original ACLs. This requires the service account - // to have `storage.objects.getIamPolicy` permission for the source object. - // [Uniform bucket-level - // access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) - // must not be enabled on either the source or destination buckets. - ACL_PRESERVE = 2; - } - - // Options for handling Google Cloud Storage object storage class. - enum StorageClass { - // Storage class behavior is unspecified. - STORAGE_CLASS_UNSPECIFIED = 0; - - // Use the destination bucket's default storage class. - STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1; - - // Preserve the object's original storage class. This is only supported for - // transfers from Google Cloud Storage buckets. - STORAGE_CLASS_PRESERVE = 2; - - // Set the storage class to STANDARD. - STORAGE_CLASS_STANDARD = 3; - - // Set the storage class to NEARLINE. - STORAGE_CLASS_NEARLINE = 4; - - // Set the storage class to COLDLINE. - STORAGE_CLASS_COLDLINE = 5; - - // Set the storage class to ARCHIVE. - STORAGE_CLASS_ARCHIVE = 6; - } - - // Options for handling temporary holds for Google Cloud Storage objects. - enum TemporaryHold { - // Temporary hold behavior is unspecified. - TEMPORARY_HOLD_UNSPECIFIED = 0; - - // Do not set a temporary hold on the destination object. - TEMPORARY_HOLD_SKIP = 1; - - // Preserve the object's original temporary hold status. - TEMPORARY_HOLD_PRESERVE = 2; - } - - // Options for handling the KmsKey setting for Google Cloud Storage objects. - enum KmsKey { - // KmsKey behavior is unspecified. - KMS_KEY_UNSPECIFIED = 0; - - // Use the destination bucket's default encryption settings. - KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1; - - // Preserve the object's original Cloud KMS customer-managed encryption key - // (CMEK) if present. Objects that do not use a Cloud KMS encryption key - // will be encrypted using the destination bucket's encryption settings. - KMS_KEY_PRESERVE = 2; - } - - // Options for handling `timeCreated` metadata for Google Cloud Storage - // objects. - enum TimeCreated { - // TimeCreated behavior is unspecified. - TIME_CREATED_UNSPECIFIED = 0; - - // Do not preserve the `timeCreated` metadata from the source object. - TIME_CREATED_SKIP = 1; - - // Preserves the source object's `timeCreated` metadata in the `customTime` - // field in the destination object. Note that any value stored in the - // source object's `customTime` field will not be propagated to the - // destination object. - TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2; - } - - // Specifies how symlinks should be handled by the transfer. By default, - // symlinks are not preserved. Only applicable to transfers involving - // POSIX file systems, and ignored for other transfers. - Symlink symlink = 1; - - // Specifies how each file's mode attribute should be handled by the transfer. - // By default, mode is not preserved. Only applicable to transfers involving - // POSIX file systems, and ignored for other transfers. - Mode mode = 2; - - // Specifies how each file's POSIX group ID (GID) attribute should be handled - // by the transfer. By default, GID is not preserved. Only applicable to - // transfers involving POSIX file systems, and ignored for other transfers. - GID gid = 3; - - // Specifies how each file's POSIX user ID (UID) attribute should be handled - // by the transfer. By default, UID is not preserved. Only applicable to - // transfers involving POSIX file systems, and ignored for other transfers. - UID uid = 4; - - // Specifies how each object's ACLs should be preserved for transfers between - // Google Cloud Storage buckets. If unspecified, the default behavior is the - // same as ACL_DESTINATION_BUCKET_DEFAULT. - Acl acl = 5; - - // Specifies the storage class to set on objects being transferred to Google - // Cloud Storage buckets. If unspecified, the default behavior is the same as - // [STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.StorageClass.STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT]. - StorageClass storage_class = 6; - - // Specifies how each object's temporary hold status should be preserved for - // transfers between Google Cloud Storage buckets. If unspecified, the - // default behavior is the same as - // [TEMPORARY_HOLD_PRESERVE][google.storagetransfer.v1.MetadataOptions.TemporaryHold.TEMPORARY_HOLD_PRESERVE]. - TemporaryHold temporary_hold = 7; - - // Specifies how each object's Cloud KMS customer-managed encryption key - // (CMEK) is preserved for transfers between Google Cloud Storage buckets. If - // unspecified, the default behavior is the same as - // [KMS_KEY_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.KmsKey.KMS_KEY_DESTINATION_BUCKET_DEFAULT]. - KmsKey kms_key = 8; - - // Specifies how each object's `timeCreated` metadata is preserved for - // transfers between Google Cloud Storage buckets. If unspecified, the - // default behavior is the same as - // [TIME_CREATED_SKIP][google.storagetransfer.v1.MetadataOptions.TimeCreated.TIME_CREATED_SKIP]. - TimeCreated time_created = 9; -} - -// Specifies where the manifest is located. -message TransferManifest { - // Specifies the path to the manifest in Cloud Storage. The Google-managed - // service account for the transfer must have `storage.objects.get` - // permission for this object. An example path is - // `gs://bucket_name/path/manifest.csv`. - string location = 1; -} - -// Transfers can be scheduled to recur or to run just once. -message Schedule { - // Required. The start date of a transfer. Date boundaries are determined - // relative to UTC time. If `schedule_start_date` and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] - // are in the past relative to the job's creation time, the transfer starts - // the day after you schedule the transfer request. - // - // **Note:** When starting jobs at or near midnight UTC it is possible that - // a job starts later than expected. For example, if you send an outbound - // request on June 1 one millisecond prior to midnight UTC and the Storage - // Transfer Service server receives the request on June 2, then it creates - // a TransferJob with `schedule_start_date` set to June 2 and a - // `start_time_of_day` set to midnight UTC. The first scheduled - // [TransferOperation][google.storagetransfer.v1.TransferOperation] takes place on June 3 at midnight UTC. - google.type.Date schedule_start_date = 1 [(google.api.field_behavior) = REQUIRED]; - - // The last day a transfer runs. Date boundaries are determined relative to - // UTC time. A job runs once per 24 hours within the following guidelines: - // - // * If `schedule_end_date` and [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] are the same and in - // the future relative to UTC, the transfer is executed only one time. - // * If `schedule_end_date` is later than `schedule_start_date` and - // `schedule_end_date` is in the future relative to UTC, the job runs each - // day at [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] through `schedule_end_date`. - google.type.Date schedule_end_date = 2; - - // The time in UTC that a transfer job is scheduled to run. Transfers may - // start later than this time. - // - // If `start_time_of_day` is not specified: - // - // * One-time transfers run immediately. - // * Recurring transfers run immediately, and each day at midnight UTC, - // through [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date]. - // - // If `start_time_of_day` is specified: - // - // * One-time transfers run at the specified time. - // * Recurring transfers run at the specified time each day, through - // `schedule_end_date`. - google.type.TimeOfDay start_time_of_day = 3; - - // The time in UTC that no further transfer operations are scheduled. Combined - // with [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date], `end_time_of_day` specifies the end date and - // time for starting new transfer operations. This field must be greater than - // or equal to the timestamp corresponding to the combintation of - // [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day], and is subject to the - // following: - // - // * If `end_time_of_day` is not set and `schedule_end_date` is set, then - // a default value of `23:59:59` is used for `end_time_of_day`. - // - // * If `end_time_of_day` is set and `schedule_end_date` is not set, then - // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] is returned. - google.type.TimeOfDay end_time_of_day = 4; - - // Interval between the start of each scheduled TransferOperation. If - // unspecified, the default value is 24 hours. This value may not be less than - // 1 hour. - google.protobuf.Duration repeat_interval = 5; -} - -// This resource represents the configuration of a transfer job that runs -// periodically. -message TransferJob { - // The status of the transfer job. - enum Status { - // Zero is an illegal value. - STATUS_UNSPECIFIED = 0; - - // New transfers are performed based on the schedule. - ENABLED = 1; - - // New transfers are not scheduled. - DISABLED = 2; - - // This is a soft delete state. After a transfer job is set to this - // state, the job and all the transfer executions are subject to - // garbage collection. Transfer jobs become eligible for garbage collection - // 30 days after their status is set to `DELETED`. - DELETED = 3; - } - - // A unique name (within the transfer project) assigned when the job is - // created. If this field is empty in a CreateTransferJobRequest, Storage - // Transfer Service assigns a unique name. Otherwise, the specified name - // is used as the unique name for this job. - // - // If the specified name is in use by a job, the creation request fails with - // an [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - // - // This name must start with `"transferJobs/"` prefix and end with a letter or - // a number, and should be no more than 128 characters. For transfers - // involving PosixFilesystem, this name must start with `transferJobs/OPI` - // specifically. For all other transfer types, this name must not start with - // `transferJobs/OPI`. - // - // Non-PosixFilesystem example: - // `"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"` - // - // PosixFilesystem example: - // `"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"` - // - // Applications must not rely on the enforcement of naming requirements - // involving OPI. - // - // Invalid job names fail with an - // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. - string name = 1; - - // A description provided by the user for the job. Its max length is 1024 - // bytes when Unicode-encoded. - string description = 2; - - // The ID of the Google Cloud project that owns the job. - string project_id = 3; - - // Transfer specification. - TransferSpec transfer_spec = 4; - - // Notification configuration. This is not supported for transfers involving - // PosixFilesystem. - NotificationConfig notification_config = 11; - - // Logging configuration. - LoggingConfig logging_config = 14; - - // Specifies schedule for the transfer job. - // This is an optional field. When the field is not set, the job never - // executes a transfer, unless you invoke RunTransferJob or update the job to - // have a non-empty schedule. - Schedule schedule = 5; - - // Status of the job. This value MUST be specified for - // `CreateTransferJobRequests`. - // - // **Note:** The effect of the new job status takes place during a subsequent - // job run. For example, if you change the job status from - // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED] to [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and an operation - // spawned by the transfer is running, the status change would not affect the - // current operation. - Status status = 6; - - // Output only. The time that the transfer job was created. - google.protobuf.Timestamp creation_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time that the transfer job was last modified. - google.protobuf.Timestamp last_modification_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time that the transfer job was deleted. - google.protobuf.Timestamp deletion_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The name of the most recently started TransferOperation of this JobConfig. - // Present if a TransferOperation has been created for this JobConfig. - string latest_operation_name = 12; -} - -// An entry describing an error that has occurred. -message ErrorLogEntry { - // Required. A URL that refers to the target (a data source, a data sink, - // or an object) with which the error is associated. - string url = 1 [(google.api.field_behavior) = REQUIRED]; - - // A list of messages that carry the error details. - repeated string error_details = 3; -} - -// A summary of errors by error code, plus a count and sample error log -// entries. -message ErrorSummary { - // Required. - google.rpc.Code error_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Count of this type of error. - int64 error_count = 2 [(google.api.field_behavior) = REQUIRED]; - - // Error samples. - // - // At most 5 error log entries are recorded for a given - // error code for a single transfer operation. - repeated ErrorLogEntry error_log_entries = 3; -} - -// A collection of counters that report the progress of a transfer operation. -message TransferCounters { - // Objects found in the data source that are scheduled to be transferred, - // excluding any that are filtered based on object conditions or skipped due - // to sync. - int64 objects_found_from_source = 1; - - // Bytes found in the data source that are scheduled to be transferred, - // excluding any that are filtered based on object conditions or skipped due - // to sync. - int64 bytes_found_from_source = 2; - - // Objects found only in the data sink that are scheduled to be deleted. - int64 objects_found_only_from_sink = 3; - - // Bytes found only in the data sink that are scheduled to be deleted. - int64 bytes_found_only_from_sink = 4; - - // Objects in the data source that are not transferred because they already - // exist in the data sink. - int64 objects_from_source_skipped_by_sync = 5; - - // Bytes in the data source that are not transferred because they already - // exist in the data sink. - int64 bytes_from_source_skipped_by_sync = 6; - - // Objects that are copied to the data sink. - int64 objects_copied_to_sink = 7; - - // Bytes that are copied to the data sink. - int64 bytes_copied_to_sink = 8; - - // Objects that are deleted from the data source. - int64 objects_deleted_from_source = 9; - - // Bytes that are deleted from the data source. - int64 bytes_deleted_from_source = 10; - - // Objects that are deleted from the data sink. - int64 objects_deleted_from_sink = 11; - - // Bytes that are deleted from the data sink. - int64 bytes_deleted_from_sink = 12; - - // Objects in the data source that failed to be transferred or that failed - // to be deleted after being transferred. - int64 objects_from_source_failed = 13; - - // Bytes in the data source that failed to be transferred or that failed to - // be deleted after being transferred. - int64 bytes_from_source_failed = 14; - - // Objects that failed to be deleted from the data sink. - int64 objects_failed_to_delete_from_sink = 15; - - // Bytes that failed to be deleted from the data sink. - int64 bytes_failed_to_delete_from_sink = 16; - - // For transfers involving PosixFilesystem only. - // - // Number of directories found while listing. For example, if the root - // directory of the transfer is `base/` and there are two other directories, - // `a/` and `b/` under this directory, the count after listing `base/`, - // `base/a/` and `base/b/` is 3. - int64 directories_found_from_source = 17; - - // For transfers involving PosixFilesystem only. - // - // Number of listing failures for each directory found at the source. - // Potential failures when listing a directory include permission failure or - // block failure. If listing a directory fails, no files in the directory are - // transferred. - int64 directories_failed_to_list_from_source = 18; - - // For transfers involving PosixFilesystem only. - // - // Number of successful listings for each directory found at the source. - int64 directories_successfully_listed_from_source = 19; - - // Number of successfully cleaned up intermediate objects. - int64 intermediate_objects_cleaned_up = 22; - - // Number of intermediate objects failed cleaned up. - int64 intermediate_objects_failed_cleaned_up = 23; -} - -// Specification to configure notifications published to Pub/Sub. -// Notifications are published to the customer-provided topic using the -// following `PubsubMessage.attributes`: -// -// * `"eventType"`: one of the [EventType][google.storagetransfer.v1.NotificationConfig.EventType] values -// * `"payloadFormat"`: one of the [PayloadFormat][google.storagetransfer.v1.NotificationConfig.PayloadFormat] values -// * `"projectId"`: the [project_id][google.storagetransfer.v1.TransferOperation.project_id] of the -// `TransferOperation` -// * `"transferJobName"`: the -// [transfer_job_name][google.storagetransfer.v1.TransferOperation.transfer_job_name] of the -// `TransferOperation` -// * `"transferOperationName"`: the [name][google.storagetransfer.v1.TransferOperation.name] of the -// `TransferOperation` -// -// The `PubsubMessage.data` contains a [TransferOperation][google.storagetransfer.v1.TransferOperation] resource -// formatted according to the specified `PayloadFormat`. -message NotificationConfig { - // Enum for specifying event types for which notifications are to be - // published. - // - // Additional event types may be added in the future. Clients should either - // safely ignore unrecognized event types or explicitly specify which event - // types they are prepared to accept. - enum EventType { - // Illegal value, to avoid allowing a default. - EVENT_TYPE_UNSPECIFIED = 0; - - // `TransferOperation` completed with status - // [SUCCESS][google.storagetransfer.v1.TransferOperation.Status.SUCCESS]. - TRANSFER_OPERATION_SUCCESS = 1; - - // `TransferOperation` completed with status - // [FAILED][google.storagetransfer.v1.TransferOperation.Status.FAILED]. - TRANSFER_OPERATION_FAILED = 2; - - // `TransferOperation` completed with status - // [ABORTED][google.storagetransfer.v1.TransferOperation.Status.ABORTED]. - TRANSFER_OPERATION_ABORTED = 3; - } - - // Enum for specifying the format of a notification message's payload. - enum PayloadFormat { - // Illegal value, to avoid allowing a default. - PAYLOAD_FORMAT_UNSPECIFIED = 0; - - // No payload is included with the notification. - NONE = 1; - - // `TransferOperation` is [formatted as a JSON - // response](https://developers.google.com/protocol-buffers/docs/proto3#json), - // in application/json. - JSON = 2; - } - - // Required. The `Topic.name` of the Pub/Sub topic to which to publish - // notifications. Must be of the format: `projects/{project}/topics/{topic}`. - // Not matching this format results in an - // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. - string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; - - // Event types for which a notification is desired. If empty, send - // notifications for all event types. - repeated EventType event_types = 2; - - // Required. The desired format of the notification message payloads. - PayloadFormat payload_format = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies the logging behavior for transfer operations. -// -// For cloud-to-cloud transfers, logs are sent to Cloud Logging. See -// [Read transfer -// logs](https://cloud.google.com/storage-transfer/docs/read-transfer-logs) for -// details. -// -// For transfers to or from a POSIX file system, logs are stored in the -// Cloud Storage bucket that is the source or sink of the transfer. -// See [Managing Transfer for on-premises jobs] -// (https://cloud.google.com/storage-transfer/docs/managing-on-prem-jobs#viewing-logs) -// for details. -message LoggingConfig { - // Loggable actions. - enum LoggableAction { - // Default value. This value is unused. - LOGGABLE_ACTION_UNSPECIFIED = 0; - - // Listing objects in a bucket. - FIND = 1; - - // Deleting objects at the source or the destination. - DELETE = 2; - - // Copying objects to Google Cloud Storage. - COPY = 3; - } - - // Loggable action states. - enum LoggableActionState { - // Default value. This value is unused. - LOGGABLE_ACTION_STATE_UNSPECIFIED = 0; - - // `LoggableAction` completed successfully. `SUCCEEDED` actions are - // logged as [INFO][google.logging.type.LogSeverity.INFO]. - SUCCEEDED = 1; - - // `LoggableAction` terminated in an error state. `FAILED` actions are - // logged as [ERROR][google.logging.type.LogSeverity.ERROR]. - FAILED = 2; - } - - // Specifies the actions to be logged. If empty, no logs are generated. - // Not supported for transfers with PosixFilesystem data sources; use - // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. - repeated LoggableAction log_actions = 1; - - // States in which `log_actions` are logged. If empty, no logs are generated. - // Not supported for transfers with PosixFilesystem data sources; use - // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. - repeated LoggableActionState log_action_states = 2; - - // For transfers with a PosixFilesystem source, this option enables the Cloud - // Storage transfer logs for this transfer. - bool enable_onprem_gcs_transfer_logs = 3; -} - -// A description of the execution of a transfer. -message TransferOperation { - // The status of a TransferOperation. - enum Status { - // Zero is an illegal value. - STATUS_UNSPECIFIED = 0; - - // In progress. - IN_PROGRESS = 1; - - // Paused. - PAUSED = 2; - - // Completed successfully. - SUCCESS = 3; - - // Terminated due to an unrecoverable failure. - FAILED = 4; - - // Aborted by the user. - ABORTED = 5; - - // Temporarily delayed by the system. No user action is required. - QUEUED = 6; - } - - // A globally unique ID assigned by the system. - string name = 1; - - // The ID of the Google Cloud project that owns the operation. - string project_id = 2; - - // Transfer specification. - TransferSpec transfer_spec = 3; - - // Notification configuration. - NotificationConfig notification_config = 10; - - // Start time of this transfer execution. - google.protobuf.Timestamp start_time = 4; - - // End time of this transfer execution. - google.protobuf.Timestamp end_time = 5; - - // Status of the transfer operation. - Status status = 6; - - // Information about the progress of the transfer operation. - TransferCounters counters = 7; - - // Summarizes errors encountered with sample error log entries. - repeated ErrorSummary error_breakdowns = 8; - - // The name of the transfer job that triggers this transfer operation. - string transfer_job_name = 9; -} diff --git a/owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json b/owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json deleted file mode 100644 index 8bf69ae..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json +++ /dev/null @@ -1,587 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-storagetransfer", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.storagetransfer.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async", - "title": "StorageTransferService getGoogleServiceAccount Sample", - "origin": "API_DEFINITION", - "description": " Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", - "canonical": true, - "file": "storage_transfer_service.get_google_service_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetGoogleServiceAccount", - "fullName": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.storagetransfer.v1.GoogleServiceAccount", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "GetGoogleServiceAccount", - "fullName": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async", - "title": "StorageTransferService createTransferJob Sample", - "origin": "API_DEFINITION", - "description": " Creates a transfer job that runs periodically.", - "canonical": true, - "file": "storage_transfer_service.create_transfer_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", - "async": true, - "parameters": [ - { - "name": "transfer_job", - "type": ".google.storagetransfer.v1.TransferJob" - } - ], - "resultType": ".google.storagetransfer.v1.TransferJob", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "CreateTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async", - "title": "StorageTransferService updateTransferJob Sample", - "origin": "API_DEFINITION", - "description": " Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).", - "canonical": true, - "file": "storage_transfer_service.update_transfer_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", - "async": true, - "parameters": [ - { - "name": "job_name", - "type": "TYPE_STRING" - }, - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "transfer_job", - "type": ".google.storagetransfer.v1.TransferJob" - }, - { - "name": "update_transfer_job_field_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.storagetransfer.v1.TransferJob", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "UpdateTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async", - "title": "StorageTransferService getTransferJob Sample", - "origin": "API_DEFINITION", - "description": " Gets a transfer job.", - "canonical": true, - "file": "storage_transfer_service.get_transfer_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", - "async": true, - "parameters": [ - { - "name": "job_name", - "type": "TYPE_STRING" - }, - { - "name": "project_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.storagetransfer.v1.TransferJob", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "GetTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async", - "title": "StorageTransferService listTransferJobs Sample", - "origin": "API_DEFINITION", - "description": " Lists transfer jobs.", - "canonical": true, - "file": "storage_transfer_service.list_transfer_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTransferJobs", - "fullName": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", - "async": true, - "parameters": [ - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.storagetransfer.v1.ListTransferJobsResponse", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "ListTransferJobs", - "fullName": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async", - "title": "StorageTransferService pauseTransferOperation Sample", - "origin": "API_DEFINITION", - "description": " Pauses a transfer operation.", - "canonical": true, - "file": "storage_transfer_service.pause_transfer_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PauseTransferOperation", - "fullName": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "PauseTransferOperation", - "fullName": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async", - "title": "StorageTransferService resumeTransferOperation Sample", - "origin": "API_DEFINITION", - "description": " Resumes a transfer operation that is paused.", - "canonical": true, - "file": "storage_transfer_service.resume_transfer_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResumeTransferOperation", - "fullName": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "ResumeTransferOperation", - "fullName": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async", - "title": "StorageTransferService runTransferJob Sample", - "origin": "API_DEFINITION", - "description": " Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.", - "canonical": true, - "file": "storage_transfer_service.run_transfer_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", - "async": true, - "parameters": [ - { - "name": "job_name", - "type": "TYPE_STRING" - }, - { - "name": "project_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "RunTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async", - "title": "StorageTransferService createAgentPool Sample", - "origin": "API_DEFINITION", - "description": " Creates an agent pool resource.", - "canonical": true, - "file": "storage_transfer_service.create_agent_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "agent_pool", - "type": ".google.storagetransfer.v1.AgentPool" - }, - { - "name": "agent_pool_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.storagetransfer.v1.AgentPool", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "CreateAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async", - "title": "StorageTransferService updateAgentPool Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing agent pool resource.", - "canonical": true, - "file": "storage_transfer_service.update_agent_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", - "async": true, - "parameters": [ - { - "name": "agent_pool", - "type": ".google.storagetransfer.v1.AgentPool" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.storagetransfer.v1.AgentPool", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "UpdateAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async", - "title": "StorageTransferService getAgentPool Sample", - "origin": "API_DEFINITION", - "description": " Gets an agent pool.", - "canonical": true, - "file": "storage_transfer_service.get_agent_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.storagetransfer.v1.AgentPool", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "GetAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async", - "title": "StorageTransferService listAgentPools Sample", - "origin": "API_DEFINITION", - "description": " Lists agent pools.", - "canonical": true, - "file": "storage_transfer_service.list_agent_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAgentPools", - "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.storagetransfer.v1.ListAgentPoolsResponse", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "ListAgentPools", - "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - }, - { - "regionTag": "storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async", - "title": "StorageTransferService deleteAgentPool Sample", - "origin": "API_DEFINITION", - "description": " Deletes an agent pool.", - "canonical": true, - "file": "storage_transfer_service.delete_agent_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "DeleteAgentPool", - "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", - "service": { - "shortName": "StorageTransferService", - "fullName": "google.storagetransfer.v1.StorageTransferService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js deleted file mode 100644 index 60f7402..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js +++ /dev/null @@ -1,58 +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 -// -// 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(transferJob) { - // [START storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The job to create. - */ - // const transferJob = {} - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callCreateTransferJob() { - // Construct request - const request = { - transferJob, - }; - - // Run request - const response = await storagetransferClient.createTransferJob(request); - console.log(response); - } - - callCreateTransferJob(); - // [END storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js deleted file mode 100644 index 7c588b9..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js +++ /dev/null @@ -1,59 +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 -// -// 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(projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the Google Cloud project that the Google service - * account is associated with. - */ - // const projectId = 'abc123' - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callGetGoogleServiceAccount() { - // Construct request - const request = { - projectId, - }; - - // Run request - const response = await storagetransferClient.getGoogleServiceAccount(request); - console.log(response); - } - - callGetGoogleServiceAccount(); - // [END storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js deleted file mode 100644 index 46ff036..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js +++ /dev/null @@ -1,64 +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 -// -// 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(jobName, projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The job to get. - */ - // const jobName = 'abc123' - /** - * Required. The ID of the Google Cloud project that owns the - * job. - */ - // const projectId = 'abc123' - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callGetTransferJob() { - // Construct request - const request = { - jobName, - projectId, - }; - - // Run request - const response = await storagetransferClient.getTransferJob(request); - console.log(response); - } - - callGetTransferJob(); - // [END storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js deleted file mode 100644 index 09b0a5a..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js +++ /dev/null @@ -1,78 +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 -// -// 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(filter) { - // [START storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. A list of query parameters specified as JSON text in the form of: - * `{"projectId":"my_project_id", - * "jobNames":"jobid1","jobid2",..., - * "jobStatuses":"status1","status2",... }` - * Since `jobNames` and `jobStatuses` support multiple values, their values - * must be specified with array notation. `projectId` is required. - * `jobNames` and `jobStatuses` are optional. The valid values for - * `jobStatuses` are case-insensitive: - * ENABLED google.storagetransfer.v1.TransferJob.Status.ENABLED, - * DISABLED google.storagetransfer.v1.TransferJob.Status.DISABLED, and - * DELETED google.storagetransfer.v1.TransferJob.Status.DELETED. - */ - // const filter = 'abc123' - /** - * The list page size. The max allowed value is 256. - */ - // const pageSize = 1234 - /** - * The list page token. - */ - // const pageToken = 'abc123' - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callListTransferJobs() { - // Construct request - const request = { - filter, - }; - - // Run request - const iterable = await storagetransferClient.listTransferJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTransferJobs(); - // [END storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js deleted file mode 100644 index 8c92715..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js +++ /dev/null @@ -1,58 +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 -// -// 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 storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the transfer operation. - */ - // const name = 'abc123' - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callPauseTransferOperation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await storagetransferClient.pauseTransferOperation(request); - console.log(response); - } - - callPauseTransferOperation(); - // [END storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js deleted file mode 100644 index 826857f..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js +++ /dev/null @@ -1,58 +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 -// -// 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 storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the transfer operation. - */ - // const name = 'abc123' - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callResumeTransferOperation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await storagetransferClient.resumeTransferOperation(request); - console.log(response); - } - - callResumeTransferOperation(); - // [END storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js deleted file mode 100644 index ef1e7da..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js +++ /dev/null @@ -1,65 +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 -// -// 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(jobName, projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the transfer job. - */ - // const jobName = 'abc123' - /** - * Required. The ID of the Google Cloud project that owns the transfer - * job. - */ - // const projectId = 'abc123' - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callRunTransferJob() { - // Construct request - const request = { - jobName, - projectId, - }; - - // Run request - const [operation] = await storagetransferClient.runTransferJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRunTransferJob(); - // [END storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js b/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js deleted file mode 100644 index 161e303..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js +++ /dev/null @@ -1,91 +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 -// -// 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(jobName, projectId, transferJob) { - // [START storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of job to update. - */ - // const jobName = 'abc123' - /** - * Required. The ID of the Google Cloud project that owns the - * job. - */ - // const projectId = 'abc123' - /** - * Required. The job to update. `transferJob` is expected to specify one or more of - * five fields: description google.storagetransfer.v1.TransferJob.description, - * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, - * notification_config google.storagetransfer.v1.TransferJob.notification_config, - * logging_config google.storagetransfer.v1.TransferJob.logging_config, and - * status google.storagetransfer.v1.TransferJob.status. An `UpdateTransferJobRequest` that specifies - * other fields are rejected with the error - * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. Updating a job status - * to DELETED google.storagetransfer.v1.TransferJob.Status.DELETED requires - * `storagetransfer.jobs.delete` permissions. - */ - // const transferJob = {} - /** - * The field mask of the fields in `transferJob` that are to be updated in - * this request. Fields in `transferJob` that can be updated are: - * description google.storagetransfer.v1.TransferJob.description, - * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, - * notification_config google.storagetransfer.v1.TransferJob.notification_config, - * logging_config google.storagetransfer.v1.TransferJob.logging_config, and - * status google.storagetransfer.v1.TransferJob.status. To update the `transfer_spec` of the job, a - * complete transfer specification must be provided. An incomplete - * specification missing any required fields is rejected with the error - * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. - */ - // const updateTransferJobFieldMask = {} - - // Imports the Storagetransfer library - const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; - - // Instantiates a client - const storagetransferClient = new StorageTransferServiceClient(); - - async function callUpdateTransferJob() { - // Construct request - const request = { - jobName, - projectId, - transferJob, - }; - - // Run request - const response = await storagetransferClient.updateTransferJob(request); - console.log(response); - } - - callUpdateTransferJob(); - // [END storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts deleted file mode 100644 index b2ff704..0000000 --- a/owl-bot-staging/v1/src/index.ts +++ /dev/null @@ -1,25 +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 -// -// 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 StorageTransferServiceClient = v1.StorageTransferServiceClient; -type StorageTransferServiceClient = v1.StorageTransferServiceClient; -export {v1, StorageTransferServiceClient}; -export default {v1, StorageTransferServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 7f8bdf9..0000000 --- a/owl-bot-staging/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.storagetransfer.v1", - "libraryPackage": "@google-cloud/storage-transfer", - "services": { - "StorageTransferService": { - "clients": { - "grpc": { - "libraryClient": "StorageTransferServiceClient", - "rpcs": { - "GetGoogleServiceAccount": { - "methods": [ - "getGoogleServiceAccount" - ] - }, - "CreateTransferJob": { - "methods": [ - "createTransferJob" - ] - }, - "UpdateTransferJob": { - "methods": [ - "updateTransferJob" - ] - }, - "GetTransferJob": { - "methods": [ - "getTransferJob" - ] - }, - "PauseTransferOperation": { - "methods": [ - "pauseTransferOperation" - ] - }, - "ResumeTransferOperation": { - "methods": [ - "resumeTransferOperation" - ] - }, - "CreateAgentPool": { - "methods": [ - "createAgentPool" - ] - }, - "UpdateAgentPool": { - "methods": [ - "updateAgentPool" - ] - }, - "GetAgentPool": { - "methods": [ - "getAgentPool" - ] - }, - "DeleteAgentPool": { - "methods": [ - "deleteAgentPool" - ] - }, - "RunTransferJob": { - "methods": [ - "runTransferJob" - ] - }, - "ListTransferJobs": { - "methods": [ - "listTransferJobs", - "listTransferJobsStream", - "listTransferJobsAsync" - ] - }, - "ListAgentPools": { - "methods": [ - "listAgentPools", - "listAgentPoolsStream", - "listAgentPoolsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "StorageTransferServiceClient", - "rpcs": { - "GetGoogleServiceAccount": { - "methods": [ - "getGoogleServiceAccount" - ] - }, - "CreateTransferJob": { - "methods": [ - "createTransferJob" - ] - }, - "UpdateTransferJob": { - "methods": [ - "updateTransferJob" - ] - }, - "GetTransferJob": { - "methods": [ - "getTransferJob" - ] - }, - "PauseTransferOperation": { - "methods": [ - "pauseTransferOperation" - ] - }, - "ResumeTransferOperation": { - "methods": [ - "resumeTransferOperation" - ] - }, - "CreateAgentPool": { - "methods": [ - "createAgentPool" - ] - }, - "UpdateAgentPool": { - "methods": [ - "updateAgentPool" - ] - }, - "GetAgentPool": { - "methods": [ - "getAgentPool" - ] - }, - "DeleteAgentPool": { - "methods": [ - "deleteAgentPool" - ] - }, - "RunTransferJob": { - "methods": [ - "runTransferJob" - ] - }, - "ListTransferJobs": { - "methods": [ - "listTransferJobs", - "listTransferJobsStream", - "listTransferJobsAsync" - ] - }, - "ListAgentPools": { - "methods": [ - "listAgentPools", - "listAgentPoolsStream", - "listAgentPoolsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts deleted file mode 100644 index f0a69d4..0000000 --- a/owl-bot-staging/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +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 -// -// 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 {StorageTransferServiceClient} from './storage_transfer_service_client'; diff --git a/owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts b/owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts deleted file mode 100644 index 2ac4396..0000000 --- a/owl-bot-staging/v1/src/v1/storage_transfer_service_client.ts +++ /dev/null @@ -1,1652 +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 -// -// 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 * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/storage_transfer_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './storage_transfer_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Storage Transfer Service and its protos. - * Transfers data between between Google Cloud Storage buckets or from a data - * source external to Google to a Cloud Storage bucket. - * @class - * @memberof v1 - */ -export class StorageTransferServiceClient { - 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}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - storageTransferServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of StorageTransferServiceClient. - * - * @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/master/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} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof StorageTransferServiceClient; - 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); - - // 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; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // 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; - } - - // 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 = { - agentPoolsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project_id}/agentPools/{agent_pool_id}' - ), - }; - - // 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 = { - listTransferJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'transferJobs'), - listAgentPools: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'agentPools') - }; - - 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. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const runTransferJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const runTransferJobMetadata = protoFilesRoot.lookup( - '.google.storagetransfer.v1.TransferOperation') as gax.protobuf.Type; - - this.descriptors.longrunning = { - runTransferJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - runTransferJobResponse.decode.bind(runTransferJobResponse), - runTransferJobMetadata.decode.bind(runTransferJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.storagetransfer.v1.StorageTransferService', 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 = gax.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.storageTransferServiceStub) { - return this.storageTransferServiceStub; - } - - // Put together the "service stub" for - // google.storagetransfer.v1.StorageTransferService. - this.storageTransferServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.storagetransfer.v1.StorageTransferService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.storagetransfer.v1.StorageTransferService, - 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 storageTransferServiceStubMethods = - ['getGoogleServiceAccount', 'createTransferJob', 'updateTransferJob', 'getTransferJob', 'listTransferJobs', 'pauseTransferOperation', 'resumeTransferOperation', 'runTransferJob', 'createAgentPool', 'updateAgentPool', 'getAgentPool', 'listAgentPools', 'deleteAgentPool']; - for (const methodName of storageTransferServiceStubMethods) { - const callPromise = this.storageTransferServiceStub.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.innerApiCalls[methodName] = apiCall; - } - - return this.storageTransferServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'storagetransfer.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 'storagetransfer.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 Google service account that is used by Storage Transfer - * Service to access buckets in the project where transfers - * run or in other projects. Each Google service account is associated - * with one Google Cloud project. Users - * should add this service account to the Google Cloud Storage bucket - * ACLs to grant access to Storage Transfer Service. This service - * account is created and owned by Storage Transfer Service and can - * only be used by Storage Transfer Service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud project that the Google service - * account is associated with. - * @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 [GoogleServiceAccount]{@link google.storagetransfer.v1.GoogleServiceAccount}. - * 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/storage_transfer_service.get_google_service_account.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async - */ - getGoogleServiceAccount( - request?: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.IGoogleServiceAccount, - protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|undefined, {}|undefined - ]>; - getGoogleServiceAccount( - request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.storagetransfer.v1.IGoogleServiceAccount, - protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, - {}|null|undefined>): void; - getGoogleServiceAccount( - request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, - callback: Callback< - protos.google.storagetransfer.v1.IGoogleServiceAccount, - protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, - {}|null|undefined>): void; - getGoogleServiceAccount( - request?: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.storagetransfer.v1.IGoogleServiceAccount, - protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.storagetransfer.v1.IGoogleServiceAccount, - protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.storagetransfer.v1.IGoogleServiceAccount, - protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest|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' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); - this.initialize(); - return this.innerApiCalls.getGoogleServiceAccount(request, options, callback); - } -/** - * Creates a transfer job that runs periodically. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.storagetransfer.v1.TransferJob} request.transferJob - * Required. The job to create. - * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. - * 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/storage_transfer_service.create_transfer_job.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async - */ - createTransferJob( - request?: protos.google.storagetransfer.v1.ICreateTransferJobRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.ICreateTransferJobRequest|undefined, {}|undefined - ]>; - createTransferJob( - request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, - options: CallOptions, - callback: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, - {}|null|undefined>): void; - createTransferJob( - request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, - callback: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, - {}|null|undefined>): void; - createTransferJob( - request?: protos.google.storagetransfer.v1.ICreateTransferJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.ICreateTransferJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.ICreateTransferJobRequest|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 || {}; - this.initialize(); - return this.innerApiCalls.createTransferJob(request, options, callback); - } -/** - * Updates a transfer job. Updating a job's transfer spec does not affect - * transfer operations that are running already. - * - * **Note:** The job's {@link google.storagetransfer.v1.TransferJob.status|status} field can be modified - * using this RPC (for example, to set a job's status to - * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}, - * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, or - * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.jobName - * Required. The name of job to update. - * @param {string} request.projectId - * Required. The ID of the Google Cloud project that owns the - * job. - * @param {google.storagetransfer.v1.TransferJob} request.transferJob - * Required. The job to update. `transferJob` is expected to specify one or more of - * five fields: {@link google.storagetransfer.v1.TransferJob.description|description}, - * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, - * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, - * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and - * {@link google.storagetransfer.v1.TransferJob.status|status}. An `UpdateTransferJobRequest` that specifies - * other fields are rejected with the error - * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. Updating a job status - * to {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED} requires - * `storagetransfer.jobs.delete` permissions. - * @param {google.protobuf.FieldMask} request.updateTransferJobFieldMask - * The field mask of the fields in `transferJob` that are to be updated in - * this request. Fields in `transferJob` that can be updated are: - * {@link google.storagetransfer.v1.TransferJob.description|description}, - * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, - * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, - * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and - * {@link google.storagetransfer.v1.TransferJob.status|status}. To update the `transfer_spec` of the job, a - * complete transfer specification must be provided. An incomplete - * specification missing any required fields is rejected with the error - * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. - * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. - * 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/storage_transfer_service.update_transfer_job.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async - */ - updateTransferJob( - request?: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IUpdateTransferJobRequest|undefined, {}|undefined - ]>; - updateTransferJob( - request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, - options: CallOptions, - callback: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, - {}|null|undefined>): void; - updateTransferJob( - request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, - callback: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, - {}|null|undefined>): void; - updateTransferJob( - request?: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IUpdateTransferJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IUpdateTransferJobRequest|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' - ] = gax.routingHeader.fromParams({ - 'job_name': request.jobName || '', - }); - this.initialize(); - return this.innerApiCalls.updateTransferJob(request, options, callback); - } -/** - * Gets a transfer job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.jobName - * Required. The job to get. - * @param {string} request.projectId - * Required. The ID of the Google Cloud project that owns the - * job. - * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. - * 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/storage_transfer_service.get_transfer_job.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async - */ - getTransferJob( - request?: protos.google.storagetransfer.v1.IGetTransferJobRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IGetTransferJobRequest|undefined, {}|undefined - ]>; - getTransferJob( - request: protos.google.storagetransfer.v1.IGetTransferJobRequest, - options: CallOptions, - callback: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, - {}|null|undefined>): void; - getTransferJob( - request: protos.google.storagetransfer.v1.IGetTransferJobRequest, - callback: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, - {}|null|undefined>): void; - getTransferJob( - request?: protos.google.storagetransfer.v1.IGetTransferJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IGetTransferJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob, - protos.google.storagetransfer.v1.IGetTransferJobRequest|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' - ] = gax.routingHeader.fromParams({ - 'job_name': request.jobName || '', - }); - this.initialize(); - return this.innerApiCalls.getTransferJob(request, options, callback); - } -/** - * Pauses a transfer operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the transfer operation. - * @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 [Empty]{@link google.protobuf.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/storage_transfer_service.pause_transfer_operation.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async - */ - pauseTransferOperation( - request?: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IPauseTransferOperationRequest|undefined, {}|undefined - ]>; - pauseTransferOperation( - request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, - {}|null|undefined>): void; - pauseTransferOperation( - request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, - {}|null|undefined>): void; - pauseTransferOperation( - request?: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IPauseTransferOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IPauseTransferOperationRequest|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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.pauseTransferOperation(request, options, callback); - } -/** - * Resumes a transfer operation that is paused. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the transfer operation. - * @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 [Empty]{@link google.protobuf.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/storage_transfer_service.resume_transfer_operation.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async - */ - resumeTransferOperation( - request?: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IResumeTransferOperationRequest|undefined, {}|undefined - ]>; - resumeTransferOperation( - request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, - {}|null|undefined>): void; - resumeTransferOperation( - request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, - {}|null|undefined>): void; - resumeTransferOperation( - request?: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IResumeTransferOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IResumeTransferOperationRequest|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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.resumeTransferOperation(request, options, callback); - } -/** - * Creates an agent pool resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud project that owns the - * agent pool. - * @param {google.storagetransfer.v1.AgentPool} request.agentPool - * Required. The agent pool to create. - * @param {string} request.agentPoolId - * Required. The ID of the agent pool to create. - * - * The `agent_pool_id` must meet the following requirements: - * - * * Length of 128 characters or less. - * * Not start with the string `goog`. - * * Start with a lowercase ASCII character, followed by: - * * Zero or more: lowercase Latin alphabet characters, numerals, - * hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). - * * One or more numerals or lowercase ASCII characters. - * - * As expressed by the regular expression: - * `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. - * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. - * 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/storage_transfer_service.create_agent_pool.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async - */ - createAgentPool( - request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.ICreateAgentPoolRequest|undefined, {}|undefined - ]>; - createAgentPool( - request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - createAgentPool( - request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, - callback: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - createAgentPool( - request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.ICreateAgentPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.ICreateAgentPoolRequest|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' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); - this.initialize(); - return this.innerApiCalls.createAgentPool(request, options, callback); - } -/** - * Updates an existing agent pool resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.storagetransfer.v1.AgentPool} request.agentPool - * Required. The agent pool to update. `agent_pool` is expected to specify following - * fields: - * - * * {@link google.storagetransfer.v1.AgentPool.name|name} - * - * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} - * - * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} - * An `UpdateAgentPoolRequest` with any other fields is rejected - * with the error {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. - * @param {google.protobuf.FieldMask} request.updateMask - * The [field mask] - * (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) - * of the fields in `agentPool` to update in this request. - * The following `agentPool` fields can be updated: - * - * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} - * - * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} - * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. - * 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/storage_transfer_service.update_agent_pool.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async - */ - updateAgentPool( - request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|undefined, {}|undefined - ]>; - updateAgentPool( - request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - updateAgentPool( - request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, - callback: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - updateAgentPool( - request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IUpdateAgentPoolRequest|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' - ] = gax.routingHeader.fromParams({ - 'agent_pool.name': request.agentPool!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateAgentPool(request, options, callback); - } -/** - * Gets an agent pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the agent pool to get. - * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. - * 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/storage_transfer_service.get_agent_pool.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async - */ - getAgentPool( - request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IGetAgentPoolRequest|undefined, {}|undefined - ]>; - getAgentPool( - request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - getAgentPool( - request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, - callback: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - getAgentPool( - request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IGetAgentPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool, - protos.google.storagetransfer.v1.IGetAgentPoolRequest|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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getAgentPool(request, options, callback); - } -/** - * Deletes an agent pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the agent pool to delete. - * @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 [Empty]{@link google.protobuf.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/storage_transfer_service.delete_agent_pool.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async - */ - deleteAgentPool( - request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|undefined, {}|undefined - ]>; - deleteAgentPool( - request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - deleteAgentPool( - request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, - {}|null|undefined>): void; - deleteAgentPool( - request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteAgentPoolRequest|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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteAgentPool(request, options, callback); - } - -/** - * Attempts to start a new TransferOperation for the current TransferJob. A - * TransferJob has a maximum of one active TransferOperation. If this method - * is called while a TransferOperation is active, an error will be returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.jobName - * Required. The name of the transfer job. - * @param {string} request.projectId - * Required. The ID of the Google Cloud project that owns the transfer - * job. - * @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/storage_transfer_service.run_transfer_job.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async - */ - runTransferJob( - request?: protos.google.storagetransfer.v1.IRunTransferJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - runTransferJob( - request: protos.google.storagetransfer.v1.IRunTransferJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runTransferJob( - request: protos.google.storagetransfer.v1.IRunTransferJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runTransferJob( - request?: protos.google.storagetransfer.v1.IRunTransferJobRequest, - 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' - ] = gax.routingHeader.fromParams({ - 'job_name': request.jobName || '', - }); - this.initialize(); - return this.innerApiCalls.runTransferJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `runTransferJob()`. - * @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/storage_transfer_service.run_transfer_job.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async - */ - async checkRunTransferJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.runTransferJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists transfer jobs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.filter - * Required. A list of query parameters specified as JSON text in the form of: - * `{"projectId":"my_project_id", - * "jobNames":["jobid1","jobid2",...], - * "jobStatuses":["status1","status2",...]}` - * - * Since `jobNames` and `jobStatuses` support multiple values, their values - * must be specified with array notation. `projectId` is required. - * `jobNames` and `jobStatuses` are optional. The valid values for - * `jobStatuses` are case-insensitive: - * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, - * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and - * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. - * @param {number} request.pageSize - * The list page size. The max allowed value is 256. - * @param {string} request.pageToken - * The 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 {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TransferJob]{@link google.storagetransfer.v1.TransferJob}. - * 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 `listTransferJobsAsync()` - * 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. - */ - listTransferJobs( - request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob[], - protos.google.storagetransfer.v1.IListTransferJobsRequest|null, - protos.google.storagetransfer.v1.IListTransferJobsResponse - ]>; - listTransferJobs( - request: protos.google.storagetransfer.v1.IListTransferJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.storagetransfer.v1.IListTransferJobsRequest, - protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, - protos.google.storagetransfer.v1.ITransferJob>): void; - listTransferJobs( - request: protos.google.storagetransfer.v1.IListTransferJobsRequest, - callback: PaginationCallback< - protos.google.storagetransfer.v1.IListTransferJobsRequest, - protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, - protos.google.storagetransfer.v1.ITransferJob>): void; - listTransferJobs( - request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.storagetransfer.v1.IListTransferJobsRequest, - protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, - protos.google.storagetransfer.v1.ITransferJob>, - callback?: PaginationCallback< - protos.google.storagetransfer.v1.IListTransferJobsRequest, - protos.google.storagetransfer.v1.IListTransferJobsResponse|null|undefined, - protos.google.storagetransfer.v1.ITransferJob>): - Promise<[ - protos.google.storagetransfer.v1.ITransferJob[], - protos.google.storagetransfer.v1.IListTransferJobsRequest|null, - protos.google.storagetransfer.v1.IListTransferJobsResponse - ]>|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 || {}; - this.initialize(); - return this.innerApiCalls.listTransferJobs(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.filter - * Required. A list of query parameters specified as JSON text in the form of: - * `{"projectId":"my_project_id", - * "jobNames":["jobid1","jobid2",...], - * "jobStatuses":["status1","status2",...]}` - * - * Since `jobNames` and `jobStatuses` support multiple values, their values - * must be specified with array notation. `projectId` is required. - * `jobNames` and `jobStatuses` are optional. The valid values for - * `jobStatuses` are case-insensitive: - * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, - * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and - * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. - * @param {number} request.pageSize - * The list page size. The max allowed value is 256. - * @param {string} request.pageToken - * The 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 {Stream} - * An object stream which emits an object representing [TransferJob]{@link google.storagetransfer.v1.TransferJob} 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 `listTransferJobsAsync()` - * 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. - */ - listTransferJobsStream( - request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listTransferJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTransferJobs.createStream( - this.innerApiCalls.listTransferJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTransferJobs`, 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.filter - * Required. A list of query parameters specified as JSON text in the form of: - * `{"projectId":"my_project_id", - * "jobNames":["jobid1","jobid2",...], - * "jobStatuses":["status1","status2",...]}` - * - * Since `jobNames` and `jobStatuses` support multiple values, their values - * must be specified with array notation. `projectId` is required. - * `jobNames` and `jobStatuses` are optional. The valid values for - * `jobStatuses` are case-insensitive: - * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, - * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and - * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. - * @param {number} request.pageSize - * The list page size. The max allowed value is 256. - * @param {string} request.pageToken - * The 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 - * [TransferJob]{@link google.storagetransfer.v1.TransferJob}. 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/storage_transfer_service.list_transfer_jobs.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async - */ - listTransferJobsAsync( - request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listTransferJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTransferJobs.asyncIterate( - this.innerApiCalls['listTransferJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists agent pools. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud project that owns the job. - * @param {string} request.filter - * An optional list of query parameters specified as JSON text in the - * form of: - * - * `{"agentPoolNames":["agentpool1","agentpool2",...]}` - * - * Since `agentPoolNames` support multiple values, its values must be - * specified with array notation. When the filter is either empty or not - * provided, the list returns all agent pools for the project. - * @param {number} request.pageSize - * The list page size. The max allowed value is `256`. - * @param {string} request.pageToken - * The 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 {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [AgentPool]{@link google.storagetransfer.v1.AgentPool}. - * 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 `listAgentPoolsAsync()` - * 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. - */ - listAgentPools( - request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool[], - protos.google.storagetransfer.v1.IListAgentPoolsRequest|null, - protos.google.storagetransfer.v1.IListAgentPoolsResponse - ]>; - listAgentPools( - request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.storagetransfer.v1.IListAgentPoolsRequest, - protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, - protos.google.storagetransfer.v1.IAgentPool>): void; - listAgentPools( - request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, - callback: PaginationCallback< - protos.google.storagetransfer.v1.IListAgentPoolsRequest, - protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, - protos.google.storagetransfer.v1.IAgentPool>): void; - listAgentPools( - request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.storagetransfer.v1.IListAgentPoolsRequest, - protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, - protos.google.storagetransfer.v1.IAgentPool>, - callback?: PaginationCallback< - protos.google.storagetransfer.v1.IListAgentPoolsRequest, - protos.google.storagetransfer.v1.IListAgentPoolsResponse|null|undefined, - protos.google.storagetransfer.v1.IAgentPool>): - Promise<[ - protos.google.storagetransfer.v1.IAgentPool[], - protos.google.storagetransfer.v1.IListAgentPoolsRequest|null, - protos.google.storagetransfer.v1.IListAgentPoolsResponse - ]>|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' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); - this.initialize(); - return this.innerApiCalls.listAgentPools(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.projectId - * Required. The ID of the Google Cloud project that owns the job. - * @param {string} request.filter - * An optional list of query parameters specified as JSON text in the - * form of: - * - * `{"agentPoolNames":["agentpool1","agentpool2",...]}` - * - * Since `agentPoolNames` support multiple values, its values must be - * specified with array notation. When the filter is either empty or not - * provided, the list returns all agent pools for the project. - * @param {number} request.pageSize - * The list page size. The max allowed value is `256`. - * @param {string} request.pageToken - * The 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 {Stream} - * An object stream which emits an object representing [AgentPool]{@link google.storagetransfer.v1.AgentPool} 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 `listAgentPoolsAsync()` - * 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. - */ - listAgentPoolsStream( - request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); - const defaultCallSettings = this._defaults['listAgentPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAgentPools.createStream( - this.innerApiCalls.listAgentPools as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAgentPools`, 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.projectId - * Required. The ID of the Google Cloud project that owns the job. - * @param {string} request.filter - * An optional list of query parameters specified as JSON text in the - * form of: - * - * `{"agentPoolNames":["agentpool1","agentpool2",...]}` - * - * Since `agentPoolNames` support multiple values, its values must be - * specified with array notation. When the filter is either empty or not - * provided, the list returns all agent pools for the project. - * @param {number} request.pageSize - * The list page size. The max allowed value is `256`. - * @param {string} request.pageToken - * The 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 - * [AgentPool]{@link google.storagetransfer.v1.AgentPool}. 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/storage_transfer_service.list_agent_pools.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async - */ - listAgentPoolsAsync( - request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); - const defaultCallSettings = this._defaults['listAgentPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAgentPools.asyncIterate( - this.innerApiCalls['listAgentPools'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified agentPools resource name string. - * - * @param {string} project_id - * @param {string} agent_pool_id - * @returns {string} Resource name string. - */ - agentPoolsPath(projectId:string,agentPoolId:string) { - return this.pathTemplates.agentPoolsPathTemplate.render({ - project_id: projectId, - agent_pool_id: agentPoolId, - }); - } - - /** - * Parse the project_id from AgentPools resource. - * - * @param {string} agentPoolsName - * A fully-qualified path representing agentPools resource. - * @returns {string} A string representing the project_id. - */ - matchProjectIdFromAgentPoolsName(agentPoolsName: string) { - return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName).project_id; - } - - /** - * Parse the agent_pool_id from AgentPools resource. - * - * @param {string} agentPoolsName - * A fully-qualified path representing agentPools resource. - * @returns {string} A string representing the agent_pool_id. - */ - matchAgentPoolIdFromAgentPoolsName(agentPoolsName: string) { - return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName).agent_pool_id; - } - - /** - * 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.storageTransferServiceStub && !this._terminated) { - return this.storageTransferServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json b/owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json deleted file mode 100644 index 6e42410..0000000 --- a/owl-bot-staging/v1/src/v1/storage_transfer_service_client_config.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "interfaces": { - "google.storagetransfer.v1.StorageTransferService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "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 - } - }, - "methods": { - "GetGoogleServiceAccount": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTransferJob": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTransferJob": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTransferJob": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTransferJobs": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PauseTransferOperation": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeTransferOperation": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RunTransferJob": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateAgentPool": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateAgentPool": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetAgentPool": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListAgentPools": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteAgentPool": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json b/owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json deleted file mode 100644 index ea755b4..0000000 --- a/owl-bot-staging/v1/src/v1/storage_transfer_service_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/storagetransfer/v1/transfer.proto", - "../../protos/google/storagetransfer/v1/transfer_types.proto" -] diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 842da4d..0000000 --- a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +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 -// -// 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 storagetransfer = require('@google-cloud/storage-transfer'); - -function main() { - const storageTransferServiceClient = new storagetransfer.StorageTransferServiceClient(); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 458ee50..0000000 --- a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +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 -// -// 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 {StorageTransferServiceClient} from '@google-cloud/storage-transfer'; - -// check that the client class type name can be used -function doStuffWithStorageTransferServiceClient(client: StorageTransferServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const storageTransferServiceClient = new StorageTransferServiceClient(); - doStuffWithStorageTransferServiceClient(storageTransferServiceClient); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/install.ts b/owl-bot-staging/v1/system-test/install.ts deleted file mode 100644 index 8ec4522..0000000 --- a/owl-bot-staging/v1/system-test/install.ts +++ /dev/null @@ -1,49 +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 -// -// 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/v1/test/gapic_storage_transfer_service_v1.ts b/owl-bot-staging/v1/test/gapic_storage_transfer_service_v1.ts deleted file mode 100644 index 3783e3e..0000000 --- a/owl-bot-staging/v1/test/gapic_storage_transfer_service_v1.ts +++ /dev/null @@ -1,1726 +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 -// -// 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 storagetransferserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -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.StorageTransferServiceClient', () => { - it('has servicePath', () => { - const servicePath = storagetransferserviceModule.v1.StorageTransferServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = storagetransferserviceModule.v1.StorageTransferServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = storagetransferserviceModule.v1.StorageTransferServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.storageTransferServiceStub, undefined); - await client.initialize(); - assert(client.storageTransferServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.storageTransferServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.storageTransferServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - 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 storagetransferserviceModule.v1.StorageTransferServiceClient({ - 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('getGoogleServiceAccount', () => { - it('invokes getGoogleServiceAccount without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.GoogleServiceAccount()); - client.innerApiCalls.getGoogleServiceAccount = stubSimpleCall(expectedResponse); - const [response] = await client.getGoogleServiceAccount(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getGoogleServiceAccount without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.GoogleServiceAccount()); - client.innerApiCalls.getGoogleServiceAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getGoogleServiceAccount( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.IGoogleServiceAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getGoogleServiceAccount with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getGoogleServiceAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getGoogleServiceAccount(request), expectedError); - assert((client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getGoogleServiceAccount with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getGoogleServiceAccount(request), expectedError); - }); - }); - - describe('createTransferJob', () => { - it('invokes createTransferJob without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); - client.innerApiCalls.createTransferJob = stubSimpleCall(expectedResponse); - const [response] = await client.createTransferJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTransferJob without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); - client.innerApiCalls.createTransferJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTransferJob( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTransferJob with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedError = new Error('expected'); - client.innerApiCalls.createTransferJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTransferJob(request), expectedError); - assert((client.innerApiCalls.createTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTransferJob with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateTransferJobRequest()); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTransferJob(request), expectedError); - }); - }); - - describe('updateTransferJob', () => { - it('invokes updateTransferJob without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); - client.innerApiCalls.updateTransferJob = stubSimpleCall(expectedResponse); - const [response] = await client.updateTransferJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTransferJob without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); - client.innerApiCalls.updateTransferJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTransferJob( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTransferJob with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTransferJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTransferJob(request), expectedError); - assert((client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTransferJob with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateTransferJobRequest()); - request.jobName = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTransferJob(request), expectedError); - }); - }); - - describe('getTransferJob', () => { - it('invokes getTransferJob without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); - client.innerApiCalls.getTransferJob = stubSimpleCall(expectedResponse); - const [response] = await client.getTransferJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTransferJob without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()); - client.innerApiCalls.getTransferJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTransferJob( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTransferJob with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTransferJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTransferJob(request), expectedError); - assert((client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTransferJob with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetTransferJobRequest()); - request.jobName = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTransferJob(request), expectedError); - }); - }); - - describe('pauseTransferOperation', () => { - it('invokes pauseTransferOperation without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pauseTransferOperation = stubSimpleCall(expectedResponse); - const [response] = await client.pauseTransferOperation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pauseTransferOperation without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pauseTransferOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pauseTransferOperation( - 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); - assert((client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes pauseTransferOperation with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseTransferOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pauseTransferOperation(request), expectedError); - assert((client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pauseTransferOperation with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.PauseTransferOperationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pauseTransferOperation(request), expectedError); - }); - }); - - describe('resumeTransferOperation', () => { - it('invokes resumeTransferOperation without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resumeTransferOperation = stubSimpleCall(expectedResponse); - const [response] = await client.resumeTransferOperation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resumeTransferOperation without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resumeTransferOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeTransferOperation( - 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); - assert((client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes resumeTransferOperation with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeTransferOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resumeTransferOperation(request), expectedError); - assert((client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resumeTransferOperation with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ResumeTransferOperationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeTransferOperation(request), expectedError); - }); - }); - - describe('createAgentPool', () => { - it('invokes createAgentPool without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); - client.innerApiCalls.createAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.createAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createAgentPool without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); - client.innerApiCalls.createAgentPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAgentPool( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createAgentPool with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAgentPool(request), expectedError); - assert((client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createAgentPool with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.CreateAgentPoolRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createAgentPool(request), expectedError); - }); - }); - - describe('updateAgentPool', () => { - it('invokes updateAgentPool without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); - request.agentPool = {}; - request.agentPool.name = ''; - const expectedHeaderRequestParams = "agent_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); - client.innerApiCalls.updateAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.updateAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateAgentPool without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); - request.agentPool = {}; - request.agentPool.name = ''; - const expectedHeaderRequestParams = "agent_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); - client.innerApiCalls.updateAgentPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAgentPool( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateAgentPool with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); - request.agentPool = {}; - request.agentPool.name = ''; - const expectedHeaderRequestParams = "agent_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAgentPool(request), expectedError); - assert((client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateAgentPool with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.UpdateAgentPoolRequest()); - request.agentPool = {}; - request.agentPool.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAgentPool(request), expectedError); - }); - }); - - describe('getAgentPool', () => { - it('invokes getAgentPool without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); - client.innerApiCalls.getAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.getAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAgentPool without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()); - client.innerApiCalls.getAgentPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAgentPool( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getAgentPool with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAgentPool(request), expectedError); - assert((client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAgentPool with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.GetAgentPoolRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAgentPool(request), expectedError); - }); - }); - - describe('deleteAgentPool', () => { - it('invokes deleteAgentPool without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteAgentPool without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteAgentPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAgentPool( - 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); - assert((client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteAgentPool with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAgentPool(request), expectedError); - assert((client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteAgentPool with closed client', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.DeleteAgentPoolRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAgentPool(request), expectedError); - }); - }); - - describe('runTransferJob', () => { - it('invokes runTransferJob without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.runTransferJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.runTransferJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runTransferJob without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.runTransferJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runTransferJob( - 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); - assert((client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes runTransferJob with call error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runTransferJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.runTransferJob(request), expectedError); - assert((client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runTransferJob with LRO error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.RunTransferJobRequest()); - request.jobName = ''; - const expectedHeaderRequestParams = "job_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runTransferJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.runTransferJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkRunTransferJobProgress without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - 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.checkRunTransferJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRunTransferJobProgress with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - 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.checkRunTransferJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listTransferJobs', () => { - it('invokes listTransferJobs without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - ]; - client.innerApiCalls.listTransferJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listTransferJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTransferJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTransferJobs without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - ]; - client.innerApiCalls.listTransferJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTransferJobs( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.ITransferJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTransferJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTransferJobs with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); - const expectedOptions = {otherArgs: {headers: {}}};; - const expectedError = new Error('expected'); - client.innerApiCalls.listTransferJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTransferJobs(request), expectedError); - assert((client.innerApiCalls.listTransferJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTransferJobsStream without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - ]; - client.descriptors.page.listTransferJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTransferJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.storagetransfer.v1.TransferJob[] = []; - stream.on('data', (response: protos.google.storagetransfer.v1.TransferJob) => { - 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.listTransferJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTransferJobs, request)); - }); - - it('invokes listTransferJobsStream with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); - const expectedError = new Error('expected'); - client.descriptors.page.listTransferJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTransferJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.storagetransfer.v1.TransferJob[] = []; - stream.on('data', (response: protos.google.storagetransfer.v1.TransferJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTransferJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTransferJobs, request)); - }); - - it('uses async iteration with listTransferJobs without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest()); - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - generateSampleMessage(new protos.google.storagetransfer.v1.TransferJob()), - ]; - client.descriptors.page.listTransferJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.storagetransfer.v1.ITransferJob[] = []; - const iterable = client.listTransferJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTransferJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - - it('uses async iteration with listTransferJobs with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListTransferJobsRequest());const expectedError = new Error('expected'); - client.descriptors.page.listTransferJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTransferJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.storagetransfer.v1.ITransferJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTransferJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('listAgentPools', () => { - it('invokes listAgentPools without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - ]; - client.innerApiCalls.listAgentPools = stubSimpleCall(expectedResponse); - const [response] = await client.listAgentPools(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAgentPools without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - ]; - client.innerApiCalls.listAgentPools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAgentPools( - request, - (err?: Error|null, result?: protos.google.storagetransfer.v1.IAgentPool[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listAgentPools with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listAgentPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAgentPools(request), expectedError); - assert((client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAgentPoolsStream without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - ]; - client.descriptors.page.listAgentPools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAgentPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.storagetransfer.v1.AgentPool[] = []; - stream.on('data', (response: protos.google.storagetransfer.v1.AgentPool) => { - 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.listAgentPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAgentPools, request)); - assert.strictEqual( - (client.descriptors.page.listAgentPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listAgentPoolsStream with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedError = new Error('expected'); - client.descriptors.page.listAgentPools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAgentPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.storagetransfer.v1.AgentPool[] = []; - stream.on('data', (response: protos.google.storagetransfer.v1.AgentPool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAgentPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAgentPools, request)); - assert.strictEqual( - (client.descriptors.page.listAgentPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAgentPools without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedResponse = [ - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), - ]; - client.descriptors.page.listAgentPools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; - const iterable = client.listAgentPoolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAgentPools with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.storagetransfer.v1.ListAgentPoolsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id=";const expectedError = new Error('expected'); - client.descriptors.page.listAgentPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAgentPoolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('agentPools', () => { - const fakePath = "/rendered/path/agentPools"; - const expectedParameters = { - project_id: "projectIdValue", - agent_pool_id: "agentPoolIdValue", - }; - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.agentPoolsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.agentPoolsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('agentPoolsPath', () => { - const result = client.agentPoolsPath("projectIdValue", "agentPoolIdValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.agentPoolsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectIdFromAgentPoolsName', () => { - const result = client.matchProjectIdFromAgentPoolsName(fakePath); - assert.strictEqual(result, "projectIdValue"); - assert((client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAgentPoolIdFromAgentPoolsName', () => { - const result = client.matchAgentPoolIdFromAgentPoolsName(fakePath); - assert.strictEqual(result, "agentPoolIdValue"); - assert((client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json deleted file mode 100644 index c78f1c8..0000000 --- a/owl-bot-staging/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/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js deleted file mode 100644 index 08a3efc..0000000 --- a/owl-bot-staging/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: 'StorageTransferService', - filename: './storage-transfer-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/protos/google/storagetransfer/v1/transfer.proto b/protos/google/storagetransfer/v1/transfer.proto index d282628..5ee7211 100644 --- a/protos/google/storagetransfer/v1/transfer.proto +++ b/protos/google/storagetransfer/v1/transfer.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -20,7 +20,6 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/storagetransfer/v1/transfer_types.proto"; @@ -38,19 +37,17 @@ option ruby_package = "Google::Cloud::StorageTransfer::V1"; // source external to Google to a Cloud Storage bucket. service StorageTransferService { option (google.api.default_host) = "storagetransfer.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"; // Returns the Google service account that is used by Storage Transfer // Service to access buckets in the project where transfers // run or in other projects. Each Google service account is associated - // with one Google Cloud Platform Console project. Users + // with one Google Cloud project. Users // should add this service account to the Google Cloud Storage bucket // ACLs to grant access to Storage Transfer Service. This service // account is created and owned by Storage Transfer Service and can // only be used by Storage Transfer Service. - rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) - returns (GoogleServiceAccount) { + rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) returns (GoogleServiceAccount) { option (google.api.http) = { get: "/v1/googleServiceAccounts/{project_id}" }; @@ -67,8 +64,8 @@ service StorageTransferService { // Updates a transfer job. Updating a job's transfer spec does not affect // transfer operations that are running already. // - // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] - // field can be modified using this RPC (for example, to set a job's status to + // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified + // using this RPC (for example, to set a job's status to // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]). @@ -87,16 +84,14 @@ service StorageTransferService { } // Lists transfer jobs. - rpc ListTransferJobs(ListTransferJobsRequest) - returns (ListTransferJobsResponse) { + rpc ListTransferJobs(ListTransferJobsRequest) returns (ListTransferJobsResponse) { option (google.api.http) = { get: "/v1/transferJobs" }; } // Pauses a transfer operation. - rpc PauseTransferOperation(PauseTransferOperationRequest) - returns (google.protobuf.Empty) { + rpc PauseTransferOperation(PauseTransferOperationRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v1/{name=transferOperations/**}:pause" body: "*" @@ -104,8 +99,7 @@ service StorageTransferService { } // Resumes a transfer operation that is paused. - rpc ResumeTransferOperation(ResumeTransferOperationRequest) - returns (google.protobuf.Empty) { + rpc ResumeTransferOperation(ResumeTransferOperationRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v1/{name=transferOperations/**}:resume" body: "*" @@ -114,9 +108,8 @@ service StorageTransferService { // Attempts to start a new TransferOperation for the current TransferJob. A // TransferJob has a maximum of one active TransferOperation. If this method - // is called while a TransferOperation is active, an error wil be returned. - rpc RunTransferJob(RunTransferJobRequest) - returns (google.longrunning.Operation) { + // is called while a TransferOperation is active, an error will be returned. + rpc RunTransferJob(RunTransferJobRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{job_name=transferJobs/**}:run" body: "*" @@ -126,12 +119,54 @@ service StorageTransferService { metadata_type: "TransferOperation" }; } + + // Creates an agent pool resource. + rpc CreateAgentPool(CreateAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + post: "/v1/projects/{project_id=*}/agentPools" + body: "agent_pool" + }; + option (google.api.method_signature) = "project_id,agent_pool,agent_pool_id"; + } + + // Updates an existing agent pool resource. + rpc UpdateAgentPool(UpdateAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + patch: "/v1/{agent_pool.name=projects/*/agentPools/*}" + body: "agent_pool" + }; + option (google.api.method_signature) = "agent_pool,update_mask"; + } + + // Gets an agent pool. + rpc GetAgentPool(GetAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/agentPools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists agent pools. + rpc ListAgentPools(ListAgentPoolsRequest) returns (ListAgentPoolsResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id=*}/agentPools" + }; + option (google.api.method_signature) = "project_id"; + } + + // Deletes an agent pool. + rpc DeleteAgentPool(DeleteAgentPoolRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/agentPools/*}" + }; + option (google.api.method_signature) = "name"; + } } // Request passed to GetGoogleServiceAccount. message GetGoogleServiceAccountRequest { - // Required. The ID of the Google Cloud Platform Console project that the - // Google service account is associated with. + // Required. The ID of the Google Cloud project that the Google service + // account is associated with. string project_id = 1 [(google.api.field_behavior) = REQUIRED]; } @@ -146,20 +181,19 @@ message UpdateTransferJobRequest { // Required. The name of job to update. string job_name = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The ID of the Google Cloud Platform Console project that owns the + // Required. The ID of the Google Cloud project that owns the // job. string project_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The job to update. `transferJob` is expected to specify only - // four fields: - // [description][google.storagetransfer.v1.TransferJob.description], + // Required. The job to update. `transferJob` is expected to specify one or more of + // five fields: [description][google.storagetransfer.v1.TransferJob.description], // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], - // and [status][google.storagetransfer.v1.TransferJob.status]. An - // `UpdateTransferJobRequest` that specifies other fields are rejected with - // the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a - // job status to - // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires + // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and + // [status][google.storagetransfer.v1.TransferJob.status]. An `UpdateTransferJobRequest` that specifies + // other fields are rejected with the error + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a job status + // to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires // `storagetransfer.jobs.delete` permissions. TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED]; @@ -168,21 +202,20 @@ message UpdateTransferJobRequest { // [description][google.storagetransfer.v1.TransferJob.description], // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], - // and [status][google.storagetransfer.v1.TransferJob.status]. To update the - // `transfer_spec` of the job, a complete transfer specification must be - // provided. An incomplete specification missing any required fields is - // rejected with the error + // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and + // [status][google.storagetransfer.v1.TransferJob.status]. To update the `transfer_spec` of the job, a + // complete transfer specification must be provided. An incomplete + // specification missing any required fields is rejected with the error // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. google.protobuf.FieldMask update_transfer_job_field_mask = 4; } // Request passed to GetTransferJob. message GetTransferJobRequest { - // Required. - // The job to get. + // Required. The job to get. string job_name = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The ID of the Google Cloud Platform Console project that owns the + // Required. The ID of the Google Cloud project that owns the // job. string project_id = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -237,7 +270,100 @@ message RunTransferJobRequest { // Required. The name of the transfer job. string job_name = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The ID of the Google Cloud Platform Console project that owns the - // transfer job. + // Required. The ID of the Google Cloud project that owns the transfer + // job. string project_id = 2 [(google.api.field_behavior) = REQUIRED]; } + +// Specifies the request passed to CreateAgentPool. +message CreateAgentPoolRequest { + // Required. The ID of the Google Cloud project that owns the + // agent pool. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The agent pool to create. + AgentPool agent_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the agent pool to create. + // + // The `agent_pool_id` must meet the following requirements: + // + // * Length of 128 characters or less. + // * Not start with the string `goog`. + // * Start with a lowercase ASCII character, followed by: + // * Zero or more: lowercase Latin alphabet characters, numerals, + // hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + // * One or more numerals or lowercase ASCII characters. + // + // As expressed by the regular expression: + // `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + string agent_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to UpdateAgentPool. +message UpdateAgentPoolRequest { + // Required. The agent pool to update. `agent_pool` is expected to specify following + // fields: + // + // * [name][google.storagetransfer.v1.AgentPool.name] + // + // * [display_name][google.storagetransfer.v1.AgentPool.display_name] + // + // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] + // An `UpdateAgentPoolRequest` with any other fields is rejected + // with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + AgentPool agent_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // The [field mask] + // (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + // of the fields in `agentPool` to update in this request. + // The following `agentPool` fields can be updated: + // + // * [display_name][google.storagetransfer.v1.AgentPool.display_name] + // + // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] + google.protobuf.FieldMask update_mask = 2; +} + +// Specifies the request passed to GetAgentPool. +message GetAgentPoolRequest { + // Required. The name of the agent pool to get. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to DeleteAgentPool. +message DeleteAgentPoolRequest { + // Required. The name of the agent pool to delete. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request passed to ListAgentPools. +message ListAgentPoolsRequest { + // Required. The ID of the Google Cloud project that owns the job. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // An optional list of query parameters specified as JSON text in the + // form of: + // + // `{"agentPoolNames":["agentpool1","agentpool2",...]}` + // + // Since `agentPoolNames` support multiple values, its values must be + // specified with array notation. When the filter is either empty or not + // provided, the list returns all agent pools for the project. + string filter = 2; + + // The list page size. The max allowed value is `256`. + int32 page_size = 3; + + // The list page token. + string page_token = 4; +} + +// Response from ListAgentPools. +message ListAgentPoolsResponse { + // A list of agent pools. + repeated AgentPool agent_pools = 1; + + // The list next page token. + string next_page_token = 2; +} diff --git a/protos/google/storagetransfer/v1/transfer_types.proto b/protos/google/storagetransfer/v1/transfer_types.proto index 6301c57..cfb87a6 100644 --- a/protos/google/storagetransfer/v1/transfer_types.proto +++ b/protos/google/storagetransfer/v1/transfer_types.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -16,9 +16,8 @@ syntax = "proto3"; package google.storagetransfer.v1; -import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; -import "google/protobuf/any.proto"; +import "google/api/resource.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; @@ -64,13 +63,6 @@ message AwsAccessKey { message AzureCredentials { // Required. Azure shared access signature (SAS). // - // - // // For more information about SAS, see // [Grant limited access to Azure Storage resources using shared access // signatures @@ -78,41 +70,41 @@ message AzureCredentials { string sas_token = 2 [(google.api.field_behavior) = REQUIRED]; } -// Conditions that determine which objects will be transferred. Applies only +// Conditions that determine which objects are transferred. Applies only // to Cloud Data Sources such as S3, Azure, and Cloud Storage. // // The "last modification time" refers to the time of the // last change to the object's content or metadata — specifically, this is // the `updated` property of Cloud Storage objects, the `LastModified` field // of S3 objects, and the `Last-Modified` header of Azure blobs. +// +// Transfers with a [PosixFilesystem][google.storagetransfer.v1.PosixFilesystem] source or destination don't support +// `ObjectConditions`. message ObjectConditions { - // If specified, only objects with a "last modification time" before - // `NOW` - `min_time_elapsed_since_last_modification` and objects that don't - // have a "last modification time" are transferred. - // - // For each [TransferOperation][google.storagetransfer.v1.TransferOperation] - // started by this [TransferJob][google.storagetransfer.v1.TransferJob], `NOW` - // refers to the [start_time] - // [google.storagetransfer.v1.TransferOperation.start_time] of the - // `TransferOperation`. + // Ensures that objects are not transferred until a specific minimum time + // has elapsed after the "last modification time". When a + // [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a "last modification time" are + // transferred only if the elapsed time between the + // [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the `TransferOperation` + // and the "last modification time" of the object is equal to or + // greater than the value of min_time_elapsed_since_last_modification`. + // Objects that do not have a "last modification time" are also transferred. google.protobuf.Duration min_time_elapsed_since_last_modification = 1; - // If specified, only objects with a "last modification time" on or after - // `NOW` - `max_time_elapsed_since_last_modification` and objects that don't - // have a "last modification time" are transferred. - // - // For each [TransferOperation][google.storagetransfer.v1.TransferOperation] - // started by this [TransferJob][google.storagetransfer.v1.TransferJob], - // `NOW` refers to the [start_time] - // [google.storagetransfer.v1.TransferOperation.start_time] of the - // `TransferOperation`. + // Ensures that objects are not transferred if a specific maximum time + // has elapsed since the "last modification time". + // When a [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a + // "last modification time" are transferred only if the elapsed time + // between the [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the + // `TransferOperation`and the "last modification time" of the object + // is less than the value of max_time_elapsed_since_last_modification`. + // Objects that do not have a "last modification time" are also transferred. google.protobuf.Duration max_time_elapsed_since_last_modification = 2; // If you specify `include_prefixes`, Storage Transfer Service uses the items // in the `include_prefixes` array to determine which objects to include in a // transfer. Objects must start with one of the matching `include_prefixes` - // for inclusion in the transfer. If [exclude_prefixes] - // [google.storagetransfer.v1.ObjectConditions.exclude_prefixes] is specified, + // for inclusion in the transfer. If [exclude_prefixes][google.storagetransfer.v1.ObjectConditions.exclude_prefixes] is specified, // objects must not start with any of the `exclude_prefixes` specified for // inclusion in the transfer. // @@ -161,10 +153,8 @@ message ObjectConditions { // namespace. No exclude-prefix may be a prefix of another // exclude-prefix. // - // * If [include_prefixes] - // [google.storagetransfer.v1.ObjectConditions.include_prefixes] is - // specified, then each exclude-prefix must start with the value of a path - // explicitly included by `include_prefixes`. + // * If [include_prefixes][google.storagetransfer.v1.ObjectConditions.include_prefixes] is specified, then each exclude-prefix must + // start with the value of a path explicitly included by `include_prefixes`. // // The max size of `exclude_prefixes` is 1000. // @@ -187,7 +177,7 @@ message ObjectConditions { google.protobuf.Timestamp last_modified_since = 5; // If specified, only objects with a "last modification time" before this - // timestamp and objects that don't have a "last modification time" will be + // timestamp and objects that don't have a "last modification time" are // transferred. google.protobuf.Timestamp last_modified_before = 6; } @@ -220,9 +210,9 @@ message AwsS3Data { // bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; - // Input only. AWS access key used to sign the API requests to the AWS S3 - // bucket. Permissions on the bucket must be granted to the access ID of the - // AWS access key. This field is required. + // Input only. AWS access key used to sign the API requests to the AWS S3 bucket. + // Permissions on the bucket must be granted to the access ID of the AWS + // access key. // // For information on our data retention policy for user credentials, see // [User credentials](/storage-transfer/docs/data-retention#user-credentials). @@ -235,13 +225,15 @@ message AwsS3Data { // a '/'. string path = 3; - // Input only. Role arn to support temporary credentials via - // AssumeRoleWithWebIdentity. + // The Amazon Resource Name (ARN) of the role to support temporary + // credentials via `AssumeRoleWithWebIdentity`. For more information about + // ARNs, see [IAM + // ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). // - // When role arn is provided, transfer service will fetch temporary - // credentials for the session using AssumeRoleWithWebIdentity call for the - // provided role using the [GoogleServiceAccount] for this project. - string role_arn = 4 [(google.api.field_behavior) = INPUT_ONLY]; + // When a role ARN is provided, Transfer Service fetches temporary + // credentials for the session using a `AssumeRoleWithWebIdentity` call for + // the provided role using the [GoogleServiceAccount][google.storagetransfer.v1.GoogleServiceAccount] for this project. + string role_arn = 4; } // An AzureBlobStorageData resource can be a data source, but not a data sink. @@ -255,8 +247,7 @@ message AzureBlobStorageData { // Required. The name of the Azure Storage account. string storage_account = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. Input only. Credentials used to authenticate API requests to - // Azure. + // Required. Input only. Credentials used to authenticate API requests to Azure. // // For information on our data retention policy for user credentials, see // [User credentials](/storage-transfer/docs/data-retention#user-credentials). @@ -300,10 +291,10 @@ message AzureBlobStorageData { // `/`. // // * If the specified size of an object does not match the actual size of the -// object fetched, the object will not be transferred. +// object fetched, the object is not transferred. // // * If the specified MD5 does not match the MD5 computed from the transferred -// bytes, the object transfer will fail. +// bytes, the object transfer fails. // // * Ensure that each URL you specify is publicly accessible. For // example, in Cloud Storage you can @@ -314,8 +305,7 @@ message AzureBlobStorageData { // HTTP server to support `Range` requests and to return a `Content-Length` // header in each response. // -// * [ObjectConditions][google.storagetransfer.v1.ObjectConditions] have no -// effect when filtering objects to transfer. +// * [ObjectConditions][google.storagetransfer.v1.ObjectConditions] have no effect when filtering objects to transfer. message HttpData { // Required. The URL that points to the file that stores the object list // entries. This file must allow public access. Currently, only URLs with @@ -323,28 +313,106 @@ message HttpData { string list_url = 1 [(google.api.field_behavior) = REQUIRED]; } +// A POSIX filesystem resource. +message PosixFilesystem { + // Root directory path to the filesystem. + string root_directory = 1; +} + +// Represents an On-Premises Agent pool. +message AgentPool { + option (google.api.resource) = { + type: "storagetransfer.googleapis.com/agentPools" + pattern: "projects/{project_id}/agentPools/{agent_pool_id}" + }; + + // The state of an AgentPool. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // This is an initialization state. During this stage, the resources such as + // Pub/Sub topics are allocated for the AgentPool. + CREATING = 1; + + // Determines that the AgentPool is created for use. At this state, Agents + // can join the AgentPool and participate in the transfer jobs in that pool. + CREATED = 2; + + // Determines that the AgentPool deletion has been initiated, and all the + // resources are scheduled to be cleaned up and freed. + DELETING = 3; + } + + // Specifies a bandwidth limit for an agent pool. + message BandwidthLimit { + // Bandwidth rate in megabytes per second, distributed across all the agents + // in the pool. + int64 limit_mbps = 1; + } + + // Required. Specifies a unique string that identifies the agent pool. + // + // Format: `projects/{project_id}/agentPools/{agent_pool_id}` + string name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the client-specified AgentPool description. + string display_name = 3; + + // Output only. Specifies the state of the AgentPool. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Specifies the bandwidth limit details. If this field is unspecified, the + // default value is set as 'No Limit'. + BandwidthLimit bandwidth_limit = 5; +} + // TransferOptions define the actions to be performed on objects in a transfer. message TransferOptions { + // Specifies when to overwrite an object in the sink when an object with + // matching name is found in the source. + enum OverwriteWhen { + // Indicate the option is not set. + OVERWRITE_WHEN_UNSPECIFIED = 0; + + // Overwrite destination object with source if the two objects are + // different. + DIFFERENT = 1; + + // Never overwrite destination object. + NEVER = 2; + + // Always overwrite destination object. + ALWAYS = 3; + } + // When to overwrite objects that already exist in the sink. The default is // that only objects that are different from the source are ovewritten. If // true, all objects in the sink whose name matches an object in the source - // will be overwritten with the source object. + // are overwritten with the source object. bool overwrite_objects_already_existing_in_sink = 1; // Whether objects that exist only in the sink should be deleted. // - // **Note:** This option and [delete_objects_from_source_after_transfer] - // [google.storagetransfer.v1.TransferOptions.delete_objects_from_source_after_transfer] - // are mutually exclusive. + // **Note:** This option and [delete_objects_from_source_after_transfer][google.storagetransfer.v1.TransferOptions.delete_objects_from_source_after_transfer] are + // mutually exclusive. bool delete_objects_unique_in_sink = 2; // Whether objects should be deleted from the source after they are // transferred to the sink. // - // **Note:** This option and [delete_objects_unique_in_sink] - // [google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] - // are mutually exclusive. + // **Note:** This option and [delete_objects_unique_in_sink][google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] are mutually + // exclusive. bool delete_objects_from_source_after_transfer = 3; + + // When to overwrite objects that already exist in the sink. If not set + // overwrite behavior is determined by + // [overwrite_objects_already_existing_in_sink][google.storagetransfer.v1.TransferOptions.overwrite_objects_already_existing_in_sink]. + OverwriteWhen overwrite_when = 4; + + // Represents the selected metadata options for a transfer job. This feature + // is in Preview. + MetadataOptions metadata_options = 5; } // Configuration for running a transfer. @@ -353,6 +421,9 @@ message TransferSpec { oneof data_sink { // A Cloud Storage data sink. GcsData gcs_data_sink = 4; + + // A POSIX Filesystem data sink. + PosixFilesystem posix_data_sink = 13; } // The read source of the data. @@ -366,10 +437,21 @@ message TransferSpec { // An HTTP URL data source. HttpData http_data_source = 3; + // A POSIX Filesystem data source. + PosixFilesystem posix_data_source = 14; + // An Azure Blob Storage data source. AzureBlobStorageData azure_blob_storage_data_source = 8; } + // Represents a supported data container type which is required for transfer + // jobs which needs a data source, a data sink and an intermediate location to + // transfer data through. This is validated on TransferJob creation. + oneof intermediate_data_location { + // Cloud Storage intermediate data location. + GcsData gcs_intermediate_data_location = 16; + } + // Only objects that satisfy these object conditions are included in the set // of data source and data sink objects. Object conditions based on // objects' "last modification time" do not exclude objects in a data sink. @@ -381,39 +463,236 @@ message TransferSpec { // are specified, the request fails with an // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. TransferOptions transfer_options = 6; + + // A manifest file provides a list of objects to be transferred from the data + // source. This field points to the location of the manifest file. + // Otherwise, the entire source bucket is used. ObjectConditions still apply. + TransferManifest transfer_manifest = 15; + + // Specifies the agent pool name associated with the posix data source. When + // unspecified, the default name is used. + string source_agent_pool_name = 17; + + // Specifies the agent pool name associated with the posix data sink. When + // unspecified, the default name is used. + string sink_agent_pool_name = 18; +} + +// Specifies the metadata options for running a transfer. +message MetadataOptions { + // Whether symlinks should be skipped or preserved during a transfer job. + enum Symlink { + // Symlink behavior is unspecified. + SYMLINK_UNSPECIFIED = 0; + + // Do not preserve symlinks during a transfer job. + SYMLINK_SKIP = 1; + + // Preserve symlinks during a transfer job. + SYMLINK_PRESERVE = 2; + } + + // Options for handling file mode attribute. + enum Mode { + // Mode behavior is unspecified. + MODE_UNSPECIFIED = 0; + + // Do not preserve mode during a transfer job. + MODE_SKIP = 1; + + // Preserve mode during a transfer job. + MODE_PRESERVE = 2; + } + + // Options for handling file GID attribute. + enum GID { + // GID behavior is unspecified. + GID_UNSPECIFIED = 0; + + // Do not preserve GID during a transfer job. + GID_SKIP = 1; + + // Preserve GID during a transfer job. + GID_NUMBER = 2; + } + + // Options for handling file UID attribute. + enum UID { + // UID behavior is unspecified. + UID_UNSPECIFIED = 0; + + // Do not preserve UID during a transfer job. + UID_SKIP = 1; + + // Preserve UID during a transfer job. + UID_NUMBER = 2; + } + + // Options for handling Cloud Storage object ACLs. + enum Acl { + // ACL behavior is unspecified. + ACL_UNSPECIFIED = 0; + + // Use the destination bucket's default object ACLS, if applicable. + ACL_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original ACLs. This requires the service account + // to have `storage.objects.getIamPolicy` permission for the source object. + // [Uniform bucket-level + // access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) + // must not be enabled on either the source or destination buckets. + ACL_PRESERVE = 2; + } + + // Options for handling Google Cloud Storage object storage class. + enum StorageClass { + // Storage class behavior is unspecified. + STORAGE_CLASS_UNSPECIFIED = 0; + + // Use the destination bucket's default storage class. + STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original storage class. This is only supported for + // transfers from Google Cloud Storage buckets. + STORAGE_CLASS_PRESERVE = 2; + + // Set the storage class to STANDARD. + STORAGE_CLASS_STANDARD = 3; + + // Set the storage class to NEARLINE. + STORAGE_CLASS_NEARLINE = 4; + + // Set the storage class to COLDLINE. + STORAGE_CLASS_COLDLINE = 5; + + // Set the storage class to ARCHIVE. + STORAGE_CLASS_ARCHIVE = 6; + } + + // Options for handling temporary holds for Google Cloud Storage objects. + enum TemporaryHold { + // Temporary hold behavior is unspecified. + TEMPORARY_HOLD_UNSPECIFIED = 0; + + // Do not set a temporary hold on the destination object. + TEMPORARY_HOLD_SKIP = 1; + + // Preserve the object's original temporary hold status. + TEMPORARY_HOLD_PRESERVE = 2; + } + + // Options for handling the KmsKey setting for Google Cloud Storage objects. + enum KmsKey { + // KmsKey behavior is unspecified. + KMS_KEY_UNSPECIFIED = 0; + + // Use the destination bucket's default encryption settings. + KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original Cloud KMS customer-managed encryption key + // (CMEK) if present. Objects that do not use a Cloud KMS encryption key + // will be encrypted using the destination bucket's encryption settings. + KMS_KEY_PRESERVE = 2; + } + + // Options for handling `timeCreated` metadata for Google Cloud Storage + // objects. + enum TimeCreated { + // TimeCreated behavior is unspecified. + TIME_CREATED_UNSPECIFIED = 0; + + // Do not preserve the `timeCreated` metadata from the source object. + TIME_CREATED_SKIP = 1; + + // Preserves the source object's `timeCreated` metadata in the `customTime` + // field in the destination object. Note that any value stored in the + // source object's `customTime` field will not be propagated to the + // destination object. + TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2; + } + + // Specifies how symlinks should be handled by the transfer. By default, + // symlinks are not preserved. Only applicable to transfers involving + // POSIX file systems, and ignored for other transfers. + Symlink symlink = 1; + + // Specifies how each file's mode attribute should be handled by the transfer. + // By default, mode is not preserved. Only applicable to transfers involving + // POSIX file systems, and ignored for other transfers. + Mode mode = 2; + + // Specifies how each file's POSIX group ID (GID) attribute should be handled + // by the transfer. By default, GID is not preserved. Only applicable to + // transfers involving POSIX file systems, and ignored for other transfers. + GID gid = 3; + + // Specifies how each file's POSIX user ID (UID) attribute should be handled + // by the transfer. By default, UID is not preserved. Only applicable to + // transfers involving POSIX file systems, and ignored for other transfers. + UID uid = 4; + + // Specifies how each object's ACLs should be preserved for transfers between + // Google Cloud Storage buckets. If unspecified, the default behavior is the + // same as ACL_DESTINATION_BUCKET_DEFAULT. + Acl acl = 5; + + // Specifies the storage class to set on objects being transferred to Google + // Cloud Storage buckets. If unspecified, the default behavior is the same as + // [STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.StorageClass.STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT]. + StorageClass storage_class = 6; + + // Specifies how each object's temporary hold status should be preserved for + // transfers between Google Cloud Storage buckets. If unspecified, the + // default behavior is the same as + // [TEMPORARY_HOLD_PRESERVE][google.storagetransfer.v1.MetadataOptions.TemporaryHold.TEMPORARY_HOLD_PRESERVE]. + TemporaryHold temporary_hold = 7; + + // Specifies how each object's Cloud KMS customer-managed encryption key + // (CMEK) is preserved for transfers between Google Cloud Storage buckets. If + // unspecified, the default behavior is the same as + // [KMS_KEY_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.KmsKey.KMS_KEY_DESTINATION_BUCKET_DEFAULT]. + KmsKey kms_key = 8; + + // Specifies how each object's `timeCreated` metadata is preserved for + // transfers between Google Cloud Storage buckets. If unspecified, the + // default behavior is the same as + // [TIME_CREATED_SKIP][google.storagetransfer.v1.MetadataOptions.TimeCreated.TIME_CREATED_SKIP]. + TimeCreated time_created = 9; +} + +// Specifies where the manifest is located. +message TransferManifest { + // Specifies the path to the manifest in Cloud Storage. The Google-managed + // service account for the transfer must have `storage.objects.get` + // permission for this object. An example path is + // `gs://bucket_name/path/manifest.csv`. + string location = 1; } // Transfers can be scheduled to recur or to run just once. message Schedule { // Required. The start date of a transfer. Date boundaries are determined - // relative to UTC time. If `schedule_start_date` and - // [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] + // relative to UTC time. If `schedule_start_date` and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] // are in the past relative to the job's creation time, the transfer starts // the day after you schedule the transfer request. // // **Note:** When starting jobs at or near midnight UTC it is possible that - // a job will start later than expected. For example, if you send an outbound + // a job starts later than expected. For example, if you send an outbound // request on June 1 one millisecond prior to midnight UTC and the Storage - // Transfer Service server receives the request on June 2, then it will create + // Transfer Service server receives the request on June 2, then it creates // a TransferJob with `schedule_start_date` set to June 2 and a // `start_time_of_day` set to midnight UTC. The first scheduled - // [TransferOperation][google.storagetransfer.v1.TransferOperation] will take - // place on June 3 at midnight UTC. - google.type.Date schedule_start_date = 1 - [(google.api.field_behavior) = REQUIRED]; + // [TransferOperation][google.storagetransfer.v1.TransferOperation] takes place on June 3 at midnight UTC. + google.type.Date schedule_start_date = 1 [(google.api.field_behavior) = REQUIRED]; // The last day a transfer runs. Date boundaries are determined relative to - // UTC time. A job will run once per 24 hours within the following guidelines: + // UTC time. A job runs once per 24 hours within the following guidelines: // - // * If `schedule_end_date` and - // [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] - // are the same and in + // * If `schedule_end_date` and [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] are the same and in // the future relative to UTC, the transfer is executed only one time. // * If `schedule_end_date` is later than `schedule_start_date` and - // `schedule_end_date` is in the future relative to UTC, the job will - // run each day at - // [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] - // through `schedule_end_date`. + // `schedule_end_date` is in the future relative to UTC, the job runs each + // day at [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] through `schedule_end_date`. google.type.Date schedule_end_date = 2; // The time in UTC that a transfer job is scheduled to run. Transfers may @@ -423,8 +702,7 @@ message Schedule { // // * One-time transfers run immediately. // * Recurring transfers run immediately, and each day at midnight UTC, - // through - // [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date]. + // through [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date]. // // If `start_time_of_day` is specified: // @@ -434,15 +712,11 @@ message Schedule { google.type.TimeOfDay start_time_of_day = 3; // The time in UTC that no further transfer operations are scheduled. Combined - // with - // [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date], - // `end_time_of_day` specifies the end date and time for starting new transfer - // operations. This field must be greater than or equal to the timestamp - // corresponding to the combintation of - // [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] - // and - // [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day], - // and is subject to the following: + // with [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date], `end_time_of_day` specifies the end date and + // time for starting new transfer operations. This field must be greater than + // or equal to the timestamp corresponding to the combintation of + // [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day], and is subject to the + // following: // // * If `end_time_of_day` is not set and `schedule_end_date` is set, then // a default value of `23:59:59` is used for `end_time_of_day`. @@ -465,10 +739,10 @@ message TransferJob { // Zero is an illegal value. STATUS_UNSPECIFIED = 0; - // New transfers will be performed based on the schedule. + // New transfers are performed based on the schedule. ENABLED = 1; - // New transfers will not be scheduled. + // New transfers are not scheduled. DISABLED = 2; // This is a soft delete state. After a transfer job is set to this @@ -480,19 +754,28 @@ message TransferJob { // A unique name (within the transfer project) assigned when the job is // created. If this field is empty in a CreateTransferJobRequest, Storage - // Transfer Service will assign a unique name. Otherwise, the specified name + // Transfer Service assigns a unique name. Otherwise, the specified name // is used as the unique name for this job. // // If the specified name is in use by a job, the creation request fails with // an [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. // // This name must start with `"transferJobs/"` prefix and end with a letter or - // a number, and should be no more than 128 characters. This name must not - // start with 'transferJobs/OPI'. 'transferJobs/OPI' is a reserved prefix. - // Example: + // a number, and should be no more than 128 characters. For transfers + // involving PosixFilesystem, this name must start with `transferJobs/OPI` + // specifically. For all other transfer types, this name must not start with + // `transferJobs/OPI`. + // + // Non-PosixFilesystem example: // `"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"` // - // Invalid job names will fail with an + // PosixFilesystem example: + // `"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + // + // Applications must not rely on the enforcement of naming requirements + // involving OPI. + // + // Invalid job names fail with an // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. string name = 1; @@ -500,18 +783,22 @@ message TransferJob { // bytes when Unicode-encoded. string description = 2; - // The ID of the Google Cloud Platform Project that owns the job. + // The ID of the Google Cloud project that owns the job. string project_id = 3; // Transfer specification. TransferSpec transfer_spec = 4; - // Notification configuration. + // Notification configuration. This is not supported for transfers involving + // PosixFilesystem. NotificationConfig notification_config = 11; + // Logging configuration. + LoggingConfig logging_config = 14; + // Specifies schedule for the transfer job. - // This is an optional field. When the field is not set, the job will never - // execute a transfer, unless you invoke RunTransferJob or update the job to + // This is an optional field. When the field is not set, the job never + // executes a transfer, unless you invoke RunTransferJob or update the job to // have a non-empty schedule. Schedule schedule = 5; @@ -520,23 +807,19 @@ message TransferJob { // // **Note:** The effect of the new job status takes place during a subsequent // job run. For example, if you change the job status from - // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED] to - // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and an - // operation spawned by the transfer is running, the status change would not - // affect the current operation. + // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED] to [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and an operation + // spawned by the transfer is running, the status change would not affect the + // current operation. Status status = 6; // Output only. The time that the transfer job was created. - google.protobuf.Timestamp creation_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp creation_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time that the transfer job was last modified. - google.protobuf.Timestamp last_modification_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp last_modification_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time that the transfer job was deleted. - google.protobuf.Timestamp deletion_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp deletion_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; // The name of the most recently started TransferOperation of this JobConfig. // Present if a TransferOperation has been created for this JobConfig. @@ -564,7 +847,7 @@ message ErrorSummary { // Error samples. // - // At most 5 error log entries will be recorded for a given + // At most 5 error log entries are recorded for a given // error code for a single transfer operation. repeated ErrorLogEntry error_log_entries = 3; } @@ -626,29 +909,50 @@ message TransferCounters { // Bytes that failed to be deleted from the data sink. int64 bytes_failed_to_delete_from_sink = 16; + + // For transfers involving PosixFilesystem only. + // + // Number of directories found while listing. For example, if the root + // directory of the transfer is `base/` and there are two other directories, + // `a/` and `b/` under this directory, the count after listing `base/`, + // `base/a/` and `base/b/` is 3. + int64 directories_found_from_source = 17; + + // For transfers involving PosixFilesystem only. + // + // Number of listing failures for each directory found at the source. + // Potential failures when listing a directory include permission failure or + // block failure. If listing a directory fails, no files in the directory are + // transferred. + int64 directories_failed_to_list_from_source = 18; + + // For transfers involving PosixFilesystem only. + // + // Number of successful listings for each directory found at the source. + int64 directories_successfully_listed_from_source = 19; + + // Number of successfully cleaned up intermediate objects. + int64 intermediate_objects_cleaned_up = 22; + + // Number of intermediate objects failed cleaned up. + int64 intermediate_objects_failed_cleaned_up = 23; } -// Specification to configure notifications published to Cloud Pub/Sub. -// Notifications will be published to the customer-provided topic using the +// Specification to configure notifications published to Pub/Sub. +// Notifications are published to the customer-provided topic using the // following `PubsubMessage.attributes`: // -// * `"eventType"`: one of the -// [EventType][google.storagetransfer.v1.NotificationConfig.EventType] values -// * `"payloadFormat"`: one of the -// [PayloadFormat][google.storagetransfer.v1.NotificationConfig.PayloadFormat] -// values -// * `"projectId"`: the -// [project_id][google.storagetransfer.v1.TransferOperation.project_id] of the +// * `"eventType"`: one of the [EventType][google.storagetransfer.v1.NotificationConfig.EventType] values +// * `"payloadFormat"`: one of the [PayloadFormat][google.storagetransfer.v1.NotificationConfig.PayloadFormat] values +// * `"projectId"`: the [project_id][google.storagetransfer.v1.TransferOperation.project_id] of the // `TransferOperation` // * `"transferJobName"`: the -// [transfer_job_name][google.storagetransfer.v1.TransferOperation.transfer_job_name] -// of the `TransferOperation` -// * `"transferOperationName"`: the -// [name][google.storagetransfer.v1.TransferOperation.name] of the +// [transfer_job_name][google.storagetransfer.v1.TransferOperation.transfer_job_name] of the +// `TransferOperation` +// * `"transferOperationName"`: the [name][google.storagetransfer.v1.TransferOperation.name] of the // `TransferOperation` // -// The `PubsubMessage.data` will contain a -// [TransferOperation][google.storagetransfer.v1.TransferOperation] resource +// The `PubsubMessage.data` contains a [TransferOperation][google.storagetransfer.v1.TransferOperation] resource // formatted according to the specified `PayloadFormat`. message NotificationConfig { // Enum for specifying event types for which notifications are to be @@ -688,9 +992,9 @@ message NotificationConfig { JSON = 2; } - // Required. The `Topic.name` of the Cloud Pub/Sub topic to which to publish + // Required. The `Topic.name` of the Pub/Sub topic to which to publish // notifications. Must be of the format: `projects/{project}/topics/{topic}`. - // Not matching this format will result in an + // Not matching this format results in an // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; @@ -702,6 +1006,63 @@ message NotificationConfig { PayloadFormat payload_format = 3 [(google.api.field_behavior) = REQUIRED]; } +// Specifies the logging behavior for transfer operations. +// +// For cloud-to-cloud transfers, logs are sent to Cloud Logging. See +// [Read transfer +// logs](https://cloud.google.com/storage-transfer/docs/read-transfer-logs) for +// details. +// +// For transfers to or from a POSIX file system, logs are stored in the +// Cloud Storage bucket that is the source or sink of the transfer. +// See [Managing Transfer for on-premises jobs] +// (https://cloud.google.com/storage-transfer/docs/managing-on-prem-jobs#viewing-logs) +// for details. +message LoggingConfig { + // Loggable actions. + enum LoggableAction { + // Default value. This value is unused. + LOGGABLE_ACTION_UNSPECIFIED = 0; + + // Listing objects in a bucket. + FIND = 1; + + // Deleting objects at the source or the destination. + DELETE = 2; + + // Copying objects to Google Cloud Storage. + COPY = 3; + } + + // Loggable action states. + enum LoggableActionState { + // Default value. This value is unused. + LOGGABLE_ACTION_STATE_UNSPECIFIED = 0; + + // `LoggableAction` completed successfully. `SUCCEEDED` actions are + // logged as [INFO][google.logging.type.LogSeverity.INFO]. + SUCCEEDED = 1; + + // `LoggableAction` terminated in an error state. `FAILED` actions are + // logged as [ERROR][google.logging.type.LogSeverity.ERROR]. + FAILED = 2; + } + + // Specifies the actions to be logged. If empty, no logs are generated. + // Not supported for transfers with PosixFilesystem data sources; use + // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. + repeated LoggableAction log_actions = 1; + + // States in which `log_actions` are logged. If empty, no logs are generated. + // Not supported for transfers with PosixFilesystem data sources; use + // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. + repeated LoggableActionState log_action_states = 2; + + // For transfers with a PosixFilesystem source, this option enables the Cloud + // Storage transfer logs for this transfer. + bool enable_onprem_gcs_transfer_logs = 3; +} + // A description of the execution of a transfer. message TransferOperation { // The status of a TransferOperation. @@ -731,7 +1092,7 @@ message TransferOperation { // A globally unique ID assigned by the system. string name = 1; - // The ID of the Google Cloud Platform Project that owns the operation. + // The ID of the Google Cloud project that owns the operation. string project_id = 2; // Transfer specification. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 99dd367..3d2b3c2 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -154,6 +154,76 @@ export namespace google { * @returns Promise */ public runTransferJob(request: google.storagetransfer.v1.IRunTransferJobRequest): Promise; + + /** + * Calls CreateAgentPool. + * @param request CreateAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentPool + */ + public createAgentPool(request: google.storagetransfer.v1.ICreateAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.CreateAgentPoolCallback): void; + + /** + * Calls CreateAgentPool. + * @param request CreateAgentPoolRequest message or plain object + * @returns Promise + */ + public createAgentPool(request: google.storagetransfer.v1.ICreateAgentPoolRequest): Promise; + + /** + * Calls UpdateAgentPool. + * @param request UpdateAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentPool + */ + public updateAgentPool(request: google.storagetransfer.v1.IUpdateAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.UpdateAgentPoolCallback): void; + + /** + * Calls UpdateAgentPool. + * @param request UpdateAgentPoolRequest message or plain object + * @returns Promise + */ + public updateAgentPool(request: google.storagetransfer.v1.IUpdateAgentPoolRequest): Promise; + + /** + * Calls GetAgentPool. + * @param request GetAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentPool + */ + public getAgentPool(request: google.storagetransfer.v1.IGetAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.GetAgentPoolCallback): void; + + /** + * Calls GetAgentPool. + * @param request GetAgentPoolRequest message or plain object + * @returns Promise + */ + public getAgentPool(request: google.storagetransfer.v1.IGetAgentPoolRequest): Promise; + + /** + * Calls ListAgentPools. + * @param request ListAgentPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAgentPoolsResponse + */ + public listAgentPools(request: google.storagetransfer.v1.IListAgentPoolsRequest, callback: google.storagetransfer.v1.StorageTransferService.ListAgentPoolsCallback): void; + + /** + * Calls ListAgentPools. + * @param request ListAgentPoolsRequest message or plain object + * @returns Promise + */ + public listAgentPools(request: google.storagetransfer.v1.IListAgentPoolsRequest): Promise; + + /** + * Calls DeleteAgentPool. + * @param request DeleteAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgentPool(request: google.storagetransfer.v1.IDeleteAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.DeleteAgentPoolCallback): void; + + /** + * Calls DeleteAgentPool. + * @param request DeleteAgentPoolRequest message or plain object + * @returns Promise + */ + public deleteAgentPool(request: google.storagetransfer.v1.IDeleteAgentPoolRequest): Promise; } namespace StorageTransferService { @@ -213,6 +283,41 @@ export namespace google { * @param [response] Operation */ type RunTransferJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#createAgentPool}. + * @param error Error, if any + * @param [response] AgentPool + */ + type CreateAgentPoolCallback = (error: (Error|null), response?: google.storagetransfer.v1.AgentPool) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#updateAgentPool}. + * @param error Error, if any + * @param [response] AgentPool + */ + type UpdateAgentPoolCallback = (error: (Error|null), response?: google.storagetransfer.v1.AgentPool) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#getAgentPool}. + * @param error Error, if any + * @param [response] AgentPool + */ + type GetAgentPoolCallback = (error: (Error|null), response?: google.storagetransfer.v1.AgentPool) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#listAgentPools}. + * @param error Error, if any + * @param [response] ListAgentPoolsResponse + */ + type ListAgentPoolsCallback = (error: (Error|null), response?: google.storagetransfer.v1.ListAgentPoolsResponse) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#deleteAgentPool}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentPoolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Properties of a GetGoogleServiceAccountRequest. */ @@ -1073,828 +1178,1715 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a GoogleServiceAccount. */ - interface IGoogleServiceAccount { + /** Properties of a CreateAgentPoolRequest. */ + interface ICreateAgentPoolRequest { - /** GoogleServiceAccount accountEmail */ - accountEmail?: (string|null); + /** CreateAgentPoolRequest projectId */ + projectId?: (string|null); - /** GoogleServiceAccount subjectId */ - subjectId?: (string|null); + /** CreateAgentPoolRequest agentPool */ + agentPool?: (google.storagetransfer.v1.IAgentPool|null); + + /** CreateAgentPoolRequest agentPoolId */ + agentPoolId?: (string|null); } - /** Represents a GoogleServiceAccount. */ - class GoogleServiceAccount implements IGoogleServiceAccount { + /** Represents a CreateAgentPoolRequest. */ + class CreateAgentPoolRequest implements ICreateAgentPoolRequest { /** - * Constructs a new GoogleServiceAccount. + * Constructs a new CreateAgentPoolRequest. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IGoogleServiceAccount); + constructor(properties?: google.storagetransfer.v1.ICreateAgentPoolRequest); - /** GoogleServiceAccount accountEmail. */ - public accountEmail: string; + /** CreateAgentPoolRequest projectId. */ + public projectId: string; - /** GoogleServiceAccount subjectId. */ - public subjectId: string; + /** CreateAgentPoolRequest agentPool. */ + public agentPool?: (google.storagetransfer.v1.IAgentPool|null); + + /** CreateAgentPoolRequest agentPoolId. */ + public agentPoolId: string; /** - * Creates a new GoogleServiceAccount instance using the specified properties. + * Creates a new CreateAgentPoolRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GoogleServiceAccount instance + * @returns CreateAgentPoolRequest instance */ - public static create(properties?: google.storagetransfer.v1.IGoogleServiceAccount): google.storagetransfer.v1.GoogleServiceAccount; + public static create(properties?: google.storagetransfer.v1.ICreateAgentPoolRequest): google.storagetransfer.v1.CreateAgentPoolRequest; /** - * Encodes the specified GoogleServiceAccount message. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. - * @param message GoogleServiceAccount message or plain object to encode + * Encodes the specified CreateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. + * @param message CreateAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IGoogleServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.ICreateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GoogleServiceAccount message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. - * @param message GoogleServiceAccount message or plain object to encode + * Encodes the specified CreateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. + * @param message CreateAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IGoogleServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.ICreateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GoogleServiceAccount message from the specified reader or buffer. + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GoogleServiceAccount + * @returns CreateAgentPoolRequest * @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.storagetransfer.v1.GoogleServiceAccount; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.CreateAgentPoolRequest; /** - * Decodes a GoogleServiceAccount message from the specified reader or buffer, length delimited. + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GoogleServiceAccount + * @returns CreateAgentPoolRequest * @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.storagetransfer.v1.GoogleServiceAccount; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.CreateAgentPoolRequest; /** - * Verifies a GoogleServiceAccount message. + * Verifies a CreateAgentPoolRequest 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 GoogleServiceAccount message from a plain object. Also converts values to their respective internal types. + * Creates a CreateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GoogleServiceAccount + * @returns CreateAgentPoolRequest */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GoogleServiceAccount; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.CreateAgentPoolRequest; /** - * Creates a plain object from a GoogleServiceAccount message. Also converts values to other types if specified. - * @param message GoogleServiceAccount + * Creates a plain object from a CreateAgentPoolRequest message. Also converts values to other types if specified. + * @param message CreateAgentPoolRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.GoogleServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.CreateAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GoogleServiceAccount to JSON. + * Converts this CreateAgentPoolRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AwsAccessKey. */ - interface IAwsAccessKey { + /** Properties of an UpdateAgentPoolRequest. */ + interface IUpdateAgentPoolRequest { - /** AwsAccessKey accessKeyId */ - accessKeyId?: (string|null); + /** UpdateAgentPoolRequest agentPool */ + agentPool?: (google.storagetransfer.v1.IAgentPool|null); - /** AwsAccessKey secretAccessKey */ - secretAccessKey?: (string|null); + /** UpdateAgentPoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an AwsAccessKey. */ - class AwsAccessKey implements IAwsAccessKey { + /** Represents an UpdateAgentPoolRequest. */ + class UpdateAgentPoolRequest implements IUpdateAgentPoolRequest { /** - * Constructs a new AwsAccessKey. + * Constructs a new UpdateAgentPoolRequest. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IAwsAccessKey); + constructor(properties?: google.storagetransfer.v1.IUpdateAgentPoolRequest); - /** AwsAccessKey accessKeyId. */ - public accessKeyId: string; + /** UpdateAgentPoolRequest agentPool. */ + public agentPool?: (google.storagetransfer.v1.IAgentPool|null); - /** AwsAccessKey secretAccessKey. */ - public secretAccessKey: string; + /** UpdateAgentPoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new AwsAccessKey instance using the specified properties. + * Creates a new UpdateAgentPoolRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AwsAccessKey instance + * @returns UpdateAgentPoolRequest instance */ - public static create(properties?: google.storagetransfer.v1.IAwsAccessKey): google.storagetransfer.v1.AwsAccessKey; + public static create(properties?: google.storagetransfer.v1.IUpdateAgentPoolRequest): google.storagetransfer.v1.UpdateAgentPoolRequest; /** - * Encodes the specified AwsAccessKey message. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. - * @param message AwsAccessKey message or plain object to encode + * Encodes the specified UpdateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. + * @param message UpdateAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IAwsAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.IUpdateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AwsAccessKey message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. - * @param message AwsAccessKey message or plain object to encode + * Encodes the specified UpdateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. + * @param message UpdateAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IAwsAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.IUpdateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AwsAccessKey message from the specified reader or buffer. + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AwsAccessKey + * @returns UpdateAgentPoolRequest * @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.storagetransfer.v1.AwsAccessKey; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.UpdateAgentPoolRequest; /** - * Decodes an AwsAccessKey message from the specified reader or buffer, length delimited. + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AwsAccessKey + * @returns UpdateAgentPoolRequest * @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.storagetransfer.v1.AwsAccessKey; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.UpdateAgentPoolRequest; /** - * Verifies an AwsAccessKey message. + * Verifies an UpdateAgentPoolRequest 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 AwsAccessKey message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AwsAccessKey + * @returns UpdateAgentPoolRequest */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AwsAccessKey; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.UpdateAgentPoolRequest; /** - * Creates a plain object from an AwsAccessKey message. Also converts values to other types if specified. - * @param message AwsAccessKey + * Creates a plain object from an UpdateAgentPoolRequest message. Also converts values to other types if specified. + * @param message UpdateAgentPoolRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.AwsAccessKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.UpdateAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AwsAccessKey to JSON. + * Converts this UpdateAgentPoolRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AzureCredentials. */ - interface IAzureCredentials { + /** Properties of a GetAgentPoolRequest. */ + interface IGetAgentPoolRequest { - /** AzureCredentials sasToken */ - sasToken?: (string|null); + /** GetAgentPoolRequest name */ + name?: (string|null); } - /** Represents an AzureCredentials. */ - class AzureCredentials implements IAzureCredentials { + /** Represents a GetAgentPoolRequest. */ + class GetAgentPoolRequest implements IGetAgentPoolRequest { /** - * Constructs a new AzureCredentials. + * Constructs a new GetAgentPoolRequest. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IAzureCredentials); + constructor(properties?: google.storagetransfer.v1.IGetAgentPoolRequest); - /** AzureCredentials sasToken. */ - public sasToken: string; + /** GetAgentPoolRequest name. */ + public name: string; /** - * Creates a new AzureCredentials instance using the specified properties. + * Creates a new GetAgentPoolRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AzureCredentials instance + * @returns GetAgentPoolRequest instance */ - public static create(properties?: google.storagetransfer.v1.IAzureCredentials): google.storagetransfer.v1.AzureCredentials; + public static create(properties?: google.storagetransfer.v1.IGetAgentPoolRequest): google.storagetransfer.v1.GetAgentPoolRequest; /** - * Encodes the specified AzureCredentials message. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. - * @param message AzureCredentials message or plain object to encode + * Encodes the specified GetAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. + * @param message GetAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IAzureCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.IGetAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AzureCredentials message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. - * @param message AzureCredentials message or plain object to encode + * Encodes the specified GetAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. + * @param message GetAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IAzureCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.IGetAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AzureCredentials message from the specified reader or buffer. + * Decodes a GetAgentPoolRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AzureCredentials + * @returns GetAgentPoolRequest * @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.storagetransfer.v1.AzureCredentials; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.GetAgentPoolRequest; /** - * Decodes an AzureCredentials message from the specified reader or buffer, length delimited. + * Decodes a GetAgentPoolRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AzureCredentials + * @returns GetAgentPoolRequest * @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.storagetransfer.v1.AzureCredentials; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.GetAgentPoolRequest; /** - * Verifies an AzureCredentials message. + * Verifies a GetAgentPoolRequest 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 AzureCredentials message from a plain object. Also converts values to their respective internal types. + * Creates a GetAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AzureCredentials + * @returns GetAgentPoolRequest */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AzureCredentials; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GetAgentPoolRequest; /** - * Creates a plain object from an AzureCredentials message. Also converts values to other types if specified. - * @param message AzureCredentials + * Creates a plain object from a GetAgentPoolRequest message. Also converts values to other types if specified. + * @param message GetAgentPoolRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.AzureCredentials, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.GetAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AzureCredentials to JSON. + * Converts this GetAgentPoolRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ObjectConditions. */ - interface IObjectConditions { - - /** ObjectConditions minTimeElapsedSinceLastModification */ - minTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); - - /** ObjectConditions maxTimeElapsedSinceLastModification */ - maxTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); - - /** ObjectConditions includePrefixes */ - includePrefixes?: (string[]|null); - - /** ObjectConditions excludePrefixes */ - excludePrefixes?: (string[]|null); + /** Properties of a DeleteAgentPoolRequest. */ + interface IDeleteAgentPoolRequest { - /** ObjectConditions lastModifiedSince */ - lastModifiedSince?: (google.protobuf.ITimestamp|null); - - /** ObjectConditions lastModifiedBefore */ - lastModifiedBefore?: (google.protobuf.ITimestamp|null); + /** DeleteAgentPoolRequest name */ + name?: (string|null); } - /** Represents an ObjectConditions. */ - class ObjectConditions implements IObjectConditions { + /** Represents a DeleteAgentPoolRequest. */ + class DeleteAgentPoolRequest implements IDeleteAgentPoolRequest { /** - * Constructs a new ObjectConditions. + * Constructs a new DeleteAgentPoolRequest. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IObjectConditions); - - /** ObjectConditions minTimeElapsedSinceLastModification. */ - public minTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); - - /** ObjectConditions maxTimeElapsedSinceLastModification. */ - public maxTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); - - /** ObjectConditions includePrefixes. */ - public includePrefixes: string[]; - - /** ObjectConditions excludePrefixes. */ - public excludePrefixes: string[]; - - /** ObjectConditions lastModifiedSince. */ - public lastModifiedSince?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.storagetransfer.v1.IDeleteAgentPoolRequest); - /** ObjectConditions lastModifiedBefore. */ - public lastModifiedBefore?: (google.protobuf.ITimestamp|null); + /** DeleteAgentPoolRequest name. */ + public name: string; /** - * Creates a new ObjectConditions instance using the specified properties. + * Creates a new DeleteAgentPoolRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ObjectConditions instance + * @returns DeleteAgentPoolRequest instance */ - public static create(properties?: google.storagetransfer.v1.IObjectConditions): google.storagetransfer.v1.ObjectConditions; + public static create(properties?: google.storagetransfer.v1.IDeleteAgentPoolRequest): google.storagetransfer.v1.DeleteAgentPoolRequest; /** - * Encodes the specified ObjectConditions message. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. - * @param message ObjectConditions message or plain object to encode + * Encodes the specified DeleteAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. + * @param message DeleteAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IObjectConditions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.IDeleteAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ObjectConditions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. - * @param message ObjectConditions message or plain object to encode + * Encodes the specified DeleteAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. + * @param message DeleteAgentPoolRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IObjectConditions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.IDeleteAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ObjectConditions message from the specified reader or buffer. + * Decodes a DeleteAgentPoolRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ObjectConditions + * @returns DeleteAgentPoolRequest * @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.storagetransfer.v1.ObjectConditions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.DeleteAgentPoolRequest; /** - * Decodes an ObjectConditions message from the specified reader or buffer, length delimited. + * Decodes a DeleteAgentPoolRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ObjectConditions + * @returns DeleteAgentPoolRequest * @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.storagetransfer.v1.ObjectConditions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.DeleteAgentPoolRequest; /** - * Verifies an ObjectConditions message. + * Verifies a DeleteAgentPoolRequest 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 ObjectConditions message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ObjectConditions + * @returns DeleteAgentPoolRequest */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ObjectConditions; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.DeleteAgentPoolRequest; /** - * Creates a plain object from an ObjectConditions message. Also converts values to other types if specified. - * @param message ObjectConditions + * Creates a plain object from a DeleteAgentPoolRequest message. Also converts values to other types if specified. + * @param message DeleteAgentPoolRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.ObjectConditions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.DeleteAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ObjectConditions to JSON. + * Converts this DeleteAgentPoolRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsData. */ - interface IGcsData { + /** Properties of a ListAgentPoolsRequest. */ + interface IListAgentPoolsRequest { - /** GcsData bucketName */ - bucketName?: (string|null); + /** ListAgentPoolsRequest projectId */ + projectId?: (string|null); - /** GcsData path */ - path?: (string|null); + /** ListAgentPoolsRequest filter */ + filter?: (string|null); + + /** ListAgentPoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListAgentPoolsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a GcsData. */ - class GcsData implements IGcsData { + /** Represents a ListAgentPoolsRequest. */ + class ListAgentPoolsRequest implements IListAgentPoolsRequest { /** - * Constructs a new GcsData. + * Constructs a new ListAgentPoolsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IGcsData); + constructor(properties?: google.storagetransfer.v1.IListAgentPoolsRequest); - /** GcsData bucketName. */ - public bucketName: string; + /** ListAgentPoolsRequest projectId. */ + public projectId: string; - /** GcsData path. */ - public path: string; + /** ListAgentPoolsRequest filter. */ + public filter: string; + + /** ListAgentPoolsRequest pageSize. */ + public pageSize: number; + + /** ListAgentPoolsRequest pageToken. */ + public pageToken: string; /** - * Creates a new GcsData instance using the specified properties. + * Creates a new ListAgentPoolsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GcsData instance + * @returns ListAgentPoolsRequest instance */ - public static create(properties?: google.storagetransfer.v1.IGcsData): google.storagetransfer.v1.GcsData; + public static create(properties?: google.storagetransfer.v1.IListAgentPoolsRequest): google.storagetransfer.v1.ListAgentPoolsRequest; /** - * Encodes the specified GcsData message. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. - * @param message GcsData message or plain object to encode + * Encodes the specified ListAgentPoolsRequest message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. + * @param message ListAgentPoolsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IGcsData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.IListAgentPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. - * @param message GcsData message or plain object to encode + * Encodes the specified ListAgentPoolsRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. + * @param message ListAgentPoolsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IGcsData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.IListAgentPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsData message from the specified reader or buffer. + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsData + * @returns ListAgentPoolsRequest * @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.storagetransfer.v1.GcsData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ListAgentPoolsRequest; /** - * Decodes a GcsData message from the specified reader or buffer, length delimited. + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsData + * @returns ListAgentPoolsRequest * @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.storagetransfer.v1.GcsData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ListAgentPoolsRequest; /** - * Verifies a GcsData message. + * Verifies a ListAgentPoolsRequest 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 GcsData message from a plain object. Also converts values to their respective internal types. + * Creates a ListAgentPoolsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsData + * @returns ListAgentPoolsRequest */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GcsData; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ListAgentPoolsRequest; /** - * Creates a plain object from a GcsData message. Also converts values to other types if specified. - * @param message GcsData + * Creates a plain object from a ListAgentPoolsRequest message. Also converts values to other types if specified. + * @param message ListAgentPoolsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.GcsData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.ListAgentPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsData to JSON. + * Converts this ListAgentPoolsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AwsS3Data. */ - interface IAwsS3Data { - - /** AwsS3Data bucketName */ - bucketName?: (string|null); - - /** AwsS3Data awsAccessKey */ - awsAccessKey?: (google.storagetransfer.v1.IAwsAccessKey|null); + /** Properties of a ListAgentPoolsResponse. */ + interface IListAgentPoolsResponse { - /** AwsS3Data path */ - path?: (string|null); + /** ListAgentPoolsResponse agentPools */ + agentPools?: (google.storagetransfer.v1.IAgentPool[]|null); - /** AwsS3Data roleArn */ - roleArn?: (string|null); + /** ListAgentPoolsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an AwsS3Data. */ - class AwsS3Data implements IAwsS3Data { + /** Represents a ListAgentPoolsResponse. */ + class ListAgentPoolsResponse implements IListAgentPoolsResponse { /** - * Constructs a new AwsS3Data. + * Constructs a new ListAgentPoolsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IAwsS3Data); - - /** AwsS3Data bucketName. */ - public bucketName: string; + constructor(properties?: google.storagetransfer.v1.IListAgentPoolsResponse); - /** AwsS3Data awsAccessKey. */ - public awsAccessKey?: (google.storagetransfer.v1.IAwsAccessKey|null); - - /** AwsS3Data path. */ - public path: string; + /** ListAgentPoolsResponse agentPools. */ + public agentPools: google.storagetransfer.v1.IAgentPool[]; - /** AwsS3Data roleArn. */ - public roleArn: string; + /** ListAgentPoolsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new AwsS3Data instance using the specified properties. + * Creates a new ListAgentPoolsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns AwsS3Data instance + * @returns ListAgentPoolsResponse instance */ - public static create(properties?: google.storagetransfer.v1.IAwsS3Data): google.storagetransfer.v1.AwsS3Data; + public static create(properties?: google.storagetransfer.v1.IListAgentPoolsResponse): google.storagetransfer.v1.ListAgentPoolsResponse; /** - * Encodes the specified AwsS3Data message. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. - * @param message AwsS3Data message or plain object to encode + * Encodes the specified ListAgentPoolsResponse message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. + * @param message ListAgentPoolsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IAwsS3Data, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.IListAgentPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AwsS3Data message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. - * @param message AwsS3Data message or plain object to encode + * Encodes the specified ListAgentPoolsResponse message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. + * @param message ListAgentPoolsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IAwsS3Data, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.IListAgentPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AwsS3Data message from the specified reader or buffer. + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AwsS3Data + * @returns ListAgentPoolsResponse * @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.storagetransfer.v1.AwsS3Data; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ListAgentPoolsResponse; /** - * Decodes an AwsS3Data message from the specified reader or buffer, length delimited. + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AwsS3Data + * @returns ListAgentPoolsResponse * @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.storagetransfer.v1.AwsS3Data; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ListAgentPoolsResponse; /** - * Verifies an AwsS3Data message. + * Verifies a ListAgentPoolsResponse 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 AwsS3Data message from a plain object. Also converts values to their respective internal types. + * Creates a ListAgentPoolsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AwsS3Data + * @returns ListAgentPoolsResponse */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AwsS3Data; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ListAgentPoolsResponse; /** - * Creates a plain object from an AwsS3Data message. Also converts values to other types if specified. - * @param message AwsS3Data + * Creates a plain object from a ListAgentPoolsResponse message. Also converts values to other types if specified. + * @param message ListAgentPoolsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.AwsS3Data, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.ListAgentPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AwsS3Data to JSON. + * Converts this ListAgentPoolsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AzureBlobStorageData. */ - interface IAzureBlobStorageData { - - /** AzureBlobStorageData storageAccount */ - storageAccount?: (string|null); - - /** AzureBlobStorageData azureCredentials */ - azureCredentials?: (google.storagetransfer.v1.IAzureCredentials|null); + /** Properties of a GoogleServiceAccount. */ + interface IGoogleServiceAccount { - /** AzureBlobStorageData container */ - container?: (string|null); + /** GoogleServiceAccount accountEmail */ + accountEmail?: (string|null); - /** AzureBlobStorageData path */ - path?: (string|null); + /** GoogleServiceAccount subjectId */ + subjectId?: (string|null); } - /** Represents an AzureBlobStorageData. */ - class AzureBlobStorageData implements IAzureBlobStorageData { + /** Represents a GoogleServiceAccount. */ + class GoogleServiceAccount implements IGoogleServiceAccount { /** - * Constructs a new AzureBlobStorageData. + * Constructs a new GoogleServiceAccount. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IAzureBlobStorageData); - - /** AzureBlobStorageData storageAccount. */ - public storageAccount: string; - - /** AzureBlobStorageData azureCredentials. */ - public azureCredentials?: (google.storagetransfer.v1.IAzureCredentials|null); + constructor(properties?: google.storagetransfer.v1.IGoogleServiceAccount); - /** AzureBlobStorageData container. */ - public container: string; + /** GoogleServiceAccount accountEmail. */ + public accountEmail: string; - /** AzureBlobStorageData path. */ - public path: string; + /** GoogleServiceAccount subjectId. */ + public subjectId: string; /** - * Creates a new AzureBlobStorageData instance using the specified properties. + * Creates a new GoogleServiceAccount instance using the specified properties. * @param [properties] Properties to set - * @returns AzureBlobStorageData instance + * @returns GoogleServiceAccount instance */ - public static create(properties?: google.storagetransfer.v1.IAzureBlobStorageData): google.storagetransfer.v1.AzureBlobStorageData; + public static create(properties?: google.storagetransfer.v1.IGoogleServiceAccount): google.storagetransfer.v1.GoogleServiceAccount; /** - * Encodes the specified AzureBlobStorageData message. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. - * @param message AzureBlobStorageData message or plain object to encode + * Encodes the specified GoogleServiceAccount message. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * @param message GoogleServiceAccount message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IAzureBlobStorageData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.IGoogleServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AzureBlobStorageData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. - * @param message AzureBlobStorageData message or plain object to encode + * Encodes the specified GoogleServiceAccount message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * @param message GoogleServiceAccount message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IAzureBlobStorageData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.IGoogleServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AzureBlobStorageData message from the specified reader or buffer. + * Decodes a GoogleServiceAccount message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AzureBlobStorageData + * @returns GoogleServiceAccount * @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.storagetransfer.v1.AzureBlobStorageData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.GoogleServiceAccount; /** - * Decodes an AzureBlobStorageData message from the specified reader or buffer, length delimited. + * Decodes a GoogleServiceAccount message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AzureBlobStorageData + * @returns GoogleServiceAccount * @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.storagetransfer.v1.AzureBlobStorageData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.GoogleServiceAccount; /** - * Verifies an AzureBlobStorageData message. + * Verifies a GoogleServiceAccount 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 AzureBlobStorageData message from a plain object. Also converts values to their respective internal types. + * Creates a GoogleServiceAccount message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AzureBlobStorageData + * @returns GoogleServiceAccount */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AzureBlobStorageData; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GoogleServiceAccount; /** - * Creates a plain object from an AzureBlobStorageData message. Also converts values to other types if specified. - * @param message AzureBlobStorageData + * Creates a plain object from a GoogleServiceAccount message. Also converts values to other types if specified. + * @param message GoogleServiceAccount * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.AzureBlobStorageData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.GoogleServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AzureBlobStorageData to JSON. + * Converts this GoogleServiceAccount to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpData. */ - interface IHttpData { + /** Properties of an AwsAccessKey. */ + interface IAwsAccessKey { - /** HttpData listUrl */ - listUrl?: (string|null); + /** AwsAccessKey accessKeyId */ + accessKeyId?: (string|null); + + /** AwsAccessKey secretAccessKey */ + secretAccessKey?: (string|null); } - /** Represents a HttpData. */ - class HttpData implements IHttpData { + /** Represents an AwsAccessKey. */ + class AwsAccessKey implements IAwsAccessKey { /** - * Constructs a new HttpData. + * Constructs a new AwsAccessKey. * @param [properties] Properties to set */ - constructor(properties?: google.storagetransfer.v1.IHttpData); + constructor(properties?: google.storagetransfer.v1.IAwsAccessKey); - /** HttpData listUrl. */ - public listUrl: string; + /** AwsAccessKey accessKeyId. */ + public accessKeyId: string; + + /** AwsAccessKey secretAccessKey. */ + public secretAccessKey: string; /** - * Creates a new HttpData instance using the specified properties. + * Creates a new AwsAccessKey instance using the specified properties. * @param [properties] Properties to set - * @returns HttpData instance + * @returns AwsAccessKey instance */ - public static create(properties?: google.storagetransfer.v1.IHttpData): google.storagetransfer.v1.HttpData; + public static create(properties?: google.storagetransfer.v1.IAwsAccessKey): google.storagetransfer.v1.AwsAccessKey; /** - * Encodes the specified HttpData message. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. - * @param message HttpData message or plain object to encode + * Encodes the specified AwsAccessKey message. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * @param message AwsAccessKey message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.IHttpData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.IAwsAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HttpData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. - * @param message HttpData message or plain object to encode + * Encodes the specified AwsAccessKey message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * @param message AwsAccessKey message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.IHttpData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.IAwsAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpData message from the specified reader or buffer. + * Decodes an AwsAccessKey message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HttpData + * @returns AwsAccessKey * @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.storagetransfer.v1.HttpData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AwsAccessKey; /** - * Decodes a HttpData message from the specified reader or buffer, length delimited. + * Decodes an AwsAccessKey message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpData + * @returns AwsAccessKey * @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.storagetransfer.v1.HttpData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AwsAccessKey; /** - * Verifies a HttpData message. + * Verifies an AwsAccessKey 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 HttpData message from a plain object. Also converts values to their respective internal types. + * Creates an AwsAccessKey message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpData + * @returns AwsAccessKey */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.HttpData; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AwsAccessKey; /** - * Creates a plain object from a HttpData message. Also converts values to other types if specified. - * @param message HttpData + * Creates a plain object from an AwsAccessKey message. Also converts values to other types if specified. + * @param message AwsAccessKey * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.HttpData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.AwsAccessKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpData to JSON. + * Converts this AwsAccessKey to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TransferOptions. */ - interface ITransferOptions { - - /** TransferOptions overwriteObjectsAlreadyExistingInSink */ - overwriteObjectsAlreadyExistingInSink?: (boolean|null); - - /** TransferOptions deleteObjectsUniqueInSink */ - deleteObjectsUniqueInSink?: (boolean|null); + /** Properties of an AzureCredentials. */ + interface IAzureCredentials { - /** TransferOptions deleteObjectsFromSourceAfterTransfer */ - deleteObjectsFromSourceAfterTransfer?: (boolean|null); + /** AzureCredentials sasToken */ + sasToken?: (string|null); } - /** Represents a TransferOptions. */ - class TransferOptions implements ITransferOptions { + /** Represents an AzureCredentials. */ + class AzureCredentials implements IAzureCredentials { /** - * Constructs a new TransferOptions. + * Constructs a new AzureCredentials. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAzureCredentials); + + /** AzureCredentials sasToken. */ + public sasToken: string; + + /** + * Creates a new AzureCredentials instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureCredentials instance + */ + public static create(properties?: google.storagetransfer.v1.IAzureCredentials): google.storagetransfer.v1.AzureCredentials; + + /** + * Encodes the specified AzureCredentials message. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * @param message AzureCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAzureCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureCredentials message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * @param message AzureCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAzureCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureCredentials message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureCredentials + * @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.storagetransfer.v1.AzureCredentials; + + /** + * Decodes an AzureCredentials message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureCredentials + * @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.storagetransfer.v1.AzureCredentials; + + /** + * Verifies an AzureCredentials 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 AzureCredentials message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureCredentials + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AzureCredentials; + + /** + * Creates a plain object from an AzureCredentials message. Also converts values to other types if specified. + * @param message AzureCredentials + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AzureCredentials, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureCredentials to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ObjectConditions. */ + interface IObjectConditions { + + /** ObjectConditions minTimeElapsedSinceLastModification */ + minTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions maxTimeElapsedSinceLastModification */ + maxTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions includePrefixes */ + includePrefixes?: (string[]|null); + + /** ObjectConditions excludePrefixes */ + excludePrefixes?: (string[]|null); + + /** ObjectConditions lastModifiedSince */ + lastModifiedSince?: (google.protobuf.ITimestamp|null); + + /** ObjectConditions lastModifiedBefore */ + lastModifiedBefore?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ObjectConditions. */ + class ObjectConditions implements IObjectConditions { + + /** + * Constructs a new ObjectConditions. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IObjectConditions); + + /** ObjectConditions minTimeElapsedSinceLastModification. */ + public minTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions maxTimeElapsedSinceLastModification. */ + public maxTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions includePrefixes. */ + public includePrefixes: string[]; + + /** ObjectConditions excludePrefixes. */ + public excludePrefixes: string[]; + + /** ObjectConditions lastModifiedSince. */ + public lastModifiedSince?: (google.protobuf.ITimestamp|null); + + /** ObjectConditions lastModifiedBefore. */ + public lastModifiedBefore?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ObjectConditions instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectConditions instance + */ + public static create(properties?: google.storagetransfer.v1.IObjectConditions): google.storagetransfer.v1.ObjectConditions; + + /** + * Encodes the specified ObjectConditions message. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * @param message ObjectConditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IObjectConditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectConditions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * @param message ObjectConditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IObjectConditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectConditions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectConditions + * @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.storagetransfer.v1.ObjectConditions; + + /** + * Decodes an ObjectConditions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectConditions + * @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.storagetransfer.v1.ObjectConditions; + + /** + * Verifies an ObjectConditions 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 ObjectConditions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectConditions + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ObjectConditions; + + /** + * Creates a plain object from an ObjectConditions message. Also converts values to other types if specified. + * @param message ObjectConditions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ObjectConditions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectConditions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsData. */ + interface IGcsData { + + /** GcsData bucketName */ + bucketName?: (string|null); + + /** GcsData path */ + path?: (string|null); + } + + /** Represents a GcsData. */ + class GcsData implements IGcsData { + + /** + * Constructs a new GcsData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IGcsData); + + /** GcsData bucketName. */ + public bucketName: string; + + /** GcsData path. */ + public path: string; + + /** + * Creates a new GcsData instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsData instance + */ + public static create(properties?: google.storagetransfer.v1.IGcsData): google.storagetransfer.v1.GcsData; + + /** + * Encodes the specified GcsData message. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * @param message GcsData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IGcsData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * @param message GcsData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IGcsData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsData + * @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.storagetransfer.v1.GcsData; + + /** + * Decodes a GcsData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsData + * @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.storagetransfer.v1.GcsData; + + /** + * Verifies a GcsData 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 GcsData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsData + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GcsData; + + /** + * Creates a plain object from a GcsData message. Also converts values to other types if specified. + * @param message GcsData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.GcsData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AwsS3Data. */ + interface IAwsS3Data { + + /** AwsS3Data bucketName */ + bucketName?: (string|null); + + /** AwsS3Data awsAccessKey */ + awsAccessKey?: (google.storagetransfer.v1.IAwsAccessKey|null); + + /** AwsS3Data path */ + path?: (string|null); + + /** AwsS3Data roleArn */ + roleArn?: (string|null); + } + + /** Represents an AwsS3Data. */ + class AwsS3Data implements IAwsS3Data { + + /** + * Constructs a new AwsS3Data. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAwsS3Data); + + /** AwsS3Data bucketName. */ + public bucketName: string; + + /** AwsS3Data awsAccessKey. */ + public awsAccessKey?: (google.storagetransfer.v1.IAwsAccessKey|null); + + /** AwsS3Data path. */ + public path: string; + + /** AwsS3Data roleArn. */ + public roleArn: string; + + /** + * Creates a new AwsS3Data instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsS3Data instance + */ + public static create(properties?: google.storagetransfer.v1.IAwsS3Data): google.storagetransfer.v1.AwsS3Data; + + /** + * Encodes the specified AwsS3Data message. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * @param message AwsS3Data message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAwsS3Data, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsS3Data message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * @param message AwsS3Data message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAwsS3Data, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsS3Data message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsS3Data + * @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.storagetransfer.v1.AwsS3Data; + + /** + * Decodes an AwsS3Data message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsS3Data + * @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.storagetransfer.v1.AwsS3Data; + + /** + * Verifies an AwsS3Data 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 AwsS3Data message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsS3Data + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AwsS3Data; + + /** + * Creates a plain object from an AwsS3Data message. Also converts values to other types if specified. + * @param message AwsS3Data + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AwsS3Data, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsS3Data to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AzureBlobStorageData. */ + interface IAzureBlobStorageData { + + /** AzureBlobStorageData storageAccount */ + storageAccount?: (string|null); + + /** AzureBlobStorageData azureCredentials */ + azureCredentials?: (google.storagetransfer.v1.IAzureCredentials|null); + + /** AzureBlobStorageData container */ + container?: (string|null); + + /** AzureBlobStorageData path */ + path?: (string|null); + } + + /** Represents an AzureBlobStorageData. */ + class AzureBlobStorageData implements IAzureBlobStorageData { + + /** + * Constructs a new AzureBlobStorageData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAzureBlobStorageData); + + /** AzureBlobStorageData storageAccount. */ + public storageAccount: string; + + /** AzureBlobStorageData azureCredentials. */ + public azureCredentials?: (google.storagetransfer.v1.IAzureCredentials|null); + + /** AzureBlobStorageData container. */ + public container: string; + + /** AzureBlobStorageData path. */ + public path: string; + + /** + * Creates a new AzureBlobStorageData instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureBlobStorageData instance + */ + public static create(properties?: google.storagetransfer.v1.IAzureBlobStorageData): google.storagetransfer.v1.AzureBlobStorageData; + + /** + * Encodes the specified AzureBlobStorageData message. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * @param message AzureBlobStorageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAzureBlobStorageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureBlobStorageData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * @param message AzureBlobStorageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAzureBlobStorageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureBlobStorageData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureBlobStorageData + * @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.storagetransfer.v1.AzureBlobStorageData; + + /** + * Decodes an AzureBlobStorageData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureBlobStorageData + * @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.storagetransfer.v1.AzureBlobStorageData; + + /** + * Verifies an AzureBlobStorageData 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 AzureBlobStorageData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureBlobStorageData + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AzureBlobStorageData; + + /** + * Creates a plain object from an AzureBlobStorageData message. Also converts values to other types if specified. + * @param message AzureBlobStorageData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AzureBlobStorageData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureBlobStorageData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpData. */ + interface IHttpData { + + /** HttpData listUrl */ + listUrl?: (string|null); + } + + /** Represents a HttpData. */ + class HttpData implements IHttpData { + + /** + * Constructs a new HttpData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IHttpData); + + /** HttpData listUrl. */ + public listUrl: string; + + /** + * Creates a new HttpData instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpData instance + */ + public static create(properties?: google.storagetransfer.v1.IHttpData): google.storagetransfer.v1.HttpData; + + /** + * Encodes the specified HttpData message. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * @param message HttpData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IHttpData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * @param message HttpData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IHttpData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpData + * @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.storagetransfer.v1.HttpData; + + /** + * Decodes a HttpData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpData + * @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.storagetransfer.v1.HttpData; + + /** + * Verifies a HttpData 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 HttpData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpData + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.HttpData; + + /** + * Creates a plain object from a HttpData message. Also converts values to other types if specified. + * @param message HttpData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.HttpData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PosixFilesystem. */ + interface IPosixFilesystem { + + /** PosixFilesystem rootDirectory */ + rootDirectory?: (string|null); + } + + /** Represents a PosixFilesystem. */ + class PosixFilesystem implements IPosixFilesystem { + + /** + * Constructs a new PosixFilesystem. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IPosixFilesystem); + + /** PosixFilesystem rootDirectory. */ + public rootDirectory: string; + + /** + * Creates a new PosixFilesystem instance using the specified properties. + * @param [properties] Properties to set + * @returns PosixFilesystem instance + */ + public static create(properties?: google.storagetransfer.v1.IPosixFilesystem): google.storagetransfer.v1.PosixFilesystem; + + /** + * Encodes the specified PosixFilesystem message. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @param message PosixFilesystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IPosixFilesystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PosixFilesystem message, length delimited. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @param message PosixFilesystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IPosixFilesystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PosixFilesystem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PosixFilesystem + * @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.storagetransfer.v1.PosixFilesystem; + + /** + * Decodes a PosixFilesystem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PosixFilesystem + * @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.storagetransfer.v1.PosixFilesystem; + + /** + * Verifies a PosixFilesystem 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 PosixFilesystem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PosixFilesystem + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.PosixFilesystem; + + /** + * Creates a plain object from a PosixFilesystem message. Also converts values to other types if specified. + * @param message PosixFilesystem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.PosixFilesystem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PosixFilesystem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AgentPool. */ + interface IAgentPool { + + /** AgentPool name */ + name?: (string|null); + + /** AgentPool displayName */ + displayName?: (string|null); + + /** AgentPool state */ + state?: (google.storagetransfer.v1.AgentPool.State|keyof typeof google.storagetransfer.v1.AgentPool.State|null); + + /** AgentPool bandwidthLimit */ + bandwidthLimit?: (google.storagetransfer.v1.AgentPool.IBandwidthLimit|null); + } + + /** Represents an AgentPool. */ + class AgentPool implements IAgentPool { + + /** + * Constructs a new AgentPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAgentPool); + + /** AgentPool name. */ + public name: string; + + /** AgentPool displayName. */ + public displayName: string; + + /** AgentPool state. */ + public state: (google.storagetransfer.v1.AgentPool.State|keyof typeof google.storagetransfer.v1.AgentPool.State); + + /** AgentPool bandwidthLimit. */ + public bandwidthLimit?: (google.storagetransfer.v1.AgentPool.IBandwidthLimit|null); + + /** + * Creates a new AgentPool instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentPool instance + */ + public static create(properties?: google.storagetransfer.v1.IAgentPool): google.storagetransfer.v1.AgentPool; + + /** + * Encodes the specified AgentPool message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. + * @param message AgentPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAgentPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentPool message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. + * @param message AgentPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAgentPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentPool + * @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.storagetransfer.v1.AgentPool; + + /** + * Decodes an AgentPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentPool + * @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.storagetransfer.v1.AgentPool; + + /** + * Verifies an AgentPool 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 AgentPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentPool + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AgentPool; + + /** + * Creates a plain object from an AgentPool message. Also converts values to other types if specified. + * @param message AgentPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AgentPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AgentPool { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + CREATED = 2, + DELETING = 3 + } + + /** Properties of a BandwidthLimit. */ + interface IBandwidthLimit { + + /** BandwidthLimit limitMbps */ + limitMbps?: (number|Long|string|null); + } + + /** Represents a BandwidthLimit. */ + class BandwidthLimit implements IBandwidthLimit { + + /** + * Constructs a new BandwidthLimit. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.AgentPool.IBandwidthLimit); + + /** BandwidthLimit limitMbps. */ + public limitMbps: (number|Long|string); + + /** + * Creates a new BandwidthLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns BandwidthLimit instance + */ + public static create(properties?: google.storagetransfer.v1.AgentPool.IBandwidthLimit): google.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Encodes the specified BandwidthLimit message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @param message BandwidthLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.AgentPool.IBandwidthLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BandwidthLimit message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @param message BandwidthLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.AgentPool.IBandwidthLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BandwidthLimit + * @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.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BandwidthLimit + * @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.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Verifies a BandwidthLimit 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 BandwidthLimit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BandwidthLimit + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Creates a plain object from a BandwidthLimit message. Also converts values to other types if specified. + * @param message BandwidthLimit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AgentPool.BandwidthLimit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BandwidthLimit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a TransferOptions. */ + interface ITransferOptions { + + /** TransferOptions overwriteObjectsAlreadyExistingInSink */ + overwriteObjectsAlreadyExistingInSink?: (boolean|null); + + /** TransferOptions deleteObjectsUniqueInSink */ + deleteObjectsUniqueInSink?: (boolean|null); + + /** TransferOptions deleteObjectsFromSourceAfterTransfer */ + deleteObjectsFromSourceAfterTransfer?: (boolean|null); + + /** TransferOptions overwriteWhen */ + overwriteWhen?: (google.storagetransfer.v1.TransferOptions.OverwriteWhen|keyof typeof google.storagetransfer.v1.TransferOptions.OverwriteWhen|null); + + /** TransferOptions metadataOptions */ + metadataOptions?: (google.storagetransfer.v1.IMetadataOptions|null); + } + + /** Represents a TransferOptions. */ + class TransferOptions implements ITransferOptions { + + /** + * Constructs a new TransferOptions. * @param [properties] Properties to set */ constructor(properties?: google.storagetransfer.v1.ITransferOptions); @@ -1908,6 +2900,12 @@ export namespace google { /** TransferOptions deleteObjectsFromSourceAfterTransfer. */ public deleteObjectsFromSourceAfterTransfer: boolean; + /** TransferOptions overwriteWhen. */ + public overwriteWhen: (google.storagetransfer.v1.TransferOptions.OverwriteWhen|keyof typeof google.storagetransfer.v1.TransferOptions.OverwriteWhen); + + /** TransferOptions metadataOptions. */ + public metadataOptions?: (google.storagetransfer.v1.IMetadataOptions|null); + /** * Creates a new TransferOptions instance using the specified properties. * @param [properties] Properties to set @@ -1979,12 +2977,26 @@ export namespace google { public toJSON(): { [k: string]: any }; } + namespace TransferOptions { + + /** OverwriteWhen enum. */ + enum OverwriteWhen { + OVERWRITE_WHEN_UNSPECIFIED = 0, + DIFFERENT = 1, + NEVER = 2, + ALWAYS = 3 + } + } + /** Properties of a TransferSpec. */ interface ITransferSpec { /** TransferSpec gcsDataSink */ gcsDataSink?: (google.storagetransfer.v1.IGcsData|null); + /** TransferSpec posixDataSink */ + posixDataSink?: (google.storagetransfer.v1.IPosixFilesystem|null); + /** TransferSpec gcsDataSource */ gcsDataSource?: (google.storagetransfer.v1.IGcsData|null); @@ -1994,14 +3006,29 @@ export namespace google { /** TransferSpec httpDataSource */ httpDataSource?: (google.storagetransfer.v1.IHttpData|null); + /** TransferSpec posixDataSource */ + posixDataSource?: (google.storagetransfer.v1.IPosixFilesystem|null); + /** TransferSpec azureBlobStorageDataSource */ azureBlobStorageDataSource?: (google.storagetransfer.v1.IAzureBlobStorageData|null); + /** TransferSpec gcsIntermediateDataLocation */ + gcsIntermediateDataLocation?: (google.storagetransfer.v1.IGcsData|null); + /** TransferSpec objectConditions */ objectConditions?: (google.storagetransfer.v1.IObjectConditions|null); /** TransferSpec transferOptions */ transferOptions?: (google.storagetransfer.v1.ITransferOptions|null); + + /** TransferSpec transferManifest */ + transferManifest?: (google.storagetransfer.v1.ITransferManifest|null); + + /** TransferSpec sourceAgentPoolName */ + sourceAgentPoolName?: (string|null); + + /** TransferSpec sinkAgentPoolName */ + sinkAgentPoolName?: (string|null); } /** Represents a TransferSpec. */ @@ -2016,96 +3043,415 @@ export namespace google { /** TransferSpec gcsDataSink. */ public gcsDataSink?: (google.storagetransfer.v1.IGcsData|null); + /** TransferSpec posixDataSink. */ + public posixDataSink?: (google.storagetransfer.v1.IPosixFilesystem|null); + /** TransferSpec gcsDataSource. */ public gcsDataSource?: (google.storagetransfer.v1.IGcsData|null); /** TransferSpec awsS3DataSource. */ public awsS3DataSource?: (google.storagetransfer.v1.IAwsS3Data|null); - /** TransferSpec httpDataSource. */ - public httpDataSource?: (google.storagetransfer.v1.IHttpData|null); + /** TransferSpec httpDataSource. */ + public httpDataSource?: (google.storagetransfer.v1.IHttpData|null); + + /** TransferSpec posixDataSource. */ + public posixDataSource?: (google.storagetransfer.v1.IPosixFilesystem|null); + + /** TransferSpec azureBlobStorageDataSource. */ + public azureBlobStorageDataSource?: (google.storagetransfer.v1.IAzureBlobStorageData|null); + + /** TransferSpec gcsIntermediateDataLocation. */ + public gcsIntermediateDataLocation?: (google.storagetransfer.v1.IGcsData|null); + + /** TransferSpec objectConditions. */ + public objectConditions?: (google.storagetransfer.v1.IObjectConditions|null); + + /** TransferSpec transferOptions. */ + public transferOptions?: (google.storagetransfer.v1.ITransferOptions|null); + + /** TransferSpec transferManifest. */ + public transferManifest?: (google.storagetransfer.v1.ITransferManifest|null); + + /** TransferSpec sourceAgentPoolName. */ + public sourceAgentPoolName: string; + + /** TransferSpec sinkAgentPoolName. */ + public sinkAgentPoolName: string; + + /** TransferSpec dataSink. */ + public dataSink?: ("gcsDataSink"|"posixDataSink"); + + /** TransferSpec dataSource. */ + public dataSource?: ("gcsDataSource"|"awsS3DataSource"|"httpDataSource"|"posixDataSource"|"azureBlobStorageDataSource"); + + /** TransferSpec intermediateDataLocation. */ + public intermediateDataLocation?: "gcsIntermediateDataLocation"; + + /** + * Creates a new TransferSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferSpec instance + */ + public static create(properties?: google.storagetransfer.v1.ITransferSpec): google.storagetransfer.v1.TransferSpec; + + /** + * Encodes the specified TransferSpec message. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. + * @param message TransferSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ITransferSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferSpec message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. + * @param message TransferSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ITransferSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferSpec + * @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.storagetransfer.v1.TransferSpec; + + /** + * Decodes a TransferSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferSpec + * @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.storagetransfer.v1.TransferSpec; + + /** + * Verifies a TransferSpec 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 TransferSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferSpec + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferSpec; + + /** + * Creates a plain object from a TransferSpec message. Also converts values to other types if specified. + * @param message TransferSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.TransferSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MetadataOptions. */ + interface IMetadataOptions { + + /** MetadataOptions symlink */ + symlink?: (google.storagetransfer.v1.MetadataOptions.Symlink|keyof typeof google.storagetransfer.v1.MetadataOptions.Symlink|null); + + /** MetadataOptions mode */ + mode?: (google.storagetransfer.v1.MetadataOptions.Mode|keyof typeof google.storagetransfer.v1.MetadataOptions.Mode|null); + + /** MetadataOptions gid */ + gid?: (google.storagetransfer.v1.MetadataOptions.GID|keyof typeof google.storagetransfer.v1.MetadataOptions.GID|null); + + /** MetadataOptions uid */ + uid?: (google.storagetransfer.v1.MetadataOptions.UID|keyof typeof google.storagetransfer.v1.MetadataOptions.UID|null); + + /** MetadataOptions acl */ + acl?: (google.storagetransfer.v1.MetadataOptions.Acl|keyof typeof google.storagetransfer.v1.MetadataOptions.Acl|null); + + /** MetadataOptions storageClass */ + storageClass?: (google.storagetransfer.v1.MetadataOptions.StorageClass|keyof typeof google.storagetransfer.v1.MetadataOptions.StorageClass|null); + + /** MetadataOptions temporaryHold */ + temporaryHold?: (google.storagetransfer.v1.MetadataOptions.TemporaryHold|keyof typeof google.storagetransfer.v1.MetadataOptions.TemporaryHold|null); + + /** MetadataOptions kmsKey */ + kmsKey?: (google.storagetransfer.v1.MetadataOptions.KmsKey|keyof typeof google.storagetransfer.v1.MetadataOptions.KmsKey|null); + + /** MetadataOptions timeCreated */ + timeCreated?: (google.storagetransfer.v1.MetadataOptions.TimeCreated|keyof typeof google.storagetransfer.v1.MetadataOptions.TimeCreated|null); + } + + /** Represents a MetadataOptions. */ + class MetadataOptions implements IMetadataOptions { + + /** + * Constructs a new MetadataOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IMetadataOptions); + + /** MetadataOptions symlink. */ + public symlink: (google.storagetransfer.v1.MetadataOptions.Symlink|keyof typeof google.storagetransfer.v1.MetadataOptions.Symlink); + + /** MetadataOptions mode. */ + public mode: (google.storagetransfer.v1.MetadataOptions.Mode|keyof typeof google.storagetransfer.v1.MetadataOptions.Mode); + + /** MetadataOptions gid. */ + public gid: (google.storagetransfer.v1.MetadataOptions.GID|keyof typeof google.storagetransfer.v1.MetadataOptions.GID); + + /** MetadataOptions uid. */ + public uid: (google.storagetransfer.v1.MetadataOptions.UID|keyof typeof google.storagetransfer.v1.MetadataOptions.UID); + + /** MetadataOptions acl. */ + public acl: (google.storagetransfer.v1.MetadataOptions.Acl|keyof typeof google.storagetransfer.v1.MetadataOptions.Acl); + + /** MetadataOptions storageClass. */ + public storageClass: (google.storagetransfer.v1.MetadataOptions.StorageClass|keyof typeof google.storagetransfer.v1.MetadataOptions.StorageClass); + + /** MetadataOptions temporaryHold. */ + public temporaryHold: (google.storagetransfer.v1.MetadataOptions.TemporaryHold|keyof typeof google.storagetransfer.v1.MetadataOptions.TemporaryHold); + + /** MetadataOptions kmsKey. */ + public kmsKey: (google.storagetransfer.v1.MetadataOptions.KmsKey|keyof typeof google.storagetransfer.v1.MetadataOptions.KmsKey); + + /** MetadataOptions timeCreated. */ + public timeCreated: (google.storagetransfer.v1.MetadataOptions.TimeCreated|keyof typeof google.storagetransfer.v1.MetadataOptions.TimeCreated); + + /** + * Creates a new MetadataOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataOptions instance + */ + public static create(properties?: google.storagetransfer.v1.IMetadataOptions): google.storagetransfer.v1.MetadataOptions; + + /** + * Encodes the specified MetadataOptions message. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @param message MetadataOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IMetadataOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @param message MetadataOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IMetadataOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataOptions + * @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.storagetransfer.v1.MetadataOptions; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataOptions + * @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.storagetransfer.v1.MetadataOptions; + + /** + * Verifies a MetadataOptions 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 MetadataOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataOptions + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.MetadataOptions; + + /** + * Creates a plain object from a MetadataOptions message. Also converts values to other types if specified. + * @param message MetadataOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.MetadataOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MetadataOptions { + + /** Symlink enum. */ + enum Symlink { + SYMLINK_UNSPECIFIED = 0, + SYMLINK_SKIP = 1, + SYMLINK_PRESERVE = 2 + } + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + MODE_SKIP = 1, + MODE_PRESERVE = 2 + } + + /** GID enum. */ + enum GID { + GID_UNSPECIFIED = 0, + GID_SKIP = 1, + GID_NUMBER = 2 + } + + /** UID enum. */ + enum UID { + UID_UNSPECIFIED = 0, + UID_SKIP = 1, + UID_NUMBER = 2 + } + + /** Acl enum. */ + enum Acl { + ACL_UNSPECIFIED = 0, + ACL_DESTINATION_BUCKET_DEFAULT = 1, + ACL_PRESERVE = 2 + } + + /** StorageClass enum. */ + enum StorageClass { + STORAGE_CLASS_UNSPECIFIED = 0, + STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1, + STORAGE_CLASS_PRESERVE = 2, + STORAGE_CLASS_STANDARD = 3, + STORAGE_CLASS_NEARLINE = 4, + STORAGE_CLASS_COLDLINE = 5, + STORAGE_CLASS_ARCHIVE = 6 + } + + /** TemporaryHold enum. */ + enum TemporaryHold { + TEMPORARY_HOLD_UNSPECIFIED = 0, + TEMPORARY_HOLD_SKIP = 1, + TEMPORARY_HOLD_PRESERVE = 2 + } + + /** KmsKey enum. */ + enum KmsKey { + KMS_KEY_UNSPECIFIED = 0, + KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1, + KMS_KEY_PRESERVE = 2 + } + + /** TimeCreated enum. */ + enum TimeCreated { + TIME_CREATED_UNSPECIFIED = 0, + TIME_CREATED_SKIP = 1, + TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2 + } + } - /** TransferSpec azureBlobStorageDataSource. */ - public azureBlobStorageDataSource?: (google.storagetransfer.v1.IAzureBlobStorageData|null); + /** Properties of a TransferManifest. */ + interface ITransferManifest { - /** TransferSpec objectConditions. */ - public objectConditions?: (google.storagetransfer.v1.IObjectConditions|null); + /** TransferManifest location */ + location?: (string|null); + } - /** TransferSpec transferOptions. */ - public transferOptions?: (google.storagetransfer.v1.ITransferOptions|null); + /** Represents a TransferManifest. */ + class TransferManifest implements ITransferManifest { - /** TransferSpec dataSink. */ - public dataSink?: "gcsDataSink"; + /** + * Constructs a new TransferManifest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ITransferManifest); - /** TransferSpec dataSource. */ - public dataSource?: ("gcsDataSource"|"awsS3DataSource"|"httpDataSource"|"azureBlobStorageDataSource"); + /** TransferManifest location. */ + public location: string; /** - * Creates a new TransferSpec instance using the specified properties. + * Creates a new TransferManifest instance using the specified properties. * @param [properties] Properties to set - * @returns TransferSpec instance + * @returns TransferManifest instance */ - public static create(properties?: google.storagetransfer.v1.ITransferSpec): google.storagetransfer.v1.TransferSpec; + public static create(properties?: google.storagetransfer.v1.ITransferManifest): google.storagetransfer.v1.TransferManifest; /** - * Encodes the specified TransferSpec message. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. - * @param message TransferSpec message or plain object to encode + * Encodes the specified TransferManifest message. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @param message TransferManifest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.storagetransfer.v1.ITransferSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.storagetransfer.v1.ITransferManifest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TransferSpec message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. - * @param message TransferSpec message or plain object to encode + * Encodes the specified TransferManifest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @param message TransferManifest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.storagetransfer.v1.ITransferSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.storagetransfer.v1.ITransferManifest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TransferSpec message from the specified reader or buffer. + * Decodes a TransferManifest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TransferSpec + * @returns TransferManifest * @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.storagetransfer.v1.TransferSpec; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.TransferManifest; /** - * Decodes a TransferSpec message from the specified reader or buffer, length delimited. + * Decodes a TransferManifest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TransferSpec + * @returns TransferManifest * @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.storagetransfer.v1.TransferSpec; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.TransferManifest; /** - * Verifies a TransferSpec message. + * Verifies a TransferManifest 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 TransferSpec message from a plain object. Also converts values to their respective internal types. + * Creates a TransferManifest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TransferSpec + * @returns TransferManifest */ - public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferSpec; + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferManifest; /** - * Creates a plain object from a TransferSpec message. Also converts values to other types if specified. - * @param message TransferSpec + * Creates a plain object from a TransferManifest message. Also converts values to other types if specified. + * @param message TransferManifest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.storagetransfer.v1.TransferSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.storagetransfer.v1.TransferManifest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TransferSpec to JSON. + * Converts this TransferManifest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2243,6 +3589,9 @@ export namespace google { /** TransferJob notificationConfig */ notificationConfig?: (google.storagetransfer.v1.INotificationConfig|null); + /** TransferJob loggingConfig */ + loggingConfig?: (google.storagetransfer.v1.ILoggingConfig|null); + /** TransferJob schedule */ schedule?: (google.storagetransfer.v1.ISchedule|null); @@ -2286,6 +3635,9 @@ export namespace google { /** TransferJob notificationConfig. */ public notificationConfig?: (google.storagetransfer.v1.INotificationConfig|null); + /** TransferJob loggingConfig. */ + public loggingConfig?: (google.storagetransfer.v1.ILoggingConfig|null); + /** TransferJob schedule. */ public schedule?: (google.storagetransfer.v1.ISchedule|null); @@ -2634,6 +3986,21 @@ export namespace google { /** TransferCounters bytesFailedToDeleteFromSink */ bytesFailedToDeleteFromSink?: (number|Long|string|null); + + /** TransferCounters directoriesFoundFromSource */ + directoriesFoundFromSource?: (number|Long|string|null); + + /** TransferCounters directoriesFailedToListFromSource */ + directoriesFailedToListFromSource?: (number|Long|string|null); + + /** TransferCounters directoriesSuccessfullyListedFromSource */ + directoriesSuccessfullyListedFromSource?: (number|Long|string|null); + + /** TransferCounters intermediateObjectsCleanedUp */ + intermediateObjectsCleanedUp?: (number|Long|string|null); + + /** TransferCounters intermediateObjectsFailedCleanedUp */ + intermediateObjectsFailedCleanedUp?: (number|Long|string|null); } /** Represents a TransferCounters. */ @@ -2693,6 +4060,21 @@ export namespace google { /** TransferCounters bytesFailedToDeleteFromSink. */ public bytesFailedToDeleteFromSink: (number|Long|string); + /** TransferCounters directoriesFoundFromSource. */ + public directoriesFoundFromSource: (number|Long|string); + + /** TransferCounters directoriesFailedToListFromSource. */ + public directoriesFailedToListFromSource: (number|Long|string); + + /** TransferCounters directoriesSuccessfullyListedFromSource. */ + public directoriesSuccessfullyListedFromSource: (number|Long|string); + + /** TransferCounters intermediateObjectsCleanedUp. */ + public intermediateObjectsCleanedUp: (number|Long|string); + + /** TransferCounters intermediateObjectsFailedCleanedUp. */ + public intermediateObjectsFailedCleanedUp: (number|Long|string); + /** * Creates a new TransferCounters instance using the specified properties. * @param [properties] Properties to set @@ -2884,6 +4266,126 @@ export namespace google { } } + /** Properties of a LoggingConfig. */ + interface ILoggingConfig { + + /** LoggingConfig logActions */ + logActions?: (google.storagetransfer.v1.LoggingConfig.LoggableAction[]|null); + + /** LoggingConfig logActionStates */ + logActionStates?: (google.storagetransfer.v1.LoggingConfig.LoggableActionState[]|null); + + /** LoggingConfig enableOnpremGcsTransferLogs */ + enableOnpremGcsTransferLogs?: (boolean|null); + } + + /** Represents a LoggingConfig. */ + class LoggingConfig implements ILoggingConfig { + + /** + * Constructs a new LoggingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ILoggingConfig); + + /** LoggingConfig logActions. */ + public logActions: google.storagetransfer.v1.LoggingConfig.LoggableAction[]; + + /** LoggingConfig logActionStates. */ + public logActionStates: google.storagetransfer.v1.LoggingConfig.LoggableActionState[]; + + /** LoggingConfig enableOnpremGcsTransferLogs. */ + public enableOnpremGcsTransferLogs: boolean; + + /** + * Creates a new LoggingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingConfig instance + */ + public static create(properties?: google.storagetransfer.v1.ILoggingConfig): google.storagetransfer.v1.LoggingConfig; + + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingConfig + * @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.storagetransfer.v1.LoggingConfig; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingConfig + * @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.storagetransfer.v1.LoggingConfig; + + /** + * Verifies a LoggingConfig 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 LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingConfig + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.LoggingConfig; + + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @param message LoggingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.LoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace LoggingConfig { + + /** LoggableAction enum. */ + enum LoggableAction { + LOGGABLE_ACTION_UNSPECIFIED = 0, + FIND = 1, + DELETE = 2, + COPY = 3 + } + + /** LoggableActionState enum. */ + enum LoggableActionState { + LOGGABLE_ACTION_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2 + } + } + /** Properties of a TransferOperation. */ interface ITransferOperation { @@ -3397,6 +4899,244 @@ export namespace google { UNORDERED_LIST = 6, NON_EMPTY_DEFAULT = 7 } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @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.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @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.api.ResourceReference; + + /** + * Verifies a ResourceReference 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace protobuf. */ @@ -4963,6 +6703,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ @@ -5135,6 +6878,9 @@ export namespace google { /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -5258,6 +7004,9 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); } /** Represents a FieldOptions. */ diff --git a/protos/protos.js b/protos/protos.js index 48a60c9..1f6e009 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -353,6 +353,171 @@ * @variation 2 */ + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#createAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef CreateAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.AgentPool} [response] AgentPool + */ + + /** + * Calls CreateAgentPool. + * @function createAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} request CreateAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.CreateAgentPoolCallback} callback Node-style callback called with the error, if any, and AgentPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.createAgentPool = function createAgentPool(request, callback) { + return this.rpcCall(createAgentPool, $root.google.storagetransfer.v1.CreateAgentPoolRequest, $root.google.storagetransfer.v1.AgentPool, request, callback); + }, "name", { value: "CreateAgentPool" }); + + /** + * Calls CreateAgentPool. + * @function createAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} request CreateAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#updateAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef UpdateAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.AgentPool} [response] AgentPool + */ + + /** + * Calls UpdateAgentPool. + * @function updateAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} request UpdateAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.UpdateAgentPoolCallback} callback Node-style callback called with the error, if any, and AgentPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.updateAgentPool = function updateAgentPool(request, callback) { + return this.rpcCall(updateAgentPool, $root.google.storagetransfer.v1.UpdateAgentPoolRequest, $root.google.storagetransfer.v1.AgentPool, request, callback); + }, "name", { value: "UpdateAgentPool" }); + + /** + * Calls UpdateAgentPool. + * @function updateAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} request UpdateAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#getAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef GetAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.AgentPool} [response] AgentPool + */ + + /** + * Calls GetAgentPool. + * @function getAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} request GetAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.GetAgentPoolCallback} callback Node-style callback called with the error, if any, and AgentPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.getAgentPool = function getAgentPool(request, callback) { + return this.rpcCall(getAgentPool, $root.google.storagetransfer.v1.GetAgentPoolRequest, $root.google.storagetransfer.v1.AgentPool, request, callback); + }, "name", { value: "GetAgentPool" }); + + /** + * Calls GetAgentPool. + * @function getAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} request GetAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#listAgentPools}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef ListAgentPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.ListAgentPoolsResponse} [response] ListAgentPoolsResponse + */ + + /** + * Calls ListAgentPools. + * @function listAgentPools + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} request ListAgentPoolsRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.ListAgentPoolsCallback} callback Node-style callback called with the error, if any, and ListAgentPoolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.listAgentPools = function listAgentPools(request, callback) { + return this.rpcCall(listAgentPools, $root.google.storagetransfer.v1.ListAgentPoolsRequest, $root.google.storagetransfer.v1.ListAgentPoolsResponse, request, callback); + }, "name", { value: "ListAgentPools" }); + + /** + * Calls ListAgentPools. + * @function listAgentPools + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} request ListAgentPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService#deleteAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef DeleteAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgentPool. + * @function deleteAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} request DeleteAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.DeleteAgentPoolCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.deleteAgentPool = function deleteAgentPool(request, callback) { + return this.rpcCall(deleteAgentPool, $root.google.storagetransfer.v1.DeleteAgentPoolRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgentPool" }); + + /** + * Calls DeleteAgentPool. + * @function deleteAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} request DeleteAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return StorageTransferService; })(); @@ -2256,25 +2421,26 @@ return RunTransferJobRequest; })(); - v1.GoogleServiceAccount = (function() { + v1.CreateAgentPoolRequest = (function() { /** - * Properties of a GoogleServiceAccount. + * Properties of a CreateAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @interface IGoogleServiceAccount - * @property {string|null} [accountEmail] GoogleServiceAccount accountEmail - * @property {string|null} [subjectId] GoogleServiceAccount subjectId + * @interface ICreateAgentPoolRequest + * @property {string|null} [projectId] CreateAgentPoolRequest projectId + * @property {google.storagetransfer.v1.IAgentPool|null} [agentPool] CreateAgentPoolRequest agentPool + * @property {string|null} [agentPoolId] CreateAgentPoolRequest agentPoolId */ /** - * Constructs a new GoogleServiceAccount. + * Constructs a new CreateAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @classdesc Represents a GoogleServiceAccount. - * @implements IGoogleServiceAccount + * @classdesc Represents a CreateAgentPoolRequest. + * @implements ICreateAgentPoolRequest * @constructor - * @param {google.storagetransfer.v1.IGoogleServiceAccount=} [properties] Properties to set + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest=} [properties] Properties to set */ - function GoogleServiceAccount(properties) { + function CreateAgentPoolRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2282,88 +2448,101 @@ } /** - * GoogleServiceAccount accountEmail. - * @member {string} accountEmail - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * CreateAgentPoolRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @instance */ - GoogleServiceAccount.prototype.accountEmail = ""; + CreateAgentPoolRequest.prototype.projectId = ""; /** - * GoogleServiceAccount subjectId. - * @member {string} subjectId - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * CreateAgentPoolRequest agentPool. + * @member {google.storagetransfer.v1.IAgentPool|null|undefined} agentPool + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @instance */ - GoogleServiceAccount.prototype.subjectId = ""; + CreateAgentPoolRequest.prototype.agentPool = null; /** - * Creates a new GoogleServiceAccount instance using the specified properties. + * CreateAgentPoolRequest agentPoolId. + * @member {string} agentPoolId + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @instance + */ + CreateAgentPoolRequest.prototype.agentPoolId = ""; + + /** + * Creates a new CreateAgentPoolRequest instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IGoogleServiceAccount=} [properties] Properties to set - * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount instance + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest instance */ - GoogleServiceAccount.create = function create(properties) { - return new GoogleServiceAccount(properties); + CreateAgentPoolRequest.create = function create(properties) { + return new CreateAgentPoolRequest(properties); }; /** - * Encodes the specified GoogleServiceAccount message. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * Encodes the specified CreateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IGoogleServiceAccount} message GoogleServiceAccount message or plain object to encode + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} message CreateAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GoogleServiceAccount.encode = function encode(message, writer) { + CreateAgentPoolRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.accountEmail != null && Object.hasOwnProperty.call(message, "accountEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.accountEmail); - if (message.subjectId != null && Object.hasOwnProperty.call(message, "subjectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subjectId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.agentPool != null && Object.hasOwnProperty.call(message, "agentPool")) + $root.google.storagetransfer.v1.AgentPool.encode(message.agentPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.agentPoolId != null && Object.hasOwnProperty.call(message, "agentPoolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentPoolId); return writer; }; /** - * Encodes the specified GoogleServiceAccount message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * Encodes the specified CreateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IGoogleServiceAccount} message GoogleServiceAccount message or plain object to encode + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} message CreateAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GoogleServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + CreateAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GoogleServiceAccount message from the specified reader or buffer. + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GoogleServiceAccount.decode = function decode(reader, length) { + CreateAgentPoolRequest.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.storagetransfer.v1.GoogleServiceAccount(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.CreateAgentPoolRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accountEmail = reader.string(); + message.projectId = reader.string(); break; case 2: - message.subjectId = reader.string(); + message.agentPool = $root.google.storagetransfer.v1.AgentPool.decode(reader, reader.uint32()); + break; + case 3: + message.agentPoolId = reader.string(); break; default: reader.skipType(tag & 7); @@ -2374,117 +2553,130 @@ }; /** - * Decodes a GoogleServiceAccount message from the specified reader or buffer, length delimited. + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GoogleServiceAccount.decodeDelimited = function decodeDelimited(reader) { + CreateAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GoogleServiceAccount message. + * Verifies a CreateAgentPoolRequest message. * @function verify - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GoogleServiceAccount.verify = function verify(message) { + CreateAgentPoolRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.accountEmail != null && message.hasOwnProperty("accountEmail")) - if (!$util.isString(message.accountEmail)) - return "accountEmail: string expected"; - if (message.subjectId != null && message.hasOwnProperty("subjectId")) - if (!$util.isString(message.subjectId)) - return "subjectId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.agentPool != null && message.hasOwnProperty("agentPool")) { + var error = $root.google.storagetransfer.v1.AgentPool.verify(message.agentPool); + if (error) + return "agentPool." + error; + } + if (message.agentPoolId != null && message.hasOwnProperty("agentPoolId")) + if (!$util.isString(message.agentPoolId)) + return "agentPoolId: string expected"; return null; }; /** - * Creates a GoogleServiceAccount message from a plain object. Also converts values to their respective internal types. + * Creates a CreateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest */ - GoogleServiceAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.GoogleServiceAccount) + CreateAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.CreateAgentPoolRequest) return object; - var message = new $root.google.storagetransfer.v1.GoogleServiceAccount(); - if (object.accountEmail != null) - message.accountEmail = String(object.accountEmail); - if (object.subjectId != null) - message.subjectId = String(object.subjectId); + var message = new $root.google.storagetransfer.v1.CreateAgentPoolRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.agentPool != null) { + if (typeof object.agentPool !== "object") + throw TypeError(".google.storagetransfer.v1.CreateAgentPoolRequest.agentPool: object expected"); + message.agentPool = $root.google.storagetransfer.v1.AgentPool.fromObject(object.agentPool); + } + if (object.agentPoolId != null) + message.agentPoolId = String(object.agentPoolId); return message; }; /** - * Creates a plain object from a GoogleServiceAccount message. Also converts values to other types if specified. + * Creates a plain object from a CreateAgentPoolRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.GoogleServiceAccount} message GoogleServiceAccount + * @param {google.storagetransfer.v1.CreateAgentPoolRequest} message CreateAgentPoolRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GoogleServiceAccount.toObject = function toObject(message, options) { + CreateAgentPoolRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.accountEmail = ""; - object.subjectId = ""; + object.projectId = ""; + object.agentPool = null; + object.agentPoolId = ""; } - if (message.accountEmail != null && message.hasOwnProperty("accountEmail")) - object.accountEmail = message.accountEmail; - if (message.subjectId != null && message.hasOwnProperty("subjectId")) - object.subjectId = message.subjectId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.agentPool != null && message.hasOwnProperty("agentPool")) + object.agentPool = $root.google.storagetransfer.v1.AgentPool.toObject(message.agentPool, options); + if (message.agentPoolId != null && message.hasOwnProperty("agentPoolId")) + object.agentPoolId = message.agentPoolId; return object; }; /** - * Converts this GoogleServiceAccount to JSON. + * Converts this CreateAgentPoolRequest to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest * @instance * @returns {Object.} JSON object */ - GoogleServiceAccount.prototype.toJSON = function toJSON() { + CreateAgentPoolRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GoogleServiceAccount; + return CreateAgentPoolRequest; })(); - v1.AwsAccessKey = (function() { + v1.UpdateAgentPoolRequest = (function() { /** - * Properties of an AwsAccessKey. + * Properties of an UpdateAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @interface IAwsAccessKey - * @property {string|null} [accessKeyId] AwsAccessKey accessKeyId - * @property {string|null} [secretAccessKey] AwsAccessKey secretAccessKey + * @interface IUpdateAgentPoolRequest + * @property {google.storagetransfer.v1.IAgentPool|null} [agentPool] UpdateAgentPoolRequest agentPool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentPoolRequest updateMask */ /** - * Constructs a new AwsAccessKey. + * Constructs a new UpdateAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @classdesc Represents an AwsAccessKey. - * @implements IAwsAccessKey + * @classdesc Represents an UpdateAgentPoolRequest. + * @implements IUpdateAgentPoolRequest * @constructor - * @param {google.storagetransfer.v1.IAwsAccessKey=} [properties] Properties to set + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest=} [properties] Properties to set */ - function AwsAccessKey(properties) { + function UpdateAgentPoolRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2492,88 +2684,88 @@ } /** - * AwsAccessKey accessKeyId. - * @member {string} accessKeyId - * @memberof google.storagetransfer.v1.AwsAccessKey + * UpdateAgentPoolRequest agentPool. + * @member {google.storagetransfer.v1.IAgentPool|null|undefined} agentPool + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @instance */ - AwsAccessKey.prototype.accessKeyId = ""; + UpdateAgentPoolRequest.prototype.agentPool = null; /** - * AwsAccessKey secretAccessKey. - * @member {string} secretAccessKey - * @memberof google.storagetransfer.v1.AwsAccessKey + * UpdateAgentPoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @instance */ - AwsAccessKey.prototype.secretAccessKey = ""; + UpdateAgentPoolRequest.prototype.updateMask = null; /** - * Creates a new AwsAccessKey instance using the specified properties. + * Creates a new UpdateAgentPoolRequest instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IAwsAccessKey=} [properties] Properties to set - * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey instance + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest instance */ - AwsAccessKey.create = function create(properties) { - return new AwsAccessKey(properties); + UpdateAgentPoolRequest.create = function create(properties) { + return new UpdateAgentPoolRequest(properties); }; /** - * Encodes the specified AwsAccessKey message. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * Encodes the specified UpdateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IAwsAccessKey} message AwsAccessKey message or plain object to encode + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} message UpdateAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AwsAccessKey.encode = function encode(message, writer) { + UpdateAgentPoolRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.accessKeyId != null && Object.hasOwnProperty.call(message, "accessKeyId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessKeyId); - if (message.secretAccessKey != null && Object.hasOwnProperty.call(message, "secretAccessKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretAccessKey); + if (message.agentPool != null && Object.hasOwnProperty.call(message, "agentPool")) + $root.google.storagetransfer.v1.AgentPool.encode(message.agentPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified AwsAccessKey message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * Encodes the specified UpdateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IAwsAccessKey} message AwsAccessKey message or plain object to encode + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} message UpdateAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AwsAccessKey.encodeDelimited = function encodeDelimited(message, writer) { + UpdateAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AwsAccessKey message from the specified reader or buffer. + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AwsAccessKey.decode = function decode(reader, length) { + UpdateAgentPoolRequest.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.storagetransfer.v1.AwsAccessKey(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.UpdateAgentPoolRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accessKeyId = reader.string(); + message.agentPool = $root.google.storagetransfer.v1.AgentPool.decode(reader, reader.uint32()); break; case 2: - message.secretAccessKey = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2584,116 +2776,126 @@ }; /** - * Decodes an AwsAccessKey message from the specified reader or buffer, length delimited. + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AwsAccessKey.decodeDelimited = function decodeDelimited(reader) { + UpdateAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AwsAccessKey message. + * Verifies an UpdateAgentPoolRequest message. * @function verify - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AwsAccessKey.verify = function verify(message) { + UpdateAgentPoolRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.accessKeyId != null && message.hasOwnProperty("accessKeyId")) - if (!$util.isString(message.accessKeyId)) - return "accessKeyId: string expected"; - if (message.secretAccessKey != null && message.hasOwnProperty("secretAccessKey")) - if (!$util.isString(message.secretAccessKey)) - return "secretAccessKey: string expected"; - return null; - }; + if (message.agentPool != null && message.hasOwnProperty("agentPool")) { + var error = $root.google.storagetransfer.v1.AgentPool.verify(message.agentPool); + if (error) + return "agentPool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * Creates an AwsAccessKey message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest */ - AwsAccessKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.AwsAccessKey) + UpdateAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.UpdateAgentPoolRequest) return object; - var message = new $root.google.storagetransfer.v1.AwsAccessKey(); - if (object.accessKeyId != null) - message.accessKeyId = String(object.accessKeyId); - if (object.secretAccessKey != null) - message.secretAccessKey = String(object.secretAccessKey); + var message = new $root.google.storagetransfer.v1.UpdateAgentPoolRequest(); + if (object.agentPool != null) { + if (typeof object.agentPool !== "object") + throw TypeError(".google.storagetransfer.v1.UpdateAgentPoolRequest.agentPool: object expected"); + message.agentPool = $root.google.storagetransfer.v1.AgentPool.fromObject(object.agentPool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storagetransfer.v1.UpdateAgentPoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from an AwsAccessKey message. Also converts values to other types if specified. + * Creates a plain object from an UpdateAgentPoolRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @static - * @param {google.storagetransfer.v1.AwsAccessKey} message AwsAccessKey + * @param {google.storagetransfer.v1.UpdateAgentPoolRequest} message UpdateAgentPoolRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AwsAccessKey.toObject = function toObject(message, options) { + UpdateAgentPoolRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.accessKeyId = ""; - object.secretAccessKey = ""; + object.agentPool = null; + object.updateMask = null; } - if (message.accessKeyId != null && message.hasOwnProperty("accessKeyId")) - object.accessKeyId = message.accessKeyId; - if (message.secretAccessKey != null && message.hasOwnProperty("secretAccessKey")) - object.secretAccessKey = message.secretAccessKey; + if (message.agentPool != null && message.hasOwnProperty("agentPool")) + object.agentPool = $root.google.storagetransfer.v1.AgentPool.toObject(message.agentPool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this AwsAccessKey to JSON. + * Converts this UpdateAgentPoolRequest to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.AwsAccessKey + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest * @instance * @returns {Object.} JSON object */ - AwsAccessKey.prototype.toJSON = function toJSON() { + UpdateAgentPoolRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AwsAccessKey; + return UpdateAgentPoolRequest; })(); - v1.AzureCredentials = (function() { + v1.GetAgentPoolRequest = (function() { /** - * Properties of an AzureCredentials. + * Properties of a GetAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @interface IAzureCredentials - * @property {string|null} [sasToken] AzureCredentials sasToken + * @interface IGetAgentPoolRequest + * @property {string|null} [name] GetAgentPoolRequest name */ /** - * Constructs a new AzureCredentials. + * Constructs a new GetAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @classdesc Represents an AzureCredentials. - * @implements IAzureCredentials + * @classdesc Represents a GetAgentPoolRequest. + * @implements IGetAgentPoolRequest * @constructor - * @param {google.storagetransfer.v1.IAzureCredentials=} [properties] Properties to set + * @param {google.storagetransfer.v1.IGetAgentPoolRequest=} [properties] Properties to set */ - function AzureCredentials(properties) { + function GetAgentPoolRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2701,75 +2903,75 @@ } /** - * AzureCredentials sasToken. - * @member {string} sasToken - * @memberof google.storagetransfer.v1.AzureCredentials + * GetAgentPoolRequest name. + * @member {string} name + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @instance */ - AzureCredentials.prototype.sasToken = ""; + GetAgentPoolRequest.prototype.name = ""; /** - * Creates a new AzureCredentials instance using the specified properties. + * Creates a new GetAgentPoolRequest instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IAzureCredentials=} [properties] Properties to set - * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials instance + * @param {google.storagetransfer.v1.IGetAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest instance */ - AzureCredentials.create = function create(properties) { - return new AzureCredentials(properties); + GetAgentPoolRequest.create = function create(properties) { + return new GetAgentPoolRequest(properties); }; /** - * Encodes the specified AzureCredentials message. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * Encodes the specified GetAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IAzureCredentials} message AzureCredentials message or plain object to encode + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} message GetAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AzureCredentials.encode = function encode(message, writer) { + GetAgentPoolRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sasToken != null && Object.hasOwnProperty.call(message, "sasToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sasToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified AzureCredentials message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * Encodes the specified GetAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IAzureCredentials} message AzureCredentials message or plain object to encode + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} message GetAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AzureCredentials.encodeDelimited = function encodeDelimited(message, writer) { + GetAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AzureCredentials message from the specified reader or buffer. + * Decodes a GetAgentPoolRequest message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AzureCredentials.decode = function decode(reader, length) { + GetAgentPoolRequest.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.storagetransfer.v1.AzureCredentials(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GetAgentPoolRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.sasToken = reader.string(); + case 1: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -2780,114 +2982,107 @@ }; /** - * Decodes an AzureCredentials message from the specified reader or buffer, length delimited. + * Decodes a GetAgentPoolRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AzureCredentials.decodeDelimited = function decodeDelimited(reader) { + GetAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AzureCredentials message. + * Verifies a GetAgentPoolRequest message. * @function verify - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AzureCredentials.verify = function verify(message) { + GetAgentPoolRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sasToken != null && message.hasOwnProperty("sasToken")) - if (!$util.isString(message.sasToken)) - return "sasToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an AzureCredentials message from a plain object. Also converts values to their respective internal types. + * Creates a GetAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest */ - AzureCredentials.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.AzureCredentials) + GetAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GetAgentPoolRequest) return object; - var message = new $root.google.storagetransfer.v1.AzureCredentials(); - if (object.sasToken != null) - message.sasToken = String(object.sasToken); + var message = new $root.google.storagetransfer.v1.GetAgentPoolRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an AzureCredentials message. Also converts values to other types if specified. + * Creates a plain object from a GetAgentPoolRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @static - * @param {google.storagetransfer.v1.AzureCredentials} message AzureCredentials + * @param {google.storagetransfer.v1.GetAgentPoolRequest} message GetAgentPoolRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AzureCredentials.toObject = function toObject(message, options) { + GetAgentPoolRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.sasToken = ""; - if (message.sasToken != null && message.hasOwnProperty("sasToken")) - object.sasToken = message.sasToken; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this AzureCredentials to JSON. + * Converts this GetAgentPoolRequest to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.AzureCredentials + * @memberof google.storagetransfer.v1.GetAgentPoolRequest * @instance * @returns {Object.} JSON object */ - AzureCredentials.prototype.toJSON = function toJSON() { + GetAgentPoolRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AzureCredentials; + return GetAgentPoolRequest; })(); - v1.ObjectConditions = (function() { + v1.DeleteAgentPoolRequest = (function() { /** - * Properties of an ObjectConditions. + * Properties of a DeleteAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @interface IObjectConditions - * @property {google.protobuf.IDuration|null} [minTimeElapsedSinceLastModification] ObjectConditions minTimeElapsedSinceLastModification - * @property {google.protobuf.IDuration|null} [maxTimeElapsedSinceLastModification] ObjectConditions maxTimeElapsedSinceLastModification - * @property {Array.|null} [includePrefixes] ObjectConditions includePrefixes - * @property {Array.|null} [excludePrefixes] ObjectConditions excludePrefixes - * @property {google.protobuf.ITimestamp|null} [lastModifiedSince] ObjectConditions lastModifiedSince - * @property {google.protobuf.ITimestamp|null} [lastModifiedBefore] ObjectConditions lastModifiedBefore + * @interface IDeleteAgentPoolRequest + * @property {string|null} [name] DeleteAgentPoolRequest name */ /** - * Constructs a new ObjectConditions. + * Constructs a new DeleteAgentPoolRequest. * @memberof google.storagetransfer.v1 - * @classdesc Represents an ObjectConditions. - * @implements IObjectConditions + * @classdesc Represents a DeleteAgentPoolRequest. + * @implements IDeleteAgentPoolRequest * @constructor - * @param {google.storagetransfer.v1.IObjectConditions=} [properties] Properties to set + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest=} [properties] Properties to set */ - function ObjectConditions(properties) { - this.includePrefixes = []; - this.excludePrefixes = []; + function DeleteAgentPoolRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2895,146 +3090,75 @@ } /** - * ObjectConditions minTimeElapsedSinceLastModification. - * @member {google.protobuf.IDuration|null|undefined} minTimeElapsedSinceLastModification - * @memberof google.storagetransfer.v1.ObjectConditions - * @instance - */ - ObjectConditions.prototype.minTimeElapsedSinceLastModification = null; - - /** - * ObjectConditions maxTimeElapsedSinceLastModification. - * @member {google.protobuf.IDuration|null|undefined} maxTimeElapsedSinceLastModification - * @memberof google.storagetransfer.v1.ObjectConditions - * @instance - */ - ObjectConditions.prototype.maxTimeElapsedSinceLastModification = null; - - /** - * ObjectConditions includePrefixes. - * @member {Array.} includePrefixes - * @memberof google.storagetransfer.v1.ObjectConditions - * @instance - */ - ObjectConditions.prototype.includePrefixes = $util.emptyArray; - - /** - * ObjectConditions excludePrefixes. - * @member {Array.} excludePrefixes - * @memberof google.storagetransfer.v1.ObjectConditions - * @instance - */ - ObjectConditions.prototype.excludePrefixes = $util.emptyArray; - - /** - * ObjectConditions lastModifiedSince. - * @member {google.protobuf.ITimestamp|null|undefined} lastModifiedSince - * @memberof google.storagetransfer.v1.ObjectConditions - * @instance - */ - ObjectConditions.prototype.lastModifiedSince = null; - - /** - * ObjectConditions lastModifiedBefore. - * @member {google.protobuf.ITimestamp|null|undefined} lastModifiedBefore - * @memberof google.storagetransfer.v1.ObjectConditions + * DeleteAgentPoolRequest name. + * @member {string} name + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @instance */ - ObjectConditions.prototype.lastModifiedBefore = null; + DeleteAgentPoolRequest.prototype.name = ""; /** - * Creates a new ObjectConditions instance using the specified properties. + * Creates a new DeleteAgentPoolRequest instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IObjectConditions=} [properties] Properties to set - * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions instance + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest instance */ - ObjectConditions.create = function create(properties) { - return new ObjectConditions(properties); + DeleteAgentPoolRequest.create = function create(properties) { + return new DeleteAgentPoolRequest(properties); }; /** - * Encodes the specified ObjectConditions message. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * Encodes the specified DeleteAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IObjectConditions} message ObjectConditions message or plain object to encode + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} message DeleteAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectConditions.encode = function encode(message, writer) { + DeleteAgentPoolRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.minTimeElapsedSinceLastModification != null && Object.hasOwnProperty.call(message, "minTimeElapsedSinceLastModification")) - $root.google.protobuf.Duration.encode(message.minTimeElapsedSinceLastModification, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxTimeElapsedSinceLastModification != null && Object.hasOwnProperty.call(message, "maxTimeElapsedSinceLastModification")) - $root.google.protobuf.Duration.encode(message.maxTimeElapsedSinceLastModification, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.includePrefixes != null && message.includePrefixes.length) - for (var i = 0; i < message.includePrefixes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.includePrefixes[i]); - if (message.excludePrefixes != null && message.excludePrefixes.length) - for (var i = 0; i < message.excludePrefixes.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludePrefixes[i]); - if (message.lastModifiedSince != null && Object.hasOwnProperty.call(message, "lastModifiedSince")) - $root.google.protobuf.Timestamp.encode(message.lastModifiedSince, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.lastModifiedBefore != null && Object.hasOwnProperty.call(message, "lastModifiedBefore")) - $root.google.protobuf.Timestamp.encode(message.lastModifiedBefore, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ObjectConditions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * Encodes the specified DeleteAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static - * @param {google.storagetransfer.v1.IObjectConditions} message ObjectConditions message or plain object to encode + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} message DeleteAgentPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ObjectConditions.encodeDelimited = function encodeDelimited(message, writer) { + DeleteAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ObjectConditions message from the specified reader or buffer. + * Decodes a DeleteAgentPoolRequest message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ObjectConditions.decode = function decode(reader, length) { + DeleteAgentPoolRequest.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.storagetransfer.v1.ObjectConditions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.DeleteAgentPoolRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 2: - message.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.includePrefixes && message.includePrefixes.length)) - message.includePrefixes = []; - message.includePrefixes.push(reader.string()); - break; - case 4: - if (!(message.excludePrefixes && message.excludePrefixes.length)) - message.excludePrefixes = []; - message.excludePrefixes.push(reader.string()); - break; - case 5: - message.lastModifiedSince = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.lastModifiedBefore = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3045,195 +3169,110 @@ }; /** - * Decodes an ObjectConditions message from the specified reader or buffer, length delimited. + * Decodes a DeleteAgentPoolRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ObjectConditions.decodeDelimited = function decodeDelimited(reader) { + DeleteAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ObjectConditions message. + * Verifies a DeleteAgentPoolRequest message. * @function verify - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ObjectConditions.verify = function verify(message) { + DeleteAgentPoolRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.minTimeElapsedSinceLastModification != null && message.hasOwnProperty("minTimeElapsedSinceLastModification")) { - var error = $root.google.protobuf.Duration.verify(message.minTimeElapsedSinceLastModification); - if (error) - return "minTimeElapsedSinceLastModification." + error; - } - if (message.maxTimeElapsedSinceLastModification != null && message.hasOwnProperty("maxTimeElapsedSinceLastModification")) { - var error = $root.google.protobuf.Duration.verify(message.maxTimeElapsedSinceLastModification); - if (error) - return "maxTimeElapsedSinceLastModification." + error; - } - if (message.includePrefixes != null && message.hasOwnProperty("includePrefixes")) { - if (!Array.isArray(message.includePrefixes)) - return "includePrefixes: array expected"; - for (var i = 0; i < message.includePrefixes.length; ++i) - if (!$util.isString(message.includePrefixes[i])) - return "includePrefixes: string[] expected"; - } - if (message.excludePrefixes != null && message.hasOwnProperty("excludePrefixes")) { - if (!Array.isArray(message.excludePrefixes)) - return "excludePrefixes: array expected"; - for (var i = 0; i < message.excludePrefixes.length; ++i) - if (!$util.isString(message.excludePrefixes[i])) - return "excludePrefixes: string[] expected"; - } - if (message.lastModifiedSince != null && message.hasOwnProperty("lastModifiedSince")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastModifiedSince); - if (error) - return "lastModifiedSince." + error; - } - if (message.lastModifiedBefore != null && message.hasOwnProperty("lastModifiedBefore")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastModifiedBefore); - if (error) - return "lastModifiedBefore." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an ObjectConditions message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAgentPoolRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest */ - ObjectConditions.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.ObjectConditions) + DeleteAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.DeleteAgentPoolRequest) return object; - var message = new $root.google.storagetransfer.v1.ObjectConditions(); - if (object.minTimeElapsedSinceLastModification != null) { - if (typeof object.minTimeElapsedSinceLastModification !== "object") - throw TypeError(".google.storagetransfer.v1.ObjectConditions.minTimeElapsedSinceLastModification: object expected"); - message.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.fromObject(object.minTimeElapsedSinceLastModification); - } - if (object.maxTimeElapsedSinceLastModification != null) { - if (typeof object.maxTimeElapsedSinceLastModification !== "object") - throw TypeError(".google.storagetransfer.v1.ObjectConditions.maxTimeElapsedSinceLastModification: object expected"); - message.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.fromObject(object.maxTimeElapsedSinceLastModification); - } - if (object.includePrefixes) { - if (!Array.isArray(object.includePrefixes)) - throw TypeError(".google.storagetransfer.v1.ObjectConditions.includePrefixes: array expected"); - message.includePrefixes = []; - for (var i = 0; i < object.includePrefixes.length; ++i) - message.includePrefixes[i] = String(object.includePrefixes[i]); - } - if (object.excludePrefixes) { - if (!Array.isArray(object.excludePrefixes)) - throw TypeError(".google.storagetransfer.v1.ObjectConditions.excludePrefixes: array expected"); - message.excludePrefixes = []; - for (var i = 0; i < object.excludePrefixes.length; ++i) - message.excludePrefixes[i] = String(object.excludePrefixes[i]); - } - if (object.lastModifiedSince != null) { - if (typeof object.lastModifiedSince !== "object") - throw TypeError(".google.storagetransfer.v1.ObjectConditions.lastModifiedSince: object expected"); - message.lastModifiedSince = $root.google.protobuf.Timestamp.fromObject(object.lastModifiedSince); - } - if (object.lastModifiedBefore != null) { - if (typeof object.lastModifiedBefore !== "object") - throw TypeError(".google.storagetransfer.v1.ObjectConditions.lastModifiedBefore: object expected"); - message.lastModifiedBefore = $root.google.protobuf.Timestamp.fromObject(object.lastModifiedBefore); - } + var message = new $root.google.storagetransfer.v1.DeleteAgentPoolRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an ObjectConditions message. Also converts values to other types if specified. + * Creates a plain object from a DeleteAgentPoolRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @static - * @param {google.storagetransfer.v1.ObjectConditions} message ObjectConditions + * @param {google.storagetransfer.v1.DeleteAgentPoolRequest} message DeleteAgentPoolRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ObjectConditions.toObject = function toObject(message, options) { + DeleteAgentPoolRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.includePrefixes = []; - object.excludePrefixes = []; - } - if (options.defaults) { - object.minTimeElapsedSinceLastModification = null; - object.maxTimeElapsedSinceLastModification = null; - object.lastModifiedSince = null; - object.lastModifiedBefore = null; - } - if (message.minTimeElapsedSinceLastModification != null && message.hasOwnProperty("minTimeElapsedSinceLastModification")) - object.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.toObject(message.minTimeElapsedSinceLastModification, options); - if (message.maxTimeElapsedSinceLastModification != null && message.hasOwnProperty("maxTimeElapsedSinceLastModification")) - object.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.toObject(message.maxTimeElapsedSinceLastModification, options); - if (message.includePrefixes && message.includePrefixes.length) { - object.includePrefixes = []; - for (var j = 0; j < message.includePrefixes.length; ++j) - object.includePrefixes[j] = message.includePrefixes[j]; - } - if (message.excludePrefixes && message.excludePrefixes.length) { - object.excludePrefixes = []; - for (var j = 0; j < message.excludePrefixes.length; ++j) - object.excludePrefixes[j] = message.excludePrefixes[j]; - } - if (message.lastModifiedSince != null && message.hasOwnProperty("lastModifiedSince")) - object.lastModifiedSince = $root.google.protobuf.Timestamp.toObject(message.lastModifiedSince, options); - if (message.lastModifiedBefore != null && message.hasOwnProperty("lastModifiedBefore")) - object.lastModifiedBefore = $root.google.protobuf.Timestamp.toObject(message.lastModifiedBefore, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ObjectConditions to JSON. + * Converts this DeleteAgentPoolRequest to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.ObjectConditions + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest * @instance * @returns {Object.} JSON object */ - ObjectConditions.prototype.toJSON = function toJSON() { + DeleteAgentPoolRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ObjectConditions; + return DeleteAgentPoolRequest; })(); - v1.GcsData = (function() { + v1.ListAgentPoolsRequest = (function() { /** - * Properties of a GcsData. + * Properties of a ListAgentPoolsRequest. * @memberof google.storagetransfer.v1 - * @interface IGcsData - * @property {string|null} [bucketName] GcsData bucketName - * @property {string|null} [path] GcsData path + * @interface IListAgentPoolsRequest + * @property {string|null} [projectId] ListAgentPoolsRequest projectId + * @property {string|null} [filter] ListAgentPoolsRequest filter + * @property {number|null} [pageSize] ListAgentPoolsRequest pageSize + * @property {string|null} [pageToken] ListAgentPoolsRequest pageToken */ /** - * Constructs a new GcsData. + * Constructs a new ListAgentPoolsRequest. * @memberof google.storagetransfer.v1 - * @classdesc Represents a GcsData. - * @implements IGcsData + * @classdesc Represents a ListAgentPoolsRequest. + * @implements IListAgentPoolsRequest * @constructor - * @param {google.storagetransfer.v1.IGcsData=} [properties] Properties to set + * @param {google.storagetransfer.v1.IListAgentPoolsRequest=} [properties] Properties to set */ - function GcsData(properties) { + function ListAgentPoolsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3241,88 +3280,114 @@ } /** - * GcsData bucketName. - * @member {string} bucketName - * @memberof google.storagetransfer.v1.GcsData + * ListAgentPoolsRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @instance */ - GcsData.prototype.bucketName = ""; + ListAgentPoolsRequest.prototype.projectId = ""; /** - * GcsData path. - * @member {string} path - * @memberof google.storagetransfer.v1.GcsData + * ListAgentPoolsRequest filter. + * @member {string} filter + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @instance */ - GcsData.prototype.path = ""; + ListAgentPoolsRequest.prototype.filter = ""; /** - * Creates a new GcsData instance using the specified properties. + * ListAgentPoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @instance + */ + ListAgentPoolsRequest.prototype.pageSize = 0; + + /** + * ListAgentPoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @instance + */ + ListAgentPoolsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAgentPoolsRequest instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static - * @param {google.storagetransfer.v1.IGcsData=} [properties] Properties to set - * @returns {google.storagetransfer.v1.GcsData} GcsData instance + * @param {google.storagetransfer.v1.IListAgentPoolsRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest instance */ - GcsData.create = function create(properties) { - return new GcsData(properties); + ListAgentPoolsRequest.create = function create(properties) { + return new ListAgentPoolsRequest(properties); }; /** - * Encodes the specified GcsData message. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * Encodes the specified ListAgentPoolsRequest message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static - * @param {google.storagetransfer.v1.IGcsData} message GcsData message or plain object to encode + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} message ListAgentPoolsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsData.encode = function encode(message, writer) { + ListAgentPoolsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified GcsData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * Encodes the specified ListAgentPoolsRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static - * @param {google.storagetransfer.v1.IGcsData} message GcsData message or plain object to encode + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} message ListAgentPoolsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsData.encodeDelimited = function encodeDelimited(message, writer) { + ListAgentPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsData message from the specified reader or buffer. + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.GcsData} GcsData + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsData.decode = function decode(reader, length) { + ListAgentPoolsRequest.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.storagetransfer.v1.GcsData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ListAgentPoolsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.bucketName = reader.string(); + message.projectId = reader.string(); + break; + case 2: + message.filter = reader.string(); break; case 3: - message.path = reader.string(); + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -3333,119 +3398,134 @@ }; /** - * Decodes a GcsData message from the specified reader or buffer, length delimited. + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.GcsData} GcsData + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsData.decodeDelimited = function decodeDelimited(reader) { + ListAgentPoolsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsData message. + * Verifies a ListAgentPoolsRequest message. * @function verify - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsData.verify = function verify(message) { + ListAgentPoolsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.bucketName != null && message.hasOwnProperty("bucketName")) - if (!$util.isString(message.bucketName)) - return "bucketName: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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"; return null; }; /** - * Creates a GcsData message from a plain object. Also converts values to their respective internal types. + * Creates a ListAgentPoolsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.GcsData} GcsData + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest */ - GcsData.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.GcsData) + ListAgentPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ListAgentPoolsRequest) return object; - var message = new $root.google.storagetransfer.v1.GcsData(); - if (object.bucketName != null) - message.bucketName = String(object.bucketName); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.storagetransfer.v1.ListAgentPoolsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GcsData message. Also converts values to other types if specified. + * Creates a plain object from a ListAgentPoolsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @static - * @param {google.storagetransfer.v1.GcsData} message GcsData + * @param {google.storagetransfer.v1.ListAgentPoolsRequest} message ListAgentPoolsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsData.toObject = function toObject(message, options) { + ListAgentPoolsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.bucketName = ""; - object.path = ""; + object.projectId = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.bucketName != null && message.hasOwnProperty("bucketName")) - object.bucketName = message.bucketName; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GcsData to JSON. + * Converts this ListAgentPoolsRequest to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.GcsData + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest * @instance * @returns {Object.} JSON object */ - GcsData.prototype.toJSON = function toJSON() { + ListAgentPoolsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsData; + return ListAgentPoolsRequest; })(); - v1.AwsS3Data = (function() { + v1.ListAgentPoolsResponse = (function() { /** - * Properties of an AwsS3Data. + * Properties of a ListAgentPoolsResponse. * @memberof google.storagetransfer.v1 - * @interface IAwsS3Data - * @property {string|null} [bucketName] AwsS3Data bucketName - * @property {google.storagetransfer.v1.IAwsAccessKey|null} [awsAccessKey] AwsS3Data awsAccessKey - * @property {string|null} [path] AwsS3Data path - * @property {string|null} [roleArn] AwsS3Data roleArn + * @interface IListAgentPoolsResponse + * @property {Array.|null} [agentPools] ListAgentPoolsResponse agentPools + * @property {string|null} [nextPageToken] ListAgentPoolsResponse nextPageToken */ /** - * Constructs a new AwsS3Data. + * Constructs a new ListAgentPoolsResponse. * @memberof google.storagetransfer.v1 - * @classdesc Represents an AwsS3Data. - * @implements IAwsS3Data + * @classdesc Represents a ListAgentPoolsResponse. + * @implements IListAgentPoolsResponse * @constructor - * @param {google.storagetransfer.v1.IAwsS3Data=} [properties] Properties to set + * @param {google.storagetransfer.v1.IListAgentPoolsResponse=} [properties] Properties to set */ - function AwsS3Data(properties) { + function ListAgentPoolsResponse(properties) { + this.agentPools = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3453,114 +3533,91 @@ } /** - * AwsS3Data bucketName. - * @member {string} bucketName - * @memberof google.storagetransfer.v1.AwsS3Data + * ListAgentPoolsResponse agentPools. + * @member {Array.} agentPools + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @instance */ - AwsS3Data.prototype.bucketName = ""; + ListAgentPoolsResponse.prototype.agentPools = $util.emptyArray; /** - * AwsS3Data awsAccessKey. - * @member {google.storagetransfer.v1.IAwsAccessKey|null|undefined} awsAccessKey - * @memberof google.storagetransfer.v1.AwsS3Data + * ListAgentPoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @instance */ - AwsS3Data.prototype.awsAccessKey = null; + ListAgentPoolsResponse.prototype.nextPageToken = ""; /** - * AwsS3Data path. - * @member {string} path - * @memberof google.storagetransfer.v1.AwsS3Data - * @instance - */ - AwsS3Data.prototype.path = ""; - - /** - * AwsS3Data roleArn. - * @member {string} roleArn - * @memberof google.storagetransfer.v1.AwsS3Data - * @instance - */ - AwsS3Data.prototype.roleArn = ""; - - /** - * Creates a new AwsS3Data instance using the specified properties. + * Creates a new ListAgentPoolsResponse instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static - * @param {google.storagetransfer.v1.IAwsS3Data=} [properties] Properties to set - * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data instance + * @param {google.storagetransfer.v1.IListAgentPoolsResponse=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse instance */ - AwsS3Data.create = function create(properties) { - return new AwsS3Data(properties); + ListAgentPoolsResponse.create = function create(properties) { + return new ListAgentPoolsResponse(properties); }; /** - * Encodes the specified AwsS3Data message. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * Encodes the specified ListAgentPoolsResponse message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static - * @param {google.storagetransfer.v1.IAwsS3Data} message AwsS3Data message or plain object to encode + * @param {google.storagetransfer.v1.IListAgentPoolsResponse} message ListAgentPoolsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AwsS3Data.encode = function encode(message, writer) { + ListAgentPoolsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); - if (message.awsAccessKey != null && Object.hasOwnProperty.call(message, "awsAccessKey")) - $root.google.storagetransfer.v1.AwsAccessKey.encode(message.awsAccessKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); - if (message.roleArn != null && Object.hasOwnProperty.call(message, "roleArn")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.roleArn); + if (message.agentPools != null && message.agentPools.length) + for (var i = 0; i < message.agentPools.length; ++i) + $root.google.storagetransfer.v1.AgentPool.encode(message.agentPools[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); return writer; }; /** - * Encodes the specified AwsS3Data message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * Encodes the specified ListAgentPoolsResponse message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static - * @param {google.storagetransfer.v1.IAwsS3Data} message AwsS3Data message or plain object to encode + * @param {google.storagetransfer.v1.IListAgentPoolsResponse} message ListAgentPoolsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AwsS3Data.encodeDelimited = function encodeDelimited(message, writer) { + ListAgentPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AwsS3Data message from the specified reader or buffer. + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AwsS3Data.decode = function decode(reader, length) { + ListAgentPoolsResponse.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.storagetransfer.v1.AwsS3Data(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ListAgentPoolsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.bucketName = reader.string(); + if (!(message.agentPools && message.agentPools.length)) + message.agentPools = []; + message.agentPools.push($root.google.storagetransfer.v1.AgentPool.decode(reader, reader.uint32())); break; case 2: - message.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.decode(reader, reader.uint32()); - break; - case 3: - message.path = reader.string(); - break; - case 4: - message.roleArn = reader.string(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -3571,140 +3628,134 @@ }; /** - * Decodes an AwsS3Data message from the specified reader or buffer, length delimited. + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AwsS3Data.decodeDelimited = function decodeDelimited(reader) { + ListAgentPoolsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AwsS3Data message. + * Verifies a ListAgentPoolsResponse message. * @function verify - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AwsS3Data.verify = function verify(message) { + ListAgentPoolsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.bucketName != null && message.hasOwnProperty("bucketName")) - if (!$util.isString(message.bucketName)) - return "bucketName: string expected"; - if (message.awsAccessKey != null && message.hasOwnProperty("awsAccessKey")) { - var error = $root.google.storagetransfer.v1.AwsAccessKey.verify(message.awsAccessKey); - if (error) - return "awsAccessKey." + error; + if (message.agentPools != null && message.hasOwnProperty("agentPools")) { + if (!Array.isArray(message.agentPools)) + return "agentPools: array expected"; + for (var i = 0; i < message.agentPools.length; ++i) { + var error = $root.google.storagetransfer.v1.AgentPool.verify(message.agentPools[i]); + if (error) + return "agentPools." + error; + } } - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.roleArn != null && message.hasOwnProperty("roleArn")) - if (!$util.isString(message.roleArn)) - return "roleArn: string expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an AwsS3Data message from a plain object. Also converts values to their respective internal types. + * Creates a ListAgentPoolsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse */ - AwsS3Data.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.AwsS3Data) + ListAgentPoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ListAgentPoolsResponse) return object; - var message = new $root.google.storagetransfer.v1.AwsS3Data(); - if (object.bucketName != null) - message.bucketName = String(object.bucketName); - if (object.awsAccessKey != null) { - if (typeof object.awsAccessKey !== "object") - throw TypeError(".google.storagetransfer.v1.AwsS3Data.awsAccessKey: object expected"); - message.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.fromObject(object.awsAccessKey); + var message = new $root.google.storagetransfer.v1.ListAgentPoolsResponse(); + if (object.agentPools) { + if (!Array.isArray(object.agentPools)) + throw TypeError(".google.storagetransfer.v1.ListAgentPoolsResponse.agentPools: array expected"); + message.agentPools = []; + for (var i = 0; i < object.agentPools.length; ++i) { + if (typeof object.agentPools[i] !== "object") + throw TypeError(".google.storagetransfer.v1.ListAgentPoolsResponse.agentPools: object expected"); + message.agentPools[i] = $root.google.storagetransfer.v1.AgentPool.fromObject(object.agentPools[i]); + } } - if (object.path != null) - message.path = String(object.path); - if (object.roleArn != null) - message.roleArn = String(object.roleArn); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an AwsS3Data message. Also converts values to other types if specified. + * Creates a plain object from a ListAgentPoolsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @static - * @param {google.storagetransfer.v1.AwsS3Data} message AwsS3Data + * @param {google.storagetransfer.v1.ListAgentPoolsResponse} message ListAgentPoolsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AwsS3Data.toObject = function toObject(message, options) { + ListAgentPoolsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.bucketName = ""; - object.awsAccessKey = null; - object.path = ""; - object.roleArn = ""; + if (options.arrays || options.defaults) + object.agentPools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agentPools && message.agentPools.length) { + object.agentPools = []; + for (var j = 0; j < message.agentPools.length; ++j) + object.agentPools[j] = $root.google.storagetransfer.v1.AgentPool.toObject(message.agentPools[j], options); } - if (message.bucketName != null && message.hasOwnProperty("bucketName")) - object.bucketName = message.bucketName; - if (message.awsAccessKey != null && message.hasOwnProperty("awsAccessKey")) - object.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.toObject(message.awsAccessKey, options); - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.roleArn != null && message.hasOwnProperty("roleArn")) - object.roleArn = message.roleArn; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this AwsS3Data to JSON. + * Converts this ListAgentPoolsResponse to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.AwsS3Data + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse * @instance * @returns {Object.} JSON object */ - AwsS3Data.prototype.toJSON = function toJSON() { + ListAgentPoolsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AwsS3Data; + return ListAgentPoolsResponse; })(); - v1.AzureBlobStorageData = (function() { + v1.GoogleServiceAccount = (function() { /** - * Properties of an AzureBlobStorageData. + * Properties of a GoogleServiceAccount. * @memberof google.storagetransfer.v1 - * @interface IAzureBlobStorageData - * @property {string|null} [storageAccount] AzureBlobStorageData storageAccount - * @property {google.storagetransfer.v1.IAzureCredentials|null} [azureCredentials] AzureBlobStorageData azureCredentials - * @property {string|null} [container] AzureBlobStorageData container - * @property {string|null} [path] AzureBlobStorageData path + * @interface IGoogleServiceAccount + * @property {string|null} [accountEmail] GoogleServiceAccount accountEmail + * @property {string|null} [subjectId] GoogleServiceAccount subjectId */ /** - * Constructs a new AzureBlobStorageData. + * Constructs a new GoogleServiceAccount. * @memberof google.storagetransfer.v1 - * @classdesc Represents an AzureBlobStorageData. - * @implements IAzureBlobStorageData + * @classdesc Represents a GoogleServiceAccount. + * @implements IGoogleServiceAccount * @constructor - * @param {google.storagetransfer.v1.IAzureBlobStorageData=} [properties] Properties to set + * @param {google.storagetransfer.v1.IGoogleServiceAccount=} [properties] Properties to set */ - function AzureBlobStorageData(properties) { + function GoogleServiceAccount(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3712,114 +3763,88 @@ } /** - * AzureBlobStorageData storageAccount. - * @member {string} storageAccount - * @memberof google.storagetransfer.v1.AzureBlobStorageData - * @instance - */ - AzureBlobStorageData.prototype.storageAccount = ""; - - /** - * AzureBlobStorageData azureCredentials. - * @member {google.storagetransfer.v1.IAzureCredentials|null|undefined} azureCredentials - * @memberof google.storagetransfer.v1.AzureBlobStorageData - * @instance - */ - AzureBlobStorageData.prototype.azureCredentials = null; - - /** - * AzureBlobStorageData container. - * @member {string} container - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * GoogleServiceAccount accountEmail. + * @member {string} accountEmail + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @instance */ - AzureBlobStorageData.prototype.container = ""; + GoogleServiceAccount.prototype.accountEmail = ""; /** - * AzureBlobStorageData path. - * @member {string} path - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * GoogleServiceAccount subjectId. + * @member {string} subjectId + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @instance */ - AzureBlobStorageData.prototype.path = ""; + GoogleServiceAccount.prototype.subjectId = ""; /** - * Creates a new AzureBlobStorageData instance using the specified properties. + * Creates a new GoogleServiceAccount instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static - * @param {google.storagetransfer.v1.IAzureBlobStorageData=} [properties] Properties to set - * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData instance + * @param {google.storagetransfer.v1.IGoogleServiceAccount=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount instance */ - AzureBlobStorageData.create = function create(properties) { - return new AzureBlobStorageData(properties); + GoogleServiceAccount.create = function create(properties) { + return new GoogleServiceAccount(properties); }; /** - * Encodes the specified AzureBlobStorageData message. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * Encodes the specified GoogleServiceAccount message. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static - * @param {google.storagetransfer.v1.IAzureBlobStorageData} message AzureBlobStorageData message or plain object to encode + * @param {google.storagetransfer.v1.IGoogleServiceAccount} message GoogleServiceAccount message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AzureBlobStorageData.encode = function encode(message, writer) { + GoogleServiceAccount.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.storageAccount != null && Object.hasOwnProperty.call(message, "storageAccount")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.storageAccount); - if (message.azureCredentials != null && Object.hasOwnProperty.call(message, "azureCredentials")) - $root.google.storagetransfer.v1.AzureCredentials.encode(message.azureCredentials, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.container != null && Object.hasOwnProperty.call(message, "container")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.container); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.path); + if (message.accountEmail != null && Object.hasOwnProperty.call(message, "accountEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accountEmail); + if (message.subjectId != null && Object.hasOwnProperty.call(message, "subjectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subjectId); return writer; }; /** - * Encodes the specified AzureBlobStorageData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * Encodes the specified GoogleServiceAccount message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static - * @param {google.storagetransfer.v1.IAzureBlobStorageData} message AzureBlobStorageData message or plain object to encode + * @param {google.storagetransfer.v1.IGoogleServiceAccount} message GoogleServiceAccount message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AzureBlobStorageData.encodeDelimited = function encodeDelimited(message, writer) { + GoogleServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AzureBlobStorageData message from the specified reader or buffer. + * Decodes a GoogleServiceAccount message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AzureBlobStorageData.decode = function decode(reader, length) { + GoogleServiceAccount.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.storagetransfer.v1.AzureBlobStorageData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GoogleServiceAccount(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.storageAccount = reader.string(); + message.accountEmail = reader.string(); break; case 2: - message.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.decode(reader, reader.uint32()); - break; - case 4: - message.container = reader.string(); - break; - case 5: - message.path = reader.string(); + message.subjectId = reader.string(); break; default: reader.skipType(tag & 7); @@ -3830,137 +3855,117 @@ }; /** - * Decodes an AzureBlobStorageData message from the specified reader or buffer, length delimited. + * Decodes a GoogleServiceAccount message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AzureBlobStorageData.decodeDelimited = function decodeDelimited(reader) { + GoogleServiceAccount.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AzureBlobStorageData message. + * Verifies a GoogleServiceAccount message. * @function verify - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AzureBlobStorageData.verify = function verify(message) { + GoogleServiceAccount.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.storageAccount != null && message.hasOwnProperty("storageAccount")) - if (!$util.isString(message.storageAccount)) - return "storageAccount: string expected"; - if (message.azureCredentials != null && message.hasOwnProperty("azureCredentials")) { - var error = $root.google.storagetransfer.v1.AzureCredentials.verify(message.azureCredentials); - if (error) - return "azureCredentials." + error; - } - if (message.container != null && message.hasOwnProperty("container")) - if (!$util.isString(message.container)) - return "container: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.accountEmail != null && message.hasOwnProperty("accountEmail")) + if (!$util.isString(message.accountEmail)) + return "accountEmail: string expected"; + if (message.subjectId != null && message.hasOwnProperty("subjectId")) + if (!$util.isString(message.subjectId)) + return "subjectId: string expected"; return null; }; /** - * Creates an AzureBlobStorageData message from a plain object. Also converts values to their respective internal types. + * Creates a GoogleServiceAccount message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount */ - AzureBlobStorageData.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.AzureBlobStorageData) + GoogleServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GoogleServiceAccount) return object; - var message = new $root.google.storagetransfer.v1.AzureBlobStorageData(); - if (object.storageAccount != null) - message.storageAccount = String(object.storageAccount); - if (object.azureCredentials != null) { - if (typeof object.azureCredentials !== "object") - throw TypeError(".google.storagetransfer.v1.AzureBlobStorageData.azureCredentials: object expected"); - message.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.fromObject(object.azureCredentials); - } - if (object.container != null) - message.container = String(object.container); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.storagetransfer.v1.GoogleServiceAccount(); + if (object.accountEmail != null) + message.accountEmail = String(object.accountEmail); + if (object.subjectId != null) + message.subjectId = String(object.subjectId); return message; }; /** - * Creates a plain object from an AzureBlobStorageData message. Also converts values to other types if specified. + * Creates a plain object from a GoogleServiceAccount message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @static - * @param {google.storagetransfer.v1.AzureBlobStorageData} message AzureBlobStorageData + * @param {google.storagetransfer.v1.GoogleServiceAccount} message GoogleServiceAccount * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AzureBlobStorageData.toObject = function toObject(message, options) { + GoogleServiceAccount.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.storageAccount = ""; - object.azureCredentials = null; - object.container = ""; - object.path = ""; + object.accountEmail = ""; + object.subjectId = ""; } - if (message.storageAccount != null && message.hasOwnProperty("storageAccount")) - object.storageAccount = message.storageAccount; - if (message.azureCredentials != null && message.hasOwnProperty("azureCredentials")) - object.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.toObject(message.azureCredentials, options); - if (message.container != null && message.hasOwnProperty("container")) - object.container = message.container; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.accountEmail != null && message.hasOwnProperty("accountEmail")) + object.accountEmail = message.accountEmail; + if (message.subjectId != null && message.hasOwnProperty("subjectId")) + object.subjectId = message.subjectId; return object; }; /** - * Converts this AzureBlobStorageData to JSON. + * Converts this GoogleServiceAccount to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @memberof google.storagetransfer.v1.GoogleServiceAccount * @instance * @returns {Object.} JSON object */ - AzureBlobStorageData.prototype.toJSON = function toJSON() { + GoogleServiceAccount.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AzureBlobStorageData; + return GoogleServiceAccount; })(); - v1.HttpData = (function() { + v1.AwsAccessKey = (function() { /** - * Properties of a HttpData. + * Properties of an AwsAccessKey. * @memberof google.storagetransfer.v1 - * @interface IHttpData - * @property {string|null} [listUrl] HttpData listUrl + * @interface IAwsAccessKey + * @property {string|null} [accessKeyId] AwsAccessKey accessKeyId + * @property {string|null} [secretAccessKey] AwsAccessKey secretAccessKey */ /** - * Constructs a new HttpData. + * Constructs a new AwsAccessKey. * @memberof google.storagetransfer.v1 - * @classdesc Represents a HttpData. - * @implements IHttpData + * @classdesc Represents an AwsAccessKey. + * @implements IAwsAccessKey * @constructor - * @param {google.storagetransfer.v1.IHttpData=} [properties] Properties to set + * @param {google.storagetransfer.v1.IAwsAccessKey=} [properties] Properties to set */ - function HttpData(properties) { + function AwsAccessKey(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3968,75 +3973,88 @@ } /** - * HttpData listUrl. - * @member {string} listUrl - * @memberof google.storagetransfer.v1.HttpData + * AwsAccessKey accessKeyId. + * @member {string} accessKeyId + * @memberof google.storagetransfer.v1.AwsAccessKey * @instance */ - HttpData.prototype.listUrl = ""; + AwsAccessKey.prototype.accessKeyId = ""; /** - * Creates a new HttpData instance using the specified properties. + * AwsAccessKey secretAccessKey. + * @member {string} secretAccessKey + * @memberof google.storagetransfer.v1.AwsAccessKey + * @instance + */ + AwsAccessKey.prototype.secretAccessKey = ""; + + /** + * Creates a new AwsAccessKey instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static - * @param {google.storagetransfer.v1.IHttpData=} [properties] Properties to set - * @returns {google.storagetransfer.v1.HttpData} HttpData instance + * @param {google.storagetransfer.v1.IAwsAccessKey=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey instance */ - HttpData.create = function create(properties) { - return new HttpData(properties); + AwsAccessKey.create = function create(properties) { + return new AwsAccessKey(properties); }; /** - * Encodes the specified HttpData message. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * Encodes the specified AwsAccessKey message. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static - * @param {google.storagetransfer.v1.IHttpData} message HttpData message or plain object to encode + * @param {google.storagetransfer.v1.IAwsAccessKey} message AwsAccessKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpData.encode = function encode(message, writer) { + AwsAccessKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.listUrl != null && Object.hasOwnProperty.call(message, "listUrl")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.listUrl); + if (message.accessKeyId != null && Object.hasOwnProperty.call(message, "accessKeyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessKeyId); + if (message.secretAccessKey != null && Object.hasOwnProperty.call(message, "secretAccessKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretAccessKey); return writer; }; /** - * Encodes the specified HttpData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * Encodes the specified AwsAccessKey message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static - * @param {google.storagetransfer.v1.IHttpData} message HttpData message or plain object to encode + * @param {google.storagetransfer.v1.IAwsAccessKey} message AwsAccessKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpData.encodeDelimited = function encodeDelimited(message, writer) { + AwsAccessKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpData message from the specified reader or buffer. + * Decodes an AwsAccessKey message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.HttpData} HttpData + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpData.decode = function decode(reader, length) { + AwsAccessKey.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.storagetransfer.v1.HttpData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AwsAccessKey(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.listUrl = reader.string(); + message.accessKeyId = reader.string(); + break; + case 2: + message.secretAccessKey = reader.string(); break; default: reader.skipType(tag & 7); @@ -4047,109 +4065,116 @@ }; /** - * Decodes a HttpData message from the specified reader or buffer, length delimited. + * Decodes an AwsAccessKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.HttpData} HttpData + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpData.decodeDelimited = function decodeDelimited(reader) { + AwsAccessKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpData message. + * Verifies an AwsAccessKey message. * @function verify - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpData.verify = function verify(message) { + AwsAccessKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.listUrl != null && message.hasOwnProperty("listUrl")) - if (!$util.isString(message.listUrl)) - return "listUrl: string expected"; + if (message.accessKeyId != null && message.hasOwnProperty("accessKeyId")) + if (!$util.isString(message.accessKeyId)) + return "accessKeyId: string expected"; + if (message.secretAccessKey != null && message.hasOwnProperty("secretAccessKey")) + if (!$util.isString(message.secretAccessKey)) + return "secretAccessKey: string expected"; return null; }; /** - * Creates a HttpData message from a plain object. Also converts values to their respective internal types. + * Creates an AwsAccessKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.HttpData} HttpData + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey */ - HttpData.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.HttpData) + AwsAccessKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AwsAccessKey) return object; - var message = new $root.google.storagetransfer.v1.HttpData(); - if (object.listUrl != null) - message.listUrl = String(object.listUrl); + var message = new $root.google.storagetransfer.v1.AwsAccessKey(); + if (object.accessKeyId != null) + message.accessKeyId = String(object.accessKeyId); + if (object.secretAccessKey != null) + message.secretAccessKey = String(object.secretAccessKey); return message; }; /** - * Creates a plain object from a HttpData message. Also converts values to other types if specified. + * Creates a plain object from an AwsAccessKey message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @static - * @param {google.storagetransfer.v1.HttpData} message HttpData + * @param {google.storagetransfer.v1.AwsAccessKey} message AwsAccessKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpData.toObject = function toObject(message, options) { + AwsAccessKey.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.listUrl = ""; - if (message.listUrl != null && message.hasOwnProperty("listUrl")) - object.listUrl = message.listUrl; + if (options.defaults) { + object.accessKeyId = ""; + object.secretAccessKey = ""; + } + if (message.accessKeyId != null && message.hasOwnProperty("accessKeyId")) + object.accessKeyId = message.accessKeyId; + if (message.secretAccessKey != null && message.hasOwnProperty("secretAccessKey")) + object.secretAccessKey = message.secretAccessKey; return object; }; /** - * Converts this HttpData to JSON. + * Converts this AwsAccessKey to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.HttpData + * @memberof google.storagetransfer.v1.AwsAccessKey * @instance * @returns {Object.} JSON object */ - HttpData.prototype.toJSON = function toJSON() { + AwsAccessKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpData; + return AwsAccessKey; })(); - v1.TransferOptions = (function() { + v1.AzureCredentials = (function() { /** - * Properties of a TransferOptions. + * Properties of an AzureCredentials. * @memberof google.storagetransfer.v1 - * @interface ITransferOptions - * @property {boolean|null} [overwriteObjectsAlreadyExistingInSink] TransferOptions overwriteObjectsAlreadyExistingInSink - * @property {boolean|null} [deleteObjectsUniqueInSink] TransferOptions deleteObjectsUniqueInSink - * @property {boolean|null} [deleteObjectsFromSourceAfterTransfer] TransferOptions deleteObjectsFromSourceAfterTransfer + * @interface IAzureCredentials + * @property {string|null} [sasToken] AzureCredentials sasToken */ /** - * Constructs a new TransferOptions. + * Constructs a new AzureCredentials. * @memberof google.storagetransfer.v1 - * @classdesc Represents a TransferOptions. - * @implements ITransferOptions + * @classdesc Represents an AzureCredentials. + * @implements IAzureCredentials * @constructor - * @param {google.storagetransfer.v1.ITransferOptions=} [properties] Properties to set + * @param {google.storagetransfer.v1.IAzureCredentials=} [properties] Properties to set */ - function TransferOptions(properties) { + function AzureCredentials(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4157,101 +4182,75 @@ } /** - * TransferOptions overwriteObjectsAlreadyExistingInSink. - * @member {boolean} overwriteObjectsAlreadyExistingInSink - * @memberof google.storagetransfer.v1.TransferOptions + * AzureCredentials sasToken. + * @member {string} sasToken + * @memberof google.storagetransfer.v1.AzureCredentials * @instance */ - TransferOptions.prototype.overwriteObjectsAlreadyExistingInSink = false; - - /** - * TransferOptions deleteObjectsUniqueInSink. - * @member {boolean} deleteObjectsUniqueInSink - * @memberof google.storagetransfer.v1.TransferOptions - * @instance - */ - TransferOptions.prototype.deleteObjectsUniqueInSink = false; - - /** - * TransferOptions deleteObjectsFromSourceAfterTransfer. - * @member {boolean} deleteObjectsFromSourceAfterTransfer - * @memberof google.storagetransfer.v1.TransferOptions - * @instance - */ - TransferOptions.prototype.deleteObjectsFromSourceAfterTransfer = false; + AzureCredentials.prototype.sasToken = ""; /** - * Creates a new TransferOptions instance using the specified properties. + * Creates a new AzureCredentials instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static - * @param {google.storagetransfer.v1.ITransferOptions=} [properties] Properties to set - * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions instance + * @param {google.storagetransfer.v1.IAzureCredentials=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials instance */ - TransferOptions.create = function create(properties) { - return new TransferOptions(properties); + AzureCredentials.create = function create(properties) { + return new AzureCredentials(properties); }; /** - * Encodes the specified TransferOptions message. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. + * Encodes the specified AzureCredentials message. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static - * @param {google.storagetransfer.v1.ITransferOptions} message TransferOptions message or plain object to encode + * @param {google.storagetransfer.v1.IAzureCredentials} message AzureCredentials message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferOptions.encode = function encode(message, writer) { + AzureCredentials.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.overwriteObjectsAlreadyExistingInSink != null && Object.hasOwnProperty.call(message, "overwriteObjectsAlreadyExistingInSink")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.overwriteObjectsAlreadyExistingInSink); - if (message.deleteObjectsUniqueInSink != null && Object.hasOwnProperty.call(message, "deleteObjectsUniqueInSink")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleteObjectsUniqueInSink); - if (message.deleteObjectsFromSourceAfterTransfer != null && Object.hasOwnProperty.call(message, "deleteObjectsFromSourceAfterTransfer")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteObjectsFromSourceAfterTransfer); + if (message.sasToken != null && Object.hasOwnProperty.call(message, "sasToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sasToken); return writer; }; /** - * Encodes the specified TransferOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. + * Encodes the specified AzureCredentials message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static - * @param {google.storagetransfer.v1.ITransferOptions} message TransferOptions message or plain object to encode + * @param {google.storagetransfer.v1.IAzureCredentials} message AzureCredentials message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferOptions.encodeDelimited = function encodeDelimited(message, writer) { + AzureCredentials.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TransferOptions message from the specified reader or buffer. + * Decodes an AzureCredentials message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferOptions.decode = function decode(reader, length) { + AzureCredentials.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.storagetransfer.v1.TransferOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AzureCredentials(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.overwriteObjectsAlreadyExistingInSink = reader.bool(); - break; case 2: - message.deleteObjectsUniqueInSink = reader.bool(); - break; - case 3: - message.deleteObjectsFromSourceAfterTransfer = reader.bool(); + message.sasToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4262,130 +4261,114 @@ }; /** - * Decodes a TransferOptions message from the specified reader or buffer, length delimited. + * Decodes an AzureCredentials message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferOptions.decodeDelimited = function decodeDelimited(reader) { + AzureCredentials.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TransferOptions message. + * Verifies an AzureCredentials message. * @function verify - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TransferOptions.verify = function verify(message) { + AzureCredentials.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.overwriteObjectsAlreadyExistingInSink != null && message.hasOwnProperty("overwriteObjectsAlreadyExistingInSink")) - if (typeof message.overwriteObjectsAlreadyExistingInSink !== "boolean") - return "overwriteObjectsAlreadyExistingInSink: boolean expected"; - if (message.deleteObjectsUniqueInSink != null && message.hasOwnProperty("deleteObjectsUniqueInSink")) - if (typeof message.deleteObjectsUniqueInSink !== "boolean") - return "deleteObjectsUniqueInSink: boolean expected"; - if (message.deleteObjectsFromSourceAfterTransfer != null && message.hasOwnProperty("deleteObjectsFromSourceAfterTransfer")) - if (typeof message.deleteObjectsFromSourceAfterTransfer !== "boolean") - return "deleteObjectsFromSourceAfterTransfer: boolean expected"; + if (message.sasToken != null && message.hasOwnProperty("sasToken")) + if (!$util.isString(message.sasToken)) + return "sasToken: string expected"; return null; }; /** - * Creates a TransferOptions message from a plain object. Also converts values to their respective internal types. + * Creates an AzureCredentials message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials */ - TransferOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.TransferOptions) + AzureCredentials.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AzureCredentials) return object; - var message = new $root.google.storagetransfer.v1.TransferOptions(); - if (object.overwriteObjectsAlreadyExistingInSink != null) - message.overwriteObjectsAlreadyExistingInSink = Boolean(object.overwriteObjectsAlreadyExistingInSink); - if (object.deleteObjectsUniqueInSink != null) - message.deleteObjectsUniqueInSink = Boolean(object.deleteObjectsUniqueInSink); - if (object.deleteObjectsFromSourceAfterTransfer != null) - message.deleteObjectsFromSourceAfterTransfer = Boolean(object.deleteObjectsFromSourceAfterTransfer); + var message = new $root.google.storagetransfer.v1.AzureCredentials(); + if (object.sasToken != null) + message.sasToken = String(object.sasToken); return message; }; /** - * Creates a plain object from a TransferOptions message. Also converts values to other types if specified. + * Creates a plain object from an AzureCredentials message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @static - * @param {google.storagetransfer.v1.TransferOptions} message TransferOptions + * @param {google.storagetransfer.v1.AzureCredentials} message AzureCredentials * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransferOptions.toObject = function toObject(message, options) { + AzureCredentials.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.overwriteObjectsAlreadyExistingInSink = false; - object.deleteObjectsUniqueInSink = false; - object.deleteObjectsFromSourceAfterTransfer = false; - } - if (message.overwriteObjectsAlreadyExistingInSink != null && message.hasOwnProperty("overwriteObjectsAlreadyExistingInSink")) - object.overwriteObjectsAlreadyExistingInSink = message.overwriteObjectsAlreadyExistingInSink; - if (message.deleteObjectsUniqueInSink != null && message.hasOwnProperty("deleteObjectsUniqueInSink")) - object.deleteObjectsUniqueInSink = message.deleteObjectsUniqueInSink; - if (message.deleteObjectsFromSourceAfterTransfer != null && message.hasOwnProperty("deleteObjectsFromSourceAfterTransfer")) - object.deleteObjectsFromSourceAfterTransfer = message.deleteObjectsFromSourceAfterTransfer; + if (options.defaults) + object.sasToken = ""; + if (message.sasToken != null && message.hasOwnProperty("sasToken")) + object.sasToken = message.sasToken; return object; }; /** - * Converts this TransferOptions to JSON. + * Converts this AzureCredentials to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.TransferOptions + * @memberof google.storagetransfer.v1.AzureCredentials * @instance * @returns {Object.} JSON object */ - TransferOptions.prototype.toJSON = function toJSON() { + AzureCredentials.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TransferOptions; + return AzureCredentials; })(); - v1.TransferSpec = (function() { + v1.ObjectConditions = (function() { /** - * Properties of a TransferSpec. + * Properties of an ObjectConditions. * @memberof google.storagetransfer.v1 - * @interface ITransferSpec - * @property {google.storagetransfer.v1.IGcsData|null} [gcsDataSink] TransferSpec gcsDataSink - * @property {google.storagetransfer.v1.IGcsData|null} [gcsDataSource] TransferSpec gcsDataSource - * @property {google.storagetransfer.v1.IAwsS3Data|null} [awsS3DataSource] TransferSpec awsS3DataSource - * @property {google.storagetransfer.v1.IHttpData|null} [httpDataSource] TransferSpec httpDataSource - * @property {google.storagetransfer.v1.IAzureBlobStorageData|null} [azureBlobStorageDataSource] TransferSpec azureBlobStorageDataSource - * @property {google.storagetransfer.v1.IObjectConditions|null} [objectConditions] TransferSpec objectConditions - * @property {google.storagetransfer.v1.ITransferOptions|null} [transferOptions] TransferSpec transferOptions + * @interface IObjectConditions + * @property {google.protobuf.IDuration|null} [minTimeElapsedSinceLastModification] ObjectConditions minTimeElapsedSinceLastModification + * @property {google.protobuf.IDuration|null} [maxTimeElapsedSinceLastModification] ObjectConditions maxTimeElapsedSinceLastModification + * @property {Array.|null} [includePrefixes] ObjectConditions includePrefixes + * @property {Array.|null} [excludePrefixes] ObjectConditions excludePrefixes + * @property {google.protobuf.ITimestamp|null} [lastModifiedSince] ObjectConditions lastModifiedSince + * @property {google.protobuf.ITimestamp|null} [lastModifiedBefore] ObjectConditions lastModifiedBefore */ /** - * Constructs a new TransferSpec. + * Constructs a new ObjectConditions. * @memberof google.storagetransfer.v1 - * @classdesc Represents a TransferSpec. - * @implements ITransferSpec + * @classdesc Represents an ObjectConditions. + * @implements IObjectConditions * @constructor - * @param {google.storagetransfer.v1.ITransferSpec=} [properties] Properties to set + * @param {google.storagetransfer.v1.IObjectConditions=} [properties] Properties to set */ - function TransferSpec(properties) { + function ObjectConditions(properties) { + this.includePrefixes = []; + this.excludePrefixes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4393,178 +4376,146 @@ } /** - * TransferSpec gcsDataSink. - * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsDataSink - * @memberof google.storagetransfer.v1.TransferSpec + * ObjectConditions minTimeElapsedSinceLastModification. + * @member {google.protobuf.IDuration|null|undefined} minTimeElapsedSinceLastModification + * @memberof google.storagetransfer.v1.ObjectConditions * @instance */ - TransferSpec.prototype.gcsDataSink = null; + ObjectConditions.prototype.minTimeElapsedSinceLastModification = null; /** - * TransferSpec gcsDataSource. - * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsDataSource - * @memberof google.storagetransfer.v1.TransferSpec + * ObjectConditions maxTimeElapsedSinceLastModification. + * @member {google.protobuf.IDuration|null|undefined} maxTimeElapsedSinceLastModification + * @memberof google.storagetransfer.v1.ObjectConditions * @instance */ - TransferSpec.prototype.gcsDataSource = null; + ObjectConditions.prototype.maxTimeElapsedSinceLastModification = null; /** - * TransferSpec awsS3DataSource. - * @member {google.storagetransfer.v1.IAwsS3Data|null|undefined} awsS3DataSource - * @memberof google.storagetransfer.v1.TransferSpec + * ObjectConditions includePrefixes. + * @member {Array.} includePrefixes + * @memberof google.storagetransfer.v1.ObjectConditions * @instance */ - TransferSpec.prototype.awsS3DataSource = null; + ObjectConditions.prototype.includePrefixes = $util.emptyArray; /** - * TransferSpec httpDataSource. - * @member {google.storagetransfer.v1.IHttpData|null|undefined} httpDataSource - * @memberof google.storagetransfer.v1.TransferSpec + * ObjectConditions excludePrefixes. + * @member {Array.} excludePrefixes + * @memberof google.storagetransfer.v1.ObjectConditions * @instance */ - TransferSpec.prototype.httpDataSource = null; + ObjectConditions.prototype.excludePrefixes = $util.emptyArray; /** - * TransferSpec azureBlobStorageDataSource. - * @member {google.storagetransfer.v1.IAzureBlobStorageData|null|undefined} azureBlobStorageDataSource - * @memberof google.storagetransfer.v1.TransferSpec + * ObjectConditions lastModifiedSince. + * @member {google.protobuf.ITimestamp|null|undefined} lastModifiedSince + * @memberof google.storagetransfer.v1.ObjectConditions * @instance */ - TransferSpec.prototype.azureBlobStorageDataSource = null; + ObjectConditions.prototype.lastModifiedSince = null; /** - * TransferSpec objectConditions. - * @member {google.storagetransfer.v1.IObjectConditions|null|undefined} objectConditions - * @memberof google.storagetransfer.v1.TransferSpec + * ObjectConditions lastModifiedBefore. + * @member {google.protobuf.ITimestamp|null|undefined} lastModifiedBefore + * @memberof google.storagetransfer.v1.ObjectConditions * @instance */ - TransferSpec.prototype.objectConditions = null; + ObjectConditions.prototype.lastModifiedBefore = null; /** - * TransferSpec transferOptions. - * @member {google.storagetransfer.v1.ITransferOptions|null|undefined} transferOptions - * @memberof google.storagetransfer.v1.TransferSpec - * @instance + * Creates a new ObjectConditions instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {google.storagetransfer.v1.IObjectConditions=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions instance */ - TransferSpec.prototype.transferOptions = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ObjectConditions.create = function create(properties) { + return new ObjectConditions(properties); + }; /** - * TransferSpec dataSink. - * @member {"gcsDataSink"|undefined} dataSink - * @memberof google.storagetransfer.v1.TransferSpec - * @instance + * Encodes the specified ObjectConditions message. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {google.storagetransfer.v1.IObjectConditions} message ObjectConditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(TransferSpec.prototype, "dataSink", { - get: $util.oneOfGetter($oneOfFields = ["gcsDataSink"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * TransferSpec dataSource. - * @member {"gcsDataSource"|"awsS3DataSource"|"httpDataSource"|"azureBlobStorageDataSource"|undefined} dataSource - * @memberof google.storagetransfer.v1.TransferSpec - * @instance - */ - Object.defineProperty(TransferSpec.prototype, "dataSource", { - get: $util.oneOfGetter($oneOfFields = ["gcsDataSource", "awsS3DataSource", "httpDataSource", "azureBlobStorageDataSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransferSpec instance using the specified properties. - * @function create - * @memberof google.storagetransfer.v1.TransferSpec - * @static - * @param {google.storagetransfer.v1.ITransferSpec=} [properties] Properties to set - * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec instance - */ - TransferSpec.create = function create(properties) { - return new TransferSpec(properties); - }; - - /** - * Encodes the specified TransferSpec message. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. - * @function encode - * @memberof google.storagetransfer.v1.TransferSpec - * @static - * @param {google.storagetransfer.v1.ITransferSpec} message TransferSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferSpec.encode = function encode(message, writer) { + ObjectConditions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDataSource != null && Object.hasOwnProperty.call(message, "gcsDataSource")) - $root.google.storagetransfer.v1.GcsData.encode(message.gcsDataSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.awsS3DataSource != null && Object.hasOwnProperty.call(message, "awsS3DataSource")) - $root.google.storagetransfer.v1.AwsS3Data.encode(message.awsS3DataSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.httpDataSource != null && Object.hasOwnProperty.call(message, "httpDataSource")) - $root.google.storagetransfer.v1.HttpData.encode(message.httpDataSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.gcsDataSink != null && Object.hasOwnProperty.call(message, "gcsDataSink")) - $root.google.storagetransfer.v1.GcsData.encode(message.gcsDataSink, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.objectConditions != null && Object.hasOwnProperty.call(message, "objectConditions")) - $root.google.storagetransfer.v1.ObjectConditions.encode(message.objectConditions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.transferOptions != null && Object.hasOwnProperty.call(message, "transferOptions")) - $root.google.storagetransfer.v1.TransferOptions.encode(message.transferOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.azureBlobStorageDataSource != null && Object.hasOwnProperty.call(message, "azureBlobStorageDataSource")) - $root.google.storagetransfer.v1.AzureBlobStorageData.encode(message.azureBlobStorageDataSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.minTimeElapsedSinceLastModification != null && Object.hasOwnProperty.call(message, "minTimeElapsedSinceLastModification")) + $root.google.protobuf.Duration.encode(message.minTimeElapsedSinceLastModification, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxTimeElapsedSinceLastModification != null && Object.hasOwnProperty.call(message, "maxTimeElapsedSinceLastModification")) + $root.google.protobuf.Duration.encode(message.maxTimeElapsedSinceLastModification, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.includePrefixes != null && message.includePrefixes.length) + for (var i = 0; i < message.includePrefixes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.includePrefixes[i]); + if (message.excludePrefixes != null && message.excludePrefixes.length) + for (var i = 0; i < message.excludePrefixes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludePrefixes[i]); + if (message.lastModifiedSince != null && Object.hasOwnProperty.call(message, "lastModifiedSince")) + $root.google.protobuf.Timestamp.encode(message.lastModifiedSince, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastModifiedBefore != null && Object.hasOwnProperty.call(message, "lastModifiedBefore")) + $root.google.protobuf.Timestamp.encode(message.lastModifiedBefore, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified TransferSpec message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. + * Encodes the specified ObjectConditions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.TransferSpec + * @memberof google.storagetransfer.v1.ObjectConditions * @static - * @param {google.storagetransfer.v1.ITransferSpec} message TransferSpec message or plain object to encode + * @param {google.storagetransfer.v1.IObjectConditions} message ObjectConditions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferSpec.encodeDelimited = function encodeDelimited(message, writer) { + ObjectConditions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TransferSpec message from the specified reader or buffer. + * Decodes an ObjectConditions message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.TransferSpec + * @memberof google.storagetransfer.v1.ObjectConditions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferSpec.decode = function decode(reader, length) { + ObjectConditions.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.storagetransfer.v1.TransferSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ObjectConditions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.gcsDataSink = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); - break; case 1: - message.gcsDataSource = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); + message.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 2: - message.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.decode(reader, reader.uint32()); + message.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 3: - message.httpDataSource = $root.google.storagetransfer.v1.HttpData.decode(reader, reader.uint32()); + if (!(message.includePrefixes && message.includePrefixes.length)) + message.includePrefixes = []; + message.includePrefixes.push(reader.string()); break; - case 8: - message.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.decode(reader, reader.uint32()); + case 4: + if (!(message.excludePrefixes && message.excludePrefixes.length)) + message.excludePrefixes = []; + message.excludePrefixes.push(reader.string()); break; case 5: - message.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.decode(reader, reader.uint32()); + message.lastModifiedSince = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 6: - message.transferOptions = $root.google.storagetransfer.v1.TransferOptions.decode(reader, reader.uint32()); + message.lastModifiedBefore = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4575,227 +4526,195 @@ }; /** - * Decodes a TransferSpec message from the specified reader or buffer, length delimited. + * Decodes an ObjectConditions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.TransferSpec + * @memberof google.storagetransfer.v1.ObjectConditions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferSpec.decodeDelimited = function decodeDelimited(reader) { + ObjectConditions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TransferSpec message. + * Verifies an ObjectConditions message. * @function verify - * @memberof google.storagetransfer.v1.TransferSpec + * @memberof google.storagetransfer.v1.ObjectConditions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TransferSpec.verify = function verify(message) { + ObjectConditions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDataSink != null && message.hasOwnProperty("gcsDataSink")) { - properties.dataSink = 1; - { - var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsDataSink); - if (error) - return "gcsDataSink." + error; - } - } - if (message.gcsDataSource != null && message.hasOwnProperty("gcsDataSource")) { - properties.dataSource = 1; - { - var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsDataSource); - if (error) - return "gcsDataSource." + error; - } + if (message.minTimeElapsedSinceLastModification != null && message.hasOwnProperty("minTimeElapsedSinceLastModification")) { + var error = $root.google.protobuf.Duration.verify(message.minTimeElapsedSinceLastModification); + if (error) + return "minTimeElapsedSinceLastModification." + error; } - if (message.awsS3DataSource != null && message.hasOwnProperty("awsS3DataSource")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - { - var error = $root.google.storagetransfer.v1.AwsS3Data.verify(message.awsS3DataSource); - if (error) - return "awsS3DataSource." + error; - } + if (message.maxTimeElapsedSinceLastModification != null && message.hasOwnProperty("maxTimeElapsedSinceLastModification")) { + var error = $root.google.protobuf.Duration.verify(message.maxTimeElapsedSinceLastModification); + if (error) + return "maxTimeElapsedSinceLastModification." + error; } - if (message.httpDataSource != null && message.hasOwnProperty("httpDataSource")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - { - var error = $root.google.storagetransfer.v1.HttpData.verify(message.httpDataSource); - if (error) - return "httpDataSource." + error; - } + if (message.includePrefixes != null && message.hasOwnProperty("includePrefixes")) { + if (!Array.isArray(message.includePrefixes)) + return "includePrefixes: array expected"; + for (var i = 0; i < message.includePrefixes.length; ++i) + if (!$util.isString(message.includePrefixes[i])) + return "includePrefixes: string[] expected"; } - if (message.azureBlobStorageDataSource != null && message.hasOwnProperty("azureBlobStorageDataSource")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - { - var error = $root.google.storagetransfer.v1.AzureBlobStorageData.verify(message.azureBlobStorageDataSource); - if (error) - return "azureBlobStorageDataSource." + error; - } + if (message.excludePrefixes != null && message.hasOwnProperty("excludePrefixes")) { + if (!Array.isArray(message.excludePrefixes)) + return "excludePrefixes: array expected"; + for (var i = 0; i < message.excludePrefixes.length; ++i) + if (!$util.isString(message.excludePrefixes[i])) + return "excludePrefixes: string[] expected"; } - if (message.objectConditions != null && message.hasOwnProperty("objectConditions")) { - var error = $root.google.storagetransfer.v1.ObjectConditions.verify(message.objectConditions); + if (message.lastModifiedSince != null && message.hasOwnProperty("lastModifiedSince")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastModifiedSince); if (error) - return "objectConditions." + error; + return "lastModifiedSince." + error; } - if (message.transferOptions != null && message.hasOwnProperty("transferOptions")) { - var error = $root.google.storagetransfer.v1.TransferOptions.verify(message.transferOptions); + if (message.lastModifiedBefore != null && message.hasOwnProperty("lastModifiedBefore")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastModifiedBefore); if (error) - return "transferOptions." + error; + return "lastModifiedBefore." + error; } return null; }; /** - * Creates a TransferSpec message from a plain object. Also converts values to their respective internal types. + * Creates an ObjectConditions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.TransferSpec + * @memberof google.storagetransfer.v1.ObjectConditions * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions */ - TransferSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.TransferSpec) + ObjectConditions.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ObjectConditions) return object; - var message = new $root.google.storagetransfer.v1.TransferSpec(); - if (object.gcsDataSink != null) { - if (typeof object.gcsDataSink !== "object") - throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsDataSink: object expected"); - message.gcsDataSink = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsDataSink); + var message = new $root.google.storagetransfer.v1.ObjectConditions(); + if (object.minTimeElapsedSinceLastModification != null) { + if (typeof object.minTimeElapsedSinceLastModification !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.minTimeElapsedSinceLastModification: object expected"); + message.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.fromObject(object.minTimeElapsedSinceLastModification); } - if (object.gcsDataSource != null) { - if (typeof object.gcsDataSource !== "object") - throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsDataSource: object expected"); - message.gcsDataSource = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsDataSource); + if (object.maxTimeElapsedSinceLastModification != null) { + if (typeof object.maxTimeElapsedSinceLastModification !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.maxTimeElapsedSinceLastModification: object expected"); + message.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.fromObject(object.maxTimeElapsedSinceLastModification); } - if (object.awsS3DataSource != null) { - if (typeof object.awsS3DataSource !== "object") - throw TypeError(".google.storagetransfer.v1.TransferSpec.awsS3DataSource: object expected"); - message.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.fromObject(object.awsS3DataSource); + if (object.includePrefixes) { + if (!Array.isArray(object.includePrefixes)) + throw TypeError(".google.storagetransfer.v1.ObjectConditions.includePrefixes: array expected"); + message.includePrefixes = []; + for (var i = 0; i < object.includePrefixes.length; ++i) + message.includePrefixes[i] = String(object.includePrefixes[i]); } - if (object.httpDataSource != null) { - if (typeof object.httpDataSource !== "object") - throw TypeError(".google.storagetransfer.v1.TransferSpec.httpDataSource: object expected"); - message.httpDataSource = $root.google.storagetransfer.v1.HttpData.fromObject(object.httpDataSource); + if (object.excludePrefixes) { + if (!Array.isArray(object.excludePrefixes)) + throw TypeError(".google.storagetransfer.v1.ObjectConditions.excludePrefixes: array expected"); + message.excludePrefixes = []; + for (var i = 0; i < object.excludePrefixes.length; ++i) + message.excludePrefixes[i] = String(object.excludePrefixes[i]); } - if (object.azureBlobStorageDataSource != null) { - if (typeof object.azureBlobStorageDataSource !== "object") - throw TypeError(".google.storagetransfer.v1.TransferSpec.azureBlobStorageDataSource: object expected"); - message.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.fromObject(object.azureBlobStorageDataSource); + if (object.lastModifiedSince != null) { + if (typeof object.lastModifiedSince !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.lastModifiedSince: object expected"); + message.lastModifiedSince = $root.google.protobuf.Timestamp.fromObject(object.lastModifiedSince); } - if (object.objectConditions != null) { - if (typeof object.objectConditions !== "object") - throw TypeError(".google.storagetransfer.v1.TransferSpec.objectConditions: object expected"); - message.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.fromObject(object.objectConditions); - } - if (object.transferOptions != null) { - if (typeof object.transferOptions !== "object") - throw TypeError(".google.storagetransfer.v1.TransferSpec.transferOptions: object expected"); - message.transferOptions = $root.google.storagetransfer.v1.TransferOptions.fromObject(object.transferOptions); + if (object.lastModifiedBefore != null) { + if (typeof object.lastModifiedBefore !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.lastModifiedBefore: object expected"); + message.lastModifiedBefore = $root.google.protobuf.Timestamp.fromObject(object.lastModifiedBefore); } return message; }; /** - * Creates a plain object from a TransferSpec message. Also converts values to other types if specified. + * Creates a plain object from an ObjectConditions message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.TransferSpec + * @memberof google.storagetransfer.v1.ObjectConditions * @static - * @param {google.storagetransfer.v1.TransferSpec} message TransferSpec + * @param {google.storagetransfer.v1.ObjectConditions} message ObjectConditions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransferSpec.toObject = function toObject(message, options) { + ObjectConditions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.objectConditions = null; - object.transferOptions = null; - } - if (message.gcsDataSource != null && message.hasOwnProperty("gcsDataSource")) { - object.gcsDataSource = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsDataSource, options); - if (options.oneofs) - object.dataSource = "gcsDataSource"; - } - if (message.awsS3DataSource != null && message.hasOwnProperty("awsS3DataSource")) { - object.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.toObject(message.awsS3DataSource, options); - if (options.oneofs) - object.dataSource = "awsS3DataSource"; + if (options.arrays || options.defaults) { + object.includePrefixes = []; + object.excludePrefixes = []; } - if (message.httpDataSource != null && message.hasOwnProperty("httpDataSource")) { - object.httpDataSource = $root.google.storagetransfer.v1.HttpData.toObject(message.httpDataSource, options); - if (options.oneofs) - object.dataSource = "httpDataSource"; + if (options.defaults) { + object.minTimeElapsedSinceLastModification = null; + object.maxTimeElapsedSinceLastModification = null; + object.lastModifiedSince = null; + object.lastModifiedBefore = null; } - if (message.gcsDataSink != null && message.hasOwnProperty("gcsDataSink")) { - object.gcsDataSink = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsDataSink, options); - if (options.oneofs) - object.dataSink = "gcsDataSink"; + if (message.minTimeElapsedSinceLastModification != null && message.hasOwnProperty("minTimeElapsedSinceLastModification")) + object.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.toObject(message.minTimeElapsedSinceLastModification, options); + if (message.maxTimeElapsedSinceLastModification != null && message.hasOwnProperty("maxTimeElapsedSinceLastModification")) + object.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.toObject(message.maxTimeElapsedSinceLastModification, options); + if (message.includePrefixes && message.includePrefixes.length) { + object.includePrefixes = []; + for (var j = 0; j < message.includePrefixes.length; ++j) + object.includePrefixes[j] = message.includePrefixes[j]; } - if (message.objectConditions != null && message.hasOwnProperty("objectConditions")) - object.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.toObject(message.objectConditions, options); - if (message.transferOptions != null && message.hasOwnProperty("transferOptions")) - object.transferOptions = $root.google.storagetransfer.v1.TransferOptions.toObject(message.transferOptions, options); - if (message.azureBlobStorageDataSource != null && message.hasOwnProperty("azureBlobStorageDataSource")) { - object.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.toObject(message.azureBlobStorageDataSource, options); - if (options.oneofs) - object.dataSource = "azureBlobStorageDataSource"; + if (message.excludePrefixes && message.excludePrefixes.length) { + object.excludePrefixes = []; + for (var j = 0; j < message.excludePrefixes.length; ++j) + object.excludePrefixes[j] = message.excludePrefixes[j]; } + if (message.lastModifiedSince != null && message.hasOwnProperty("lastModifiedSince")) + object.lastModifiedSince = $root.google.protobuf.Timestamp.toObject(message.lastModifiedSince, options); + if (message.lastModifiedBefore != null && message.hasOwnProperty("lastModifiedBefore")) + object.lastModifiedBefore = $root.google.protobuf.Timestamp.toObject(message.lastModifiedBefore, options); return object; }; /** - * Converts this TransferSpec to JSON. + * Converts this ObjectConditions to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.TransferSpec + * @memberof google.storagetransfer.v1.ObjectConditions * @instance * @returns {Object.} JSON object */ - TransferSpec.prototype.toJSON = function toJSON() { + ObjectConditions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TransferSpec; + return ObjectConditions; })(); - v1.Schedule = (function() { + v1.GcsData = (function() { /** - * Properties of a Schedule. + * Properties of a GcsData. * @memberof google.storagetransfer.v1 - * @interface ISchedule - * @property {google.type.IDate|null} [scheduleStartDate] Schedule scheduleStartDate - * @property {google.type.IDate|null} [scheduleEndDate] Schedule scheduleEndDate - * @property {google.type.ITimeOfDay|null} [startTimeOfDay] Schedule startTimeOfDay - * @property {google.type.ITimeOfDay|null} [endTimeOfDay] Schedule endTimeOfDay - * @property {google.protobuf.IDuration|null} [repeatInterval] Schedule repeatInterval + * @interface IGcsData + * @property {string|null} [bucketName] GcsData bucketName + * @property {string|null} [path] GcsData path */ /** - * Constructs a new Schedule. + * Constructs a new GcsData. * @memberof google.storagetransfer.v1 - * @classdesc Represents a Schedule. - * @implements ISchedule + * @classdesc Represents a GcsData. + * @implements IGcsData * @constructor - * @param {google.storagetransfer.v1.ISchedule=} [properties] Properties to set + * @param {google.storagetransfer.v1.IGcsData=} [properties] Properties to set */ - function Schedule(properties) { + function GcsData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4803,127 +4722,88 @@ } /** - * Schedule scheduleStartDate. - * @member {google.type.IDate|null|undefined} scheduleStartDate - * @memberof google.storagetransfer.v1.Schedule - * @instance - */ - Schedule.prototype.scheduleStartDate = null; - - /** - * Schedule scheduleEndDate. - * @member {google.type.IDate|null|undefined} scheduleEndDate - * @memberof google.storagetransfer.v1.Schedule - * @instance - */ - Schedule.prototype.scheduleEndDate = null; - - /** - * Schedule startTimeOfDay. - * @member {google.type.ITimeOfDay|null|undefined} startTimeOfDay - * @memberof google.storagetransfer.v1.Schedule - * @instance - */ - Schedule.prototype.startTimeOfDay = null; - - /** - * Schedule endTimeOfDay. - * @member {google.type.ITimeOfDay|null|undefined} endTimeOfDay - * @memberof google.storagetransfer.v1.Schedule + * GcsData bucketName. + * @member {string} bucketName + * @memberof google.storagetransfer.v1.GcsData * @instance */ - Schedule.prototype.endTimeOfDay = null; + GcsData.prototype.bucketName = ""; /** - * Schedule repeatInterval. - * @member {google.protobuf.IDuration|null|undefined} repeatInterval - * @memberof google.storagetransfer.v1.Schedule + * GcsData path. + * @member {string} path + * @memberof google.storagetransfer.v1.GcsData * @instance */ - Schedule.prototype.repeatInterval = null; + GcsData.prototype.path = ""; /** - * Creates a new Schedule instance using the specified properties. + * Creates a new GcsData instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static - * @param {google.storagetransfer.v1.ISchedule=} [properties] Properties to set - * @returns {google.storagetransfer.v1.Schedule} Schedule instance + * @param {google.storagetransfer.v1.IGcsData=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GcsData} GcsData instance */ - Schedule.create = function create(properties) { - return new Schedule(properties); + GcsData.create = function create(properties) { + return new GcsData(properties); }; /** - * Encodes the specified Schedule message. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * Encodes the specified GcsData message. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static - * @param {google.storagetransfer.v1.ISchedule} message Schedule message or plain object to encode + * @param {google.storagetransfer.v1.IGcsData} message GcsData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Schedule.encode = function encode(message, writer) { + GcsData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scheduleStartDate != null && Object.hasOwnProperty.call(message, "scheduleStartDate")) - $root.google.type.Date.encode(message.scheduleStartDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.scheduleEndDate != null && Object.hasOwnProperty.call(message, "scheduleEndDate")) - $root.google.type.Date.encode(message.scheduleEndDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.startTimeOfDay != null && Object.hasOwnProperty.call(message, "startTimeOfDay")) - $root.google.type.TimeOfDay.encode(message.startTimeOfDay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTimeOfDay != null && Object.hasOwnProperty.call(message, "endTimeOfDay")) - $root.google.type.TimeOfDay.encode(message.endTimeOfDay, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.repeatInterval != null && Object.hasOwnProperty.call(message, "repeatInterval")) - $root.google.protobuf.Duration.encode(message.repeatInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); return writer; }; /** - * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * Encodes the specified GcsData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static - * @param {google.storagetransfer.v1.ISchedule} message Schedule message or plain object to encode + * @param {google.storagetransfer.v1.IGcsData} message GcsData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Schedule.encodeDelimited = function encodeDelimited(message, writer) { + GcsData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Schedule message from the specified reader or buffer. + * Decodes a GcsData message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.Schedule} Schedule + * @returns {google.storagetransfer.v1.GcsData} GcsData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Schedule.decode = function decode(reader, length) { + GcsData.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.storagetransfer.v1.Schedule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GcsData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.scheduleStartDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - case 2: - message.scheduleEndDate = $root.google.type.Date.decode(reader, reader.uint32()); + message.bucketName = reader.string(); break; case 3: - message.startTimeOfDay = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - case 4: - message.endTimeOfDay = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - case 5: - message.repeatInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -4934,175 +4814,119 @@ }; /** - * Decodes a Schedule message from the specified reader or buffer, length delimited. + * Decodes a GcsData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.Schedule} Schedule + * @returns {google.storagetransfer.v1.GcsData} GcsData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Schedule.decodeDelimited = function decodeDelimited(reader) { + GcsData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Schedule message. + * Verifies a GcsData message. * @function verify - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Schedule.verify = function verify(message) { + GcsData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.scheduleStartDate != null && message.hasOwnProperty("scheduleStartDate")) { - var error = $root.google.type.Date.verify(message.scheduleStartDate); - if (error) - return "scheduleStartDate." + error; - } - if (message.scheduleEndDate != null && message.hasOwnProperty("scheduleEndDate")) { - var error = $root.google.type.Date.verify(message.scheduleEndDate); - if (error) - return "scheduleEndDate." + error; - } - if (message.startTimeOfDay != null && message.hasOwnProperty("startTimeOfDay")) { - var error = $root.google.type.TimeOfDay.verify(message.startTimeOfDay); - if (error) - return "startTimeOfDay." + error; - } - if (message.endTimeOfDay != null && message.hasOwnProperty("endTimeOfDay")) { - var error = $root.google.type.TimeOfDay.verify(message.endTimeOfDay); - if (error) - return "endTimeOfDay." + error; - } - if (message.repeatInterval != null && message.hasOwnProperty("repeatInterval")) { - var error = $root.google.protobuf.Duration.verify(message.repeatInterval); - if (error) - return "repeatInterval." + error; - } + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; return null; }; /** - * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * Creates a GcsData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.Schedule} Schedule + * @returns {google.storagetransfer.v1.GcsData} GcsData */ - Schedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.Schedule) + GcsData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GcsData) return object; - var message = new $root.google.storagetransfer.v1.Schedule(); - if (object.scheduleStartDate != null) { - if (typeof object.scheduleStartDate !== "object") - throw TypeError(".google.storagetransfer.v1.Schedule.scheduleStartDate: object expected"); - message.scheduleStartDate = $root.google.type.Date.fromObject(object.scheduleStartDate); - } - if (object.scheduleEndDate != null) { - if (typeof object.scheduleEndDate !== "object") - throw TypeError(".google.storagetransfer.v1.Schedule.scheduleEndDate: object expected"); - message.scheduleEndDate = $root.google.type.Date.fromObject(object.scheduleEndDate); - } - if (object.startTimeOfDay != null) { - if (typeof object.startTimeOfDay !== "object") - throw TypeError(".google.storagetransfer.v1.Schedule.startTimeOfDay: object expected"); - message.startTimeOfDay = $root.google.type.TimeOfDay.fromObject(object.startTimeOfDay); - } - if (object.endTimeOfDay != null) { - if (typeof object.endTimeOfDay !== "object") - throw TypeError(".google.storagetransfer.v1.Schedule.endTimeOfDay: object expected"); - message.endTimeOfDay = $root.google.type.TimeOfDay.fromObject(object.endTimeOfDay); - } - if (object.repeatInterval != null) { - if (typeof object.repeatInterval !== "object") - throw TypeError(".google.storagetransfer.v1.Schedule.repeatInterval: object expected"); - message.repeatInterval = $root.google.protobuf.Duration.fromObject(object.repeatInterval); - } + var message = new $root.google.storagetransfer.v1.GcsData(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.path != null) + message.path = String(object.path); return message; }; /** - * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * Creates a plain object from a GcsData message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @static - * @param {google.storagetransfer.v1.Schedule} message Schedule + * @param {google.storagetransfer.v1.GcsData} message GcsData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Schedule.toObject = function toObject(message, options) { + GcsData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.scheduleStartDate = null; - object.scheduleEndDate = null; - object.startTimeOfDay = null; - object.endTimeOfDay = null; - object.repeatInterval = null; + object.bucketName = ""; + object.path = ""; } - if (message.scheduleStartDate != null && message.hasOwnProperty("scheduleStartDate")) - object.scheduleStartDate = $root.google.type.Date.toObject(message.scheduleStartDate, options); - if (message.scheduleEndDate != null && message.hasOwnProperty("scheduleEndDate")) - object.scheduleEndDate = $root.google.type.Date.toObject(message.scheduleEndDate, options); - if (message.startTimeOfDay != null && message.hasOwnProperty("startTimeOfDay")) - object.startTimeOfDay = $root.google.type.TimeOfDay.toObject(message.startTimeOfDay, options); - if (message.endTimeOfDay != null && message.hasOwnProperty("endTimeOfDay")) - object.endTimeOfDay = $root.google.type.TimeOfDay.toObject(message.endTimeOfDay, options); - if (message.repeatInterval != null && message.hasOwnProperty("repeatInterval")) - object.repeatInterval = $root.google.protobuf.Duration.toObject(message.repeatInterval, options); + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + object.bucketName = message.bucketName; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; /** - * Converts this Schedule to JSON. + * Converts this GcsData to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.Schedule + * @memberof google.storagetransfer.v1.GcsData * @instance * @returns {Object.} JSON object */ - Schedule.prototype.toJSON = function toJSON() { + GcsData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Schedule; + return GcsData; })(); - v1.TransferJob = (function() { + v1.AwsS3Data = (function() { /** - * Properties of a TransferJob. + * Properties of an AwsS3Data. * @memberof google.storagetransfer.v1 - * @interface ITransferJob - * @property {string|null} [name] TransferJob name - * @property {string|null} [description] TransferJob description - * @property {string|null} [projectId] TransferJob projectId - * @property {google.storagetransfer.v1.ITransferSpec|null} [transferSpec] TransferJob transferSpec - * @property {google.storagetransfer.v1.INotificationConfig|null} [notificationConfig] TransferJob notificationConfig - * @property {google.storagetransfer.v1.ISchedule|null} [schedule] TransferJob schedule - * @property {google.storagetransfer.v1.TransferJob.Status|null} [status] TransferJob status - * @property {google.protobuf.ITimestamp|null} [creationTime] TransferJob creationTime - * @property {google.protobuf.ITimestamp|null} [lastModificationTime] TransferJob lastModificationTime - * @property {google.protobuf.ITimestamp|null} [deletionTime] TransferJob deletionTime - * @property {string|null} [latestOperationName] TransferJob latestOperationName + * @interface IAwsS3Data + * @property {string|null} [bucketName] AwsS3Data bucketName + * @property {google.storagetransfer.v1.IAwsAccessKey|null} [awsAccessKey] AwsS3Data awsAccessKey + * @property {string|null} [path] AwsS3Data path + * @property {string|null} [roleArn] AwsS3Data roleArn */ /** - * Constructs a new TransferJob. + * Constructs a new AwsS3Data. * @memberof google.storagetransfer.v1 - * @classdesc Represents a TransferJob. - * @implements ITransferJob + * @classdesc Represents an AwsS3Data. + * @implements IAwsS3Data * @constructor - * @param {google.storagetransfer.v1.ITransferJob=} [properties] Properties to set + * @param {google.storagetransfer.v1.IAwsS3Data=} [properties] Properties to set */ - function TransferJob(properties) { + function AwsS3Data(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5110,205 +4934,114 @@ } /** - * TransferJob name. - * @member {string} name - * @memberof google.storagetransfer.v1.TransferJob - * @instance - */ - TransferJob.prototype.name = ""; - - /** - * TransferJob description. - * @member {string} description - * @memberof google.storagetransfer.v1.TransferJob - * @instance - */ - TransferJob.prototype.description = ""; - - /** - * TransferJob projectId. - * @member {string} projectId - * @memberof google.storagetransfer.v1.TransferJob - * @instance - */ - TransferJob.prototype.projectId = ""; - - /** - * TransferJob transferSpec. - * @member {google.storagetransfer.v1.ITransferSpec|null|undefined} transferSpec - * @memberof google.storagetransfer.v1.TransferJob - * @instance - */ - TransferJob.prototype.transferSpec = null; - - /** - * TransferJob notificationConfig. - * @member {google.storagetransfer.v1.INotificationConfig|null|undefined} notificationConfig - * @memberof google.storagetransfer.v1.TransferJob - * @instance - */ - TransferJob.prototype.notificationConfig = null; - - /** - * TransferJob schedule. - * @member {google.storagetransfer.v1.ISchedule|null|undefined} schedule - * @memberof google.storagetransfer.v1.TransferJob - * @instance - */ - TransferJob.prototype.schedule = null; - - /** - * TransferJob status. - * @member {google.storagetransfer.v1.TransferJob.Status} status - * @memberof google.storagetransfer.v1.TransferJob - * @instance - */ - TransferJob.prototype.status = 0; - - /** - * TransferJob creationTime. - * @member {google.protobuf.ITimestamp|null|undefined} creationTime - * @memberof google.storagetransfer.v1.TransferJob + * AwsS3Data bucketName. + * @member {string} bucketName + * @memberof google.storagetransfer.v1.AwsS3Data * @instance */ - TransferJob.prototype.creationTime = null; + AwsS3Data.prototype.bucketName = ""; /** - * TransferJob lastModificationTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastModificationTime - * @memberof google.storagetransfer.v1.TransferJob + * AwsS3Data awsAccessKey. + * @member {google.storagetransfer.v1.IAwsAccessKey|null|undefined} awsAccessKey + * @memberof google.storagetransfer.v1.AwsS3Data * @instance */ - TransferJob.prototype.lastModificationTime = null; + AwsS3Data.prototype.awsAccessKey = null; /** - * TransferJob deletionTime. - * @member {google.protobuf.ITimestamp|null|undefined} deletionTime - * @memberof google.storagetransfer.v1.TransferJob + * AwsS3Data path. + * @member {string} path + * @memberof google.storagetransfer.v1.AwsS3Data * @instance */ - TransferJob.prototype.deletionTime = null; + AwsS3Data.prototype.path = ""; /** - * TransferJob latestOperationName. - * @member {string} latestOperationName - * @memberof google.storagetransfer.v1.TransferJob + * AwsS3Data roleArn. + * @member {string} roleArn + * @memberof google.storagetransfer.v1.AwsS3Data * @instance */ - TransferJob.prototype.latestOperationName = ""; + AwsS3Data.prototype.roleArn = ""; /** - * Creates a new TransferJob instance using the specified properties. + * Creates a new AwsS3Data instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static - * @param {google.storagetransfer.v1.ITransferJob=} [properties] Properties to set - * @returns {google.storagetransfer.v1.TransferJob} TransferJob instance + * @param {google.storagetransfer.v1.IAwsS3Data=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data instance */ - TransferJob.create = function create(properties) { - return new TransferJob(properties); + AwsS3Data.create = function create(properties) { + return new AwsS3Data(properties); }; /** - * Encodes the specified TransferJob message. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * Encodes the specified AwsS3Data message. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static - * @param {google.storagetransfer.v1.ITransferJob} message TransferJob message or plain object to encode + * @param {google.storagetransfer.v1.IAwsS3Data} message AwsS3Data message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferJob.encode = function encode(message, writer) { + AwsS3Data.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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); - if (message.transferSpec != null && Object.hasOwnProperty.call(message, "transferSpec")) - $root.google.storagetransfer.v1.TransferSpec.encode(message.transferSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) - $root.google.storagetransfer.v1.Schedule.encode(message.schedule, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.status); - if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) - $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.lastModificationTime != null && Object.hasOwnProperty.call(message, "lastModificationTime")) - $root.google.protobuf.Timestamp.encode(message.lastModificationTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deletionTime != null && Object.hasOwnProperty.call(message, "deletionTime")) - $root.google.protobuf.Timestamp.encode(message.deletionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) - $root.google.storagetransfer.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.latestOperationName != null && Object.hasOwnProperty.call(message, "latestOperationName")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.latestOperationName); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); + if (message.awsAccessKey != null && Object.hasOwnProperty.call(message, "awsAccessKey")) + $root.google.storagetransfer.v1.AwsAccessKey.encode(message.awsAccessKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + if (message.roleArn != null && Object.hasOwnProperty.call(message, "roleArn")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.roleArn); return writer; }; /** - * Encodes the specified TransferJob message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * Encodes the specified AwsS3Data message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static - * @param {google.storagetransfer.v1.ITransferJob} message TransferJob message or plain object to encode + * @param {google.storagetransfer.v1.IAwsS3Data} message AwsS3Data message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferJob.encodeDelimited = function encodeDelimited(message, writer) { + AwsS3Data.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TransferJob message from the specified reader or buffer. + * Decodes an AwsS3Data message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.TransferJob} TransferJob + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferJob.decode = function decode(reader, length) { + AwsS3Data.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.storagetransfer.v1.TransferJob(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AwsS3Data(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.bucketName = reader.string(); break; case 2: - message.description = reader.string(); + message.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.decode(reader, reader.uint32()); break; case 3: - message.projectId = reader.string(); + message.path = reader.string(); break; case 4: - message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.decode(reader, reader.uint32()); - break; - case 11: - message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.decode(reader, reader.uint32()); - break; - case 5: - message.schedule = $root.google.storagetransfer.v1.Schedule.decode(reader, reader.uint32()); - break; - case 6: - message.status = reader.int32(); - break; - case 7: - message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.lastModificationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.deletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 12: - message.latestOperationName = reader.string(); + message.roleArn = reader.string(); break; default: reader.skipType(tag & 7); @@ -5319,261 +5052,140 @@ }; /** - * Decodes a TransferJob message from the specified reader or buffer, length delimited. + * Decodes an AwsS3Data message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.TransferJob} TransferJob + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferJob.decodeDelimited = function decodeDelimited(reader) { + AwsS3Data.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TransferJob message. + * Verifies an AwsS3Data message. * @function verify - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TransferJob.verify = function verify(message) { + AwsS3Data.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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) { - var error = $root.google.storagetransfer.v1.TransferSpec.verify(message.transferSpec); - if (error) - return "transferSpec." + error; - } - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { - var error = $root.google.storagetransfer.v1.NotificationConfig.verify(message.notificationConfig); - if (error) - return "notificationConfig." + error; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - var error = $root.google.storagetransfer.v1.Schedule.verify(message.schedule); - if (error) - return "schedule." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.creationTime != null && message.hasOwnProperty("creationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.creationTime); - if (error) - return "creationTime." + error; - } - if (message.lastModificationTime != null && message.hasOwnProperty("lastModificationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastModificationTime); - if (error) - return "lastModificationTime." + error; - } - if (message.deletionTime != null && message.hasOwnProperty("deletionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deletionTime); + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + if (message.awsAccessKey != null && message.hasOwnProperty("awsAccessKey")) { + var error = $root.google.storagetransfer.v1.AwsAccessKey.verify(message.awsAccessKey); if (error) - return "deletionTime." + error; + return "awsAccessKey." + error; } - if (message.latestOperationName != null && message.hasOwnProperty("latestOperationName")) - if (!$util.isString(message.latestOperationName)) - return "latestOperationName: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.roleArn != null && message.hasOwnProperty("roleArn")) + if (!$util.isString(message.roleArn)) + return "roleArn: string expected"; return null; }; /** - * Creates a TransferJob message from a plain object. Also converts values to their respective internal types. + * Creates an AwsS3Data message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.TransferJob} TransferJob + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data */ - TransferJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.TransferJob) + AwsS3Data.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AwsS3Data) return object; - var message = new $root.google.storagetransfer.v1.TransferJob(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.transferSpec != null) { - if (typeof object.transferSpec !== "object") - throw TypeError(".google.storagetransfer.v1.TransferJob.transferSpec: object expected"); - message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.fromObject(object.transferSpec); - } - if (object.notificationConfig != null) { - if (typeof object.notificationConfig !== "object") - throw TypeError(".google.storagetransfer.v1.TransferJob.notificationConfig: object expected"); - message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.fromObject(object.notificationConfig); - } - if (object.schedule != null) { - if (typeof object.schedule !== "object") - throw TypeError(".google.storagetransfer.v1.TransferJob.schedule: object expected"); - message.schedule = $root.google.storagetransfer.v1.Schedule.fromObject(object.schedule); - } - switch (object.status) { - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "ENABLED": - case 1: - message.status = 1; - break; - case "DISABLED": - case 2: - message.status = 2; - break; - case "DELETED": - case 3: - message.status = 3; - break; - } - if (object.creationTime != null) { - if (typeof object.creationTime !== "object") - throw TypeError(".google.storagetransfer.v1.TransferJob.creationTime: object expected"); - message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime); - } - if (object.lastModificationTime != null) { - if (typeof object.lastModificationTime !== "object") - throw TypeError(".google.storagetransfer.v1.TransferJob.lastModificationTime: object expected"); - message.lastModificationTime = $root.google.protobuf.Timestamp.fromObject(object.lastModificationTime); - } - if (object.deletionTime != null) { - if (typeof object.deletionTime !== "object") - throw TypeError(".google.storagetransfer.v1.TransferJob.deletionTime: object expected"); - message.deletionTime = $root.google.protobuf.Timestamp.fromObject(object.deletionTime); + var message = new $root.google.storagetransfer.v1.AwsS3Data(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.awsAccessKey != null) { + if (typeof object.awsAccessKey !== "object") + throw TypeError(".google.storagetransfer.v1.AwsS3Data.awsAccessKey: object expected"); + message.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.fromObject(object.awsAccessKey); } - if (object.latestOperationName != null) - message.latestOperationName = String(object.latestOperationName); + if (object.path != null) + message.path = String(object.path); + if (object.roleArn != null) + message.roleArn = String(object.roleArn); return message; }; /** - * Creates a plain object from a TransferJob message. Also converts values to other types if specified. + * Creates a plain object from an AwsS3Data message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @static - * @param {google.storagetransfer.v1.TransferJob} message TransferJob + * @param {google.storagetransfer.v1.AwsS3Data} message AwsS3Data * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransferJob.toObject = function toObject(message, options) { + AwsS3Data.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.description = ""; - object.projectId = ""; - object.transferSpec = null; - object.schedule = null; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.creationTime = null; - object.lastModificationTime = null; - object.deletionTime = null; - object.notificationConfig = null; - object.latestOperationName = ""; + object.bucketName = ""; + object.awsAccessKey = null; + object.path = ""; + object.roleArn = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) - object.transferSpec = $root.google.storagetransfer.v1.TransferSpec.toObject(message.transferSpec, options); - if (message.schedule != null && message.hasOwnProperty("schedule")) - object.schedule = $root.google.storagetransfer.v1.Schedule.toObject(message.schedule, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.storagetransfer.v1.TransferJob.Status[message.status] : message.status; - if (message.creationTime != null && message.hasOwnProperty("creationTime")) - object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); - if (message.lastModificationTime != null && message.hasOwnProperty("lastModificationTime")) - object.lastModificationTime = $root.google.protobuf.Timestamp.toObject(message.lastModificationTime, options); - if (message.deletionTime != null && message.hasOwnProperty("deletionTime")) - object.deletionTime = $root.google.protobuf.Timestamp.toObject(message.deletionTime, options); - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) - object.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.toObject(message.notificationConfig, options); - if (message.latestOperationName != null && message.hasOwnProperty("latestOperationName")) - object.latestOperationName = message.latestOperationName; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + object.bucketName = message.bucketName; + if (message.awsAccessKey != null && message.hasOwnProperty("awsAccessKey")) + object.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.toObject(message.awsAccessKey, options); + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.roleArn != null && message.hasOwnProperty("roleArn")) + object.roleArn = message.roleArn; return object; }; /** - * Converts this TransferJob to JSON. + * Converts this AwsS3Data to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.TransferJob + * @memberof google.storagetransfer.v1.AwsS3Data * @instance * @returns {Object.} JSON object */ - TransferJob.prototype.toJSON = function toJSON() { + AwsS3Data.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + return AwsS3Data; + })(); + + v1.AzureBlobStorageData = (function() { + /** - * Status enum. - * @name google.storagetransfer.v1.TransferJob.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} DELETED=3 DELETED value - */ - TransferJob.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "DELETED"] = 3; - return values; - })(); - - return TransferJob; - })(); - - v1.ErrorLogEntry = (function() { - - /** - * Properties of an ErrorLogEntry. + * Properties of an AzureBlobStorageData. * @memberof google.storagetransfer.v1 - * @interface IErrorLogEntry - * @property {string|null} [url] ErrorLogEntry url - * @property {Array.|null} [errorDetails] ErrorLogEntry errorDetails + * @interface IAzureBlobStorageData + * @property {string|null} [storageAccount] AzureBlobStorageData storageAccount + * @property {google.storagetransfer.v1.IAzureCredentials|null} [azureCredentials] AzureBlobStorageData azureCredentials + * @property {string|null} [container] AzureBlobStorageData container + * @property {string|null} [path] AzureBlobStorageData path */ /** - * Constructs a new ErrorLogEntry. + * Constructs a new AzureBlobStorageData. * @memberof google.storagetransfer.v1 - * @classdesc Represents an ErrorLogEntry. - * @implements IErrorLogEntry + * @classdesc Represents an AzureBlobStorageData. + * @implements IAzureBlobStorageData * @constructor - * @param {google.storagetransfer.v1.IErrorLogEntry=} [properties] Properties to set + * @param {google.storagetransfer.v1.IAzureBlobStorageData=} [properties] Properties to set */ - function ErrorLogEntry(properties) { - this.errorDetails = []; + function AzureBlobStorageData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5581,91 +5193,114 @@ } /** - * ErrorLogEntry url. - * @member {string} url - * @memberof google.storagetransfer.v1.ErrorLogEntry + * AzureBlobStorageData storageAccount. + * @member {string} storageAccount + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @instance */ - ErrorLogEntry.prototype.url = ""; + AzureBlobStorageData.prototype.storageAccount = ""; /** - * ErrorLogEntry errorDetails. - * @member {Array.} errorDetails - * @memberof google.storagetransfer.v1.ErrorLogEntry + * AzureBlobStorageData azureCredentials. + * @member {google.storagetransfer.v1.IAzureCredentials|null|undefined} azureCredentials + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @instance */ - ErrorLogEntry.prototype.errorDetails = $util.emptyArray; + AzureBlobStorageData.prototype.azureCredentials = null; /** - * Creates a new ErrorLogEntry instance using the specified properties. + * AzureBlobStorageData container. + * @member {string} container + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @instance + */ + AzureBlobStorageData.prototype.container = ""; + + /** + * AzureBlobStorageData path. + * @member {string} path + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @instance + */ + AzureBlobStorageData.prototype.path = ""; + + /** + * Creates a new AzureBlobStorageData instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static - * @param {google.storagetransfer.v1.IErrorLogEntry=} [properties] Properties to set - * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry instance + * @param {google.storagetransfer.v1.IAzureBlobStorageData=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData instance */ - ErrorLogEntry.create = function create(properties) { - return new ErrorLogEntry(properties); + AzureBlobStorageData.create = function create(properties) { + return new AzureBlobStorageData(properties); }; /** - * Encodes the specified ErrorLogEntry message. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * Encodes the specified AzureBlobStorageData message. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static - * @param {google.storagetransfer.v1.IErrorLogEntry} message ErrorLogEntry message or plain object to encode + * @param {google.storagetransfer.v1.IAzureBlobStorageData} message AzureBlobStorageData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ErrorLogEntry.encode = function encode(message, writer) { + AzureBlobStorageData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.errorDetails != null && message.errorDetails.length) - for (var i = 0; i < message.errorDetails.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorDetails[i]); + if (message.storageAccount != null && Object.hasOwnProperty.call(message, "storageAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.storageAccount); + if (message.azureCredentials != null && Object.hasOwnProperty.call(message, "azureCredentials")) + $root.google.storagetransfer.v1.AzureCredentials.encode(message.azureCredentials, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.container); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.path); return writer; }; /** - * Encodes the specified ErrorLogEntry message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * Encodes the specified AzureBlobStorageData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static - * @param {google.storagetransfer.v1.IErrorLogEntry} message ErrorLogEntry message or plain object to encode + * @param {google.storagetransfer.v1.IAzureBlobStorageData} message AzureBlobStorageData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ErrorLogEntry.encodeDelimited = function encodeDelimited(message, writer) { + AzureBlobStorageData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ErrorLogEntry message from the specified reader or buffer. + * Decodes an AzureBlobStorageData message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ErrorLogEntry.decode = function decode(reader, length) { + AzureBlobStorageData.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.storagetransfer.v1.ErrorLogEntry(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AzureBlobStorageData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); + message.storageAccount = reader.string(); break; - case 3: - if (!(message.errorDetails && message.errorDetails.length)) - message.errorDetails = []; - message.errorDetails.push(reader.string()); + case 2: + message.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.decode(reader, reader.uint32()); + break; + case 4: + message.container = reader.string(); + break; + case 5: + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -5676,131 +5311,137 @@ }; /** - * Decodes an ErrorLogEntry message from the specified reader or buffer, length delimited. + * Decodes an AzureBlobStorageData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ErrorLogEntry.decodeDelimited = function decodeDelimited(reader) { + AzureBlobStorageData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ErrorLogEntry message. + * Verifies an AzureBlobStorageData message. * @function verify - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ErrorLogEntry.verify = function verify(message) { + AzureBlobStorageData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.errorDetails != null && message.hasOwnProperty("errorDetails")) { - if (!Array.isArray(message.errorDetails)) - return "errorDetails: array expected"; - for (var i = 0; i < message.errorDetails.length; ++i) - if (!$util.isString(message.errorDetails[i])) - return "errorDetails: string[] expected"; + if (message.storageAccount != null && message.hasOwnProperty("storageAccount")) + if (!$util.isString(message.storageAccount)) + return "storageAccount: string expected"; + if (message.azureCredentials != null && message.hasOwnProperty("azureCredentials")) { + var error = $root.google.storagetransfer.v1.AzureCredentials.verify(message.azureCredentials); + if (error) + return "azureCredentials." + error; } + if (message.container != null && message.hasOwnProperty("container")) + if (!$util.isString(message.container)) + return "container: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; return null; }; /** - * Creates an ErrorLogEntry message from a plain object. Also converts values to their respective internal types. + * Creates an AzureBlobStorageData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData */ - ErrorLogEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.ErrorLogEntry) + AzureBlobStorageData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AzureBlobStorageData) return object; - var message = new $root.google.storagetransfer.v1.ErrorLogEntry(); - if (object.url != null) - message.url = String(object.url); - if (object.errorDetails) { - if (!Array.isArray(object.errorDetails)) - throw TypeError(".google.storagetransfer.v1.ErrorLogEntry.errorDetails: array expected"); - message.errorDetails = []; - for (var i = 0; i < object.errorDetails.length; ++i) - message.errorDetails[i] = String(object.errorDetails[i]); + var message = new $root.google.storagetransfer.v1.AzureBlobStorageData(); + if (object.storageAccount != null) + message.storageAccount = String(object.storageAccount); + if (object.azureCredentials != null) { + if (typeof object.azureCredentials !== "object") + throw TypeError(".google.storagetransfer.v1.AzureBlobStorageData.azureCredentials: object expected"); + message.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.fromObject(object.azureCredentials); } + if (object.container != null) + message.container = String(object.container); + if (object.path != null) + message.path = String(object.path); return message; }; /** - * Creates a plain object from an ErrorLogEntry message. Also converts values to other types if specified. + * Creates a plain object from an AzureBlobStorageData message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @static - * @param {google.storagetransfer.v1.ErrorLogEntry} message ErrorLogEntry + * @param {google.storagetransfer.v1.AzureBlobStorageData} message AzureBlobStorageData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ErrorLogEntry.toObject = function toObject(message, options) { + AzureBlobStorageData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorDetails = []; - if (options.defaults) - object.url = ""; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.errorDetails && message.errorDetails.length) { - object.errorDetails = []; - for (var j = 0; j < message.errorDetails.length; ++j) - object.errorDetails[j] = message.errorDetails[j]; + if (options.defaults) { + object.storageAccount = ""; + object.azureCredentials = null; + object.container = ""; + object.path = ""; } + if (message.storageAccount != null && message.hasOwnProperty("storageAccount")) + object.storageAccount = message.storageAccount; + if (message.azureCredentials != null && message.hasOwnProperty("azureCredentials")) + object.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.toObject(message.azureCredentials, options); + if (message.container != null && message.hasOwnProperty("container")) + object.container = message.container; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; /** - * Converts this ErrorLogEntry to JSON. + * Converts this AzureBlobStorageData to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.ErrorLogEntry + * @memberof google.storagetransfer.v1.AzureBlobStorageData * @instance * @returns {Object.} JSON object */ - ErrorLogEntry.prototype.toJSON = function toJSON() { + AzureBlobStorageData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ErrorLogEntry; + return AzureBlobStorageData; })(); - v1.ErrorSummary = (function() { + v1.HttpData = (function() { /** - * Properties of an ErrorSummary. + * Properties of a HttpData. * @memberof google.storagetransfer.v1 - * @interface IErrorSummary - * @property {google.rpc.Code|null} [errorCode] ErrorSummary errorCode - * @property {number|Long|null} [errorCount] ErrorSummary errorCount - * @property {Array.|null} [errorLogEntries] ErrorSummary errorLogEntries + * @interface IHttpData + * @property {string|null} [listUrl] HttpData listUrl */ /** - * Constructs a new ErrorSummary. + * Constructs a new HttpData. * @memberof google.storagetransfer.v1 - * @classdesc Represents an ErrorSummary. - * @implements IErrorSummary + * @classdesc Represents a HttpData. + * @implements IHttpData * @constructor - * @param {google.storagetransfer.v1.IErrorSummary=} [properties] Properties to set + * @param {google.storagetransfer.v1.IHttpData=} [properties] Properties to set */ - function ErrorSummary(properties) { - this.errorLogEntries = []; + function HttpData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5808,104 +5449,75 @@ } /** - * ErrorSummary errorCode. - * @member {google.rpc.Code} errorCode - * @memberof google.storagetransfer.v1.ErrorSummary - * @instance - */ - ErrorSummary.prototype.errorCode = 0; - - /** - * ErrorSummary errorCount. - * @member {number|Long} errorCount - * @memberof google.storagetransfer.v1.ErrorSummary - * @instance - */ - ErrorSummary.prototype.errorCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ErrorSummary errorLogEntries. - * @member {Array.} errorLogEntries - * @memberof google.storagetransfer.v1.ErrorSummary + * HttpData listUrl. + * @member {string} listUrl + * @memberof google.storagetransfer.v1.HttpData * @instance */ - ErrorSummary.prototype.errorLogEntries = $util.emptyArray; + HttpData.prototype.listUrl = ""; /** - * Creates a new ErrorSummary instance using the specified properties. + * Creates a new HttpData instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static - * @param {google.storagetransfer.v1.IErrorSummary=} [properties] Properties to set - * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary instance + * @param {google.storagetransfer.v1.IHttpData=} [properties] Properties to set + * @returns {google.storagetransfer.v1.HttpData} HttpData instance */ - ErrorSummary.create = function create(properties) { - return new ErrorSummary(properties); + HttpData.create = function create(properties) { + return new HttpData(properties); }; /** - * Encodes the specified ErrorSummary message. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * Encodes the specified HttpData message. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static - * @param {google.storagetransfer.v1.IErrorSummary} message ErrorSummary message or plain object to encode + * @param {google.storagetransfer.v1.IHttpData} message HttpData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ErrorSummary.encode = function encode(message, writer) { + HttpData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorCode); - if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.errorCount); - if (message.errorLogEntries != null && message.errorLogEntries.length) - for (var i = 0; i < message.errorLogEntries.length; ++i) - $root.google.storagetransfer.v1.ErrorLogEntry.encode(message.errorLogEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.listUrl != null && Object.hasOwnProperty.call(message, "listUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.listUrl); return writer; }; /** - * Encodes the specified ErrorSummary message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * Encodes the specified HttpData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static - * @param {google.storagetransfer.v1.IErrorSummary} message ErrorSummary message or plain object to encode + * @param {google.storagetransfer.v1.IHttpData} message HttpData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ErrorSummary.encodeDelimited = function encodeDelimited(message, writer) { + HttpData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ErrorSummary message from the specified reader or buffer. + * Decodes a HttpData message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + * @returns {google.storagetransfer.v1.HttpData} HttpData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ErrorSummary.decode = function decode(reader, length) { + HttpData.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.storagetransfer.v1.ErrorSummary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.HttpData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.errorCode = reader.int32(); - break; - case 2: - message.errorCount = reader.int64(); - break; - case 3: - if (!(message.errorLogEntries && message.errorLogEntries.length)) - message.errorLogEntries = []; - message.errorLogEntries.push($root.google.storagetransfer.v1.ErrorLogEntry.decode(reader, reader.uint32())); + message.listUrl = reader.string(); break; default: reader.skipType(tag & 7); @@ -5916,259 +5528,107 @@ }; /** - * Decodes an ErrorSummary message from the specified reader or buffer, length delimited. + * Decodes a HttpData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + * @returns {google.storagetransfer.v1.HttpData} HttpData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ErrorSummary.decodeDelimited = function decodeDelimited(reader) { + HttpData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ErrorSummary message. + * Verifies a HttpData message. * @function verify - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ErrorSummary.verify = function verify(message) { + HttpData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorCode != null && message.hasOwnProperty("errorCode")) - switch (message.errorCode) { - default: - return "errorCode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 16: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - break; - } - if (message.errorCount != null && message.hasOwnProperty("errorCount")) - if (!$util.isInteger(message.errorCount) && !(message.errorCount && $util.isInteger(message.errorCount.low) && $util.isInteger(message.errorCount.high))) - return "errorCount: integer|Long expected"; - if (message.errorLogEntries != null && message.hasOwnProperty("errorLogEntries")) { - if (!Array.isArray(message.errorLogEntries)) - return "errorLogEntries: array expected"; - for (var i = 0; i < message.errorLogEntries.length; ++i) { - var error = $root.google.storagetransfer.v1.ErrorLogEntry.verify(message.errorLogEntries[i]); - if (error) - return "errorLogEntries." + error; - } - } + if (message.listUrl != null && message.hasOwnProperty("listUrl")) + if (!$util.isString(message.listUrl)) + return "listUrl: string expected"; return null; }; /** - * Creates an ErrorSummary message from a plain object. Also converts values to their respective internal types. + * Creates a HttpData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + * @returns {google.storagetransfer.v1.HttpData} HttpData */ - ErrorSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.ErrorSummary) + HttpData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.HttpData) return object; - var message = new $root.google.storagetransfer.v1.ErrorSummary(); - switch (object.errorCode) { - case "OK": - case 0: - message.errorCode = 0; - break; - case "CANCELLED": - case 1: - message.errorCode = 1; - break; - case "UNKNOWN": - case 2: - message.errorCode = 2; - break; - case "INVALID_ARGUMENT": - case 3: - message.errorCode = 3; - break; - case "DEADLINE_EXCEEDED": - case 4: - message.errorCode = 4; - break; - case "NOT_FOUND": - case 5: - message.errorCode = 5; - break; - case "ALREADY_EXISTS": - case 6: - message.errorCode = 6; - break; - case "PERMISSION_DENIED": - case 7: - message.errorCode = 7; - break; - case "UNAUTHENTICATED": - case 16: - message.errorCode = 16; - break; - case "RESOURCE_EXHAUSTED": - case 8: - message.errorCode = 8; - break; - case "FAILED_PRECONDITION": - case 9: - message.errorCode = 9; - break; - case "ABORTED": - case 10: - message.errorCode = 10; - break; - case "OUT_OF_RANGE": - case 11: - message.errorCode = 11; - break; - case "UNIMPLEMENTED": - case 12: - message.errorCode = 12; - break; - case "INTERNAL": - case 13: - message.errorCode = 13; - break; - case "UNAVAILABLE": - case 14: - message.errorCode = 14; - break; - case "DATA_LOSS": - case 15: - message.errorCode = 15; - break; - } - if (object.errorCount != null) - if ($util.Long) - (message.errorCount = $util.Long.fromValue(object.errorCount)).unsigned = false; - else if (typeof object.errorCount === "string") - message.errorCount = parseInt(object.errorCount, 10); - else if (typeof object.errorCount === "number") - message.errorCount = object.errorCount; - else if (typeof object.errorCount === "object") - message.errorCount = new $util.LongBits(object.errorCount.low >>> 0, object.errorCount.high >>> 0).toNumber(); - if (object.errorLogEntries) { - if (!Array.isArray(object.errorLogEntries)) - throw TypeError(".google.storagetransfer.v1.ErrorSummary.errorLogEntries: array expected"); - message.errorLogEntries = []; - for (var i = 0; i < object.errorLogEntries.length; ++i) { - if (typeof object.errorLogEntries[i] !== "object") - throw TypeError(".google.storagetransfer.v1.ErrorSummary.errorLogEntries: object expected"); - message.errorLogEntries[i] = $root.google.storagetransfer.v1.ErrorLogEntry.fromObject(object.errorLogEntries[i]); - } - } + var message = new $root.google.storagetransfer.v1.HttpData(); + if (object.listUrl != null) + message.listUrl = String(object.listUrl); return message; }; /** - * Creates a plain object from an ErrorSummary message. Also converts values to other types if specified. + * Creates a plain object from a HttpData message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @static - * @param {google.storagetransfer.v1.ErrorSummary} message ErrorSummary + * @param {google.storagetransfer.v1.HttpData} message HttpData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ErrorSummary.toObject = function toObject(message, options) { + HttpData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorLogEntries = []; - if (options.defaults) { - object.errorCode = options.enums === String ? "OK" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.errorCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.errorCount = options.longs === String ? "0" : 0; - } - if (message.errorCode != null && message.hasOwnProperty("errorCode")) - object.errorCode = options.enums === String ? $root.google.rpc.Code[message.errorCode] : message.errorCode; - if (message.errorCount != null && message.hasOwnProperty("errorCount")) - if (typeof message.errorCount === "number") - object.errorCount = options.longs === String ? String(message.errorCount) : message.errorCount; - else - object.errorCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorCount) : options.longs === Number ? new $util.LongBits(message.errorCount.low >>> 0, message.errorCount.high >>> 0).toNumber() : message.errorCount; - if (message.errorLogEntries && message.errorLogEntries.length) { - object.errorLogEntries = []; - for (var j = 0; j < message.errorLogEntries.length; ++j) - object.errorLogEntries[j] = $root.google.storagetransfer.v1.ErrorLogEntry.toObject(message.errorLogEntries[j], options); - } + if (options.defaults) + object.listUrl = ""; + if (message.listUrl != null && message.hasOwnProperty("listUrl")) + object.listUrl = message.listUrl; return object; }; /** - * Converts this ErrorSummary to JSON. + * Converts this HttpData to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.ErrorSummary + * @memberof google.storagetransfer.v1.HttpData * @instance * @returns {Object.} JSON object */ - ErrorSummary.prototype.toJSON = function toJSON() { + HttpData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ErrorSummary; + return HttpData; })(); - v1.TransferCounters = (function() { + v1.PosixFilesystem = (function() { /** - * Properties of a TransferCounters. + * Properties of a PosixFilesystem. * @memberof google.storagetransfer.v1 - * @interface ITransferCounters - * @property {number|Long|null} [objectsFoundFromSource] TransferCounters objectsFoundFromSource - * @property {number|Long|null} [bytesFoundFromSource] TransferCounters bytesFoundFromSource - * @property {number|Long|null} [objectsFoundOnlyFromSink] TransferCounters objectsFoundOnlyFromSink - * @property {number|Long|null} [bytesFoundOnlyFromSink] TransferCounters bytesFoundOnlyFromSink - * @property {number|Long|null} [objectsFromSourceSkippedBySync] TransferCounters objectsFromSourceSkippedBySync - * @property {number|Long|null} [bytesFromSourceSkippedBySync] TransferCounters bytesFromSourceSkippedBySync - * @property {number|Long|null} [objectsCopiedToSink] TransferCounters objectsCopiedToSink - * @property {number|Long|null} [bytesCopiedToSink] TransferCounters bytesCopiedToSink - * @property {number|Long|null} [objectsDeletedFromSource] TransferCounters objectsDeletedFromSource - * @property {number|Long|null} [bytesDeletedFromSource] TransferCounters bytesDeletedFromSource - * @property {number|Long|null} [objectsDeletedFromSink] TransferCounters objectsDeletedFromSink - * @property {number|Long|null} [bytesDeletedFromSink] TransferCounters bytesDeletedFromSink - * @property {number|Long|null} [objectsFromSourceFailed] TransferCounters objectsFromSourceFailed - * @property {number|Long|null} [bytesFromSourceFailed] TransferCounters bytesFromSourceFailed - * @property {number|Long|null} [objectsFailedToDeleteFromSink] TransferCounters objectsFailedToDeleteFromSink - * @property {number|Long|null} [bytesFailedToDeleteFromSink] TransferCounters bytesFailedToDeleteFromSink + * @interface IPosixFilesystem + * @property {string|null} [rootDirectory] PosixFilesystem rootDirectory */ /** - * Constructs a new TransferCounters. + * Constructs a new PosixFilesystem. * @memberof google.storagetransfer.v1 - * @classdesc Represents a TransferCounters. - * @implements ITransferCounters + * @classdesc Represents a PosixFilesystem. + * @implements IPosixFilesystem * @constructor - * @param {google.storagetransfer.v1.ITransferCounters=} [properties] Properties to set + * @param {google.storagetransfer.v1.IPosixFilesystem=} [properties] Properties to set */ - function TransferCounters(properties) { + function PosixFilesystem(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6176,270 +5636,304 @@ } /** - * TransferCounters objectsFoundFromSource. - * @member {number|Long} objectsFoundFromSource - * @memberof google.storagetransfer.v1.TransferCounters + * PosixFilesystem rootDirectory. + * @member {string} rootDirectory + * @memberof google.storagetransfer.v1.PosixFilesystem * @instance */ - TransferCounters.prototype.objectsFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.prototype.rootDirectory = ""; /** - * TransferCounters bytesFoundFromSource. - * @member {number|Long} bytesFoundFromSource - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Creates a new PosixFilesystem instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.IPosixFilesystem=} [properties] Properties to set + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem instance */ - TransferCounters.prototype.bytesFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.create = function create(properties) { + return new PosixFilesystem(properties); + }; /** - * TransferCounters objectsFoundOnlyFromSink. - * @member {number|Long} objectsFoundOnlyFromSink - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Encodes the specified PosixFilesystem message. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.IPosixFilesystem} message PosixFilesystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - TransferCounters.prototype.objectsFoundOnlyFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootDirectory != null && Object.hasOwnProperty.call(message, "rootDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rootDirectory); + return writer; + }; /** - * TransferCounters bytesFoundOnlyFromSink. - * @member {number|Long} bytesFoundOnlyFromSink - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Encodes the specified PosixFilesystem message, length delimited. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.IPosixFilesystem} message PosixFilesystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - TransferCounters.prototype.bytesFoundOnlyFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * TransferCounters objectsFromSourceSkippedBySync. - * @member {number|Long} objectsFromSourceSkippedBySync - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Decodes a PosixFilesystem message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferCounters.prototype.objectsFromSourceSkippedBySync = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.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.storagetransfer.v1.PosixFilesystem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootDirectory = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * TransferCounters bytesFromSourceSkippedBySync. - * @member {number|Long} bytesFromSourceSkippedBySync - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Decodes a PosixFilesystem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferCounters.prototype.bytesFromSourceSkippedBySync = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * TransferCounters objectsCopiedToSink. - * @member {number|Long} objectsCopiedToSink - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Verifies a PosixFilesystem message. + * @function verify + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TransferCounters.prototype.objectsCopiedToSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootDirectory != null && message.hasOwnProperty("rootDirectory")) + if (!$util.isString(message.rootDirectory)) + return "rootDirectory: string expected"; + return null; + }; /** - * TransferCounters bytesCopiedToSink. - * @member {number|Long} bytesCopiedToSink - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Creates a PosixFilesystem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem */ - TransferCounters.prototype.bytesCopiedToSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.PosixFilesystem) + return object; + var message = new $root.google.storagetransfer.v1.PosixFilesystem(); + if (object.rootDirectory != null) + message.rootDirectory = String(object.rootDirectory); + return message; + }; /** - * TransferCounters objectsDeletedFromSource. - * @member {number|Long} objectsDeletedFromSource - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Creates a plain object from a PosixFilesystem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.PosixFilesystem} message PosixFilesystem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - TransferCounters.prototype.objectsDeletedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.rootDirectory = ""; + if (message.rootDirectory != null && message.hasOwnProperty("rootDirectory")) + object.rootDirectory = message.rootDirectory; + return object; + }; /** - * TransferCounters bytesDeletedFromSource. - * @member {number|Long} bytesDeletedFromSource - * @memberof google.storagetransfer.v1.TransferCounters + * Converts this PosixFilesystem to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.PosixFilesystem * @instance + * @returns {Object.} JSON object */ - TransferCounters.prototype.bytesDeletedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PosixFilesystem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PosixFilesystem; + })(); + + v1.AgentPool = (function() { /** - * TransferCounters objectsDeletedFromSink. - * @member {number|Long} objectsDeletedFromSink - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Properties of an AgentPool. + * @memberof google.storagetransfer.v1 + * @interface IAgentPool + * @property {string|null} [name] AgentPool name + * @property {string|null} [displayName] AgentPool displayName + * @property {google.storagetransfer.v1.AgentPool.State|null} [state] AgentPool state + * @property {google.storagetransfer.v1.AgentPool.IBandwidthLimit|null} [bandwidthLimit] AgentPool bandwidthLimit */ - TransferCounters.prototype.objectsDeletedFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * TransferCounters bytesDeletedFromSink. - * @member {number|Long} bytesDeletedFromSink - * @memberof google.storagetransfer.v1.TransferCounters - * @instance + * Constructs a new AgentPool. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an AgentPool. + * @implements IAgentPool + * @constructor + * @param {google.storagetransfer.v1.IAgentPool=} [properties] Properties to set */ - TransferCounters.prototype.bytesDeletedFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + function AgentPool(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]]; + } /** - * TransferCounters objectsFromSourceFailed. - * @member {number|Long} objectsFromSourceFailed - * @memberof google.storagetransfer.v1.TransferCounters + * AgentPool name. + * @member {string} name + * @memberof google.storagetransfer.v1.AgentPool * @instance */ - TransferCounters.prototype.objectsFromSourceFailed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AgentPool.prototype.name = ""; /** - * TransferCounters bytesFromSourceFailed. - * @member {number|Long} bytesFromSourceFailed - * @memberof google.storagetransfer.v1.TransferCounters + * AgentPool displayName. + * @member {string} displayName + * @memberof google.storagetransfer.v1.AgentPool * @instance */ - TransferCounters.prototype.bytesFromSourceFailed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AgentPool.prototype.displayName = ""; /** - * TransferCounters objectsFailedToDeleteFromSink. - * @member {number|Long} objectsFailedToDeleteFromSink - * @memberof google.storagetransfer.v1.TransferCounters + * AgentPool state. + * @member {google.storagetransfer.v1.AgentPool.State} state + * @memberof google.storagetransfer.v1.AgentPool * @instance */ - TransferCounters.prototype.objectsFailedToDeleteFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AgentPool.prototype.state = 0; /** - * TransferCounters bytesFailedToDeleteFromSink. - * @member {number|Long} bytesFailedToDeleteFromSink - * @memberof google.storagetransfer.v1.TransferCounters + * AgentPool bandwidthLimit. + * @member {google.storagetransfer.v1.AgentPool.IBandwidthLimit|null|undefined} bandwidthLimit + * @memberof google.storagetransfer.v1.AgentPool * @instance */ - TransferCounters.prototype.bytesFailedToDeleteFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AgentPool.prototype.bandwidthLimit = null; /** - * Creates a new TransferCounters instance using the specified properties. + * Creates a new AgentPool instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static - * @param {google.storagetransfer.v1.ITransferCounters=} [properties] Properties to set - * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters instance + * @param {google.storagetransfer.v1.IAgentPool=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AgentPool} AgentPool instance */ - TransferCounters.create = function create(properties) { - return new TransferCounters(properties); + AgentPool.create = function create(properties) { + return new AgentPool(properties); }; /** - * Encodes the specified TransferCounters message. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * Encodes the specified AgentPool message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static - * @param {google.storagetransfer.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {google.storagetransfer.v1.IAgentPool} message AgentPool message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferCounters.encode = function encode(message, writer) { + AgentPool.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.objectsFoundFromSource != null && Object.hasOwnProperty.call(message, "objectsFoundFromSource")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.objectsFoundFromSource); - if (message.bytesFoundFromSource != null && Object.hasOwnProperty.call(message, "bytesFoundFromSource")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.bytesFoundFromSource); - if (message.objectsFoundOnlyFromSink != null && Object.hasOwnProperty.call(message, "objectsFoundOnlyFromSink")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.objectsFoundOnlyFromSink); - if (message.bytesFoundOnlyFromSink != null && Object.hasOwnProperty.call(message, "bytesFoundOnlyFromSink")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bytesFoundOnlyFromSink); - if (message.objectsFromSourceSkippedBySync != null && Object.hasOwnProperty.call(message, "objectsFromSourceSkippedBySync")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.objectsFromSourceSkippedBySync); - if (message.bytesFromSourceSkippedBySync != null && Object.hasOwnProperty.call(message, "bytesFromSourceSkippedBySync")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.bytesFromSourceSkippedBySync); - if (message.objectsCopiedToSink != null && Object.hasOwnProperty.call(message, "objectsCopiedToSink")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.objectsCopiedToSink); - if (message.bytesCopiedToSink != null && Object.hasOwnProperty.call(message, "bytesCopiedToSink")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.bytesCopiedToSink); - if (message.objectsDeletedFromSource != null && Object.hasOwnProperty.call(message, "objectsDeletedFromSource")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.objectsDeletedFromSource); - if (message.bytesDeletedFromSource != null && Object.hasOwnProperty.call(message, "bytesDeletedFromSource")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.bytesDeletedFromSource); - if (message.objectsDeletedFromSink != null && Object.hasOwnProperty.call(message, "objectsDeletedFromSink")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.objectsDeletedFromSink); - if (message.bytesDeletedFromSink != null && Object.hasOwnProperty.call(message, "bytesDeletedFromSink")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.bytesDeletedFromSink); - if (message.objectsFromSourceFailed != null && Object.hasOwnProperty.call(message, "objectsFromSourceFailed")) - writer.uint32(/* id 13, wireType 0 =*/104).int64(message.objectsFromSourceFailed); - if (message.bytesFromSourceFailed != null && Object.hasOwnProperty.call(message, "bytesFromSourceFailed")) - writer.uint32(/* id 14, wireType 0 =*/112).int64(message.bytesFromSourceFailed); - if (message.objectsFailedToDeleteFromSink != null && Object.hasOwnProperty.call(message, "objectsFailedToDeleteFromSink")) - writer.uint32(/* id 15, wireType 0 =*/120).int64(message.objectsFailedToDeleteFromSink); - if (message.bytesFailedToDeleteFromSink != null && Object.hasOwnProperty.call(message, "bytesFailedToDeleteFromSink")) - writer.uint32(/* id 16, wireType 0 =*/128).int64(message.bytesFailedToDeleteFromSink); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.bandwidthLimit != null && Object.hasOwnProperty.call(message, "bandwidthLimit")) + $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.encode(message.bandwidthLimit, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified TransferCounters message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * Encodes the specified AgentPool message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static - * @param {google.storagetransfer.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {google.storagetransfer.v1.IAgentPool} message AgentPool message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferCounters.encodeDelimited = function encodeDelimited(message, writer) { + AgentPool.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TransferCounters message from the specified reader or buffer. + * Decodes an AgentPool message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + * @returns {google.storagetransfer.v1.AgentPool} AgentPool * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferCounters.decode = function decode(reader, length) { + AgentPool.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.storagetransfer.v1.TransferCounters(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AgentPool(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.objectsFoundFromSource = reader.int64(); - break; case 2: - message.bytesFoundFromSource = reader.int64(); + message.name = reader.string(); break; case 3: - message.objectsFoundOnlyFromSink = reader.int64(); + message.displayName = reader.string(); break; case 4: - message.bytesFoundOnlyFromSink = reader.int64(); + message.state = reader.int32(); break; case 5: - message.objectsFromSourceSkippedBySync = reader.int64(); - break; - case 6: - message.bytesFromSourceSkippedBySync = reader.int64(); - break; - case 7: - message.objectsCopiedToSink = reader.int64(); - break; - case 8: - message.bytesCopiedToSink = reader.int64(); - break; - case 9: - message.objectsDeletedFromSource = reader.int64(); - break; - case 10: - message.bytesDeletedFromSource = reader.int64(); - break; - case 11: - message.objectsDeletedFromSink = reader.int64(); - break; - case 12: - message.bytesDeletedFromSink = reader.int64(); - break; - case 13: - message.objectsFromSourceFailed = reader.int64(); - break; - case 14: - message.bytesFromSourceFailed = reader.int64(); - break; - case 15: - message.objectsFailedToDeleteFromSink = reader.int64(); - break; - case 16: - message.bytesFailedToDeleteFromSink = reader.int64(); + message.bandwidthLimit = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6450,455 +5944,383 @@ }; /** - * Decodes a TransferCounters message from the specified reader or buffer, length delimited. + * Decodes an AgentPool message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + * @returns {google.storagetransfer.v1.AgentPool} AgentPool * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferCounters.decodeDelimited = function decodeDelimited(reader) { + AgentPool.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TransferCounters message. + * Verifies an AgentPool message. * @function verify - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TransferCounters.verify = function verify(message) { + AgentPool.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.objectsFoundFromSource != null && message.hasOwnProperty("objectsFoundFromSource")) - if (!$util.isInteger(message.objectsFoundFromSource) && !(message.objectsFoundFromSource && $util.isInteger(message.objectsFoundFromSource.low) && $util.isInteger(message.objectsFoundFromSource.high))) - return "objectsFoundFromSource: integer|Long expected"; - if (message.bytesFoundFromSource != null && message.hasOwnProperty("bytesFoundFromSource")) - if (!$util.isInteger(message.bytesFoundFromSource) && !(message.bytesFoundFromSource && $util.isInteger(message.bytesFoundFromSource.low) && $util.isInteger(message.bytesFoundFromSource.high))) - return "bytesFoundFromSource: integer|Long expected"; - if (message.objectsFoundOnlyFromSink != null && message.hasOwnProperty("objectsFoundOnlyFromSink")) - if (!$util.isInteger(message.objectsFoundOnlyFromSink) && !(message.objectsFoundOnlyFromSink && $util.isInteger(message.objectsFoundOnlyFromSink.low) && $util.isInteger(message.objectsFoundOnlyFromSink.high))) - return "objectsFoundOnlyFromSink: integer|Long expected"; - if (message.bytesFoundOnlyFromSink != null && message.hasOwnProperty("bytesFoundOnlyFromSink")) - if (!$util.isInteger(message.bytesFoundOnlyFromSink) && !(message.bytesFoundOnlyFromSink && $util.isInteger(message.bytesFoundOnlyFromSink.low) && $util.isInteger(message.bytesFoundOnlyFromSink.high))) - return "bytesFoundOnlyFromSink: integer|Long expected"; - if (message.objectsFromSourceSkippedBySync != null && message.hasOwnProperty("objectsFromSourceSkippedBySync")) - if (!$util.isInteger(message.objectsFromSourceSkippedBySync) && !(message.objectsFromSourceSkippedBySync && $util.isInteger(message.objectsFromSourceSkippedBySync.low) && $util.isInteger(message.objectsFromSourceSkippedBySync.high))) - return "objectsFromSourceSkippedBySync: integer|Long expected"; - if (message.bytesFromSourceSkippedBySync != null && message.hasOwnProperty("bytesFromSourceSkippedBySync")) - if (!$util.isInteger(message.bytesFromSourceSkippedBySync) && !(message.bytesFromSourceSkippedBySync && $util.isInteger(message.bytesFromSourceSkippedBySync.low) && $util.isInteger(message.bytesFromSourceSkippedBySync.high))) - return "bytesFromSourceSkippedBySync: integer|Long expected"; - if (message.objectsCopiedToSink != null && message.hasOwnProperty("objectsCopiedToSink")) - if (!$util.isInteger(message.objectsCopiedToSink) && !(message.objectsCopiedToSink && $util.isInteger(message.objectsCopiedToSink.low) && $util.isInteger(message.objectsCopiedToSink.high))) - return "objectsCopiedToSink: integer|Long expected"; - if (message.bytesCopiedToSink != null && message.hasOwnProperty("bytesCopiedToSink")) - if (!$util.isInteger(message.bytesCopiedToSink) && !(message.bytesCopiedToSink && $util.isInteger(message.bytesCopiedToSink.low) && $util.isInteger(message.bytesCopiedToSink.high))) - return "bytesCopiedToSink: integer|Long expected"; - if (message.objectsDeletedFromSource != null && message.hasOwnProperty("objectsDeletedFromSource")) - if (!$util.isInteger(message.objectsDeletedFromSource) && !(message.objectsDeletedFromSource && $util.isInteger(message.objectsDeletedFromSource.low) && $util.isInteger(message.objectsDeletedFromSource.high))) - return "objectsDeletedFromSource: integer|Long expected"; - if (message.bytesDeletedFromSource != null && message.hasOwnProperty("bytesDeletedFromSource")) - if (!$util.isInteger(message.bytesDeletedFromSource) && !(message.bytesDeletedFromSource && $util.isInteger(message.bytesDeletedFromSource.low) && $util.isInteger(message.bytesDeletedFromSource.high))) - return "bytesDeletedFromSource: integer|Long expected"; - if (message.objectsDeletedFromSink != null && message.hasOwnProperty("objectsDeletedFromSink")) - if (!$util.isInteger(message.objectsDeletedFromSink) && !(message.objectsDeletedFromSink && $util.isInteger(message.objectsDeletedFromSink.low) && $util.isInteger(message.objectsDeletedFromSink.high))) - return "objectsDeletedFromSink: integer|Long expected"; - if (message.bytesDeletedFromSink != null && message.hasOwnProperty("bytesDeletedFromSink")) - if (!$util.isInteger(message.bytesDeletedFromSink) && !(message.bytesDeletedFromSink && $util.isInteger(message.bytesDeletedFromSink.low) && $util.isInteger(message.bytesDeletedFromSink.high))) - return "bytesDeletedFromSink: integer|Long expected"; - if (message.objectsFromSourceFailed != null && message.hasOwnProperty("objectsFromSourceFailed")) - if (!$util.isInteger(message.objectsFromSourceFailed) && !(message.objectsFromSourceFailed && $util.isInteger(message.objectsFromSourceFailed.low) && $util.isInteger(message.objectsFromSourceFailed.high))) - return "objectsFromSourceFailed: integer|Long expected"; - if (message.bytesFromSourceFailed != null && message.hasOwnProperty("bytesFromSourceFailed")) - if (!$util.isInteger(message.bytesFromSourceFailed) && !(message.bytesFromSourceFailed && $util.isInteger(message.bytesFromSourceFailed.low) && $util.isInteger(message.bytesFromSourceFailed.high))) - return "bytesFromSourceFailed: integer|Long expected"; - if (message.objectsFailedToDeleteFromSink != null && message.hasOwnProperty("objectsFailedToDeleteFromSink")) - if (!$util.isInteger(message.objectsFailedToDeleteFromSink) && !(message.objectsFailedToDeleteFromSink && $util.isInteger(message.objectsFailedToDeleteFromSink.low) && $util.isInteger(message.objectsFailedToDeleteFromSink.high))) - return "objectsFailedToDeleteFromSink: integer|Long expected"; - if (message.bytesFailedToDeleteFromSink != null && message.hasOwnProperty("bytesFailedToDeleteFromSink")) - if (!$util.isInteger(message.bytesFailedToDeleteFromSink) && !(message.bytesFailedToDeleteFromSink && $util.isInteger(message.bytesFailedToDeleteFromSink.low) && $util.isInteger(message.bytesFailedToDeleteFromSink.high))) - return "bytesFailedToDeleteFromSink: integer|Long expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.bandwidthLimit != null && message.hasOwnProperty("bandwidthLimit")) { + var error = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.verify(message.bandwidthLimit); + if (error) + return "bandwidthLimit." + error; + } return null; }; /** - * Creates a TransferCounters message from a plain object. Also converts values to their respective internal types. + * Creates an AgentPool message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + * @returns {google.storagetransfer.v1.AgentPool} AgentPool */ - TransferCounters.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.TransferCounters) + AgentPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AgentPool) return object; - var message = new $root.google.storagetransfer.v1.TransferCounters(); - if (object.objectsFoundFromSource != null) - if ($util.Long) - (message.objectsFoundFromSource = $util.Long.fromValue(object.objectsFoundFromSource)).unsigned = false; - else if (typeof object.objectsFoundFromSource === "string") - message.objectsFoundFromSource = parseInt(object.objectsFoundFromSource, 10); - else if (typeof object.objectsFoundFromSource === "number") - message.objectsFoundFromSource = object.objectsFoundFromSource; - else if (typeof object.objectsFoundFromSource === "object") - message.objectsFoundFromSource = new $util.LongBits(object.objectsFoundFromSource.low >>> 0, object.objectsFoundFromSource.high >>> 0).toNumber(); - if (object.bytesFoundFromSource != null) - if ($util.Long) - (message.bytesFoundFromSource = $util.Long.fromValue(object.bytesFoundFromSource)).unsigned = false; - else if (typeof object.bytesFoundFromSource === "string") - message.bytesFoundFromSource = parseInt(object.bytesFoundFromSource, 10); - else if (typeof object.bytesFoundFromSource === "number") - message.bytesFoundFromSource = object.bytesFoundFromSource; - else if (typeof object.bytesFoundFromSource === "object") - message.bytesFoundFromSource = new $util.LongBits(object.bytesFoundFromSource.low >>> 0, object.bytesFoundFromSource.high >>> 0).toNumber(); - if (object.objectsFoundOnlyFromSink != null) - if ($util.Long) - (message.objectsFoundOnlyFromSink = $util.Long.fromValue(object.objectsFoundOnlyFromSink)).unsigned = false; - else if (typeof object.objectsFoundOnlyFromSink === "string") - message.objectsFoundOnlyFromSink = parseInt(object.objectsFoundOnlyFromSink, 10); - else if (typeof object.objectsFoundOnlyFromSink === "number") - message.objectsFoundOnlyFromSink = object.objectsFoundOnlyFromSink; - else if (typeof object.objectsFoundOnlyFromSink === "object") - message.objectsFoundOnlyFromSink = new $util.LongBits(object.objectsFoundOnlyFromSink.low >>> 0, object.objectsFoundOnlyFromSink.high >>> 0).toNumber(); - if (object.bytesFoundOnlyFromSink != null) - if ($util.Long) - (message.bytesFoundOnlyFromSink = $util.Long.fromValue(object.bytesFoundOnlyFromSink)).unsigned = false; - else if (typeof object.bytesFoundOnlyFromSink === "string") - message.bytesFoundOnlyFromSink = parseInt(object.bytesFoundOnlyFromSink, 10); - else if (typeof object.bytesFoundOnlyFromSink === "number") - message.bytesFoundOnlyFromSink = object.bytesFoundOnlyFromSink; - else if (typeof object.bytesFoundOnlyFromSink === "object") - message.bytesFoundOnlyFromSink = new $util.LongBits(object.bytesFoundOnlyFromSink.low >>> 0, object.bytesFoundOnlyFromSink.high >>> 0).toNumber(); - if (object.objectsFromSourceSkippedBySync != null) - if ($util.Long) - (message.objectsFromSourceSkippedBySync = $util.Long.fromValue(object.objectsFromSourceSkippedBySync)).unsigned = false; - else if (typeof object.objectsFromSourceSkippedBySync === "string") - message.objectsFromSourceSkippedBySync = parseInt(object.objectsFromSourceSkippedBySync, 10); - else if (typeof object.objectsFromSourceSkippedBySync === "number") - message.objectsFromSourceSkippedBySync = object.objectsFromSourceSkippedBySync; - else if (typeof object.objectsFromSourceSkippedBySync === "object") - message.objectsFromSourceSkippedBySync = new $util.LongBits(object.objectsFromSourceSkippedBySync.low >>> 0, object.objectsFromSourceSkippedBySync.high >>> 0).toNumber(); - if (object.bytesFromSourceSkippedBySync != null) - if ($util.Long) - (message.bytesFromSourceSkippedBySync = $util.Long.fromValue(object.bytesFromSourceSkippedBySync)).unsigned = false; - else if (typeof object.bytesFromSourceSkippedBySync === "string") - message.bytesFromSourceSkippedBySync = parseInt(object.bytesFromSourceSkippedBySync, 10); - else if (typeof object.bytesFromSourceSkippedBySync === "number") - message.bytesFromSourceSkippedBySync = object.bytesFromSourceSkippedBySync; - else if (typeof object.bytesFromSourceSkippedBySync === "object") - message.bytesFromSourceSkippedBySync = new $util.LongBits(object.bytesFromSourceSkippedBySync.low >>> 0, object.bytesFromSourceSkippedBySync.high >>> 0).toNumber(); - if (object.objectsCopiedToSink != null) - if ($util.Long) - (message.objectsCopiedToSink = $util.Long.fromValue(object.objectsCopiedToSink)).unsigned = false; - else if (typeof object.objectsCopiedToSink === "string") - message.objectsCopiedToSink = parseInt(object.objectsCopiedToSink, 10); - else if (typeof object.objectsCopiedToSink === "number") - message.objectsCopiedToSink = object.objectsCopiedToSink; - else if (typeof object.objectsCopiedToSink === "object") - message.objectsCopiedToSink = new $util.LongBits(object.objectsCopiedToSink.low >>> 0, object.objectsCopiedToSink.high >>> 0).toNumber(); - if (object.bytesCopiedToSink != null) - if ($util.Long) - (message.bytesCopiedToSink = $util.Long.fromValue(object.bytesCopiedToSink)).unsigned = false; - else if (typeof object.bytesCopiedToSink === "string") - message.bytesCopiedToSink = parseInt(object.bytesCopiedToSink, 10); - else if (typeof object.bytesCopiedToSink === "number") - message.bytesCopiedToSink = object.bytesCopiedToSink; - else if (typeof object.bytesCopiedToSink === "object") - message.bytesCopiedToSink = new $util.LongBits(object.bytesCopiedToSink.low >>> 0, object.bytesCopiedToSink.high >>> 0).toNumber(); - if (object.objectsDeletedFromSource != null) - if ($util.Long) - (message.objectsDeletedFromSource = $util.Long.fromValue(object.objectsDeletedFromSource)).unsigned = false; - else if (typeof object.objectsDeletedFromSource === "string") - message.objectsDeletedFromSource = parseInt(object.objectsDeletedFromSource, 10); - else if (typeof object.objectsDeletedFromSource === "number") - message.objectsDeletedFromSource = object.objectsDeletedFromSource; - else if (typeof object.objectsDeletedFromSource === "object") - message.objectsDeletedFromSource = new $util.LongBits(object.objectsDeletedFromSource.low >>> 0, object.objectsDeletedFromSource.high >>> 0).toNumber(); - if (object.bytesDeletedFromSource != null) - if ($util.Long) - (message.bytesDeletedFromSource = $util.Long.fromValue(object.bytesDeletedFromSource)).unsigned = false; - else if (typeof object.bytesDeletedFromSource === "string") - message.bytesDeletedFromSource = parseInt(object.bytesDeletedFromSource, 10); - else if (typeof object.bytesDeletedFromSource === "number") - message.bytesDeletedFromSource = object.bytesDeletedFromSource; - else if (typeof object.bytesDeletedFromSource === "object") - message.bytesDeletedFromSource = new $util.LongBits(object.bytesDeletedFromSource.low >>> 0, object.bytesDeletedFromSource.high >>> 0).toNumber(); - if (object.objectsDeletedFromSink != null) - if ($util.Long) - (message.objectsDeletedFromSink = $util.Long.fromValue(object.objectsDeletedFromSink)).unsigned = false; - else if (typeof object.objectsDeletedFromSink === "string") - message.objectsDeletedFromSink = parseInt(object.objectsDeletedFromSink, 10); - else if (typeof object.objectsDeletedFromSink === "number") - message.objectsDeletedFromSink = object.objectsDeletedFromSink; - else if (typeof object.objectsDeletedFromSink === "object") - message.objectsDeletedFromSink = new $util.LongBits(object.objectsDeletedFromSink.low >>> 0, object.objectsDeletedFromSink.high >>> 0).toNumber(); - if (object.bytesDeletedFromSink != null) - if ($util.Long) - (message.bytesDeletedFromSink = $util.Long.fromValue(object.bytesDeletedFromSink)).unsigned = false; - else if (typeof object.bytesDeletedFromSink === "string") - message.bytesDeletedFromSink = parseInt(object.bytesDeletedFromSink, 10); - else if (typeof object.bytesDeletedFromSink === "number") - message.bytesDeletedFromSink = object.bytesDeletedFromSink; - else if (typeof object.bytesDeletedFromSink === "object") - message.bytesDeletedFromSink = new $util.LongBits(object.bytesDeletedFromSink.low >>> 0, object.bytesDeletedFromSink.high >>> 0).toNumber(); - if (object.objectsFromSourceFailed != null) - if ($util.Long) - (message.objectsFromSourceFailed = $util.Long.fromValue(object.objectsFromSourceFailed)).unsigned = false; - else if (typeof object.objectsFromSourceFailed === "string") - message.objectsFromSourceFailed = parseInt(object.objectsFromSourceFailed, 10); - else if (typeof object.objectsFromSourceFailed === "number") - message.objectsFromSourceFailed = object.objectsFromSourceFailed; - else if (typeof object.objectsFromSourceFailed === "object") - message.objectsFromSourceFailed = new $util.LongBits(object.objectsFromSourceFailed.low >>> 0, object.objectsFromSourceFailed.high >>> 0).toNumber(); - if (object.bytesFromSourceFailed != null) - if ($util.Long) - (message.bytesFromSourceFailed = $util.Long.fromValue(object.bytesFromSourceFailed)).unsigned = false; - else if (typeof object.bytesFromSourceFailed === "string") - message.bytesFromSourceFailed = parseInt(object.bytesFromSourceFailed, 10); - else if (typeof object.bytesFromSourceFailed === "number") - message.bytesFromSourceFailed = object.bytesFromSourceFailed; - else if (typeof object.bytesFromSourceFailed === "object") - message.bytesFromSourceFailed = new $util.LongBits(object.bytesFromSourceFailed.low >>> 0, object.bytesFromSourceFailed.high >>> 0).toNumber(); - if (object.objectsFailedToDeleteFromSink != null) - if ($util.Long) - (message.objectsFailedToDeleteFromSink = $util.Long.fromValue(object.objectsFailedToDeleteFromSink)).unsigned = false; - else if (typeof object.objectsFailedToDeleteFromSink === "string") - message.objectsFailedToDeleteFromSink = parseInt(object.objectsFailedToDeleteFromSink, 10); - else if (typeof object.objectsFailedToDeleteFromSink === "number") - message.objectsFailedToDeleteFromSink = object.objectsFailedToDeleteFromSink; - else if (typeof object.objectsFailedToDeleteFromSink === "object") - message.objectsFailedToDeleteFromSink = new $util.LongBits(object.objectsFailedToDeleteFromSink.low >>> 0, object.objectsFailedToDeleteFromSink.high >>> 0).toNumber(); - if (object.bytesFailedToDeleteFromSink != null) - if ($util.Long) - (message.bytesFailedToDeleteFromSink = $util.Long.fromValue(object.bytesFailedToDeleteFromSink)).unsigned = false; - else if (typeof object.bytesFailedToDeleteFromSink === "string") - message.bytesFailedToDeleteFromSink = parseInt(object.bytesFailedToDeleteFromSink, 10); - else if (typeof object.bytesFailedToDeleteFromSink === "number") - message.bytesFailedToDeleteFromSink = object.bytesFailedToDeleteFromSink; - else if (typeof object.bytesFailedToDeleteFromSink === "object") - message.bytesFailedToDeleteFromSink = new $util.LongBits(object.bytesFailedToDeleteFromSink.low >>> 0, object.bytesFailedToDeleteFromSink.high >>> 0).toNumber(); + var message = new $root.google.storagetransfer.v1.AgentPool(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "CREATED": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + } + if (object.bandwidthLimit != null) { + if (typeof object.bandwidthLimit !== "object") + throw TypeError(".google.storagetransfer.v1.AgentPool.bandwidthLimit: object expected"); + message.bandwidthLimit = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.fromObject(object.bandwidthLimit); + } return message; }; /** - * Creates a plain object from a TransferCounters message. Also converts values to other types if specified. + * Creates a plain object from an AgentPool message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @static - * @param {google.storagetransfer.v1.TransferCounters} message TransferCounters + * @param {google.storagetransfer.v1.AgentPool} message AgentPool * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransferCounters.toObject = function toObject(message, options) { + AgentPool.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.objectsFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsFoundFromSource = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesFoundFromSource = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.objectsFoundOnlyFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsFoundOnlyFromSink = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesFoundOnlyFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesFoundOnlyFromSink = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.objectsFromSourceSkippedBySync = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsFromSourceSkippedBySync = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesFromSourceSkippedBySync = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesFromSourceSkippedBySync = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.objectsCopiedToSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsCopiedToSink = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesCopiedToSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesCopiedToSink = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.objectsDeletedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsDeletedFromSource = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesDeletedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesDeletedFromSource = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.objectsDeletedFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsDeletedFromSink = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesDeletedFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesDeletedFromSink = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.objectsFromSourceFailed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsFromSourceFailed = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesFromSourceFailed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesFromSourceFailed = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.objectsFailedToDeleteFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.objectsFailedToDeleteFromSink = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesFailedToDeleteFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesFailedToDeleteFromSink = options.longs === String ? "0" : 0; + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.bandwidthLimit = null; } - if (message.objectsFoundFromSource != null && message.hasOwnProperty("objectsFoundFromSource")) - if (typeof message.objectsFoundFromSource === "number") - object.objectsFoundFromSource = options.longs === String ? String(message.objectsFoundFromSource) : message.objectsFoundFromSource; - else - object.objectsFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFoundFromSource) : options.longs === Number ? new $util.LongBits(message.objectsFoundFromSource.low >>> 0, message.objectsFoundFromSource.high >>> 0).toNumber() : message.objectsFoundFromSource; - if (message.bytesFoundFromSource != null && message.hasOwnProperty("bytesFoundFromSource")) - if (typeof message.bytesFoundFromSource === "number") - object.bytesFoundFromSource = options.longs === String ? String(message.bytesFoundFromSource) : message.bytesFoundFromSource; - else - object.bytesFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFoundFromSource) : options.longs === Number ? new $util.LongBits(message.bytesFoundFromSource.low >>> 0, message.bytesFoundFromSource.high >>> 0).toNumber() : message.bytesFoundFromSource; - if (message.objectsFoundOnlyFromSink != null && message.hasOwnProperty("objectsFoundOnlyFromSink")) - if (typeof message.objectsFoundOnlyFromSink === "number") - object.objectsFoundOnlyFromSink = options.longs === String ? String(message.objectsFoundOnlyFromSink) : message.objectsFoundOnlyFromSink; - else - object.objectsFoundOnlyFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFoundOnlyFromSink) : options.longs === Number ? new $util.LongBits(message.objectsFoundOnlyFromSink.low >>> 0, message.objectsFoundOnlyFromSink.high >>> 0).toNumber() : message.objectsFoundOnlyFromSink; - if (message.bytesFoundOnlyFromSink != null && message.hasOwnProperty("bytesFoundOnlyFromSink")) - if (typeof message.bytesFoundOnlyFromSink === "number") - object.bytesFoundOnlyFromSink = options.longs === String ? String(message.bytesFoundOnlyFromSink) : message.bytesFoundOnlyFromSink; - else - object.bytesFoundOnlyFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFoundOnlyFromSink) : options.longs === Number ? new $util.LongBits(message.bytesFoundOnlyFromSink.low >>> 0, message.bytesFoundOnlyFromSink.high >>> 0).toNumber() : message.bytesFoundOnlyFromSink; - if (message.objectsFromSourceSkippedBySync != null && message.hasOwnProperty("objectsFromSourceSkippedBySync")) - if (typeof message.objectsFromSourceSkippedBySync === "number") - object.objectsFromSourceSkippedBySync = options.longs === String ? String(message.objectsFromSourceSkippedBySync) : message.objectsFromSourceSkippedBySync; - else - object.objectsFromSourceSkippedBySync = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFromSourceSkippedBySync) : options.longs === Number ? new $util.LongBits(message.objectsFromSourceSkippedBySync.low >>> 0, message.objectsFromSourceSkippedBySync.high >>> 0).toNumber() : message.objectsFromSourceSkippedBySync; - if (message.bytesFromSourceSkippedBySync != null && message.hasOwnProperty("bytesFromSourceSkippedBySync")) - if (typeof message.bytesFromSourceSkippedBySync === "number") - object.bytesFromSourceSkippedBySync = options.longs === String ? String(message.bytesFromSourceSkippedBySync) : message.bytesFromSourceSkippedBySync; - else - object.bytesFromSourceSkippedBySync = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFromSourceSkippedBySync) : options.longs === Number ? new $util.LongBits(message.bytesFromSourceSkippedBySync.low >>> 0, message.bytesFromSourceSkippedBySync.high >>> 0).toNumber() : message.bytesFromSourceSkippedBySync; - if (message.objectsCopiedToSink != null && message.hasOwnProperty("objectsCopiedToSink")) - if (typeof message.objectsCopiedToSink === "number") - object.objectsCopiedToSink = options.longs === String ? String(message.objectsCopiedToSink) : message.objectsCopiedToSink; - else - object.objectsCopiedToSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsCopiedToSink) : options.longs === Number ? new $util.LongBits(message.objectsCopiedToSink.low >>> 0, message.objectsCopiedToSink.high >>> 0).toNumber() : message.objectsCopiedToSink; - if (message.bytesCopiedToSink != null && message.hasOwnProperty("bytesCopiedToSink")) - if (typeof message.bytesCopiedToSink === "number") - object.bytesCopiedToSink = options.longs === String ? String(message.bytesCopiedToSink) : message.bytesCopiedToSink; - else - object.bytesCopiedToSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesCopiedToSink) : options.longs === Number ? new $util.LongBits(message.bytesCopiedToSink.low >>> 0, message.bytesCopiedToSink.high >>> 0).toNumber() : message.bytesCopiedToSink; - if (message.objectsDeletedFromSource != null && message.hasOwnProperty("objectsDeletedFromSource")) - if (typeof message.objectsDeletedFromSource === "number") - object.objectsDeletedFromSource = options.longs === String ? String(message.objectsDeletedFromSource) : message.objectsDeletedFromSource; - else - object.objectsDeletedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.objectsDeletedFromSource) : options.longs === Number ? new $util.LongBits(message.objectsDeletedFromSource.low >>> 0, message.objectsDeletedFromSource.high >>> 0).toNumber() : message.objectsDeletedFromSource; - if (message.bytesDeletedFromSource != null && message.hasOwnProperty("bytesDeletedFromSource")) - if (typeof message.bytesDeletedFromSource === "number") - object.bytesDeletedFromSource = options.longs === String ? String(message.bytesDeletedFromSource) : message.bytesDeletedFromSource; - else - object.bytesDeletedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDeletedFromSource) : options.longs === Number ? new $util.LongBits(message.bytesDeletedFromSource.low >>> 0, message.bytesDeletedFromSource.high >>> 0).toNumber() : message.bytesDeletedFromSource; - if (message.objectsDeletedFromSink != null && message.hasOwnProperty("objectsDeletedFromSink")) - if (typeof message.objectsDeletedFromSink === "number") - object.objectsDeletedFromSink = options.longs === String ? String(message.objectsDeletedFromSink) : message.objectsDeletedFromSink; - else - object.objectsDeletedFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsDeletedFromSink) : options.longs === Number ? new $util.LongBits(message.objectsDeletedFromSink.low >>> 0, message.objectsDeletedFromSink.high >>> 0).toNumber() : message.objectsDeletedFromSink; - if (message.bytesDeletedFromSink != null && message.hasOwnProperty("bytesDeletedFromSink")) - if (typeof message.bytesDeletedFromSink === "number") - object.bytesDeletedFromSink = options.longs === String ? String(message.bytesDeletedFromSink) : message.bytesDeletedFromSink; - else - object.bytesDeletedFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDeletedFromSink) : options.longs === Number ? new $util.LongBits(message.bytesDeletedFromSink.low >>> 0, message.bytesDeletedFromSink.high >>> 0).toNumber() : message.bytesDeletedFromSink; - if (message.objectsFromSourceFailed != null && message.hasOwnProperty("objectsFromSourceFailed")) - if (typeof message.objectsFromSourceFailed === "number") - object.objectsFromSourceFailed = options.longs === String ? String(message.objectsFromSourceFailed) : message.objectsFromSourceFailed; - else - object.objectsFromSourceFailed = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFromSourceFailed) : options.longs === Number ? new $util.LongBits(message.objectsFromSourceFailed.low >>> 0, message.objectsFromSourceFailed.high >>> 0).toNumber() : message.objectsFromSourceFailed; - if (message.bytesFromSourceFailed != null && message.hasOwnProperty("bytesFromSourceFailed")) - if (typeof message.bytesFromSourceFailed === "number") - object.bytesFromSourceFailed = options.longs === String ? String(message.bytesFromSourceFailed) : message.bytesFromSourceFailed; - else - object.bytesFromSourceFailed = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFromSourceFailed) : options.longs === Number ? new $util.LongBits(message.bytesFromSourceFailed.low >>> 0, message.bytesFromSourceFailed.high >>> 0).toNumber() : message.bytesFromSourceFailed; - if (message.objectsFailedToDeleteFromSink != null && message.hasOwnProperty("objectsFailedToDeleteFromSink")) - if (typeof message.objectsFailedToDeleteFromSink === "number") - object.objectsFailedToDeleteFromSink = options.longs === String ? String(message.objectsFailedToDeleteFromSink) : message.objectsFailedToDeleteFromSink; - else - object.objectsFailedToDeleteFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFailedToDeleteFromSink) : options.longs === Number ? new $util.LongBits(message.objectsFailedToDeleteFromSink.low >>> 0, message.objectsFailedToDeleteFromSink.high >>> 0).toNumber() : message.objectsFailedToDeleteFromSink; - if (message.bytesFailedToDeleteFromSink != null && message.hasOwnProperty("bytesFailedToDeleteFromSink")) - if (typeof message.bytesFailedToDeleteFromSink === "number") - object.bytesFailedToDeleteFromSink = options.longs === String ? String(message.bytesFailedToDeleteFromSink) : message.bytesFailedToDeleteFromSink; - else - object.bytesFailedToDeleteFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFailedToDeleteFromSink) : options.longs === Number ? new $util.LongBits(message.bytesFailedToDeleteFromSink.low >>> 0, message.bytesFailedToDeleteFromSink.high >>> 0).toNumber() : message.bytesFailedToDeleteFromSink; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.storagetransfer.v1.AgentPool.State[message.state] : message.state; + if (message.bandwidthLimit != null && message.hasOwnProperty("bandwidthLimit")) + object.bandwidthLimit = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.toObject(message.bandwidthLimit, options); return object; }; /** - * Converts this TransferCounters to JSON. + * Converts this AgentPool to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.TransferCounters + * @memberof google.storagetransfer.v1.AgentPool * @instance * @returns {Object.} JSON object */ - TransferCounters.prototype.toJSON = function toJSON() { + AgentPool.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TransferCounters; + /** + * State enum. + * @name google.storagetransfer.v1.AgentPool.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} CREATED=2 CREATED value + * @property {number} DELETING=3 DELETING value + */ + AgentPool.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "CREATED"] = 2; + values[valuesById[3] = "DELETING"] = 3; + return values; + })(); + + AgentPool.BandwidthLimit = (function() { + + /** + * Properties of a BandwidthLimit. + * @memberof google.storagetransfer.v1.AgentPool + * @interface IBandwidthLimit + * @property {number|Long|null} [limitMbps] BandwidthLimit limitMbps + */ + + /** + * Constructs a new BandwidthLimit. + * @memberof google.storagetransfer.v1.AgentPool + * @classdesc Represents a BandwidthLimit. + * @implements IBandwidthLimit + * @constructor + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit=} [properties] Properties to set + */ + function BandwidthLimit(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]]; + } + + /** + * BandwidthLimit limitMbps. + * @member {number|Long} limitMbps + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @instance + */ + BandwidthLimit.prototype.limitMbps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BandwidthLimit instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit instance + */ + BandwidthLimit.create = function create(properties) { + return new BandwidthLimit(properties); + }; + + /** + * Encodes the specified BandwidthLimit message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit} message BandwidthLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BandwidthLimit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.limitMbps != null && Object.hasOwnProperty.call(message, "limitMbps")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.limitMbps); + return writer; + }; + + /** + * Encodes the specified BandwidthLimit message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit} message BandwidthLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BandwidthLimit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BandwidthLimit.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.storagetransfer.v1.AgentPool.BandwidthLimit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.limitMbps = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BandwidthLimit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BandwidthLimit message. + * @function verify + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BandwidthLimit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.limitMbps != null && message.hasOwnProperty("limitMbps")) + if (!$util.isInteger(message.limitMbps) && !(message.limitMbps && $util.isInteger(message.limitMbps.low) && $util.isInteger(message.limitMbps.high))) + return "limitMbps: integer|Long expected"; + return null; + }; + + /** + * Creates a BandwidthLimit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit + */ + BandwidthLimit.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AgentPool.BandwidthLimit) + return object; + var message = new $root.google.storagetransfer.v1.AgentPool.BandwidthLimit(); + if (object.limitMbps != null) + if ($util.Long) + (message.limitMbps = $util.Long.fromValue(object.limitMbps)).unsigned = false; + else if (typeof object.limitMbps === "string") + message.limitMbps = parseInt(object.limitMbps, 10); + else if (typeof object.limitMbps === "number") + message.limitMbps = object.limitMbps; + else if (typeof object.limitMbps === "object") + message.limitMbps = new $util.LongBits(object.limitMbps.low >>> 0, object.limitMbps.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BandwidthLimit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.BandwidthLimit} message BandwidthLimit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BandwidthLimit.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.limitMbps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limitMbps = options.longs === String ? "0" : 0; + if (message.limitMbps != null && message.hasOwnProperty("limitMbps")) + if (typeof message.limitMbps === "number") + object.limitMbps = options.longs === String ? String(message.limitMbps) : message.limitMbps; + else + object.limitMbps = options.longs === String ? $util.Long.prototype.toString.call(message.limitMbps) : options.longs === Number ? new $util.LongBits(message.limitMbps.low >>> 0, message.limitMbps.high >>> 0).toNumber() : message.limitMbps; + return object; + }; + + /** + * Converts this BandwidthLimit to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @instance + * @returns {Object.} JSON object + */ + BandwidthLimit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BandwidthLimit; + })(); + + return AgentPool; })(); - v1.NotificationConfig = (function() { + v1.TransferOptions = (function() { /** - * Properties of a NotificationConfig. + * Properties of a TransferOptions. * @memberof google.storagetransfer.v1 - * @interface INotificationConfig - * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic - * @property {Array.|null} [eventTypes] NotificationConfig eventTypes - * @property {google.storagetransfer.v1.NotificationConfig.PayloadFormat|null} [payloadFormat] NotificationConfig payloadFormat + * @interface ITransferOptions + * @property {boolean|null} [overwriteObjectsAlreadyExistingInSink] TransferOptions overwriteObjectsAlreadyExistingInSink + * @property {boolean|null} [deleteObjectsUniqueInSink] TransferOptions deleteObjectsUniqueInSink + * @property {boolean|null} [deleteObjectsFromSourceAfterTransfer] TransferOptions deleteObjectsFromSourceAfterTransfer + * @property {google.storagetransfer.v1.TransferOptions.OverwriteWhen|null} [overwriteWhen] TransferOptions overwriteWhen + * @property {google.storagetransfer.v1.IMetadataOptions|null} [metadataOptions] TransferOptions metadataOptions */ /** - * Constructs a new NotificationConfig. + * Constructs a new TransferOptions. * @memberof google.storagetransfer.v1 - * @classdesc Represents a NotificationConfig. - * @implements INotificationConfig + * @classdesc Represents a TransferOptions. + * @implements ITransferOptions * @constructor - * @param {google.storagetransfer.v1.INotificationConfig=} [properties] Properties to set + * @param {google.storagetransfer.v1.ITransferOptions=} [properties] Properties to set */ - function NotificationConfig(properties) { - this.eventTypes = []; + function TransferOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6906,112 +6328,127 @@ } /** - * NotificationConfig pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.storagetransfer.v1.NotificationConfig + * TransferOptions overwriteObjectsAlreadyExistingInSink. + * @member {boolean} overwriteObjectsAlreadyExistingInSink + * @memberof google.storagetransfer.v1.TransferOptions * @instance */ - NotificationConfig.prototype.pubsubTopic = ""; + TransferOptions.prototype.overwriteObjectsAlreadyExistingInSink = false; /** - * NotificationConfig eventTypes. - * @member {Array.} eventTypes - * @memberof google.storagetransfer.v1.NotificationConfig + * TransferOptions deleteObjectsUniqueInSink. + * @member {boolean} deleteObjectsUniqueInSink + * @memberof google.storagetransfer.v1.TransferOptions * @instance */ - NotificationConfig.prototype.eventTypes = $util.emptyArray; + TransferOptions.prototype.deleteObjectsUniqueInSink = false; /** - * NotificationConfig payloadFormat. - * @member {google.storagetransfer.v1.NotificationConfig.PayloadFormat} payloadFormat - * @memberof google.storagetransfer.v1.NotificationConfig + * TransferOptions deleteObjectsFromSourceAfterTransfer. + * @member {boolean} deleteObjectsFromSourceAfterTransfer + * @memberof google.storagetransfer.v1.TransferOptions * @instance */ - NotificationConfig.prototype.payloadFormat = 0; + TransferOptions.prototype.deleteObjectsFromSourceAfterTransfer = false; /** - * Creates a new NotificationConfig instance using the specified properties. - * @function create - * @memberof google.storagetransfer.v1.NotificationConfig - * @static - * @param {google.storagetransfer.v1.INotificationConfig=} [properties] Properties to set - * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig instance + * TransferOptions overwriteWhen. + * @member {google.storagetransfer.v1.TransferOptions.OverwriteWhen} overwriteWhen + * @memberof google.storagetransfer.v1.TransferOptions + * @instance */ - NotificationConfig.create = function create(properties) { - return new NotificationConfig(properties); + TransferOptions.prototype.overwriteWhen = 0; + + /** + * TransferOptions metadataOptions. + * @member {google.storagetransfer.v1.IMetadataOptions|null|undefined} metadataOptions + * @memberof google.storagetransfer.v1.TransferOptions + * @instance + */ + TransferOptions.prototype.metadataOptions = null; + + /** + * Creates a new TransferOptions instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {google.storagetransfer.v1.ITransferOptions=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions instance + */ + TransferOptions.create = function create(properties) { + return new TransferOptions(properties); }; /** - * Encodes the specified NotificationConfig message. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * Encodes the specified TransferOptions message. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @static - * @param {google.storagetransfer.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {google.storagetransfer.v1.ITransferOptions} message TransferOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationConfig.encode = function encode(message, writer) { + TransferOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); - if (message.eventTypes != null && message.eventTypes.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.eventTypes.length; ++i) - writer.int32(message.eventTypes[i]); - writer.ldelim(); - } - if (message.payloadFormat != null && Object.hasOwnProperty.call(message, "payloadFormat")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.payloadFormat); + if (message.overwriteObjectsAlreadyExistingInSink != null && Object.hasOwnProperty.call(message, "overwriteObjectsAlreadyExistingInSink")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.overwriteObjectsAlreadyExistingInSink); + if (message.deleteObjectsUniqueInSink != null && Object.hasOwnProperty.call(message, "deleteObjectsUniqueInSink")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleteObjectsUniqueInSink); + if (message.deleteObjectsFromSourceAfterTransfer != null && Object.hasOwnProperty.call(message, "deleteObjectsFromSourceAfterTransfer")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteObjectsFromSourceAfterTransfer); + if (message.overwriteWhen != null && Object.hasOwnProperty.call(message, "overwriteWhen")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.overwriteWhen); + if (message.metadataOptions != null && Object.hasOwnProperty.call(message, "metadataOptions")) + $root.google.storagetransfer.v1.MetadataOptions.encode(message.metadataOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * Encodes the specified TransferOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @static - * @param {google.storagetransfer.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {google.storagetransfer.v1.ITransferOptions} message TransferOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + TransferOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationConfig message from the specified reader or buffer. + * Decodes a TransferOptions message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationConfig.decode = function decode(reader, length) { + TransferOptions.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.storagetransfer.v1.NotificationConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pubsubTopic = reader.string(); + message.overwriteObjectsAlreadyExistingInSink = reader.bool(); break; case 2: - if (!(message.eventTypes && message.eventTypes.length)) - message.eventTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.eventTypes.push(reader.int32()); - } else - message.eventTypes.push(reader.int32()); + message.deleteObjectsUniqueInSink = reader.bool(); break; case 3: - message.payloadFormat = reader.int32(); + message.deleteObjectsFromSourceAfterTransfer = reader.bool(); + break; + case 4: + message.overwriteWhen = reader.int32(); + break; + case 5: + message.metadataOptions = $root.google.storagetransfer.v1.MetadataOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7022,224 +6459,198 @@ }; /** - * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * Decodes a TransferOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + TransferOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationConfig message. + * Verifies a TransferOptions message. * @function verify - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationConfig.verify = function verify(message) { + TransferOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - if (message.eventTypes != null && message.hasOwnProperty("eventTypes")) { - if (!Array.isArray(message.eventTypes)) - return "eventTypes: array expected"; - for (var i = 0; i < message.eventTypes.length; ++i) - switch (message.eventTypes[i]) { - default: - return "eventTypes: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.payloadFormat != null && message.hasOwnProperty("payloadFormat")) - switch (message.payloadFormat) { + if (message.overwriteObjectsAlreadyExistingInSink != null && message.hasOwnProperty("overwriteObjectsAlreadyExistingInSink")) + if (typeof message.overwriteObjectsAlreadyExistingInSink !== "boolean") + return "overwriteObjectsAlreadyExistingInSink: boolean expected"; + if (message.deleteObjectsUniqueInSink != null && message.hasOwnProperty("deleteObjectsUniqueInSink")) + if (typeof message.deleteObjectsUniqueInSink !== "boolean") + return "deleteObjectsUniqueInSink: boolean expected"; + if (message.deleteObjectsFromSourceAfterTransfer != null && message.hasOwnProperty("deleteObjectsFromSourceAfterTransfer")) + if (typeof message.deleteObjectsFromSourceAfterTransfer !== "boolean") + return "deleteObjectsFromSourceAfterTransfer: boolean expected"; + if (message.overwriteWhen != null && message.hasOwnProperty("overwriteWhen")) + switch (message.overwriteWhen) { default: - return "payloadFormat: enum value expected"; + return "overwriteWhen: enum value expected"; case 0: case 1: case 2: + case 3: break; } + if (message.metadataOptions != null && message.hasOwnProperty("metadataOptions")) { + var error = $root.google.storagetransfer.v1.MetadataOptions.verify(message.metadataOptions); + if (error) + return "metadataOptions." + error; + } return null; }; /** - * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * Creates a TransferOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions */ - NotificationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.NotificationConfig) + TransferOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferOptions) return object; - var message = new $root.google.storagetransfer.v1.NotificationConfig(); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - if (object.eventTypes) { - if (!Array.isArray(object.eventTypes)) - throw TypeError(".google.storagetransfer.v1.NotificationConfig.eventTypes: array expected"); - message.eventTypes = []; - for (var i = 0; i < object.eventTypes.length; ++i) - switch (object.eventTypes[i]) { - default: - case "EVENT_TYPE_UNSPECIFIED": - case 0: - message.eventTypes[i] = 0; - break; - case "TRANSFER_OPERATION_SUCCESS": - case 1: - message.eventTypes[i] = 1; - break; - case "TRANSFER_OPERATION_FAILED": - case 2: - message.eventTypes[i] = 2; - break; - case "TRANSFER_OPERATION_ABORTED": - case 3: - message.eventTypes[i] = 3; - break; - } - } - switch (object.payloadFormat) { - case "PAYLOAD_FORMAT_UNSPECIFIED": + var message = new $root.google.storagetransfer.v1.TransferOptions(); + if (object.overwriteObjectsAlreadyExistingInSink != null) + message.overwriteObjectsAlreadyExistingInSink = Boolean(object.overwriteObjectsAlreadyExistingInSink); + if (object.deleteObjectsUniqueInSink != null) + message.deleteObjectsUniqueInSink = Boolean(object.deleteObjectsUniqueInSink); + if (object.deleteObjectsFromSourceAfterTransfer != null) + message.deleteObjectsFromSourceAfterTransfer = Boolean(object.deleteObjectsFromSourceAfterTransfer); + switch (object.overwriteWhen) { + case "OVERWRITE_WHEN_UNSPECIFIED": case 0: - message.payloadFormat = 0; + message.overwriteWhen = 0; break; - case "NONE": + case "DIFFERENT": case 1: - message.payloadFormat = 1; + message.overwriteWhen = 1; break; - case "JSON": + case "NEVER": case 2: - message.payloadFormat = 2; + message.overwriteWhen = 2; + break; + case "ALWAYS": + case 3: + message.overwriteWhen = 3; break; } + if (object.metadataOptions != null) { + if (typeof object.metadataOptions !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOptions.metadataOptions: object expected"); + message.metadataOptions = $root.google.storagetransfer.v1.MetadataOptions.fromObject(object.metadataOptions); + } return message; }; /** - * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * Creates a plain object from a TransferOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @static - * @param {google.storagetransfer.v1.NotificationConfig} message NotificationConfig + * @param {google.storagetransfer.v1.TransferOptions} message TransferOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationConfig.toObject = function toObject(message, options) { + TransferOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.eventTypes = []; if (options.defaults) { - object.pubsubTopic = ""; - object.payloadFormat = options.enums === String ? "PAYLOAD_FORMAT_UNSPECIFIED" : 0; - } - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - if (message.eventTypes && message.eventTypes.length) { - object.eventTypes = []; - for (var j = 0; j < message.eventTypes.length; ++j) - object.eventTypes[j] = options.enums === String ? $root.google.storagetransfer.v1.NotificationConfig.EventType[message.eventTypes[j]] : message.eventTypes[j]; + object.overwriteObjectsAlreadyExistingInSink = false; + object.deleteObjectsUniqueInSink = false; + object.deleteObjectsFromSourceAfterTransfer = false; + object.overwriteWhen = options.enums === String ? "OVERWRITE_WHEN_UNSPECIFIED" : 0; + object.metadataOptions = null; } - if (message.payloadFormat != null && message.hasOwnProperty("payloadFormat")) - object.payloadFormat = options.enums === String ? $root.google.storagetransfer.v1.NotificationConfig.PayloadFormat[message.payloadFormat] : message.payloadFormat; + if (message.overwriteObjectsAlreadyExistingInSink != null && message.hasOwnProperty("overwriteObjectsAlreadyExistingInSink")) + object.overwriteObjectsAlreadyExistingInSink = message.overwriteObjectsAlreadyExistingInSink; + if (message.deleteObjectsUniqueInSink != null && message.hasOwnProperty("deleteObjectsUniqueInSink")) + object.deleteObjectsUniqueInSink = message.deleteObjectsUniqueInSink; + if (message.deleteObjectsFromSourceAfterTransfer != null && message.hasOwnProperty("deleteObjectsFromSourceAfterTransfer")) + object.deleteObjectsFromSourceAfterTransfer = message.deleteObjectsFromSourceAfterTransfer; + if (message.overwriteWhen != null && message.hasOwnProperty("overwriteWhen")) + object.overwriteWhen = options.enums === String ? $root.google.storagetransfer.v1.TransferOptions.OverwriteWhen[message.overwriteWhen] : message.overwriteWhen; + if (message.metadataOptions != null && message.hasOwnProperty("metadataOptions")) + object.metadataOptions = $root.google.storagetransfer.v1.MetadataOptions.toObject(message.metadataOptions, options); return object; }; /** - * Converts this NotificationConfig to JSON. + * Converts this TransferOptions to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.NotificationConfig + * @memberof google.storagetransfer.v1.TransferOptions * @instance * @returns {Object.} JSON object */ - NotificationConfig.prototype.toJSON = function toJSON() { + TransferOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * EventType enum. - * @name google.storagetransfer.v1.NotificationConfig.EventType - * @enum {number} - * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value - * @property {number} TRANSFER_OPERATION_SUCCESS=1 TRANSFER_OPERATION_SUCCESS value - * @property {number} TRANSFER_OPERATION_FAILED=2 TRANSFER_OPERATION_FAILED value - * @property {number} TRANSFER_OPERATION_ABORTED=3 TRANSFER_OPERATION_ABORTED value - */ - NotificationConfig.EventType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRANSFER_OPERATION_SUCCESS"] = 1; - values[valuesById[2] = "TRANSFER_OPERATION_FAILED"] = 2; - values[valuesById[3] = "TRANSFER_OPERATION_ABORTED"] = 3; - return values; - })(); - - /** - * PayloadFormat enum. - * @name google.storagetransfer.v1.NotificationConfig.PayloadFormat + * OverwriteWhen enum. + * @name google.storagetransfer.v1.TransferOptions.OverwriteWhen * @enum {number} - * @property {number} PAYLOAD_FORMAT_UNSPECIFIED=0 PAYLOAD_FORMAT_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} JSON=2 JSON value + * @property {number} OVERWRITE_WHEN_UNSPECIFIED=0 OVERWRITE_WHEN_UNSPECIFIED value + * @property {number} DIFFERENT=1 DIFFERENT value + * @property {number} NEVER=2 NEVER value + * @property {number} ALWAYS=3 ALWAYS value */ - NotificationConfig.PayloadFormat = (function() { + TransferOptions.OverwriteWhen = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PAYLOAD_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "JSON"] = 2; + values[valuesById[0] = "OVERWRITE_WHEN_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIFFERENT"] = 1; + values[valuesById[2] = "NEVER"] = 2; + values[valuesById[3] = "ALWAYS"] = 3; return values; })(); - return NotificationConfig; + return TransferOptions; })(); - v1.TransferOperation = (function() { + v1.TransferSpec = (function() { /** - * Properties of a TransferOperation. + * Properties of a TransferSpec. * @memberof google.storagetransfer.v1 - * @interface ITransferOperation - * @property {string|null} [name] TransferOperation name - * @property {string|null} [projectId] TransferOperation projectId - * @property {google.storagetransfer.v1.ITransferSpec|null} [transferSpec] TransferOperation transferSpec - * @property {google.storagetransfer.v1.INotificationConfig|null} [notificationConfig] TransferOperation notificationConfig - * @property {google.protobuf.ITimestamp|null} [startTime] TransferOperation startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TransferOperation endTime - * @property {google.storagetransfer.v1.TransferOperation.Status|null} [status] TransferOperation status - * @property {google.storagetransfer.v1.ITransferCounters|null} [counters] TransferOperation counters - * @property {Array.|null} [errorBreakdowns] TransferOperation errorBreakdowns - * @property {string|null} [transferJobName] TransferOperation transferJobName + * @interface ITransferSpec + * @property {google.storagetransfer.v1.IGcsData|null} [gcsDataSink] TransferSpec gcsDataSink + * @property {google.storagetransfer.v1.IPosixFilesystem|null} [posixDataSink] TransferSpec posixDataSink + * @property {google.storagetransfer.v1.IGcsData|null} [gcsDataSource] TransferSpec gcsDataSource + * @property {google.storagetransfer.v1.IAwsS3Data|null} [awsS3DataSource] TransferSpec awsS3DataSource + * @property {google.storagetransfer.v1.IHttpData|null} [httpDataSource] TransferSpec httpDataSource + * @property {google.storagetransfer.v1.IPosixFilesystem|null} [posixDataSource] TransferSpec posixDataSource + * @property {google.storagetransfer.v1.IAzureBlobStorageData|null} [azureBlobStorageDataSource] TransferSpec azureBlobStorageDataSource + * @property {google.storagetransfer.v1.IGcsData|null} [gcsIntermediateDataLocation] TransferSpec gcsIntermediateDataLocation + * @property {google.storagetransfer.v1.IObjectConditions|null} [objectConditions] TransferSpec objectConditions + * @property {google.storagetransfer.v1.ITransferOptions|null} [transferOptions] TransferSpec transferOptions + * @property {google.storagetransfer.v1.ITransferManifest|null} [transferManifest] TransferSpec transferManifest + * @property {string|null} [sourceAgentPoolName] TransferSpec sourceAgentPoolName + * @property {string|null} [sinkAgentPoolName] TransferSpec sinkAgentPoolName */ /** - * Constructs a new TransferOperation. + * Constructs a new TransferSpec. * @memberof google.storagetransfer.v1 - * @classdesc Represents a TransferOperation. - * @implements ITransferOperation + * @classdesc Represents a TransferSpec. + * @implements ITransferSpec * @constructor - * @param {google.storagetransfer.v1.ITransferOperation=} [properties] Properties to set + * @param {google.storagetransfer.v1.ITransferSpec=} [properties] Properties to set */ - function TransferOperation(properties) { - this.errorBreakdowns = []; + function TransferSpec(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7247,195 +6658,267 @@ } /** - * TransferOperation name. - * @member {string} name - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec gcsDataSink. + * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsDataSink + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.name = ""; + TransferSpec.prototype.gcsDataSink = null; /** - * TransferOperation projectId. - * @member {string} projectId - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec posixDataSink. + * @member {google.storagetransfer.v1.IPosixFilesystem|null|undefined} posixDataSink + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.projectId = ""; + TransferSpec.prototype.posixDataSink = null; /** - * TransferOperation transferSpec. - * @member {google.storagetransfer.v1.ITransferSpec|null|undefined} transferSpec - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec gcsDataSource. + * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsDataSource + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.transferSpec = null; + TransferSpec.prototype.gcsDataSource = null; /** - * TransferOperation notificationConfig. - * @member {google.storagetransfer.v1.INotificationConfig|null|undefined} notificationConfig - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec awsS3DataSource. + * @member {google.storagetransfer.v1.IAwsS3Data|null|undefined} awsS3DataSource + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.notificationConfig = null; + TransferSpec.prototype.awsS3DataSource = null; /** - * TransferOperation startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec httpDataSource. + * @member {google.storagetransfer.v1.IHttpData|null|undefined} httpDataSource + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.startTime = null; + TransferSpec.prototype.httpDataSource = null; /** - * TransferOperation endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec posixDataSource. + * @member {google.storagetransfer.v1.IPosixFilesystem|null|undefined} posixDataSource + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.endTime = null; + TransferSpec.prototype.posixDataSource = null; /** - * TransferOperation status. - * @member {google.storagetransfer.v1.TransferOperation.Status} status - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec azureBlobStorageDataSource. + * @member {google.storagetransfer.v1.IAzureBlobStorageData|null|undefined} azureBlobStorageDataSource + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.status = 0; + TransferSpec.prototype.azureBlobStorageDataSource = null; /** - * TransferOperation counters. - * @member {google.storagetransfer.v1.ITransferCounters|null|undefined} counters - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec gcsIntermediateDataLocation. + * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsIntermediateDataLocation + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.counters = null; + TransferSpec.prototype.gcsIntermediateDataLocation = null; /** - * TransferOperation errorBreakdowns. - * @member {Array.} errorBreakdowns - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec objectConditions. + * @member {google.storagetransfer.v1.IObjectConditions|null|undefined} objectConditions + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.errorBreakdowns = $util.emptyArray; + TransferSpec.prototype.objectConditions = null; /** - * TransferOperation transferJobName. - * @member {string} transferJobName - * @memberof google.storagetransfer.v1.TransferOperation + * TransferSpec transferOptions. + * @member {google.storagetransfer.v1.ITransferOptions|null|undefined} transferOptions + * @memberof google.storagetransfer.v1.TransferSpec * @instance */ - TransferOperation.prototype.transferJobName = ""; + TransferSpec.prototype.transferOptions = null; /** - * Creates a new TransferOperation instance using the specified properties. + * TransferSpec transferManifest. + * @member {google.storagetransfer.v1.ITransferManifest|null|undefined} transferManifest + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.transferManifest = null; + + /** + * TransferSpec sourceAgentPoolName. + * @member {string} sourceAgentPoolName + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.sourceAgentPoolName = ""; + + /** + * TransferSpec sinkAgentPoolName. + * @member {string} sinkAgentPoolName + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.sinkAgentPoolName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferSpec dataSink. + * @member {"gcsDataSink"|"posixDataSink"|undefined} dataSink + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + Object.defineProperty(TransferSpec.prototype, "dataSink", { + get: $util.oneOfGetter($oneOfFields = ["gcsDataSink", "posixDataSink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransferSpec dataSource. + * @member {"gcsDataSource"|"awsS3DataSource"|"httpDataSource"|"posixDataSource"|"azureBlobStorageDataSource"|undefined} dataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + Object.defineProperty(TransferSpec.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["gcsDataSource", "awsS3DataSource", "httpDataSource", "posixDataSource", "azureBlobStorageDataSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransferSpec intermediateDataLocation. + * @member {"gcsIntermediateDataLocation"|undefined} intermediateDataLocation + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + Object.defineProperty(TransferSpec.prototype, "intermediateDataLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsIntermediateDataLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferSpec instance using the specified properties. * @function create - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static - * @param {google.storagetransfer.v1.ITransferOperation=} [properties] Properties to set - * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation instance + * @param {google.storagetransfer.v1.ITransferSpec=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec instance */ - TransferOperation.create = function create(properties) { - return new TransferOperation(properties); + TransferSpec.create = function create(properties) { + return new TransferSpec(properties); }; /** - * Encodes the specified TransferOperation message. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * Encodes the specified TransferSpec message. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. * @function encode - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static - * @param {google.storagetransfer.v1.ITransferOperation} message TransferOperation message or plain object to encode + * @param {google.storagetransfer.v1.ITransferSpec} message TransferSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferOperation.encode = function encode(message, writer) { + TransferSpec.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.transferSpec != null && Object.hasOwnProperty.call(message, "transferSpec")) - $root.google.storagetransfer.v1.TransferSpec.encode(message.transferSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.status); - if (message.counters != null && Object.hasOwnProperty.call(message, "counters")) - $root.google.storagetransfer.v1.TransferCounters.encode(message.counters, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.errorBreakdowns != null && message.errorBreakdowns.length) - for (var i = 0; i < message.errorBreakdowns.length; ++i) - $root.google.storagetransfer.v1.ErrorSummary.encode(message.errorBreakdowns[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.transferJobName != null && Object.hasOwnProperty.call(message, "transferJobName")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.transferJobName); - if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) - $root.google.storagetransfer.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.gcsDataSource != null && Object.hasOwnProperty.call(message, "gcsDataSource")) + $root.google.storagetransfer.v1.GcsData.encode(message.gcsDataSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.awsS3DataSource != null && Object.hasOwnProperty.call(message, "awsS3DataSource")) + $root.google.storagetransfer.v1.AwsS3Data.encode(message.awsS3DataSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.httpDataSource != null && Object.hasOwnProperty.call(message, "httpDataSource")) + $root.google.storagetransfer.v1.HttpData.encode(message.httpDataSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcsDataSink != null && Object.hasOwnProperty.call(message, "gcsDataSink")) + $root.google.storagetransfer.v1.GcsData.encode(message.gcsDataSink, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.objectConditions != null && Object.hasOwnProperty.call(message, "objectConditions")) + $root.google.storagetransfer.v1.ObjectConditions.encode(message.objectConditions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.transferOptions != null && Object.hasOwnProperty.call(message, "transferOptions")) + $root.google.storagetransfer.v1.TransferOptions.encode(message.transferOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.azureBlobStorageDataSource != null && Object.hasOwnProperty.call(message, "azureBlobStorageDataSource")) + $root.google.storagetransfer.v1.AzureBlobStorageData.encode(message.azureBlobStorageDataSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.posixDataSink != null && Object.hasOwnProperty.call(message, "posixDataSink")) + $root.google.storagetransfer.v1.PosixFilesystem.encode(message.posixDataSink, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.posixDataSource != null && Object.hasOwnProperty.call(message, "posixDataSource")) + $root.google.storagetransfer.v1.PosixFilesystem.encode(message.posixDataSource, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.transferManifest != null && Object.hasOwnProperty.call(message, "transferManifest")) + $root.google.storagetransfer.v1.TransferManifest.encode(message.transferManifest, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.gcsIntermediateDataLocation != null && Object.hasOwnProperty.call(message, "gcsIntermediateDataLocation")) + $root.google.storagetransfer.v1.GcsData.encode(message.gcsIntermediateDataLocation, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.sourceAgentPoolName != null && Object.hasOwnProperty.call(message, "sourceAgentPoolName")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.sourceAgentPoolName); + if (message.sinkAgentPoolName != null && Object.hasOwnProperty.call(message, "sinkAgentPoolName")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.sinkAgentPoolName); return writer; }; /** - * Encodes the specified TransferOperation message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * Encodes the specified TransferSpec message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static - * @param {google.storagetransfer.v1.ITransferOperation} message TransferOperation message or plain object to encode + * @param {google.storagetransfer.v1.ITransferSpec} message TransferSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransferOperation.encodeDelimited = function encodeDelimited(message, writer) { + TransferSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TransferOperation message from the specified reader or buffer. + * Decodes a TransferSpec message from the specified reader or buffer. * @function decode - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferOperation.decode = function decode(reader, length) { + TransferSpec.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.storagetransfer.v1.TransferOperation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.gcsDataSink = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); + break; + case 13: + message.posixDataSink = $root.google.storagetransfer.v1.PosixFilesystem.decode(reader, reader.uint32()); + break; case 1: - message.name = reader.string(); + message.gcsDataSource = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); break; case 2: - message.projectId = reader.string(); + message.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.decode(reader, reader.uint32()); break; case 3: - message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.decode(reader, reader.uint32()); + message.httpDataSource = $root.google.storagetransfer.v1.HttpData.decode(reader, reader.uint32()); break; - case 10: - message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.decode(reader, reader.uint32()); + case 14: + message.posixDataSource = $root.google.storagetransfer.v1.PosixFilesystem.decode(reader, reader.uint32()); break; - case 4: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 8: + message.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.decode(reader, reader.uint32()); + break; + case 16: + message.gcsIntermediateDataLocation = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); break; case 5: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.decode(reader, reader.uint32()); break; case 6: - message.status = reader.int32(); + message.transferOptions = $root.google.storagetransfer.v1.TransferOptions.decode(reader, reader.uint32()); break; - case 7: - message.counters = $root.google.storagetransfer.v1.TransferCounters.decode(reader, reader.uint32()); + case 15: + message.transferManifest = $root.google.storagetransfer.v1.TransferManifest.decode(reader, reader.uint32()); break; - case 8: - if (!(message.errorBreakdowns && message.errorBreakdowns.length)) - message.errorBreakdowns = []; - message.errorBreakdowns.push($root.google.storagetransfer.v1.ErrorSummary.decode(reader, reader.uint32())); + case 17: + message.sourceAgentPoolName = reader.string(); break; - case 9: - message.transferJobName = reader.string(); + case 18: + message.sinkAgentPoolName = reader.string(); break; default: reader.skipType(tag & 7); @@ -7446,302 +6929,5405 @@ }; /** - * Decodes a TransferOperation message from the specified reader or buffer, length delimited. + * Decodes a TransferSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransferOperation.decodeDelimited = function decodeDelimited(reader) { + TransferSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TransferOperation message. + * Verifies a TransferSpec message. * @function verify - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TransferOperation.verify = function verify(message) { + TransferSpec.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.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) { - var error = $root.google.storagetransfer.v1.TransferSpec.verify(message.transferSpec); - if (error) - return "transferSpec." + error; + var properties = {}; + if (message.gcsDataSink != null && message.hasOwnProperty("gcsDataSink")) { + properties.dataSink = 1; + { + var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsDataSink); + if (error) + return "gcsDataSink." + error; + } } - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { - var error = $root.google.storagetransfer.v1.NotificationConfig.verify(message.notificationConfig); - if (error) - return "notificationConfig." + error; + if (message.posixDataSink != null && message.hasOwnProperty("posixDataSink")) { + if (properties.dataSink === 1) + return "dataSink: multiple values"; + properties.dataSink = 1; + { + var error = $root.google.storagetransfer.v1.PosixFilesystem.verify(message.posixDataSink); + if (error) + return "posixDataSink." + error; + } } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; + if (message.gcsDataSource != null && message.hasOwnProperty("gcsDataSource")) { + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsDataSource); + if (error) + return "gcsDataSource." + error; + } } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; + if (message.awsS3DataSource != null && message.hasOwnProperty("awsS3DataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.AwsS3Data.verify(message.awsS3DataSource); + if (error) + return "awsS3DataSource." + error; + } } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; + if (message.httpDataSource != null && message.hasOwnProperty("httpDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.HttpData.verify(message.httpDataSource); + if (error) + return "httpDataSource." + error; } - if (message.counters != null && message.hasOwnProperty("counters")) { - var error = $root.google.storagetransfer.v1.TransferCounters.verify(message.counters); - if (error) - return "counters." + error; } - if (message.errorBreakdowns != null && message.hasOwnProperty("errorBreakdowns")) { - if (!Array.isArray(message.errorBreakdowns)) - return "errorBreakdowns: array expected"; - for (var i = 0; i < message.errorBreakdowns.length; ++i) { - var error = $root.google.storagetransfer.v1.ErrorSummary.verify(message.errorBreakdowns[i]); + if (message.posixDataSource != null && message.hasOwnProperty("posixDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.PosixFilesystem.verify(message.posixDataSource); if (error) - return "errorBreakdowns." + error; + return "posixDataSource." + error; } } - if (message.transferJobName != null && message.hasOwnProperty("transferJobName")) - if (!$util.isString(message.transferJobName)) - return "transferJobName: string expected"; + if (message.azureBlobStorageDataSource != null && message.hasOwnProperty("azureBlobStorageDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.AzureBlobStorageData.verify(message.azureBlobStorageDataSource); + if (error) + return "azureBlobStorageDataSource." + error; + } + } + if (message.gcsIntermediateDataLocation != null && message.hasOwnProperty("gcsIntermediateDataLocation")) { + properties.intermediateDataLocation = 1; + { + var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsIntermediateDataLocation); + if (error) + return "gcsIntermediateDataLocation." + error; + } + } + if (message.objectConditions != null && message.hasOwnProperty("objectConditions")) { + var error = $root.google.storagetransfer.v1.ObjectConditions.verify(message.objectConditions); + if (error) + return "objectConditions." + error; + } + if (message.transferOptions != null && message.hasOwnProperty("transferOptions")) { + var error = $root.google.storagetransfer.v1.TransferOptions.verify(message.transferOptions); + if (error) + return "transferOptions." + error; + } + if (message.transferManifest != null && message.hasOwnProperty("transferManifest")) { + var error = $root.google.storagetransfer.v1.TransferManifest.verify(message.transferManifest); + if (error) + return "transferManifest." + error; + } + if (message.sourceAgentPoolName != null && message.hasOwnProperty("sourceAgentPoolName")) + if (!$util.isString(message.sourceAgentPoolName)) + return "sourceAgentPoolName: string expected"; + if (message.sinkAgentPoolName != null && message.hasOwnProperty("sinkAgentPoolName")) + if (!$util.isString(message.sinkAgentPoolName)) + return "sinkAgentPoolName: string expected"; return null; }; /** - * Creates a TransferOperation message from a plain object. Also converts values to their respective internal types. + * Creates a TransferSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static * @param {Object.} object Plain object - * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec */ - TransferOperation.fromObject = function fromObject(object) { - if (object instanceof $root.google.storagetransfer.v1.TransferOperation) + TransferSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferSpec) return object; - var message = new $root.google.storagetransfer.v1.TransferOperation(); - if (object.name != null) - message.name = String(object.name); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.transferSpec != null) { - if (typeof object.transferSpec !== "object") - throw TypeError(".google.storagetransfer.v1.TransferOperation.transferSpec: object expected"); - message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.fromObject(object.transferSpec); + var message = new $root.google.storagetransfer.v1.TransferSpec(); + if (object.gcsDataSink != null) { + if (typeof object.gcsDataSink !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsDataSink: object expected"); + message.gcsDataSink = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsDataSink); } - if (object.notificationConfig != null) { - if (typeof object.notificationConfig !== "object") - throw TypeError(".google.storagetransfer.v1.TransferOperation.notificationConfig: object expected"); - message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.fromObject(object.notificationConfig); + if (object.posixDataSink != null) { + if (typeof object.posixDataSink !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.posixDataSink: object expected"); + message.posixDataSink = $root.google.storagetransfer.v1.PosixFilesystem.fromObject(object.posixDataSink); } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.storagetransfer.v1.TransferOperation.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + if (object.gcsDataSource != null) { + if (typeof object.gcsDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsDataSource: object expected"); + message.gcsDataSource = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsDataSource); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.storagetransfer.v1.TransferOperation.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.awsS3DataSource != null) { + if (typeof object.awsS3DataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.awsS3DataSource: object expected"); + message.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.fromObject(object.awsS3DataSource); } - switch (object.status) { - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "IN_PROGRESS": - case 1: - message.status = 1; - break; - case "PAUSED": - case 2: - message.status = 2; - break; - case "SUCCESS": - case 3: - message.status = 3; - break; - case "FAILED": - case 4: - message.status = 4; - break; - case "ABORTED": - case 5: - message.status = 5; - break; - case "QUEUED": - case 6: - message.status = 6; - break; + if (object.httpDataSource != null) { + if (typeof object.httpDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.httpDataSource: object expected"); + message.httpDataSource = $root.google.storagetransfer.v1.HttpData.fromObject(object.httpDataSource); } - if (object.counters != null) { - if (typeof object.counters !== "object") - throw TypeError(".google.storagetransfer.v1.TransferOperation.counters: object expected"); - message.counters = $root.google.storagetransfer.v1.TransferCounters.fromObject(object.counters); + if (object.posixDataSource != null) { + if (typeof object.posixDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.posixDataSource: object expected"); + message.posixDataSource = $root.google.storagetransfer.v1.PosixFilesystem.fromObject(object.posixDataSource); } - if (object.errorBreakdowns) { - if (!Array.isArray(object.errorBreakdowns)) - throw TypeError(".google.storagetransfer.v1.TransferOperation.errorBreakdowns: array expected"); - message.errorBreakdowns = []; - for (var i = 0; i < object.errorBreakdowns.length; ++i) { - if (typeof object.errorBreakdowns[i] !== "object") - throw TypeError(".google.storagetransfer.v1.TransferOperation.errorBreakdowns: object expected"); - message.errorBreakdowns[i] = $root.google.storagetransfer.v1.ErrorSummary.fromObject(object.errorBreakdowns[i]); - } + if (object.azureBlobStorageDataSource != null) { + if (typeof object.azureBlobStorageDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.azureBlobStorageDataSource: object expected"); + message.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.fromObject(object.azureBlobStorageDataSource); } - if (object.transferJobName != null) - message.transferJobName = String(object.transferJobName); + if (object.gcsIntermediateDataLocation != null) { + if (typeof object.gcsIntermediateDataLocation !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsIntermediateDataLocation: object expected"); + message.gcsIntermediateDataLocation = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsIntermediateDataLocation); + } + if (object.objectConditions != null) { + if (typeof object.objectConditions !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.objectConditions: object expected"); + message.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.fromObject(object.objectConditions); + } + if (object.transferOptions != null) { + if (typeof object.transferOptions !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.transferOptions: object expected"); + message.transferOptions = $root.google.storagetransfer.v1.TransferOptions.fromObject(object.transferOptions); + } + if (object.transferManifest != null) { + if (typeof object.transferManifest !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.transferManifest: object expected"); + message.transferManifest = $root.google.storagetransfer.v1.TransferManifest.fromObject(object.transferManifest); + } + if (object.sourceAgentPoolName != null) + message.sourceAgentPoolName = String(object.sourceAgentPoolName); + if (object.sinkAgentPoolName != null) + message.sinkAgentPoolName = String(object.sinkAgentPoolName); return message; }; /** - * Creates a plain object from a TransferOperation message. Also converts values to other types if specified. + * Creates a plain object from a TransferSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @static - * @param {google.storagetransfer.v1.TransferOperation} message TransferOperation + * @param {google.storagetransfer.v1.TransferSpec} message TransferSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransferOperation.toObject = function toObject(message, options) { + TransferSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorBreakdowns = []; if (options.defaults) { - object.name = ""; - object.projectId = ""; - object.transferSpec = null; - object.startTime = null; - object.endTime = null; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.counters = null; - object.transferJobName = ""; - object.notificationConfig = null; + object.objectConditions = null; + object.transferOptions = null; + object.transferManifest = null; + object.sourceAgentPoolName = ""; + object.sinkAgentPoolName = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) - object.transferSpec = $root.google.storagetransfer.v1.TransferSpec.toObject(message.transferSpec, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.storagetransfer.v1.TransferOperation.Status[message.status] : message.status; - if (message.counters != null && message.hasOwnProperty("counters")) - object.counters = $root.google.storagetransfer.v1.TransferCounters.toObject(message.counters, options); - if (message.errorBreakdowns && message.errorBreakdowns.length) { - object.errorBreakdowns = []; - for (var j = 0; j < message.errorBreakdowns.length; ++j) - object.errorBreakdowns[j] = $root.google.storagetransfer.v1.ErrorSummary.toObject(message.errorBreakdowns[j], options); + if (message.gcsDataSource != null && message.hasOwnProperty("gcsDataSource")) { + object.gcsDataSource = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsDataSource, options); + if (options.oneofs) + object.dataSource = "gcsDataSource"; } - if (message.transferJobName != null && message.hasOwnProperty("transferJobName")) - object.transferJobName = message.transferJobName; - if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) - object.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.awsS3DataSource != null && message.hasOwnProperty("awsS3DataSource")) { + object.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.toObject(message.awsS3DataSource, options); + if (options.oneofs) + object.dataSource = "awsS3DataSource"; + } + if (message.httpDataSource != null && message.hasOwnProperty("httpDataSource")) { + object.httpDataSource = $root.google.storagetransfer.v1.HttpData.toObject(message.httpDataSource, options); + if (options.oneofs) + object.dataSource = "httpDataSource"; + } + if (message.gcsDataSink != null && message.hasOwnProperty("gcsDataSink")) { + object.gcsDataSink = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsDataSink, options); + if (options.oneofs) + object.dataSink = "gcsDataSink"; + } + if (message.objectConditions != null && message.hasOwnProperty("objectConditions")) + object.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.toObject(message.objectConditions, options); + if (message.transferOptions != null && message.hasOwnProperty("transferOptions")) + object.transferOptions = $root.google.storagetransfer.v1.TransferOptions.toObject(message.transferOptions, options); + if (message.azureBlobStorageDataSource != null && message.hasOwnProperty("azureBlobStorageDataSource")) { + object.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.toObject(message.azureBlobStorageDataSource, options); + if (options.oneofs) + object.dataSource = "azureBlobStorageDataSource"; + } + if (message.posixDataSink != null && message.hasOwnProperty("posixDataSink")) { + object.posixDataSink = $root.google.storagetransfer.v1.PosixFilesystem.toObject(message.posixDataSink, options); + if (options.oneofs) + object.dataSink = "posixDataSink"; + } + if (message.posixDataSource != null && message.hasOwnProperty("posixDataSource")) { + object.posixDataSource = $root.google.storagetransfer.v1.PosixFilesystem.toObject(message.posixDataSource, options); + if (options.oneofs) + object.dataSource = "posixDataSource"; + } + if (message.transferManifest != null && message.hasOwnProperty("transferManifest")) + object.transferManifest = $root.google.storagetransfer.v1.TransferManifest.toObject(message.transferManifest, options); + if (message.gcsIntermediateDataLocation != null && message.hasOwnProperty("gcsIntermediateDataLocation")) { + object.gcsIntermediateDataLocation = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsIntermediateDataLocation, options); + if (options.oneofs) + object.intermediateDataLocation = "gcsIntermediateDataLocation"; + } + if (message.sourceAgentPoolName != null && message.hasOwnProperty("sourceAgentPoolName")) + object.sourceAgentPoolName = message.sourceAgentPoolName; + if (message.sinkAgentPoolName != null && message.hasOwnProperty("sinkAgentPoolName")) + object.sinkAgentPoolName = message.sinkAgentPoolName; return object; }; /** - * Converts this TransferOperation to JSON. + * Converts this TransferSpec to JSON. * @function toJSON - * @memberof google.storagetransfer.v1.TransferOperation + * @memberof google.storagetransfer.v1.TransferSpec * @instance * @returns {Object.} JSON object */ - TransferOperation.prototype.toJSON = function toJSON() { + TransferSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + return TransferSpec; + })(); + + v1.MetadataOptions = (function() { + /** - * Status enum. - * @name google.storagetransfer.v1.TransferOperation.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} IN_PROGRESS=1 IN_PROGRESS value - * @property {number} PAUSED=2 PAUSED value - * @property {number} SUCCESS=3 SUCCESS value - * @property {number} FAILED=4 FAILED value - * @property {number} ABORTED=5 ABORTED value - * @property {number} QUEUED=6 QUEUED value + * Properties of a MetadataOptions. + * @memberof google.storagetransfer.v1 + * @interface IMetadataOptions + * @property {google.storagetransfer.v1.MetadataOptions.Symlink|null} [symlink] MetadataOptions symlink + * @property {google.storagetransfer.v1.MetadataOptions.Mode|null} [mode] MetadataOptions mode + * @property {google.storagetransfer.v1.MetadataOptions.GID|null} [gid] MetadataOptions gid + * @property {google.storagetransfer.v1.MetadataOptions.UID|null} [uid] MetadataOptions uid + * @property {google.storagetransfer.v1.MetadataOptions.Acl|null} [acl] MetadataOptions acl + * @property {google.storagetransfer.v1.MetadataOptions.StorageClass|null} [storageClass] MetadataOptions storageClass + * @property {google.storagetransfer.v1.MetadataOptions.TemporaryHold|null} [temporaryHold] MetadataOptions temporaryHold + * @property {google.storagetransfer.v1.MetadataOptions.KmsKey|null} [kmsKey] MetadataOptions kmsKey + * @property {google.storagetransfer.v1.MetadataOptions.TimeCreated|null} [timeCreated] MetadataOptions timeCreated */ - TransferOperation.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "IN_PROGRESS"] = 1; - values[valuesById[2] = "PAUSED"] = 2; - values[valuesById[3] = "SUCCESS"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "ABORTED"] = 5; - values[valuesById[6] = "QUEUED"] = 6; - return values; - })(); - return TransferOperation; - })(); + /** + * Constructs a new MetadataOptions. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a MetadataOptions. + * @implements IMetadataOptions + * @constructor + * @param {google.storagetransfer.v1.IMetadataOptions=} [properties] Properties to set + */ + function MetadataOptions(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]]; + } + + /** + * MetadataOptions symlink. + * @member {google.storagetransfer.v1.MetadataOptions.Symlink} symlink + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.symlink = 0; + + /** + * MetadataOptions mode. + * @member {google.storagetransfer.v1.MetadataOptions.Mode} mode + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.mode = 0; + + /** + * MetadataOptions gid. + * @member {google.storagetransfer.v1.MetadataOptions.GID} gid + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.gid = 0; + + /** + * MetadataOptions uid. + * @member {google.storagetransfer.v1.MetadataOptions.UID} uid + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.uid = 0; + + /** + * MetadataOptions acl. + * @member {google.storagetransfer.v1.MetadataOptions.Acl} acl + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.acl = 0; + + /** + * MetadataOptions storageClass. + * @member {google.storagetransfer.v1.MetadataOptions.StorageClass} storageClass + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.storageClass = 0; + + /** + * MetadataOptions temporaryHold. + * @member {google.storagetransfer.v1.MetadataOptions.TemporaryHold} temporaryHold + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.temporaryHold = 0; + + /** + * MetadataOptions kmsKey. + * @member {google.storagetransfer.v1.MetadataOptions.KmsKey} kmsKey + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.kmsKey = 0; + + /** + * MetadataOptions timeCreated. + * @member {google.storagetransfer.v1.MetadataOptions.TimeCreated} timeCreated + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.timeCreated = 0; + + /** + * Creates a new MetadataOptions instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.IMetadataOptions=} [properties] Properties to set + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions instance + */ + MetadataOptions.create = function create(properties) { + return new MetadataOptions(properties); + }; + + /** + * Encodes the specified MetadataOptions message. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.IMetadataOptions} message MetadataOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.symlink != null && Object.hasOwnProperty.call(message, "symlink")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.symlink); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mode); + if (message.gid != null && Object.hasOwnProperty.call(message, "gid")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.gid); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.uid); + if (message.acl != null && Object.hasOwnProperty.call(message, "acl")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.acl); + if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.storageClass); + if (message.temporaryHold != null && Object.hasOwnProperty.call(message, "temporaryHold")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.temporaryHold); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.kmsKey); + if (message.timeCreated != null && Object.hasOwnProperty.call(message, "timeCreated")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.timeCreated); + return writer; + }; + + /** + * Encodes the specified MetadataOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.IMetadataOptions} message MetadataOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataOptions.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.storagetransfer.v1.MetadataOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symlink = reader.int32(); + break; + case 2: + message.mode = reader.int32(); + break; + case 3: + message.gid = reader.int32(); + break; + case 4: + message.uid = reader.int32(); + break; + case 5: + message.acl = reader.int32(); + break; + case 6: + message.storageClass = reader.int32(); + break; + case 7: + message.temporaryHold = reader.int32(); + break; + case 8: + message.kmsKey = reader.int32(); + break; + case 9: + message.timeCreated = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataOptions message. + * @function verify + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.symlink != null && message.hasOwnProperty("symlink")) + switch (message.symlink) { + default: + return "symlink: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gid != null && message.hasOwnProperty("gid")) + switch (message.gid) { + default: + return "gid: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uid != null && message.hasOwnProperty("uid")) + switch (message.uid) { + default: + return "uid: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.acl != null && message.hasOwnProperty("acl")) + switch (message.acl) { + default: + return "acl: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + switch (message.storageClass) { + default: + return "storageClass: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.temporaryHold != null && message.hasOwnProperty("temporaryHold")) + switch (message.temporaryHold) { + default: + return "temporaryHold: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + switch (message.kmsKey) { + default: + return "kmsKey: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.timeCreated != null && message.hasOwnProperty("timeCreated")) + switch (message.timeCreated) { + default: + return "timeCreated: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a MetadataOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions + */ + MetadataOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.MetadataOptions) + return object; + var message = new $root.google.storagetransfer.v1.MetadataOptions(); + switch (object.symlink) { + case "SYMLINK_UNSPECIFIED": + case 0: + message.symlink = 0; + break; + case "SYMLINK_SKIP": + case 1: + message.symlink = 1; + break; + case "SYMLINK_PRESERVE": + case 2: + message.symlink = 2; + break; + } + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "MODE_SKIP": + case 1: + message.mode = 1; + break; + case "MODE_PRESERVE": + case 2: + message.mode = 2; + break; + } + switch (object.gid) { + case "GID_UNSPECIFIED": + case 0: + message.gid = 0; + break; + case "GID_SKIP": + case 1: + message.gid = 1; + break; + case "GID_NUMBER": + case 2: + message.gid = 2; + break; + } + switch (object.uid) { + case "UID_UNSPECIFIED": + case 0: + message.uid = 0; + break; + case "UID_SKIP": + case 1: + message.uid = 1; + break; + case "UID_NUMBER": + case 2: + message.uid = 2; + break; + } + switch (object.acl) { + case "ACL_UNSPECIFIED": + case 0: + message.acl = 0; + break; + case "ACL_DESTINATION_BUCKET_DEFAULT": + case 1: + message.acl = 1; + break; + case "ACL_PRESERVE": + case 2: + message.acl = 2; + break; + } + switch (object.storageClass) { + case "STORAGE_CLASS_UNSPECIFIED": + case 0: + message.storageClass = 0; + break; + case "STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT": + case 1: + message.storageClass = 1; + break; + case "STORAGE_CLASS_PRESERVE": + case 2: + message.storageClass = 2; + break; + case "STORAGE_CLASS_STANDARD": + case 3: + message.storageClass = 3; + break; + case "STORAGE_CLASS_NEARLINE": + case 4: + message.storageClass = 4; + break; + case "STORAGE_CLASS_COLDLINE": + case 5: + message.storageClass = 5; + break; + case "STORAGE_CLASS_ARCHIVE": + case 6: + message.storageClass = 6; + break; + } + switch (object.temporaryHold) { + case "TEMPORARY_HOLD_UNSPECIFIED": + case 0: + message.temporaryHold = 0; + break; + case "TEMPORARY_HOLD_SKIP": + case 1: + message.temporaryHold = 1; + break; + case "TEMPORARY_HOLD_PRESERVE": + case 2: + message.temporaryHold = 2; + break; + } + switch (object.kmsKey) { + case "KMS_KEY_UNSPECIFIED": + case 0: + message.kmsKey = 0; + break; + case "KMS_KEY_DESTINATION_BUCKET_DEFAULT": + case 1: + message.kmsKey = 1; + break; + case "KMS_KEY_PRESERVE": + case 2: + message.kmsKey = 2; + break; + } + switch (object.timeCreated) { + case "TIME_CREATED_UNSPECIFIED": + case 0: + message.timeCreated = 0; + break; + case "TIME_CREATED_SKIP": + case 1: + message.timeCreated = 1; + break; + case "TIME_CREATED_PRESERVE_AS_CUSTOM_TIME": + case 2: + message.timeCreated = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a MetadataOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.MetadataOptions} message MetadataOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.symlink = options.enums === String ? "SYMLINK_UNSPECIFIED" : 0; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.gid = options.enums === String ? "GID_UNSPECIFIED" : 0; + object.uid = options.enums === String ? "UID_UNSPECIFIED" : 0; + object.acl = options.enums === String ? "ACL_UNSPECIFIED" : 0; + object.storageClass = options.enums === String ? "STORAGE_CLASS_UNSPECIFIED" : 0; + object.temporaryHold = options.enums === String ? "TEMPORARY_HOLD_UNSPECIFIED" : 0; + object.kmsKey = options.enums === String ? "KMS_KEY_UNSPECIFIED" : 0; + object.timeCreated = options.enums === String ? "TIME_CREATED_UNSPECIFIED" : 0; + } + if (message.symlink != null && message.hasOwnProperty("symlink")) + object.symlink = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.Symlink[message.symlink] : message.symlink; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.Mode[message.mode] : message.mode; + if (message.gid != null && message.hasOwnProperty("gid")) + object.gid = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.GID[message.gid] : message.gid; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.UID[message.uid] : message.uid; + if (message.acl != null && message.hasOwnProperty("acl")) + object.acl = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.Acl[message.acl] : message.acl; + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + object.storageClass = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.StorageClass[message.storageClass] : message.storageClass; + if (message.temporaryHold != null && message.hasOwnProperty("temporaryHold")) + object.temporaryHold = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.TemporaryHold[message.temporaryHold] : message.temporaryHold; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.KmsKey[message.kmsKey] : message.kmsKey; + if (message.timeCreated != null && message.hasOwnProperty("timeCreated")) + object.timeCreated = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.TimeCreated[message.timeCreated] : message.timeCreated; + return object; + }; + + /** + * Converts this MetadataOptions to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + * @returns {Object.} JSON object + */ + MetadataOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Symlink enum. + * @name google.storagetransfer.v1.MetadataOptions.Symlink + * @enum {number} + * @property {number} SYMLINK_UNSPECIFIED=0 SYMLINK_UNSPECIFIED value + * @property {number} SYMLINK_SKIP=1 SYMLINK_SKIP value + * @property {number} SYMLINK_PRESERVE=2 SYMLINK_PRESERVE value + */ + MetadataOptions.Symlink = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SYMLINK_UNSPECIFIED"] = 0; + values[valuesById[1] = "SYMLINK_SKIP"] = 1; + values[valuesById[2] = "SYMLINK_PRESERVE"] = 2; + return values; + })(); + + /** + * Mode enum. + * @name google.storagetransfer.v1.MetadataOptions.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} MODE_SKIP=1 MODE_SKIP value + * @property {number} MODE_PRESERVE=2 MODE_PRESERVE value + */ + MetadataOptions.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODE_SKIP"] = 1; + values[valuesById[2] = "MODE_PRESERVE"] = 2; + return values; + })(); + + /** + * GID enum. + * @name google.storagetransfer.v1.MetadataOptions.GID + * @enum {number} + * @property {number} GID_UNSPECIFIED=0 GID_UNSPECIFIED value + * @property {number} GID_SKIP=1 GID_SKIP value + * @property {number} GID_NUMBER=2 GID_NUMBER value + */ + MetadataOptions.GID = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GID_UNSPECIFIED"] = 0; + values[valuesById[1] = "GID_SKIP"] = 1; + values[valuesById[2] = "GID_NUMBER"] = 2; + return values; + })(); + + /** + * UID enum. + * @name google.storagetransfer.v1.MetadataOptions.UID + * @enum {number} + * @property {number} UID_UNSPECIFIED=0 UID_UNSPECIFIED value + * @property {number} UID_SKIP=1 UID_SKIP value + * @property {number} UID_NUMBER=2 UID_NUMBER value + */ + MetadataOptions.UID = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UID_UNSPECIFIED"] = 0; + values[valuesById[1] = "UID_SKIP"] = 1; + values[valuesById[2] = "UID_NUMBER"] = 2; + return values; + })(); + + /** + * Acl enum. + * @name google.storagetransfer.v1.MetadataOptions.Acl + * @enum {number} + * @property {number} ACL_UNSPECIFIED=0 ACL_UNSPECIFIED value + * @property {number} ACL_DESTINATION_BUCKET_DEFAULT=1 ACL_DESTINATION_BUCKET_DEFAULT value + * @property {number} ACL_PRESERVE=2 ACL_PRESERVE value + */ + MetadataOptions.Acl = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACL_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACL_DESTINATION_BUCKET_DEFAULT"] = 1; + values[valuesById[2] = "ACL_PRESERVE"] = 2; + return values; + })(); + + /** + * StorageClass enum. + * @name google.storagetransfer.v1.MetadataOptions.StorageClass + * @enum {number} + * @property {number} STORAGE_CLASS_UNSPECIFIED=0 STORAGE_CLASS_UNSPECIFIED value + * @property {number} STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT=1 STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT value + * @property {number} STORAGE_CLASS_PRESERVE=2 STORAGE_CLASS_PRESERVE value + * @property {number} STORAGE_CLASS_STANDARD=3 STORAGE_CLASS_STANDARD value + * @property {number} STORAGE_CLASS_NEARLINE=4 STORAGE_CLASS_NEARLINE value + * @property {number} STORAGE_CLASS_COLDLINE=5 STORAGE_CLASS_COLDLINE value + * @property {number} STORAGE_CLASS_ARCHIVE=6 STORAGE_CLASS_ARCHIVE value + */ + MetadataOptions.StorageClass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORAGE_CLASS_UNSPECIFIED"] = 0; + values[valuesById[1] = "STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT"] = 1; + values[valuesById[2] = "STORAGE_CLASS_PRESERVE"] = 2; + values[valuesById[3] = "STORAGE_CLASS_STANDARD"] = 3; + values[valuesById[4] = "STORAGE_CLASS_NEARLINE"] = 4; + values[valuesById[5] = "STORAGE_CLASS_COLDLINE"] = 5; + values[valuesById[6] = "STORAGE_CLASS_ARCHIVE"] = 6; + return values; + })(); + + /** + * TemporaryHold enum. + * @name google.storagetransfer.v1.MetadataOptions.TemporaryHold + * @enum {number} + * @property {number} TEMPORARY_HOLD_UNSPECIFIED=0 TEMPORARY_HOLD_UNSPECIFIED value + * @property {number} TEMPORARY_HOLD_SKIP=1 TEMPORARY_HOLD_SKIP value + * @property {number} TEMPORARY_HOLD_PRESERVE=2 TEMPORARY_HOLD_PRESERVE value + */ + MetadataOptions.TemporaryHold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEMPORARY_HOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEMPORARY_HOLD_SKIP"] = 1; + values[valuesById[2] = "TEMPORARY_HOLD_PRESERVE"] = 2; + return values; + })(); + + /** + * KmsKey enum. + * @name google.storagetransfer.v1.MetadataOptions.KmsKey + * @enum {number} + * @property {number} KMS_KEY_UNSPECIFIED=0 KMS_KEY_UNSPECIFIED value + * @property {number} KMS_KEY_DESTINATION_BUCKET_DEFAULT=1 KMS_KEY_DESTINATION_BUCKET_DEFAULT value + * @property {number} KMS_KEY_PRESERVE=2 KMS_KEY_PRESERVE value + */ + MetadataOptions.KmsKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KMS_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "KMS_KEY_DESTINATION_BUCKET_DEFAULT"] = 1; + values[valuesById[2] = "KMS_KEY_PRESERVE"] = 2; + return values; + })(); + + /** + * TimeCreated enum. + * @name google.storagetransfer.v1.MetadataOptions.TimeCreated + * @enum {number} + * @property {number} TIME_CREATED_UNSPECIFIED=0 TIME_CREATED_UNSPECIFIED value + * @property {number} TIME_CREATED_SKIP=1 TIME_CREATED_SKIP value + * @property {number} TIME_CREATED_PRESERVE_AS_CUSTOM_TIME=2 TIME_CREATED_PRESERVE_AS_CUSTOM_TIME value + */ + MetadataOptions.TimeCreated = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIME_CREATED_UNSPECIFIED"] = 0; + values[valuesById[1] = "TIME_CREATED_SKIP"] = 1; + values[valuesById[2] = "TIME_CREATED_PRESERVE_AS_CUSTOM_TIME"] = 2; + return values; + })(); + + return MetadataOptions; + })(); + + v1.TransferManifest = (function() { + + /** + * Properties of a TransferManifest. + * @memberof google.storagetransfer.v1 + * @interface ITransferManifest + * @property {string|null} [location] TransferManifest location + */ + + /** + * Constructs a new TransferManifest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferManifest. + * @implements ITransferManifest + * @constructor + * @param {google.storagetransfer.v1.ITransferManifest=} [properties] Properties to set + */ + function TransferManifest(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]]; + } + + /** + * TransferManifest location. + * @member {string} location + * @memberof google.storagetransfer.v1.TransferManifest + * @instance + */ + TransferManifest.prototype.location = ""; + + /** + * Creates a new TransferManifest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.ITransferManifest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest instance + */ + TransferManifest.create = function create(properties) { + return new TransferManifest(properties); + }; + + /** + * Encodes the specified TransferManifest message. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.ITransferManifest} message TransferManifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferManifest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + return writer; + }; + + /** + * Encodes the specified TransferManifest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.ITransferManifest} message TransferManifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferManifest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferManifest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferManifest.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.storagetransfer.v1.TransferManifest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferManifest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferManifest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferManifest message. + * @function verify + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferManifest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a TransferManifest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest + */ + TransferManifest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferManifest) + return object; + var message = new $root.google.storagetransfer.v1.TransferManifest(); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a TransferManifest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.TransferManifest} message TransferManifest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferManifest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this TransferManifest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferManifest + * @instance + * @returns {Object.} JSON object + */ + TransferManifest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TransferManifest; + })(); + + v1.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.storagetransfer.v1 + * @interface ISchedule + * @property {google.type.IDate|null} [scheduleStartDate] Schedule scheduleStartDate + * @property {google.type.IDate|null} [scheduleEndDate] Schedule scheduleEndDate + * @property {google.type.ITimeOfDay|null} [startTimeOfDay] Schedule startTimeOfDay + * @property {google.type.ITimeOfDay|null} [endTimeOfDay] Schedule endTimeOfDay + * @property {google.protobuf.IDuration|null} [repeatInterval] Schedule repeatInterval + */ + + /** + * Constructs a new Schedule. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.storagetransfer.v1.ISchedule=} [properties] Properties to set + */ + function Schedule(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]]; + } + + /** + * Schedule scheduleStartDate. + * @member {google.type.IDate|null|undefined} scheduleStartDate + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.scheduleStartDate = null; + + /** + * Schedule scheduleEndDate. + * @member {google.type.IDate|null|undefined} scheduleEndDate + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.scheduleEndDate = null; + + /** + * Schedule startTimeOfDay. + * @member {google.type.ITimeOfDay|null|undefined} startTimeOfDay + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.startTimeOfDay = null; + + /** + * Schedule endTimeOfDay. + * @member {google.type.ITimeOfDay|null|undefined} endTimeOfDay + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.endTimeOfDay = null; + + /** + * Schedule repeatInterval. + * @member {google.protobuf.IDuration|null|undefined} repeatInterval + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.repeatInterval = null; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.ISchedule=} [properties] Properties to set + * @returns {google.storagetransfer.v1.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduleStartDate != null && Object.hasOwnProperty.call(message, "scheduleStartDate")) + $root.google.type.Date.encode(message.scheduleStartDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.scheduleEndDate != null && Object.hasOwnProperty.call(message, "scheduleEndDate")) + $root.google.type.Date.encode(message.scheduleEndDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTimeOfDay != null && Object.hasOwnProperty.call(message, "startTimeOfDay")) + $root.google.type.TimeOfDay.encode(message.startTimeOfDay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTimeOfDay != null && Object.hasOwnProperty.call(message, "endTimeOfDay")) + $root.google.type.TimeOfDay.encode(message.endTimeOfDay, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.repeatInterval != null && Object.hasOwnProperty.call(message, "repeatInterval")) + $root.google.protobuf.Duration.encode(message.repeatInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.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.storagetransfer.v1.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scheduleStartDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 2: + message.scheduleEndDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + case 3: + message.startTimeOfDay = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + case 4: + message.endTimeOfDay = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + case 5: + message.repeatInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduleStartDate != null && message.hasOwnProperty("scheduleStartDate")) { + var error = $root.google.type.Date.verify(message.scheduleStartDate); + if (error) + return "scheduleStartDate." + error; + } + if (message.scheduleEndDate != null && message.hasOwnProperty("scheduleEndDate")) { + var error = $root.google.type.Date.verify(message.scheduleEndDate); + if (error) + return "scheduleEndDate." + error; + } + if (message.startTimeOfDay != null && message.hasOwnProperty("startTimeOfDay")) { + var error = $root.google.type.TimeOfDay.verify(message.startTimeOfDay); + if (error) + return "startTimeOfDay." + error; + } + if (message.endTimeOfDay != null && message.hasOwnProperty("endTimeOfDay")) { + var error = $root.google.type.TimeOfDay.verify(message.endTimeOfDay); + if (error) + return "endTimeOfDay." + error; + } + if (message.repeatInterval != null && message.hasOwnProperty("repeatInterval")) { + var error = $root.google.protobuf.Duration.verify(message.repeatInterval); + if (error) + return "repeatInterval." + error; + } + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.Schedule) + return object; + var message = new $root.google.storagetransfer.v1.Schedule(); + if (object.scheduleStartDate != null) { + if (typeof object.scheduleStartDate !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.scheduleStartDate: object expected"); + message.scheduleStartDate = $root.google.type.Date.fromObject(object.scheduleStartDate); + } + if (object.scheduleEndDate != null) { + if (typeof object.scheduleEndDate !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.scheduleEndDate: object expected"); + message.scheduleEndDate = $root.google.type.Date.fromObject(object.scheduleEndDate); + } + if (object.startTimeOfDay != null) { + if (typeof object.startTimeOfDay !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.startTimeOfDay: object expected"); + message.startTimeOfDay = $root.google.type.TimeOfDay.fromObject(object.startTimeOfDay); + } + if (object.endTimeOfDay != null) { + if (typeof object.endTimeOfDay !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.endTimeOfDay: object expected"); + message.endTimeOfDay = $root.google.type.TimeOfDay.fromObject(object.endTimeOfDay); + } + if (object.repeatInterval != null) { + if (typeof object.repeatInterval !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.repeatInterval: object expected"); + message.repeatInterval = $root.google.protobuf.Duration.fromObject(object.repeatInterval); + } + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.Schedule} message Schedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduleStartDate = null; + object.scheduleEndDate = null; + object.startTimeOfDay = null; + object.endTimeOfDay = null; + object.repeatInterval = null; + } + if (message.scheduleStartDate != null && message.hasOwnProperty("scheduleStartDate")) + object.scheduleStartDate = $root.google.type.Date.toObject(message.scheduleStartDate, options); + if (message.scheduleEndDate != null && message.hasOwnProperty("scheduleEndDate")) + object.scheduleEndDate = $root.google.type.Date.toObject(message.scheduleEndDate, options); + if (message.startTimeOfDay != null && message.hasOwnProperty("startTimeOfDay")) + object.startTimeOfDay = $root.google.type.TimeOfDay.toObject(message.startTimeOfDay, options); + if (message.endTimeOfDay != null && message.hasOwnProperty("endTimeOfDay")) + object.endTimeOfDay = $root.google.type.TimeOfDay.toObject(message.endTimeOfDay, options); + if (message.repeatInterval != null && message.hasOwnProperty("repeatInterval")) + object.repeatInterval = $root.google.protobuf.Duration.toObject(message.repeatInterval, options); + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Schedule; + })(); + + v1.TransferJob = (function() { + + /** + * Properties of a TransferJob. + * @memberof google.storagetransfer.v1 + * @interface ITransferJob + * @property {string|null} [name] TransferJob name + * @property {string|null} [description] TransferJob description + * @property {string|null} [projectId] TransferJob projectId + * @property {google.storagetransfer.v1.ITransferSpec|null} [transferSpec] TransferJob transferSpec + * @property {google.storagetransfer.v1.INotificationConfig|null} [notificationConfig] TransferJob notificationConfig + * @property {google.storagetransfer.v1.ILoggingConfig|null} [loggingConfig] TransferJob loggingConfig + * @property {google.storagetransfer.v1.ISchedule|null} [schedule] TransferJob schedule + * @property {google.storagetransfer.v1.TransferJob.Status|null} [status] TransferJob status + * @property {google.protobuf.ITimestamp|null} [creationTime] TransferJob creationTime + * @property {google.protobuf.ITimestamp|null} [lastModificationTime] TransferJob lastModificationTime + * @property {google.protobuf.ITimestamp|null} [deletionTime] TransferJob deletionTime + * @property {string|null} [latestOperationName] TransferJob latestOperationName + */ + + /** + * Constructs a new TransferJob. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferJob. + * @implements ITransferJob + * @constructor + * @param {google.storagetransfer.v1.ITransferJob=} [properties] Properties to set + */ + function TransferJob(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]]; + } + + /** + * TransferJob name. + * @member {string} name + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.name = ""; + + /** + * TransferJob description. + * @member {string} description + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.description = ""; + + /** + * TransferJob projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.projectId = ""; + + /** + * TransferJob transferSpec. + * @member {google.storagetransfer.v1.ITransferSpec|null|undefined} transferSpec + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.transferSpec = null; + + /** + * TransferJob notificationConfig. + * @member {google.storagetransfer.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.notificationConfig = null; + + /** + * TransferJob loggingConfig. + * @member {google.storagetransfer.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.loggingConfig = null; + + /** + * TransferJob schedule. + * @member {google.storagetransfer.v1.ISchedule|null|undefined} schedule + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.schedule = null; + + /** + * TransferJob status. + * @member {google.storagetransfer.v1.TransferJob.Status} status + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.status = 0; + + /** + * TransferJob creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.creationTime = null; + + /** + * TransferJob lastModificationTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastModificationTime + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.lastModificationTime = null; + + /** + * TransferJob deletionTime. + * @member {google.protobuf.ITimestamp|null|undefined} deletionTime + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.deletionTime = null; + + /** + * TransferJob latestOperationName. + * @member {string} latestOperationName + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.latestOperationName = ""; + + /** + * Creates a new TransferJob instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.ITransferJob=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferJob} TransferJob instance + */ + TransferJob.create = function create(properties) { + return new TransferJob(properties); + }; + + /** + * Encodes the specified TransferJob message. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.ITransferJob} message TransferJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferJob.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); + if (message.transferSpec != null && Object.hasOwnProperty.call(message, "transferSpec")) + $root.google.storagetransfer.v1.TransferSpec.encode(message.transferSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.storagetransfer.v1.Schedule.encode(message.schedule, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.status); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.lastModificationTime != null && Object.hasOwnProperty.call(message, "lastModificationTime")) + $root.google.protobuf.Timestamp.encode(message.lastModificationTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deletionTime != null && Object.hasOwnProperty.call(message, "deletionTime")) + $root.google.protobuf.Timestamp.encode(message.deletionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.storagetransfer.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.latestOperationName != null && Object.hasOwnProperty.call(message, "latestOperationName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.latestOperationName); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.storagetransfer.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferJob message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.ITransferJob} message TransferJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferJob message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferJob} TransferJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferJob.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.storagetransfer.v1.TransferJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.projectId = reader.string(); + break; + case 4: + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.decode(reader, reader.uint32()); + break; + case 11: + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + case 14: + message.loggingConfig = $root.google.storagetransfer.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + case 5: + message.schedule = $root.google.storagetransfer.v1.Schedule.decode(reader, reader.uint32()); + break; + case 6: + message.status = reader.int32(); + break; + case 7: + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.lastModificationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.deletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 12: + message.latestOperationName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferJob} TransferJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferJob message. + * @function verify + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferJob.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) { + var error = $root.google.storagetransfer.v1.TransferSpec.verify(message.transferSpec); + if (error) + return "transferSpec." + error; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.storagetransfer.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.storagetransfer.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.storagetransfer.v1.Schedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.creationTime != null && message.hasOwnProperty("creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime); + if (error) + return "creationTime." + error; + } + if (message.lastModificationTime != null && message.hasOwnProperty("lastModificationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastModificationTime); + if (error) + return "lastModificationTime." + error; + } + if (message.deletionTime != null && message.hasOwnProperty("deletionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deletionTime); + if (error) + return "deletionTime." + error; + } + if (message.latestOperationName != null && message.hasOwnProperty("latestOperationName")) + if (!$util.isString(message.latestOperationName)) + return "latestOperationName: string expected"; + return null; + }; + + /** + * Creates a TransferJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferJob} TransferJob + */ + TransferJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferJob) + return object; + var message = new $root.google.storagetransfer.v1.TransferJob(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.transferSpec != null) { + if (typeof object.transferSpec !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.transferSpec: object expected"); + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.fromObject(object.transferSpec); + } + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.notificationConfig: object expected"); + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.storagetransfer.v1.LoggingConfig.fromObject(object.loggingConfig); + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.schedule: object expected"); + message.schedule = $root.google.storagetransfer.v1.Schedule.fromObject(object.schedule); + } + switch (object.status) { + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "ENABLED": + case 1: + message.status = 1; + break; + case "DISABLED": + case 2: + message.status = 2; + break; + case "DELETED": + case 3: + message.status = 3; + break; + } + if (object.creationTime != null) { + if (typeof object.creationTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime); + } + if (object.lastModificationTime != null) { + if (typeof object.lastModificationTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.lastModificationTime: object expected"); + message.lastModificationTime = $root.google.protobuf.Timestamp.fromObject(object.lastModificationTime); + } + if (object.deletionTime != null) { + if (typeof object.deletionTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.deletionTime: object expected"); + message.deletionTime = $root.google.protobuf.Timestamp.fromObject(object.deletionTime); + } + if (object.latestOperationName != null) + message.latestOperationName = String(object.latestOperationName); + return message; + }; + + /** + * Creates a plain object from a TransferJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.TransferJob} message TransferJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.projectId = ""; + object.transferSpec = null; + object.schedule = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.creationTime = null; + object.lastModificationTime = null; + object.deletionTime = null; + object.notificationConfig = null; + object.latestOperationName = ""; + object.loggingConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) + object.transferSpec = $root.google.storagetransfer.v1.TransferSpec.toObject(message.transferSpec, options); + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.storagetransfer.v1.Schedule.toObject(message.schedule, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.storagetransfer.v1.TransferJob.Status[message.status] : message.status; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); + if (message.lastModificationTime != null && message.hasOwnProperty("lastModificationTime")) + object.lastModificationTime = $root.google.protobuf.Timestamp.toObject(message.lastModificationTime, options); + if (message.deletionTime != null && message.hasOwnProperty("deletionTime")) + object.deletionTime = $root.google.protobuf.Timestamp.toObject(message.deletionTime, options); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.latestOperationName != null && message.hasOwnProperty("latestOperationName")) + object.latestOperationName = message.latestOperationName; + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.storagetransfer.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this TransferJob to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferJob + * @instance + * @returns {Object.} JSON object + */ + TransferJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.storagetransfer.v1.TransferJob.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} DELETED=3 DELETED value + */ + TransferJob.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "DELETED"] = 3; + return values; + })(); + + return TransferJob; + })(); + + v1.ErrorLogEntry = (function() { + + /** + * Properties of an ErrorLogEntry. + * @memberof google.storagetransfer.v1 + * @interface IErrorLogEntry + * @property {string|null} [url] ErrorLogEntry url + * @property {Array.|null} [errorDetails] ErrorLogEntry errorDetails + */ + + /** + * Constructs a new ErrorLogEntry. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an ErrorLogEntry. + * @implements IErrorLogEntry + * @constructor + * @param {google.storagetransfer.v1.IErrorLogEntry=} [properties] Properties to set + */ + function ErrorLogEntry(properties) { + this.errorDetails = []; + 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]]; + } + + /** + * ErrorLogEntry url. + * @member {string} url + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @instance + */ + ErrorLogEntry.prototype.url = ""; + + /** + * ErrorLogEntry errorDetails. + * @member {Array.} errorDetails + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @instance + */ + ErrorLogEntry.prototype.errorDetails = $util.emptyArray; + + /** + * Creates a new ErrorLogEntry instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.IErrorLogEntry=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry instance + */ + ErrorLogEntry.create = function create(properties) { + return new ErrorLogEntry(properties); + }; + + /** + * Encodes the specified ErrorLogEntry message. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.IErrorLogEntry} message ErrorLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorLogEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.errorDetails != null && message.errorDetails.length) + for (var i = 0; i < message.errorDetails.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorDetails[i]); + return writer; + }; + + /** + * Encodes the specified ErrorLogEntry message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.IErrorLogEntry} message ErrorLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorLogEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorLogEntry message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorLogEntry.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.storagetransfer.v1.ErrorLogEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 3: + if (!(message.errorDetails && message.errorDetails.length)) + message.errorDetails = []; + message.errorDetails.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorLogEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorLogEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorLogEntry message. + * @function verify + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorLogEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.errorDetails != null && message.hasOwnProperty("errorDetails")) { + if (!Array.isArray(message.errorDetails)) + return "errorDetails: array expected"; + for (var i = 0; i < message.errorDetails.length; ++i) + if (!$util.isString(message.errorDetails[i])) + return "errorDetails: string[] expected"; + } + return null; + }; + + /** + * Creates an ErrorLogEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + */ + ErrorLogEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ErrorLogEntry) + return object; + var message = new $root.google.storagetransfer.v1.ErrorLogEntry(); + if (object.url != null) + message.url = String(object.url); + if (object.errorDetails) { + if (!Array.isArray(object.errorDetails)) + throw TypeError(".google.storagetransfer.v1.ErrorLogEntry.errorDetails: array expected"); + message.errorDetails = []; + for (var i = 0; i < object.errorDetails.length; ++i) + message.errorDetails[i] = String(object.errorDetails[i]); + } + return message; + }; + + /** + * Creates a plain object from an ErrorLogEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.ErrorLogEntry} message ErrorLogEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorLogEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorDetails = []; + if (options.defaults) + object.url = ""; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.errorDetails && message.errorDetails.length) { + object.errorDetails = []; + for (var j = 0; j < message.errorDetails.length; ++j) + object.errorDetails[j] = message.errorDetails[j]; + } + return object; + }; + + /** + * Converts this ErrorLogEntry to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @instance + * @returns {Object.} JSON object + */ + ErrorLogEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ErrorLogEntry; + })(); + + v1.ErrorSummary = (function() { + + /** + * Properties of an ErrorSummary. + * @memberof google.storagetransfer.v1 + * @interface IErrorSummary + * @property {google.rpc.Code|null} [errorCode] ErrorSummary errorCode + * @property {number|Long|null} [errorCount] ErrorSummary errorCount + * @property {Array.|null} [errorLogEntries] ErrorSummary errorLogEntries + */ + + /** + * Constructs a new ErrorSummary. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an ErrorSummary. + * @implements IErrorSummary + * @constructor + * @param {google.storagetransfer.v1.IErrorSummary=} [properties] Properties to set + */ + function ErrorSummary(properties) { + this.errorLogEntries = []; + 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]]; + } + + /** + * ErrorSummary errorCode. + * @member {google.rpc.Code} errorCode + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + */ + ErrorSummary.prototype.errorCode = 0; + + /** + * ErrorSummary errorCount. + * @member {number|Long} errorCount + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + */ + ErrorSummary.prototype.errorCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ErrorSummary errorLogEntries. + * @member {Array.} errorLogEntries + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + */ + ErrorSummary.prototype.errorLogEntries = $util.emptyArray; + + /** + * Creates a new ErrorSummary instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.IErrorSummary=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary instance + */ + ErrorSummary.create = function create(properties) { + return new ErrorSummary(properties); + }; + + /** + * Encodes the specified ErrorSummary message. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.IErrorSummary} message ErrorSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorCode); + if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.errorCount); + if (message.errorLogEntries != null && message.errorLogEntries.length) + for (var i = 0; i < message.errorLogEntries.length; ++i) + $root.google.storagetransfer.v1.ErrorLogEntry.encode(message.errorLogEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ErrorSummary message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.IErrorSummary} message ErrorSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorSummary message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorSummary.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.storagetransfer.v1.ErrorSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errorCode = reader.int32(); + break; + case 2: + message.errorCount = reader.int64(); + break; + case 3: + if (!(message.errorLogEntries && message.errorLogEntries.length)) + message.errorLogEntries = []; + message.errorLogEntries.push($root.google.storagetransfer.v1.ErrorLogEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorSummary message. + * @function verify + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (!$util.isInteger(message.errorCount) && !(message.errorCount && $util.isInteger(message.errorCount.low) && $util.isInteger(message.errorCount.high))) + return "errorCount: integer|Long expected"; + if (message.errorLogEntries != null && message.hasOwnProperty("errorLogEntries")) { + if (!Array.isArray(message.errorLogEntries)) + return "errorLogEntries: array expected"; + for (var i = 0; i < message.errorLogEntries.length; ++i) { + var error = $root.google.storagetransfer.v1.ErrorLogEntry.verify(message.errorLogEntries[i]); + if (error) + return "errorLogEntries." + error; + } + } + return null; + }; + + /** + * Creates an ErrorSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + */ + ErrorSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ErrorSummary) + return object; + var message = new $root.google.storagetransfer.v1.ErrorSummary(); + switch (object.errorCode) { + case "OK": + case 0: + message.errorCode = 0; + break; + case "CANCELLED": + case 1: + message.errorCode = 1; + break; + case "UNKNOWN": + case 2: + message.errorCode = 2; + break; + case "INVALID_ARGUMENT": + case 3: + message.errorCode = 3; + break; + case "DEADLINE_EXCEEDED": + case 4: + message.errorCode = 4; + break; + case "NOT_FOUND": + case 5: + message.errorCode = 5; + break; + case "ALREADY_EXISTS": + case 6: + message.errorCode = 6; + break; + case "PERMISSION_DENIED": + case 7: + message.errorCode = 7; + break; + case "UNAUTHENTICATED": + case 16: + message.errorCode = 16; + break; + case "RESOURCE_EXHAUSTED": + case 8: + message.errorCode = 8; + break; + case "FAILED_PRECONDITION": + case 9: + message.errorCode = 9; + break; + case "ABORTED": + case 10: + message.errorCode = 10; + break; + case "OUT_OF_RANGE": + case 11: + message.errorCode = 11; + break; + case "UNIMPLEMENTED": + case 12: + message.errorCode = 12; + break; + case "INTERNAL": + case 13: + message.errorCode = 13; + break; + case "UNAVAILABLE": + case 14: + message.errorCode = 14; + break; + case "DATA_LOSS": + case 15: + message.errorCode = 15; + break; + } + if (object.errorCount != null) + if ($util.Long) + (message.errorCount = $util.Long.fromValue(object.errorCount)).unsigned = false; + else if (typeof object.errorCount === "string") + message.errorCount = parseInt(object.errorCount, 10); + else if (typeof object.errorCount === "number") + message.errorCount = object.errorCount; + else if (typeof object.errorCount === "object") + message.errorCount = new $util.LongBits(object.errorCount.low >>> 0, object.errorCount.high >>> 0).toNumber(); + if (object.errorLogEntries) { + if (!Array.isArray(object.errorLogEntries)) + throw TypeError(".google.storagetransfer.v1.ErrorSummary.errorLogEntries: array expected"); + message.errorLogEntries = []; + for (var i = 0; i < object.errorLogEntries.length; ++i) { + if (typeof object.errorLogEntries[i] !== "object") + throw TypeError(".google.storagetransfer.v1.ErrorSummary.errorLogEntries: object expected"); + message.errorLogEntries[i] = $root.google.storagetransfer.v1.ErrorLogEntry.fromObject(object.errorLogEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ErrorSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.ErrorSummary} message ErrorSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorLogEntries = []; + if (options.defaults) { + object.errorCode = options.enums === String ? "OK" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.errorCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.errorCount = options.longs === String ? "0" : 0; + } + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.google.rpc.Code[message.errorCode] : message.errorCode; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (typeof message.errorCount === "number") + object.errorCount = options.longs === String ? String(message.errorCount) : message.errorCount; + else + object.errorCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorCount) : options.longs === Number ? new $util.LongBits(message.errorCount.low >>> 0, message.errorCount.high >>> 0).toNumber() : message.errorCount; + if (message.errorLogEntries && message.errorLogEntries.length) { + object.errorLogEntries = []; + for (var j = 0; j < message.errorLogEntries.length; ++j) + object.errorLogEntries[j] = $root.google.storagetransfer.v1.ErrorLogEntry.toObject(message.errorLogEntries[j], options); + } + return object; + }; + + /** + * Converts this ErrorSummary to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + * @returns {Object.} JSON object + */ + ErrorSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ErrorSummary; + })(); + + v1.TransferCounters = (function() { + + /** + * Properties of a TransferCounters. + * @memberof google.storagetransfer.v1 + * @interface ITransferCounters + * @property {number|Long|null} [objectsFoundFromSource] TransferCounters objectsFoundFromSource + * @property {number|Long|null} [bytesFoundFromSource] TransferCounters bytesFoundFromSource + * @property {number|Long|null} [objectsFoundOnlyFromSink] TransferCounters objectsFoundOnlyFromSink + * @property {number|Long|null} [bytesFoundOnlyFromSink] TransferCounters bytesFoundOnlyFromSink + * @property {number|Long|null} [objectsFromSourceSkippedBySync] TransferCounters objectsFromSourceSkippedBySync + * @property {number|Long|null} [bytesFromSourceSkippedBySync] TransferCounters bytesFromSourceSkippedBySync + * @property {number|Long|null} [objectsCopiedToSink] TransferCounters objectsCopiedToSink + * @property {number|Long|null} [bytesCopiedToSink] TransferCounters bytesCopiedToSink + * @property {number|Long|null} [objectsDeletedFromSource] TransferCounters objectsDeletedFromSource + * @property {number|Long|null} [bytesDeletedFromSource] TransferCounters bytesDeletedFromSource + * @property {number|Long|null} [objectsDeletedFromSink] TransferCounters objectsDeletedFromSink + * @property {number|Long|null} [bytesDeletedFromSink] TransferCounters bytesDeletedFromSink + * @property {number|Long|null} [objectsFromSourceFailed] TransferCounters objectsFromSourceFailed + * @property {number|Long|null} [bytesFromSourceFailed] TransferCounters bytesFromSourceFailed + * @property {number|Long|null} [objectsFailedToDeleteFromSink] TransferCounters objectsFailedToDeleteFromSink + * @property {number|Long|null} [bytesFailedToDeleteFromSink] TransferCounters bytesFailedToDeleteFromSink + * @property {number|Long|null} [directoriesFoundFromSource] TransferCounters directoriesFoundFromSource + * @property {number|Long|null} [directoriesFailedToListFromSource] TransferCounters directoriesFailedToListFromSource + * @property {number|Long|null} [directoriesSuccessfullyListedFromSource] TransferCounters directoriesSuccessfullyListedFromSource + * @property {number|Long|null} [intermediateObjectsCleanedUp] TransferCounters intermediateObjectsCleanedUp + * @property {number|Long|null} [intermediateObjectsFailedCleanedUp] TransferCounters intermediateObjectsFailedCleanedUp + */ + + /** + * Constructs a new TransferCounters. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferCounters. + * @implements ITransferCounters + * @constructor + * @param {google.storagetransfer.v1.ITransferCounters=} [properties] Properties to set + */ + function TransferCounters(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]]; + } + + /** + * TransferCounters objectsFoundFromSource. + * @member {number|Long} objectsFoundFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFoundFromSource. + * @member {number|Long} bytesFoundFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFoundOnlyFromSink. + * @member {number|Long} objectsFoundOnlyFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFoundOnlyFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFoundOnlyFromSink. + * @member {number|Long} bytesFoundOnlyFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFoundOnlyFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFromSourceSkippedBySync. + * @member {number|Long} objectsFromSourceSkippedBySync + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFromSourceSkippedBySync = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFromSourceSkippedBySync. + * @member {number|Long} bytesFromSourceSkippedBySync + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFromSourceSkippedBySync = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsCopiedToSink. + * @member {number|Long} objectsCopiedToSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsCopiedToSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesCopiedToSink. + * @member {number|Long} bytesCopiedToSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesCopiedToSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsDeletedFromSource. + * @member {number|Long} objectsDeletedFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsDeletedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesDeletedFromSource. + * @member {number|Long} bytesDeletedFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesDeletedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsDeletedFromSink. + * @member {number|Long} objectsDeletedFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsDeletedFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesDeletedFromSink. + * @member {number|Long} bytesDeletedFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesDeletedFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFromSourceFailed. + * @member {number|Long} objectsFromSourceFailed + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFromSourceFailed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFromSourceFailed. + * @member {number|Long} bytesFromSourceFailed + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFromSourceFailed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFailedToDeleteFromSink. + * @member {number|Long} objectsFailedToDeleteFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFailedToDeleteFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFailedToDeleteFromSink. + * @member {number|Long} bytesFailedToDeleteFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFailedToDeleteFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters directoriesFoundFromSource. + * @member {number|Long} directoriesFoundFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.directoriesFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters directoriesFailedToListFromSource. + * @member {number|Long} directoriesFailedToListFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.directoriesFailedToListFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters directoriesSuccessfullyListedFromSource. + * @member {number|Long} directoriesSuccessfullyListedFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.directoriesSuccessfullyListedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters intermediateObjectsCleanedUp. + * @member {number|Long} intermediateObjectsCleanedUp + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.intermediateObjectsCleanedUp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters intermediateObjectsFailedCleanedUp. + * @member {number|Long} intermediateObjectsFailedCleanedUp + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.intermediateObjectsFailedCleanedUp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TransferCounters instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.ITransferCounters=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters instance + */ + TransferCounters.create = function create(properties) { + return new TransferCounters(properties); + }; + + /** + * Encodes the specified TransferCounters message. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferCounters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectsFoundFromSource != null && Object.hasOwnProperty.call(message, "objectsFoundFromSource")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.objectsFoundFromSource); + if (message.bytesFoundFromSource != null && Object.hasOwnProperty.call(message, "bytesFoundFromSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.bytesFoundFromSource); + if (message.objectsFoundOnlyFromSink != null && Object.hasOwnProperty.call(message, "objectsFoundOnlyFromSink")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.objectsFoundOnlyFromSink); + if (message.bytesFoundOnlyFromSink != null && Object.hasOwnProperty.call(message, "bytesFoundOnlyFromSink")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bytesFoundOnlyFromSink); + if (message.objectsFromSourceSkippedBySync != null && Object.hasOwnProperty.call(message, "objectsFromSourceSkippedBySync")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.objectsFromSourceSkippedBySync); + if (message.bytesFromSourceSkippedBySync != null && Object.hasOwnProperty.call(message, "bytesFromSourceSkippedBySync")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.bytesFromSourceSkippedBySync); + if (message.objectsCopiedToSink != null && Object.hasOwnProperty.call(message, "objectsCopiedToSink")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.objectsCopiedToSink); + if (message.bytesCopiedToSink != null && Object.hasOwnProperty.call(message, "bytesCopiedToSink")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.bytesCopiedToSink); + if (message.objectsDeletedFromSource != null && Object.hasOwnProperty.call(message, "objectsDeletedFromSource")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.objectsDeletedFromSource); + if (message.bytesDeletedFromSource != null && Object.hasOwnProperty.call(message, "bytesDeletedFromSource")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.bytesDeletedFromSource); + if (message.objectsDeletedFromSink != null && Object.hasOwnProperty.call(message, "objectsDeletedFromSink")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.objectsDeletedFromSink); + if (message.bytesDeletedFromSink != null && Object.hasOwnProperty.call(message, "bytesDeletedFromSink")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.bytesDeletedFromSink); + if (message.objectsFromSourceFailed != null && Object.hasOwnProperty.call(message, "objectsFromSourceFailed")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.objectsFromSourceFailed); + if (message.bytesFromSourceFailed != null && Object.hasOwnProperty.call(message, "bytesFromSourceFailed")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.bytesFromSourceFailed); + if (message.objectsFailedToDeleteFromSink != null && Object.hasOwnProperty.call(message, "objectsFailedToDeleteFromSink")) + writer.uint32(/* id 15, wireType 0 =*/120).int64(message.objectsFailedToDeleteFromSink); + if (message.bytesFailedToDeleteFromSink != null && Object.hasOwnProperty.call(message, "bytesFailedToDeleteFromSink")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.bytesFailedToDeleteFromSink); + if (message.directoriesFoundFromSource != null && Object.hasOwnProperty.call(message, "directoriesFoundFromSource")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.directoriesFoundFromSource); + if (message.directoriesFailedToListFromSource != null && Object.hasOwnProperty.call(message, "directoriesFailedToListFromSource")) + writer.uint32(/* id 18, wireType 0 =*/144).int64(message.directoriesFailedToListFromSource); + if (message.directoriesSuccessfullyListedFromSource != null && Object.hasOwnProperty.call(message, "directoriesSuccessfullyListedFromSource")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.directoriesSuccessfullyListedFromSource); + if (message.intermediateObjectsCleanedUp != null && Object.hasOwnProperty.call(message, "intermediateObjectsCleanedUp")) + writer.uint32(/* id 22, wireType 0 =*/176).int64(message.intermediateObjectsCleanedUp); + if (message.intermediateObjectsFailedCleanedUp != null && Object.hasOwnProperty.call(message, "intermediateObjectsFailedCleanedUp")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.intermediateObjectsFailedCleanedUp); + return writer; + }; + + /** + * Encodes the specified TransferCounters message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferCounters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferCounters message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferCounters.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.storagetransfer.v1.TransferCounters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.objectsFoundFromSource = reader.int64(); + break; + case 2: + message.bytesFoundFromSource = reader.int64(); + break; + case 3: + message.objectsFoundOnlyFromSink = reader.int64(); + break; + case 4: + message.bytesFoundOnlyFromSink = reader.int64(); + break; + case 5: + message.objectsFromSourceSkippedBySync = reader.int64(); + break; + case 6: + message.bytesFromSourceSkippedBySync = reader.int64(); + break; + case 7: + message.objectsCopiedToSink = reader.int64(); + break; + case 8: + message.bytesCopiedToSink = reader.int64(); + break; + case 9: + message.objectsDeletedFromSource = reader.int64(); + break; + case 10: + message.bytesDeletedFromSource = reader.int64(); + break; + case 11: + message.objectsDeletedFromSink = reader.int64(); + break; + case 12: + message.bytesDeletedFromSink = reader.int64(); + break; + case 13: + message.objectsFromSourceFailed = reader.int64(); + break; + case 14: + message.bytesFromSourceFailed = reader.int64(); + break; + case 15: + message.objectsFailedToDeleteFromSink = reader.int64(); + break; + case 16: + message.bytesFailedToDeleteFromSink = reader.int64(); + break; + case 17: + message.directoriesFoundFromSource = reader.int64(); + break; + case 18: + message.directoriesFailedToListFromSource = reader.int64(); + break; + case 19: + message.directoriesSuccessfullyListedFromSource = reader.int64(); + break; + case 22: + message.intermediateObjectsCleanedUp = reader.int64(); + break; + case 23: + message.intermediateObjectsFailedCleanedUp = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferCounters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferCounters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferCounters message. + * @function verify + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferCounters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectsFoundFromSource != null && message.hasOwnProperty("objectsFoundFromSource")) + if (!$util.isInteger(message.objectsFoundFromSource) && !(message.objectsFoundFromSource && $util.isInteger(message.objectsFoundFromSource.low) && $util.isInteger(message.objectsFoundFromSource.high))) + return "objectsFoundFromSource: integer|Long expected"; + if (message.bytesFoundFromSource != null && message.hasOwnProperty("bytesFoundFromSource")) + if (!$util.isInteger(message.bytesFoundFromSource) && !(message.bytesFoundFromSource && $util.isInteger(message.bytesFoundFromSource.low) && $util.isInteger(message.bytesFoundFromSource.high))) + return "bytesFoundFromSource: integer|Long expected"; + if (message.objectsFoundOnlyFromSink != null && message.hasOwnProperty("objectsFoundOnlyFromSink")) + if (!$util.isInteger(message.objectsFoundOnlyFromSink) && !(message.objectsFoundOnlyFromSink && $util.isInteger(message.objectsFoundOnlyFromSink.low) && $util.isInteger(message.objectsFoundOnlyFromSink.high))) + return "objectsFoundOnlyFromSink: integer|Long expected"; + if (message.bytesFoundOnlyFromSink != null && message.hasOwnProperty("bytesFoundOnlyFromSink")) + if (!$util.isInteger(message.bytesFoundOnlyFromSink) && !(message.bytesFoundOnlyFromSink && $util.isInteger(message.bytesFoundOnlyFromSink.low) && $util.isInteger(message.bytesFoundOnlyFromSink.high))) + return "bytesFoundOnlyFromSink: integer|Long expected"; + if (message.objectsFromSourceSkippedBySync != null && message.hasOwnProperty("objectsFromSourceSkippedBySync")) + if (!$util.isInteger(message.objectsFromSourceSkippedBySync) && !(message.objectsFromSourceSkippedBySync && $util.isInteger(message.objectsFromSourceSkippedBySync.low) && $util.isInteger(message.objectsFromSourceSkippedBySync.high))) + return "objectsFromSourceSkippedBySync: integer|Long expected"; + if (message.bytesFromSourceSkippedBySync != null && message.hasOwnProperty("bytesFromSourceSkippedBySync")) + if (!$util.isInteger(message.bytesFromSourceSkippedBySync) && !(message.bytesFromSourceSkippedBySync && $util.isInteger(message.bytesFromSourceSkippedBySync.low) && $util.isInteger(message.bytesFromSourceSkippedBySync.high))) + return "bytesFromSourceSkippedBySync: integer|Long expected"; + if (message.objectsCopiedToSink != null && message.hasOwnProperty("objectsCopiedToSink")) + if (!$util.isInteger(message.objectsCopiedToSink) && !(message.objectsCopiedToSink && $util.isInteger(message.objectsCopiedToSink.low) && $util.isInteger(message.objectsCopiedToSink.high))) + return "objectsCopiedToSink: integer|Long expected"; + if (message.bytesCopiedToSink != null && message.hasOwnProperty("bytesCopiedToSink")) + if (!$util.isInteger(message.bytesCopiedToSink) && !(message.bytesCopiedToSink && $util.isInteger(message.bytesCopiedToSink.low) && $util.isInteger(message.bytesCopiedToSink.high))) + return "bytesCopiedToSink: integer|Long expected"; + if (message.objectsDeletedFromSource != null && message.hasOwnProperty("objectsDeletedFromSource")) + if (!$util.isInteger(message.objectsDeletedFromSource) && !(message.objectsDeletedFromSource && $util.isInteger(message.objectsDeletedFromSource.low) && $util.isInteger(message.objectsDeletedFromSource.high))) + return "objectsDeletedFromSource: integer|Long expected"; + if (message.bytesDeletedFromSource != null && message.hasOwnProperty("bytesDeletedFromSource")) + if (!$util.isInteger(message.bytesDeletedFromSource) && !(message.bytesDeletedFromSource && $util.isInteger(message.bytesDeletedFromSource.low) && $util.isInteger(message.bytesDeletedFromSource.high))) + return "bytesDeletedFromSource: integer|Long expected"; + if (message.objectsDeletedFromSink != null && message.hasOwnProperty("objectsDeletedFromSink")) + if (!$util.isInteger(message.objectsDeletedFromSink) && !(message.objectsDeletedFromSink && $util.isInteger(message.objectsDeletedFromSink.low) && $util.isInteger(message.objectsDeletedFromSink.high))) + return "objectsDeletedFromSink: integer|Long expected"; + if (message.bytesDeletedFromSink != null && message.hasOwnProperty("bytesDeletedFromSink")) + if (!$util.isInteger(message.bytesDeletedFromSink) && !(message.bytesDeletedFromSink && $util.isInteger(message.bytesDeletedFromSink.low) && $util.isInteger(message.bytesDeletedFromSink.high))) + return "bytesDeletedFromSink: integer|Long expected"; + if (message.objectsFromSourceFailed != null && message.hasOwnProperty("objectsFromSourceFailed")) + if (!$util.isInteger(message.objectsFromSourceFailed) && !(message.objectsFromSourceFailed && $util.isInteger(message.objectsFromSourceFailed.low) && $util.isInteger(message.objectsFromSourceFailed.high))) + return "objectsFromSourceFailed: integer|Long expected"; + if (message.bytesFromSourceFailed != null && message.hasOwnProperty("bytesFromSourceFailed")) + if (!$util.isInteger(message.bytesFromSourceFailed) && !(message.bytesFromSourceFailed && $util.isInteger(message.bytesFromSourceFailed.low) && $util.isInteger(message.bytesFromSourceFailed.high))) + return "bytesFromSourceFailed: integer|Long expected"; + if (message.objectsFailedToDeleteFromSink != null && message.hasOwnProperty("objectsFailedToDeleteFromSink")) + if (!$util.isInteger(message.objectsFailedToDeleteFromSink) && !(message.objectsFailedToDeleteFromSink && $util.isInteger(message.objectsFailedToDeleteFromSink.low) && $util.isInteger(message.objectsFailedToDeleteFromSink.high))) + return "objectsFailedToDeleteFromSink: integer|Long expected"; + if (message.bytesFailedToDeleteFromSink != null && message.hasOwnProperty("bytesFailedToDeleteFromSink")) + if (!$util.isInteger(message.bytesFailedToDeleteFromSink) && !(message.bytesFailedToDeleteFromSink && $util.isInteger(message.bytesFailedToDeleteFromSink.low) && $util.isInteger(message.bytesFailedToDeleteFromSink.high))) + return "bytesFailedToDeleteFromSink: integer|Long expected"; + if (message.directoriesFoundFromSource != null && message.hasOwnProperty("directoriesFoundFromSource")) + if (!$util.isInteger(message.directoriesFoundFromSource) && !(message.directoriesFoundFromSource && $util.isInteger(message.directoriesFoundFromSource.low) && $util.isInteger(message.directoriesFoundFromSource.high))) + return "directoriesFoundFromSource: integer|Long expected"; + if (message.directoriesFailedToListFromSource != null && message.hasOwnProperty("directoriesFailedToListFromSource")) + if (!$util.isInteger(message.directoriesFailedToListFromSource) && !(message.directoriesFailedToListFromSource && $util.isInteger(message.directoriesFailedToListFromSource.low) && $util.isInteger(message.directoriesFailedToListFromSource.high))) + return "directoriesFailedToListFromSource: integer|Long expected"; + if (message.directoriesSuccessfullyListedFromSource != null && message.hasOwnProperty("directoriesSuccessfullyListedFromSource")) + if (!$util.isInteger(message.directoriesSuccessfullyListedFromSource) && !(message.directoriesSuccessfullyListedFromSource && $util.isInteger(message.directoriesSuccessfullyListedFromSource.low) && $util.isInteger(message.directoriesSuccessfullyListedFromSource.high))) + return "directoriesSuccessfullyListedFromSource: integer|Long expected"; + if (message.intermediateObjectsCleanedUp != null && message.hasOwnProperty("intermediateObjectsCleanedUp")) + if (!$util.isInteger(message.intermediateObjectsCleanedUp) && !(message.intermediateObjectsCleanedUp && $util.isInteger(message.intermediateObjectsCleanedUp.low) && $util.isInteger(message.intermediateObjectsCleanedUp.high))) + return "intermediateObjectsCleanedUp: integer|Long expected"; + if (message.intermediateObjectsFailedCleanedUp != null && message.hasOwnProperty("intermediateObjectsFailedCleanedUp")) + if (!$util.isInteger(message.intermediateObjectsFailedCleanedUp) && !(message.intermediateObjectsFailedCleanedUp && $util.isInteger(message.intermediateObjectsFailedCleanedUp.low) && $util.isInteger(message.intermediateObjectsFailedCleanedUp.high))) + return "intermediateObjectsFailedCleanedUp: integer|Long expected"; + return null; + }; + + /** + * Creates a TransferCounters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + */ + TransferCounters.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferCounters) + return object; + var message = new $root.google.storagetransfer.v1.TransferCounters(); + if (object.objectsFoundFromSource != null) + if ($util.Long) + (message.objectsFoundFromSource = $util.Long.fromValue(object.objectsFoundFromSource)).unsigned = false; + else if (typeof object.objectsFoundFromSource === "string") + message.objectsFoundFromSource = parseInt(object.objectsFoundFromSource, 10); + else if (typeof object.objectsFoundFromSource === "number") + message.objectsFoundFromSource = object.objectsFoundFromSource; + else if (typeof object.objectsFoundFromSource === "object") + message.objectsFoundFromSource = new $util.LongBits(object.objectsFoundFromSource.low >>> 0, object.objectsFoundFromSource.high >>> 0).toNumber(); + if (object.bytesFoundFromSource != null) + if ($util.Long) + (message.bytesFoundFromSource = $util.Long.fromValue(object.bytesFoundFromSource)).unsigned = false; + else if (typeof object.bytesFoundFromSource === "string") + message.bytesFoundFromSource = parseInt(object.bytesFoundFromSource, 10); + else if (typeof object.bytesFoundFromSource === "number") + message.bytesFoundFromSource = object.bytesFoundFromSource; + else if (typeof object.bytesFoundFromSource === "object") + message.bytesFoundFromSource = new $util.LongBits(object.bytesFoundFromSource.low >>> 0, object.bytesFoundFromSource.high >>> 0).toNumber(); + if (object.objectsFoundOnlyFromSink != null) + if ($util.Long) + (message.objectsFoundOnlyFromSink = $util.Long.fromValue(object.objectsFoundOnlyFromSink)).unsigned = false; + else if (typeof object.objectsFoundOnlyFromSink === "string") + message.objectsFoundOnlyFromSink = parseInt(object.objectsFoundOnlyFromSink, 10); + else if (typeof object.objectsFoundOnlyFromSink === "number") + message.objectsFoundOnlyFromSink = object.objectsFoundOnlyFromSink; + else if (typeof object.objectsFoundOnlyFromSink === "object") + message.objectsFoundOnlyFromSink = new $util.LongBits(object.objectsFoundOnlyFromSink.low >>> 0, object.objectsFoundOnlyFromSink.high >>> 0).toNumber(); + if (object.bytesFoundOnlyFromSink != null) + if ($util.Long) + (message.bytesFoundOnlyFromSink = $util.Long.fromValue(object.bytesFoundOnlyFromSink)).unsigned = false; + else if (typeof object.bytesFoundOnlyFromSink === "string") + message.bytesFoundOnlyFromSink = parseInt(object.bytesFoundOnlyFromSink, 10); + else if (typeof object.bytesFoundOnlyFromSink === "number") + message.bytesFoundOnlyFromSink = object.bytesFoundOnlyFromSink; + else if (typeof object.bytesFoundOnlyFromSink === "object") + message.bytesFoundOnlyFromSink = new $util.LongBits(object.bytesFoundOnlyFromSink.low >>> 0, object.bytesFoundOnlyFromSink.high >>> 0).toNumber(); + if (object.objectsFromSourceSkippedBySync != null) + if ($util.Long) + (message.objectsFromSourceSkippedBySync = $util.Long.fromValue(object.objectsFromSourceSkippedBySync)).unsigned = false; + else if (typeof object.objectsFromSourceSkippedBySync === "string") + message.objectsFromSourceSkippedBySync = parseInt(object.objectsFromSourceSkippedBySync, 10); + else if (typeof object.objectsFromSourceSkippedBySync === "number") + message.objectsFromSourceSkippedBySync = object.objectsFromSourceSkippedBySync; + else if (typeof object.objectsFromSourceSkippedBySync === "object") + message.objectsFromSourceSkippedBySync = new $util.LongBits(object.objectsFromSourceSkippedBySync.low >>> 0, object.objectsFromSourceSkippedBySync.high >>> 0).toNumber(); + if (object.bytesFromSourceSkippedBySync != null) + if ($util.Long) + (message.bytesFromSourceSkippedBySync = $util.Long.fromValue(object.bytesFromSourceSkippedBySync)).unsigned = false; + else if (typeof object.bytesFromSourceSkippedBySync === "string") + message.bytesFromSourceSkippedBySync = parseInt(object.bytesFromSourceSkippedBySync, 10); + else if (typeof object.bytesFromSourceSkippedBySync === "number") + message.bytesFromSourceSkippedBySync = object.bytesFromSourceSkippedBySync; + else if (typeof object.bytesFromSourceSkippedBySync === "object") + message.bytesFromSourceSkippedBySync = new $util.LongBits(object.bytesFromSourceSkippedBySync.low >>> 0, object.bytesFromSourceSkippedBySync.high >>> 0).toNumber(); + if (object.objectsCopiedToSink != null) + if ($util.Long) + (message.objectsCopiedToSink = $util.Long.fromValue(object.objectsCopiedToSink)).unsigned = false; + else if (typeof object.objectsCopiedToSink === "string") + message.objectsCopiedToSink = parseInt(object.objectsCopiedToSink, 10); + else if (typeof object.objectsCopiedToSink === "number") + message.objectsCopiedToSink = object.objectsCopiedToSink; + else if (typeof object.objectsCopiedToSink === "object") + message.objectsCopiedToSink = new $util.LongBits(object.objectsCopiedToSink.low >>> 0, object.objectsCopiedToSink.high >>> 0).toNumber(); + if (object.bytesCopiedToSink != null) + if ($util.Long) + (message.bytesCopiedToSink = $util.Long.fromValue(object.bytesCopiedToSink)).unsigned = false; + else if (typeof object.bytesCopiedToSink === "string") + message.bytesCopiedToSink = parseInt(object.bytesCopiedToSink, 10); + else if (typeof object.bytesCopiedToSink === "number") + message.bytesCopiedToSink = object.bytesCopiedToSink; + else if (typeof object.bytesCopiedToSink === "object") + message.bytesCopiedToSink = new $util.LongBits(object.bytesCopiedToSink.low >>> 0, object.bytesCopiedToSink.high >>> 0).toNumber(); + if (object.objectsDeletedFromSource != null) + if ($util.Long) + (message.objectsDeletedFromSource = $util.Long.fromValue(object.objectsDeletedFromSource)).unsigned = false; + else if (typeof object.objectsDeletedFromSource === "string") + message.objectsDeletedFromSource = parseInt(object.objectsDeletedFromSource, 10); + else if (typeof object.objectsDeletedFromSource === "number") + message.objectsDeletedFromSource = object.objectsDeletedFromSource; + else if (typeof object.objectsDeletedFromSource === "object") + message.objectsDeletedFromSource = new $util.LongBits(object.objectsDeletedFromSource.low >>> 0, object.objectsDeletedFromSource.high >>> 0).toNumber(); + if (object.bytesDeletedFromSource != null) + if ($util.Long) + (message.bytesDeletedFromSource = $util.Long.fromValue(object.bytesDeletedFromSource)).unsigned = false; + else if (typeof object.bytesDeletedFromSource === "string") + message.bytesDeletedFromSource = parseInt(object.bytesDeletedFromSource, 10); + else if (typeof object.bytesDeletedFromSource === "number") + message.bytesDeletedFromSource = object.bytesDeletedFromSource; + else if (typeof object.bytesDeletedFromSource === "object") + message.bytesDeletedFromSource = new $util.LongBits(object.bytesDeletedFromSource.low >>> 0, object.bytesDeletedFromSource.high >>> 0).toNumber(); + if (object.objectsDeletedFromSink != null) + if ($util.Long) + (message.objectsDeletedFromSink = $util.Long.fromValue(object.objectsDeletedFromSink)).unsigned = false; + else if (typeof object.objectsDeletedFromSink === "string") + message.objectsDeletedFromSink = parseInt(object.objectsDeletedFromSink, 10); + else if (typeof object.objectsDeletedFromSink === "number") + message.objectsDeletedFromSink = object.objectsDeletedFromSink; + else if (typeof object.objectsDeletedFromSink === "object") + message.objectsDeletedFromSink = new $util.LongBits(object.objectsDeletedFromSink.low >>> 0, object.objectsDeletedFromSink.high >>> 0).toNumber(); + if (object.bytesDeletedFromSink != null) + if ($util.Long) + (message.bytesDeletedFromSink = $util.Long.fromValue(object.bytesDeletedFromSink)).unsigned = false; + else if (typeof object.bytesDeletedFromSink === "string") + message.bytesDeletedFromSink = parseInt(object.bytesDeletedFromSink, 10); + else if (typeof object.bytesDeletedFromSink === "number") + message.bytesDeletedFromSink = object.bytesDeletedFromSink; + else if (typeof object.bytesDeletedFromSink === "object") + message.bytesDeletedFromSink = new $util.LongBits(object.bytesDeletedFromSink.low >>> 0, object.bytesDeletedFromSink.high >>> 0).toNumber(); + if (object.objectsFromSourceFailed != null) + if ($util.Long) + (message.objectsFromSourceFailed = $util.Long.fromValue(object.objectsFromSourceFailed)).unsigned = false; + else if (typeof object.objectsFromSourceFailed === "string") + message.objectsFromSourceFailed = parseInt(object.objectsFromSourceFailed, 10); + else if (typeof object.objectsFromSourceFailed === "number") + message.objectsFromSourceFailed = object.objectsFromSourceFailed; + else if (typeof object.objectsFromSourceFailed === "object") + message.objectsFromSourceFailed = new $util.LongBits(object.objectsFromSourceFailed.low >>> 0, object.objectsFromSourceFailed.high >>> 0).toNumber(); + if (object.bytesFromSourceFailed != null) + if ($util.Long) + (message.bytesFromSourceFailed = $util.Long.fromValue(object.bytesFromSourceFailed)).unsigned = false; + else if (typeof object.bytesFromSourceFailed === "string") + message.bytesFromSourceFailed = parseInt(object.bytesFromSourceFailed, 10); + else if (typeof object.bytesFromSourceFailed === "number") + message.bytesFromSourceFailed = object.bytesFromSourceFailed; + else if (typeof object.bytesFromSourceFailed === "object") + message.bytesFromSourceFailed = new $util.LongBits(object.bytesFromSourceFailed.low >>> 0, object.bytesFromSourceFailed.high >>> 0).toNumber(); + if (object.objectsFailedToDeleteFromSink != null) + if ($util.Long) + (message.objectsFailedToDeleteFromSink = $util.Long.fromValue(object.objectsFailedToDeleteFromSink)).unsigned = false; + else if (typeof object.objectsFailedToDeleteFromSink === "string") + message.objectsFailedToDeleteFromSink = parseInt(object.objectsFailedToDeleteFromSink, 10); + else if (typeof object.objectsFailedToDeleteFromSink === "number") + message.objectsFailedToDeleteFromSink = object.objectsFailedToDeleteFromSink; + else if (typeof object.objectsFailedToDeleteFromSink === "object") + message.objectsFailedToDeleteFromSink = new $util.LongBits(object.objectsFailedToDeleteFromSink.low >>> 0, object.objectsFailedToDeleteFromSink.high >>> 0).toNumber(); + if (object.bytesFailedToDeleteFromSink != null) + if ($util.Long) + (message.bytesFailedToDeleteFromSink = $util.Long.fromValue(object.bytesFailedToDeleteFromSink)).unsigned = false; + else if (typeof object.bytesFailedToDeleteFromSink === "string") + message.bytesFailedToDeleteFromSink = parseInt(object.bytesFailedToDeleteFromSink, 10); + else if (typeof object.bytesFailedToDeleteFromSink === "number") + message.bytesFailedToDeleteFromSink = object.bytesFailedToDeleteFromSink; + else if (typeof object.bytesFailedToDeleteFromSink === "object") + message.bytesFailedToDeleteFromSink = new $util.LongBits(object.bytesFailedToDeleteFromSink.low >>> 0, object.bytesFailedToDeleteFromSink.high >>> 0).toNumber(); + if (object.directoriesFoundFromSource != null) + if ($util.Long) + (message.directoriesFoundFromSource = $util.Long.fromValue(object.directoriesFoundFromSource)).unsigned = false; + else if (typeof object.directoriesFoundFromSource === "string") + message.directoriesFoundFromSource = parseInt(object.directoriesFoundFromSource, 10); + else if (typeof object.directoriesFoundFromSource === "number") + message.directoriesFoundFromSource = object.directoriesFoundFromSource; + else if (typeof object.directoriesFoundFromSource === "object") + message.directoriesFoundFromSource = new $util.LongBits(object.directoriesFoundFromSource.low >>> 0, object.directoriesFoundFromSource.high >>> 0).toNumber(); + if (object.directoriesFailedToListFromSource != null) + if ($util.Long) + (message.directoriesFailedToListFromSource = $util.Long.fromValue(object.directoriesFailedToListFromSource)).unsigned = false; + else if (typeof object.directoriesFailedToListFromSource === "string") + message.directoriesFailedToListFromSource = parseInt(object.directoriesFailedToListFromSource, 10); + else if (typeof object.directoriesFailedToListFromSource === "number") + message.directoriesFailedToListFromSource = object.directoriesFailedToListFromSource; + else if (typeof object.directoriesFailedToListFromSource === "object") + message.directoriesFailedToListFromSource = new $util.LongBits(object.directoriesFailedToListFromSource.low >>> 0, object.directoriesFailedToListFromSource.high >>> 0).toNumber(); + if (object.directoriesSuccessfullyListedFromSource != null) + if ($util.Long) + (message.directoriesSuccessfullyListedFromSource = $util.Long.fromValue(object.directoriesSuccessfullyListedFromSource)).unsigned = false; + else if (typeof object.directoriesSuccessfullyListedFromSource === "string") + message.directoriesSuccessfullyListedFromSource = parseInt(object.directoriesSuccessfullyListedFromSource, 10); + else if (typeof object.directoriesSuccessfullyListedFromSource === "number") + message.directoriesSuccessfullyListedFromSource = object.directoriesSuccessfullyListedFromSource; + else if (typeof object.directoriesSuccessfullyListedFromSource === "object") + message.directoriesSuccessfullyListedFromSource = new $util.LongBits(object.directoriesSuccessfullyListedFromSource.low >>> 0, object.directoriesSuccessfullyListedFromSource.high >>> 0).toNumber(); + if (object.intermediateObjectsCleanedUp != null) + if ($util.Long) + (message.intermediateObjectsCleanedUp = $util.Long.fromValue(object.intermediateObjectsCleanedUp)).unsigned = false; + else if (typeof object.intermediateObjectsCleanedUp === "string") + message.intermediateObjectsCleanedUp = parseInt(object.intermediateObjectsCleanedUp, 10); + else if (typeof object.intermediateObjectsCleanedUp === "number") + message.intermediateObjectsCleanedUp = object.intermediateObjectsCleanedUp; + else if (typeof object.intermediateObjectsCleanedUp === "object") + message.intermediateObjectsCleanedUp = new $util.LongBits(object.intermediateObjectsCleanedUp.low >>> 0, object.intermediateObjectsCleanedUp.high >>> 0).toNumber(); + if (object.intermediateObjectsFailedCleanedUp != null) + if ($util.Long) + (message.intermediateObjectsFailedCleanedUp = $util.Long.fromValue(object.intermediateObjectsFailedCleanedUp)).unsigned = false; + else if (typeof object.intermediateObjectsFailedCleanedUp === "string") + message.intermediateObjectsFailedCleanedUp = parseInt(object.intermediateObjectsFailedCleanedUp, 10); + else if (typeof object.intermediateObjectsFailedCleanedUp === "number") + message.intermediateObjectsFailedCleanedUp = object.intermediateObjectsFailedCleanedUp; + else if (typeof object.intermediateObjectsFailedCleanedUp === "object") + message.intermediateObjectsFailedCleanedUp = new $util.LongBits(object.intermediateObjectsFailedCleanedUp.low >>> 0, object.intermediateObjectsFailedCleanedUp.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TransferCounters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.TransferCounters} message TransferCounters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferCounters.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.objectsFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFoundFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFoundFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFoundOnlyFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFoundOnlyFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFoundOnlyFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFoundOnlyFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFromSourceSkippedBySync = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFromSourceSkippedBySync = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFromSourceSkippedBySync = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFromSourceSkippedBySync = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsCopiedToSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsCopiedToSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesCopiedToSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesCopiedToSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsDeletedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsDeletedFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesDeletedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesDeletedFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsDeletedFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsDeletedFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesDeletedFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesDeletedFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFromSourceFailed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFromSourceFailed = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFromSourceFailed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFromSourceFailed = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFailedToDeleteFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFailedToDeleteFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFailedToDeleteFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFailedToDeleteFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.directoriesFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.directoriesFoundFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.directoriesFailedToListFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.directoriesFailedToListFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.directoriesSuccessfullyListedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.directoriesSuccessfullyListedFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.intermediateObjectsCleanedUp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.intermediateObjectsCleanedUp = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.intermediateObjectsFailedCleanedUp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.intermediateObjectsFailedCleanedUp = options.longs === String ? "0" : 0; + } + if (message.objectsFoundFromSource != null && message.hasOwnProperty("objectsFoundFromSource")) + if (typeof message.objectsFoundFromSource === "number") + object.objectsFoundFromSource = options.longs === String ? String(message.objectsFoundFromSource) : message.objectsFoundFromSource; + else + object.objectsFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFoundFromSource) : options.longs === Number ? new $util.LongBits(message.objectsFoundFromSource.low >>> 0, message.objectsFoundFromSource.high >>> 0).toNumber() : message.objectsFoundFromSource; + if (message.bytesFoundFromSource != null && message.hasOwnProperty("bytesFoundFromSource")) + if (typeof message.bytesFoundFromSource === "number") + object.bytesFoundFromSource = options.longs === String ? String(message.bytesFoundFromSource) : message.bytesFoundFromSource; + else + object.bytesFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFoundFromSource) : options.longs === Number ? new $util.LongBits(message.bytesFoundFromSource.low >>> 0, message.bytesFoundFromSource.high >>> 0).toNumber() : message.bytesFoundFromSource; + if (message.objectsFoundOnlyFromSink != null && message.hasOwnProperty("objectsFoundOnlyFromSink")) + if (typeof message.objectsFoundOnlyFromSink === "number") + object.objectsFoundOnlyFromSink = options.longs === String ? String(message.objectsFoundOnlyFromSink) : message.objectsFoundOnlyFromSink; + else + object.objectsFoundOnlyFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFoundOnlyFromSink) : options.longs === Number ? new $util.LongBits(message.objectsFoundOnlyFromSink.low >>> 0, message.objectsFoundOnlyFromSink.high >>> 0).toNumber() : message.objectsFoundOnlyFromSink; + if (message.bytesFoundOnlyFromSink != null && message.hasOwnProperty("bytesFoundOnlyFromSink")) + if (typeof message.bytesFoundOnlyFromSink === "number") + object.bytesFoundOnlyFromSink = options.longs === String ? String(message.bytesFoundOnlyFromSink) : message.bytesFoundOnlyFromSink; + else + object.bytesFoundOnlyFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFoundOnlyFromSink) : options.longs === Number ? new $util.LongBits(message.bytesFoundOnlyFromSink.low >>> 0, message.bytesFoundOnlyFromSink.high >>> 0).toNumber() : message.bytesFoundOnlyFromSink; + if (message.objectsFromSourceSkippedBySync != null && message.hasOwnProperty("objectsFromSourceSkippedBySync")) + if (typeof message.objectsFromSourceSkippedBySync === "number") + object.objectsFromSourceSkippedBySync = options.longs === String ? String(message.objectsFromSourceSkippedBySync) : message.objectsFromSourceSkippedBySync; + else + object.objectsFromSourceSkippedBySync = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFromSourceSkippedBySync) : options.longs === Number ? new $util.LongBits(message.objectsFromSourceSkippedBySync.low >>> 0, message.objectsFromSourceSkippedBySync.high >>> 0).toNumber() : message.objectsFromSourceSkippedBySync; + if (message.bytesFromSourceSkippedBySync != null && message.hasOwnProperty("bytesFromSourceSkippedBySync")) + if (typeof message.bytesFromSourceSkippedBySync === "number") + object.bytesFromSourceSkippedBySync = options.longs === String ? String(message.bytesFromSourceSkippedBySync) : message.bytesFromSourceSkippedBySync; + else + object.bytesFromSourceSkippedBySync = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFromSourceSkippedBySync) : options.longs === Number ? new $util.LongBits(message.bytesFromSourceSkippedBySync.low >>> 0, message.bytesFromSourceSkippedBySync.high >>> 0).toNumber() : message.bytesFromSourceSkippedBySync; + if (message.objectsCopiedToSink != null && message.hasOwnProperty("objectsCopiedToSink")) + if (typeof message.objectsCopiedToSink === "number") + object.objectsCopiedToSink = options.longs === String ? String(message.objectsCopiedToSink) : message.objectsCopiedToSink; + else + object.objectsCopiedToSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsCopiedToSink) : options.longs === Number ? new $util.LongBits(message.objectsCopiedToSink.low >>> 0, message.objectsCopiedToSink.high >>> 0).toNumber() : message.objectsCopiedToSink; + if (message.bytesCopiedToSink != null && message.hasOwnProperty("bytesCopiedToSink")) + if (typeof message.bytesCopiedToSink === "number") + object.bytesCopiedToSink = options.longs === String ? String(message.bytesCopiedToSink) : message.bytesCopiedToSink; + else + object.bytesCopiedToSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesCopiedToSink) : options.longs === Number ? new $util.LongBits(message.bytesCopiedToSink.low >>> 0, message.bytesCopiedToSink.high >>> 0).toNumber() : message.bytesCopiedToSink; + if (message.objectsDeletedFromSource != null && message.hasOwnProperty("objectsDeletedFromSource")) + if (typeof message.objectsDeletedFromSource === "number") + object.objectsDeletedFromSource = options.longs === String ? String(message.objectsDeletedFromSource) : message.objectsDeletedFromSource; + else + object.objectsDeletedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.objectsDeletedFromSource) : options.longs === Number ? new $util.LongBits(message.objectsDeletedFromSource.low >>> 0, message.objectsDeletedFromSource.high >>> 0).toNumber() : message.objectsDeletedFromSource; + if (message.bytesDeletedFromSource != null && message.hasOwnProperty("bytesDeletedFromSource")) + if (typeof message.bytesDeletedFromSource === "number") + object.bytesDeletedFromSource = options.longs === String ? String(message.bytesDeletedFromSource) : message.bytesDeletedFromSource; + else + object.bytesDeletedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDeletedFromSource) : options.longs === Number ? new $util.LongBits(message.bytesDeletedFromSource.low >>> 0, message.bytesDeletedFromSource.high >>> 0).toNumber() : message.bytesDeletedFromSource; + if (message.objectsDeletedFromSink != null && message.hasOwnProperty("objectsDeletedFromSink")) + if (typeof message.objectsDeletedFromSink === "number") + object.objectsDeletedFromSink = options.longs === String ? String(message.objectsDeletedFromSink) : message.objectsDeletedFromSink; + else + object.objectsDeletedFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsDeletedFromSink) : options.longs === Number ? new $util.LongBits(message.objectsDeletedFromSink.low >>> 0, message.objectsDeletedFromSink.high >>> 0).toNumber() : message.objectsDeletedFromSink; + if (message.bytesDeletedFromSink != null && message.hasOwnProperty("bytesDeletedFromSink")) + if (typeof message.bytesDeletedFromSink === "number") + object.bytesDeletedFromSink = options.longs === String ? String(message.bytesDeletedFromSink) : message.bytesDeletedFromSink; + else + object.bytesDeletedFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDeletedFromSink) : options.longs === Number ? new $util.LongBits(message.bytesDeletedFromSink.low >>> 0, message.bytesDeletedFromSink.high >>> 0).toNumber() : message.bytesDeletedFromSink; + if (message.objectsFromSourceFailed != null && message.hasOwnProperty("objectsFromSourceFailed")) + if (typeof message.objectsFromSourceFailed === "number") + object.objectsFromSourceFailed = options.longs === String ? String(message.objectsFromSourceFailed) : message.objectsFromSourceFailed; + else + object.objectsFromSourceFailed = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFromSourceFailed) : options.longs === Number ? new $util.LongBits(message.objectsFromSourceFailed.low >>> 0, message.objectsFromSourceFailed.high >>> 0).toNumber() : message.objectsFromSourceFailed; + if (message.bytesFromSourceFailed != null && message.hasOwnProperty("bytesFromSourceFailed")) + if (typeof message.bytesFromSourceFailed === "number") + object.bytesFromSourceFailed = options.longs === String ? String(message.bytesFromSourceFailed) : message.bytesFromSourceFailed; + else + object.bytesFromSourceFailed = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFromSourceFailed) : options.longs === Number ? new $util.LongBits(message.bytesFromSourceFailed.low >>> 0, message.bytesFromSourceFailed.high >>> 0).toNumber() : message.bytesFromSourceFailed; + if (message.objectsFailedToDeleteFromSink != null && message.hasOwnProperty("objectsFailedToDeleteFromSink")) + if (typeof message.objectsFailedToDeleteFromSink === "number") + object.objectsFailedToDeleteFromSink = options.longs === String ? String(message.objectsFailedToDeleteFromSink) : message.objectsFailedToDeleteFromSink; + else + object.objectsFailedToDeleteFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFailedToDeleteFromSink) : options.longs === Number ? new $util.LongBits(message.objectsFailedToDeleteFromSink.low >>> 0, message.objectsFailedToDeleteFromSink.high >>> 0).toNumber() : message.objectsFailedToDeleteFromSink; + if (message.bytesFailedToDeleteFromSink != null && message.hasOwnProperty("bytesFailedToDeleteFromSink")) + if (typeof message.bytesFailedToDeleteFromSink === "number") + object.bytesFailedToDeleteFromSink = options.longs === String ? String(message.bytesFailedToDeleteFromSink) : message.bytesFailedToDeleteFromSink; + else + object.bytesFailedToDeleteFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFailedToDeleteFromSink) : options.longs === Number ? new $util.LongBits(message.bytesFailedToDeleteFromSink.low >>> 0, message.bytesFailedToDeleteFromSink.high >>> 0).toNumber() : message.bytesFailedToDeleteFromSink; + if (message.directoriesFoundFromSource != null && message.hasOwnProperty("directoriesFoundFromSource")) + if (typeof message.directoriesFoundFromSource === "number") + object.directoriesFoundFromSource = options.longs === String ? String(message.directoriesFoundFromSource) : message.directoriesFoundFromSource; + else + object.directoriesFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.directoriesFoundFromSource) : options.longs === Number ? new $util.LongBits(message.directoriesFoundFromSource.low >>> 0, message.directoriesFoundFromSource.high >>> 0).toNumber() : message.directoriesFoundFromSource; + if (message.directoriesFailedToListFromSource != null && message.hasOwnProperty("directoriesFailedToListFromSource")) + if (typeof message.directoriesFailedToListFromSource === "number") + object.directoriesFailedToListFromSource = options.longs === String ? String(message.directoriesFailedToListFromSource) : message.directoriesFailedToListFromSource; + else + object.directoriesFailedToListFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.directoriesFailedToListFromSource) : options.longs === Number ? new $util.LongBits(message.directoriesFailedToListFromSource.low >>> 0, message.directoriesFailedToListFromSource.high >>> 0).toNumber() : message.directoriesFailedToListFromSource; + if (message.directoriesSuccessfullyListedFromSource != null && message.hasOwnProperty("directoriesSuccessfullyListedFromSource")) + if (typeof message.directoriesSuccessfullyListedFromSource === "number") + object.directoriesSuccessfullyListedFromSource = options.longs === String ? String(message.directoriesSuccessfullyListedFromSource) : message.directoriesSuccessfullyListedFromSource; + else + object.directoriesSuccessfullyListedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.directoriesSuccessfullyListedFromSource) : options.longs === Number ? new $util.LongBits(message.directoriesSuccessfullyListedFromSource.low >>> 0, message.directoriesSuccessfullyListedFromSource.high >>> 0).toNumber() : message.directoriesSuccessfullyListedFromSource; + if (message.intermediateObjectsCleanedUp != null && message.hasOwnProperty("intermediateObjectsCleanedUp")) + if (typeof message.intermediateObjectsCleanedUp === "number") + object.intermediateObjectsCleanedUp = options.longs === String ? String(message.intermediateObjectsCleanedUp) : message.intermediateObjectsCleanedUp; + else + object.intermediateObjectsCleanedUp = options.longs === String ? $util.Long.prototype.toString.call(message.intermediateObjectsCleanedUp) : options.longs === Number ? new $util.LongBits(message.intermediateObjectsCleanedUp.low >>> 0, message.intermediateObjectsCleanedUp.high >>> 0).toNumber() : message.intermediateObjectsCleanedUp; + if (message.intermediateObjectsFailedCleanedUp != null && message.hasOwnProperty("intermediateObjectsFailedCleanedUp")) + if (typeof message.intermediateObjectsFailedCleanedUp === "number") + object.intermediateObjectsFailedCleanedUp = options.longs === String ? String(message.intermediateObjectsFailedCleanedUp) : message.intermediateObjectsFailedCleanedUp; + else + object.intermediateObjectsFailedCleanedUp = options.longs === String ? $util.Long.prototype.toString.call(message.intermediateObjectsFailedCleanedUp) : options.longs === Number ? new $util.LongBits(message.intermediateObjectsFailedCleanedUp.low >>> 0, message.intermediateObjectsFailedCleanedUp.high >>> 0).toNumber() : message.intermediateObjectsFailedCleanedUp; + return object; + }; + + /** + * Converts this TransferCounters to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + * @returns {Object.} JSON object + */ + TransferCounters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TransferCounters; + })(); + + v1.NotificationConfig = (function() { + + /** + * Properties of a NotificationConfig. + * @memberof google.storagetransfer.v1 + * @interface INotificationConfig + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {Array.|null} [eventTypes] NotificationConfig eventTypes + * @property {google.storagetransfer.v1.NotificationConfig.PayloadFormat|null} [payloadFormat] NotificationConfig payloadFormat + */ + + /** + * Constructs a new NotificationConfig. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.storagetransfer.v1.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + this.eventTypes = []; + 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]]; + } + + /** + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig eventTypes. + * @member {Array.} eventTypes + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.eventTypes = $util.emptyArray; + + /** + * NotificationConfig payloadFormat. + * @member {google.storagetransfer.v1.NotificationConfig.PayloadFormat} payloadFormat + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.payloadFormat = 0; + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.INotificationConfig=} [properties] Properties to set + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + if (message.eventTypes != null && message.eventTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.eventTypes.length; ++i) + writer.int32(message.eventTypes[i]); + writer.ldelim(); + } + if (message.payloadFormat != null && Object.hasOwnProperty.call(message, "payloadFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.payloadFormat); + return writer; + }; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.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.storagetransfer.v1.NotificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubsubTopic = reader.string(); + break; + case 2: + if (!(message.eventTypes && message.eventTypes.length)) + message.eventTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.eventTypes.push(reader.int32()); + } else + message.eventTypes.push(reader.int32()); + break; + case 3: + message.payloadFormat = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationConfig message. + * @function verify + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.eventTypes != null && message.hasOwnProperty("eventTypes")) { + if (!Array.isArray(message.eventTypes)) + return "eventTypes: array expected"; + for (var i = 0; i < message.eventTypes.length; ++i) + switch (message.eventTypes[i]) { + default: + return "eventTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.payloadFormat != null && message.hasOwnProperty("payloadFormat")) + switch (message.payloadFormat) { + default: + return "payloadFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + */ + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.NotificationConfig) + return object; + var message = new $root.google.storagetransfer.v1.NotificationConfig(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.eventTypes) { + if (!Array.isArray(object.eventTypes)) + throw TypeError(".google.storagetransfer.v1.NotificationConfig.eventTypes: array expected"); + message.eventTypes = []; + for (var i = 0; i < object.eventTypes.length; ++i) + switch (object.eventTypes[i]) { + default: + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventTypes[i] = 0; + break; + case "TRANSFER_OPERATION_SUCCESS": + case 1: + message.eventTypes[i] = 1; + break; + case "TRANSFER_OPERATION_FAILED": + case 2: + message.eventTypes[i] = 2; + break; + case "TRANSFER_OPERATION_ABORTED": + case 3: + message.eventTypes[i] = 3; + break; + } + } + switch (object.payloadFormat) { + case "PAYLOAD_FORMAT_UNSPECIFIED": + case 0: + message.payloadFormat = 0; + break; + case "NONE": + case 1: + message.payloadFormat = 1; + break; + case "JSON": + case 2: + message.payloadFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.NotificationConfig} message NotificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.eventTypes = []; + if (options.defaults) { + object.pubsubTopic = ""; + object.payloadFormat = options.enums === String ? "PAYLOAD_FORMAT_UNSPECIFIED" : 0; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.eventTypes && message.eventTypes.length) { + object.eventTypes = []; + for (var j = 0; j < message.eventTypes.length; ++j) + object.eventTypes[j] = options.enums === String ? $root.google.storagetransfer.v1.NotificationConfig.EventType[message.eventTypes[j]] : message.eventTypes[j]; + } + if (message.payloadFormat != null && message.hasOwnProperty("payloadFormat")) + object.payloadFormat = options.enums === String ? $root.google.storagetransfer.v1.NotificationConfig.PayloadFormat[message.payloadFormat] : message.payloadFormat; + return object; + }; + + /** + * Converts this NotificationConfig to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * EventType enum. + * @name google.storagetransfer.v1.NotificationConfig.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} TRANSFER_OPERATION_SUCCESS=1 TRANSFER_OPERATION_SUCCESS value + * @property {number} TRANSFER_OPERATION_FAILED=2 TRANSFER_OPERATION_FAILED value + * @property {number} TRANSFER_OPERATION_ABORTED=3 TRANSFER_OPERATION_ABORTED value + */ + NotificationConfig.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSFER_OPERATION_SUCCESS"] = 1; + values[valuesById[2] = "TRANSFER_OPERATION_FAILED"] = 2; + values[valuesById[3] = "TRANSFER_OPERATION_ABORTED"] = 3; + return values; + })(); + + /** + * PayloadFormat enum. + * @name google.storagetransfer.v1.NotificationConfig.PayloadFormat + * @enum {number} + * @property {number} PAYLOAD_FORMAT_UNSPECIFIED=0 PAYLOAD_FORMAT_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} JSON=2 JSON value + */ + NotificationConfig.PayloadFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PAYLOAD_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); + + return NotificationConfig; + })(); + + v1.LoggingConfig = (function() { + + /** + * Properties of a LoggingConfig. + * @memberof google.storagetransfer.v1 + * @interface ILoggingConfig + * @property {Array.|null} [logActions] LoggingConfig logActions + * @property {Array.|null} [logActionStates] LoggingConfig logActionStates + * @property {boolean|null} [enableOnpremGcsTransferLogs] LoggingConfig enableOnpremGcsTransferLogs + */ + + /** + * Constructs a new LoggingConfig. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a LoggingConfig. + * @implements ILoggingConfig + * @constructor + * @param {google.storagetransfer.v1.ILoggingConfig=} [properties] Properties to set + */ + function LoggingConfig(properties) { + this.logActions = []; + this.logActionStates = []; + 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]]; + } + + /** + * LoggingConfig logActions. + * @member {Array.} logActions + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + */ + LoggingConfig.prototype.logActions = $util.emptyArray; + + /** + * LoggingConfig logActionStates. + * @member {Array.} logActionStates + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + */ + LoggingConfig.prototype.logActionStates = $util.emptyArray; + + /** + * LoggingConfig enableOnpremGcsTransferLogs. + * @member {boolean} enableOnpremGcsTransferLogs + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + */ + LoggingConfig.prototype.enableOnpremGcsTransferLogs = false; + + /** + * Creates a new LoggingConfig instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.ILoggingConfig=} [properties] Properties to set + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig instance + */ + LoggingConfig.create = function create(properties) { + return new LoggingConfig(properties); + }; + + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logActions != null && message.logActions.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.logActions.length; ++i) + writer.int32(message.logActions[i]); + writer.ldelim(); + } + if (message.logActionStates != null && message.logActionStates.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.logActionStates.length; ++i) + writer.int32(message.logActionStates[i]); + writer.ldelim(); + } + if (message.enableOnpremGcsTransferLogs != null && Object.hasOwnProperty.call(message, "enableOnpremGcsTransferLogs")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOnpremGcsTransferLogs); + return writer; + }; + + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.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.storagetransfer.v1.LoggingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.logActions && message.logActions.length)) + message.logActions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.logActions.push(reader.int32()); + } else + message.logActions.push(reader.int32()); + break; + case 2: + if (!(message.logActionStates && message.logActionStates.length)) + message.logActionStates = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.logActionStates.push(reader.int32()); + } else + message.logActionStates.push(reader.int32()); + break; + case 3: + message.enableOnpremGcsTransferLogs = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingConfig message. + * @function verify + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logActions != null && message.hasOwnProperty("logActions")) { + if (!Array.isArray(message.logActions)) + return "logActions: array expected"; + for (var i = 0; i < message.logActions.length; ++i) + switch (message.logActions[i]) { + default: + return "logActions: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.logActionStates != null && message.hasOwnProperty("logActionStates")) { + if (!Array.isArray(message.logActionStates)) + return "logActionStates: array expected"; + for (var i = 0; i < message.logActionStates.length; ++i) + switch (message.logActionStates[i]) { + default: + return "logActionStates: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.enableOnpremGcsTransferLogs != null && message.hasOwnProperty("enableOnpremGcsTransferLogs")) + if (typeof message.enableOnpremGcsTransferLogs !== "boolean") + return "enableOnpremGcsTransferLogs: boolean expected"; + return null; + }; + + /** + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig + */ + LoggingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.LoggingConfig) + return object; + var message = new $root.google.storagetransfer.v1.LoggingConfig(); + if (object.logActions) { + if (!Array.isArray(object.logActions)) + throw TypeError(".google.storagetransfer.v1.LoggingConfig.logActions: array expected"); + message.logActions = []; + for (var i = 0; i < object.logActions.length; ++i) + switch (object.logActions[i]) { + default: + case "LOGGABLE_ACTION_UNSPECIFIED": + case 0: + message.logActions[i] = 0; + break; + case "FIND": + case 1: + message.logActions[i] = 1; + break; + case "DELETE": + case 2: + message.logActions[i] = 2; + break; + case "COPY": + case 3: + message.logActions[i] = 3; + break; + } + } + if (object.logActionStates) { + if (!Array.isArray(object.logActionStates)) + throw TypeError(".google.storagetransfer.v1.LoggingConfig.logActionStates: array expected"); + message.logActionStates = []; + for (var i = 0; i < object.logActionStates.length; ++i) + switch (object.logActionStates[i]) { + default: + case "LOGGABLE_ACTION_STATE_UNSPECIFIED": + case 0: + message.logActionStates[i] = 0; + break; + case "SUCCEEDED": + case 1: + message.logActionStates[i] = 1; + break; + case "FAILED": + case 2: + message.logActionStates[i] = 2; + break; + } + } + if (object.enableOnpremGcsTransferLogs != null) + message.enableOnpremGcsTransferLogs = Boolean(object.enableOnpremGcsTransferLogs); + return message; + }; + + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.LoggingConfig} message LoggingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.logActions = []; + object.logActionStates = []; + } + if (options.defaults) + object.enableOnpremGcsTransferLogs = false; + if (message.logActions && message.logActions.length) { + object.logActions = []; + for (var j = 0; j < message.logActions.length; ++j) + object.logActions[j] = options.enums === String ? $root.google.storagetransfer.v1.LoggingConfig.LoggableAction[message.logActions[j]] : message.logActions[j]; + } + if (message.logActionStates && message.logActionStates.length) { + object.logActionStates = []; + for (var j = 0; j < message.logActionStates.length; ++j) + object.logActionStates[j] = options.enums === String ? $root.google.storagetransfer.v1.LoggingConfig.LoggableActionState[message.logActionStates[j]] : message.logActionStates[j]; + } + if (message.enableOnpremGcsTransferLogs != null && message.hasOwnProperty("enableOnpremGcsTransferLogs")) + object.enableOnpremGcsTransferLogs = message.enableOnpremGcsTransferLogs; + return object; + }; + + /** + * Converts this LoggingConfig to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + * @returns {Object.} JSON object + */ + LoggingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * LoggableAction enum. + * @name google.storagetransfer.v1.LoggingConfig.LoggableAction + * @enum {number} + * @property {number} LOGGABLE_ACTION_UNSPECIFIED=0 LOGGABLE_ACTION_UNSPECIFIED value + * @property {number} FIND=1 FIND value + * @property {number} DELETE=2 DELETE value + * @property {number} COPY=3 COPY value + */ + LoggingConfig.LoggableAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGGABLE_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIND"] = 1; + values[valuesById[2] = "DELETE"] = 2; + values[valuesById[3] = "COPY"] = 3; + return values; + })(); + + /** + * LoggableActionState enum. + * @name google.storagetransfer.v1.LoggingConfig.LoggableActionState + * @enum {number} + * @property {number} LOGGABLE_ACTION_STATE_UNSPECIFIED=0 LOGGABLE_ACTION_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + */ + LoggingConfig.LoggableActionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGGABLE_ACTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + return LoggingConfig; + })(); + + v1.TransferOperation = (function() { + + /** + * Properties of a TransferOperation. + * @memberof google.storagetransfer.v1 + * @interface ITransferOperation + * @property {string|null} [name] TransferOperation name + * @property {string|null} [projectId] TransferOperation projectId + * @property {google.storagetransfer.v1.ITransferSpec|null} [transferSpec] TransferOperation transferSpec + * @property {google.storagetransfer.v1.INotificationConfig|null} [notificationConfig] TransferOperation notificationConfig + * @property {google.protobuf.ITimestamp|null} [startTime] TransferOperation startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TransferOperation endTime + * @property {google.storagetransfer.v1.TransferOperation.Status|null} [status] TransferOperation status + * @property {google.storagetransfer.v1.ITransferCounters|null} [counters] TransferOperation counters + * @property {Array.|null} [errorBreakdowns] TransferOperation errorBreakdowns + * @property {string|null} [transferJobName] TransferOperation transferJobName + */ + + /** + * Constructs a new TransferOperation. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferOperation. + * @implements ITransferOperation + * @constructor + * @param {google.storagetransfer.v1.ITransferOperation=} [properties] Properties to set + */ + function TransferOperation(properties) { + this.errorBreakdowns = []; + 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]]; + } + + /** + * TransferOperation name. + * @member {string} name + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.name = ""; + + /** + * TransferOperation projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.projectId = ""; + + /** + * TransferOperation transferSpec. + * @member {google.storagetransfer.v1.ITransferSpec|null|undefined} transferSpec + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.transferSpec = null; + + /** + * TransferOperation notificationConfig. + * @member {google.storagetransfer.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.notificationConfig = null; + + /** + * TransferOperation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.startTime = null; + + /** + * TransferOperation endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.endTime = null; + + /** + * TransferOperation status. + * @member {google.storagetransfer.v1.TransferOperation.Status} status + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.status = 0; + + /** + * TransferOperation counters. + * @member {google.storagetransfer.v1.ITransferCounters|null|undefined} counters + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.counters = null; + + /** + * TransferOperation errorBreakdowns. + * @member {Array.} errorBreakdowns + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.errorBreakdowns = $util.emptyArray; + + /** + * TransferOperation transferJobName. + * @member {string} transferJobName + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.transferJobName = ""; + + /** + * Creates a new TransferOperation instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.ITransferOperation=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation instance + */ + TransferOperation.create = function create(properties) { + return new TransferOperation(properties); + }; + + /** + * Encodes the specified TransferOperation message. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.ITransferOperation} message TransferOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOperation.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.transferSpec != null && Object.hasOwnProperty.call(message, "transferSpec")) + $root.google.storagetransfer.v1.TransferSpec.encode(message.transferSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.status); + if (message.counters != null && Object.hasOwnProperty.call(message, "counters")) + $root.google.storagetransfer.v1.TransferCounters.encode(message.counters, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.errorBreakdowns != null && message.errorBreakdowns.length) + for (var i = 0; i < message.errorBreakdowns.length; ++i) + $root.google.storagetransfer.v1.ErrorSummary.encode(message.errorBreakdowns[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.transferJobName != null && Object.hasOwnProperty.call(message, "transferJobName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.transferJobName); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.storagetransfer.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferOperation message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.ITransferOperation} message TransferOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOperation message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOperation.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.storagetransfer.v1.TransferOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.projectId = reader.string(); + break; + case 3: + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.decode(reader, reader.uint32()); + break; + case 10: + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + case 4: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.status = reader.int32(); + break; + case 7: + message.counters = $root.google.storagetransfer.v1.TransferCounters.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.errorBreakdowns && message.errorBreakdowns.length)) + message.errorBreakdowns = []; + message.errorBreakdowns.push($root.google.storagetransfer.v1.ErrorSummary.decode(reader, reader.uint32())); + break; + case 9: + message.transferJobName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOperation message. + * @function verify + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOperation.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) { + var error = $root.google.storagetransfer.v1.TransferSpec.verify(message.transferSpec); + if (error) + return "transferSpec." + error; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.storagetransfer.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.counters != null && message.hasOwnProperty("counters")) { + var error = $root.google.storagetransfer.v1.TransferCounters.verify(message.counters); + if (error) + return "counters." + error; + } + if (message.errorBreakdowns != null && message.hasOwnProperty("errorBreakdowns")) { + if (!Array.isArray(message.errorBreakdowns)) + return "errorBreakdowns: array expected"; + for (var i = 0; i < message.errorBreakdowns.length; ++i) { + var error = $root.google.storagetransfer.v1.ErrorSummary.verify(message.errorBreakdowns[i]); + if (error) + return "errorBreakdowns." + error; + } + } + if (message.transferJobName != null && message.hasOwnProperty("transferJobName")) + if (!$util.isString(message.transferJobName)) + return "transferJobName: string expected"; + return null; + }; + + /** + * Creates a TransferOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + */ + TransferOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferOperation) + return object; + var message = new $root.google.storagetransfer.v1.TransferOperation(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.transferSpec != null) { + if (typeof object.transferSpec !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.transferSpec: object expected"); + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.fromObject(object.transferSpec); + } + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.notificationConfig: object expected"); + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.status) { + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "IN_PROGRESS": + case 1: + message.status = 1; + break; + case "PAUSED": + case 2: + message.status = 2; + break; + case "SUCCESS": + case 3: + message.status = 3; + break; + case "FAILED": + case 4: + message.status = 4; + break; + case "ABORTED": + case 5: + message.status = 5; + break; + case "QUEUED": + case 6: + message.status = 6; + break; + } + if (object.counters != null) { + if (typeof object.counters !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.counters: object expected"); + message.counters = $root.google.storagetransfer.v1.TransferCounters.fromObject(object.counters); + } + if (object.errorBreakdowns) { + if (!Array.isArray(object.errorBreakdowns)) + throw TypeError(".google.storagetransfer.v1.TransferOperation.errorBreakdowns: array expected"); + message.errorBreakdowns = []; + for (var i = 0; i < object.errorBreakdowns.length; ++i) { + if (typeof object.errorBreakdowns[i] !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.errorBreakdowns: object expected"); + message.errorBreakdowns[i] = $root.google.storagetransfer.v1.ErrorSummary.fromObject(object.errorBreakdowns[i]); + } + } + if (object.transferJobName != null) + message.transferJobName = String(object.transferJobName); + return message; + }; + + /** + * Creates a plain object from a TransferOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.TransferOperation} message TransferOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorBreakdowns = []; + if (options.defaults) { + object.name = ""; + object.projectId = ""; + object.transferSpec = null; + object.startTime = null; + object.endTime = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.counters = null; + object.transferJobName = ""; + object.notificationConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) + object.transferSpec = $root.google.storagetransfer.v1.TransferSpec.toObject(message.transferSpec, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.storagetransfer.v1.TransferOperation.Status[message.status] : message.status; + if (message.counters != null && message.hasOwnProperty("counters")) + object.counters = $root.google.storagetransfer.v1.TransferCounters.toObject(message.counters, options); + if (message.errorBreakdowns && message.errorBreakdowns.length) { + object.errorBreakdowns = []; + for (var j = 0; j < message.errorBreakdowns.length; ++j) + object.errorBreakdowns[j] = $root.google.storagetransfer.v1.ErrorSummary.toObject(message.errorBreakdowns[j], options); + } + if (message.transferJobName != null && message.hasOwnProperty("transferJobName")) + object.transferJobName = message.transferJobName; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; + + /** + * Converts this TransferOperation to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + * @returns {Object.} JSON object + */ + TransferOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.storagetransfer.v1.TransferOperation.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} PAUSED=2 PAUSED value + * @property {number} SUCCESS=3 SUCCESS value + * @property {number} FAILED=4 FAILED value + * @property {number} ABORTED=5 ABORTED value + * @property {number} QUEUED=6 QUEUED value + */ + TransferOperation.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "PAUSED"] = 2; + values[valuesById[3] = "SUCCESS"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "ABORTED"] = 5; + values[valuesById[6] = "QUEUED"] = 6; + return values; + })(); + + return TransferOperation; + })(); + + return v1; + })(); + + return storagetransfer; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.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.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + 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]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.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.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return v1; + return HttpRule; })(); - return storagetransfer; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a Http. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new Http. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7749,91 +12335,88 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.rules = $util.emptyArray; + CustomHttpPattern.prototype.kind = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new Http instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - Http.create = function create(properties) { - return new Http(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decode = function decode(reader, length) { + CustomHttpPattern.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.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.kind = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -7844,143 +12427,150 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Http.verify = function verify(message) { + CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.Http} message Http + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + if (options.defaults) { + object.kind = ""; + object.path = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; /** - * Converts this Http to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + return CustomHttpPattern; + })(); + + /** + * 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.HttpRule = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a HttpRule. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + * @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 HttpRule. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + 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) @@ -7988,209 +12578,167 @@ } /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype["delete"] = null; + ResourceDescriptor.prototype.type = ""; /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.patch = null; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.custom = null; + ResourceDescriptor.prototype.nameField = ""; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.body = ""; + ResourceDescriptor.prototype.history = 0; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.responseBody = ""; + ResourceDescriptor.prototype.plural = ""; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceDescriptor.prototype.singular = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceDescriptor.prototype.style = $util.emptyArray; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decode = function decode(reader, length) { + ResourceDescriptor.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.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); break; case 3: - message.put = reader.string(); + message.nameField = reader.string(); break; case 4: - message.post = reader.string(); + message.history = reader.int32(); break; case 5: - message["delete"] = reader.string(); + message.plural = reader.string(); break; case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + message.singular = reader.string(); break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + case 10: + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); break; default: reader.skipType(tag & 7); @@ -8201,240 +12749,246 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpRule.verify = function verify(message) { + ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } } return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } } return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; })(); - api.CustomHttpPattern = (function() { + api.ResourceReference = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a ResourceReference. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8442,88 +12996,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.kind = ""; + ResourceReference.prototype.type = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.path = ""; + ResourceReference.prototype.childType = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decode = function decode(reader, length) { + ResourceReference.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.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.string(); + message.type = reader.string(); break; case 2: - message.path = reader.string(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -8534,122 +13088,96 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomHttpPattern.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; return null; }; /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); return message; }; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.type = ""; + object.childType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * 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; + return ResourceReference; })(); return api; @@ -12845,6 +17373,7 @@ * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition */ /** @@ -12857,6 +17386,7 @@ */ function FileOptions(properties) { this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13031,6 +17561,14 @@ */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** * Creates a new FileOptions instance using the specified properties. * @function create @@ -13098,6 +17636,9 @@ 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; }; @@ -13197,6 +17738,11 @@ 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; @@ -13307,6 +17853,15 @@ 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; }; @@ -13384,6 +17939,16 @@ 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; }; @@ -13400,8 +17965,10 @@ 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 = ""; @@ -13469,6 +18036,11 @@ 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; }; @@ -13513,6 +18085,7 @@ * @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 */ /** @@ -13571,6 +18144,14 @@ */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + /** * Creates a new MessageOptions instance using the specified properties. * @function create @@ -13606,6 +18187,8 @@ 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(); return writer; }; @@ -13657,6 +18240,9 @@ message.uninterpretedOption = []; 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()); + break; default: reader.skipType(tag & 7); break; @@ -13713,6 +18299,11 @@ 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 (error) + return ".google.api.resource." + error; + } return null; }; @@ -13746,6 +18337,11 @@ 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"]); + } return message; }; @@ -13769,6 +18365,7 @@ object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; + object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; @@ -13783,6 +18380,8 @@ 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); return object; }; @@ -13814,6 +18413,7 @@ * @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 */ /** @@ -13897,6 +18497,14 @@ */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * 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 @@ -13942,6 +18550,8 @@ 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; }; @@ -14009,6 +18619,9 @@ } 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; @@ -14101,6 +18714,11 @@ 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; }; @@ -14203,6 +18821,11 @@ 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; }; @@ -14230,6 +18853,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = 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] : message.ctype; @@ -14253,6 +18877,8 @@ 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]] : 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; }; diff --git a/protos/protos.json b/protos/protos.json index 7957ba9..33e645e 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -150,6 +150,100 @@ } } ] + }, + "CreateAgentPool": { + "requestType": "CreateAgentPoolRequest", + "responseType": "AgentPool", + "options": { + "(google.api.http).post": "/v1/projects/{project_id=*}/agentPools", + "(google.api.http).body": "agent_pool", + "(google.api.method_signature)": "project_id,agent_pool,agent_pool_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id=*}/agentPools", + "body": "agent_pool" + } + }, + { + "(google.api.method_signature)": "project_id,agent_pool,agent_pool_id" + } + ] + }, + "UpdateAgentPool": { + "requestType": "UpdateAgentPoolRequest", + "responseType": "AgentPool", + "options": { + "(google.api.http).patch": "/v1/{agent_pool.name=projects/*/agentPools/*}", + "(google.api.http).body": "agent_pool", + "(google.api.method_signature)": "agent_pool,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{agent_pool.name=projects/*/agentPools/*}", + "body": "agent_pool" + } + }, + { + "(google.api.method_signature)": "agent_pool,update_mask" + } + ] + }, + "GetAgentPool": { + "requestType": "GetAgentPoolRequest", + "responseType": "AgentPool", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/agentPools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/agentPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAgentPools": { + "requestType": "ListAgentPoolsRequest", + "responseType": "ListAgentPoolsResponse", + "options": { + "(google.api.http).get": "/v1/projects/{project_id=*}/agentPools", + "(google.api.method_signature)": "project_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id=*}/agentPools" + } + }, + { + "(google.api.method_signature)": "project_id" + } + ] + }, + "DeleteAgentPool": { + "requestType": "DeleteAgentPoolRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/agentPools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/agentPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -294,6 +388,104 @@ } } }, + "CreateAgentPoolRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "agentPool": { + "type": "AgentPool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "agentPoolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAgentPoolRequest": { + "fields": { + "agentPool": { + "type": "AgentPool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetAgentPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteAgentPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListAgentPoolsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListAgentPoolsResponse": { + "fields": { + "agentPools": { + "rule": "repeated", + "type": "AgentPool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "GoogleServiceAccount": { "fields": { "accountEmail": { @@ -402,10 +594,7 @@ }, "roleArn": { "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } + "id": 4 } } }, @@ -449,6 +638,62 @@ } } }, + "PosixFilesystem": { + "fields": { + "rootDirectory": { + "type": "string", + "id": 1 + } + } + }, + "AgentPool": { + "options": { + "(google.api.resource).type": "storagetransfer.googleapis.com/agentPools", + "(google.api.resource).pattern": "projects/{project_id}/agentPools/{agent_pool_id}" + }, + "fields": { + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "bandwidthLimit": { + "type": "BandwidthLimit", + "id": 5 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "CREATED": 2, + "DELETING": 3 + } + }, + "BandwidthLimit": { + "fields": { + "limitMbps": { + "type": "int64", + "id": 1 + } + } + } + } + }, "TransferOptions": { "fields": { "overwriteObjectsAlreadyExistingInSink": { @@ -462,6 +707,24 @@ "deleteObjectsFromSourceAfterTransfer": { "type": "bool", "id": 3 + }, + "overwriteWhen": { + "type": "OverwriteWhen", + "id": 4 + }, + "metadataOptions": { + "type": "MetadataOptions", + "id": 5 + } + }, + "nested": { + "OverwriteWhen": { + "values": { + "OVERWRITE_WHEN_UNSPECIFIED": 0, + "DIFFERENT": 1, + "NEVER": 2, + "ALWAYS": 3 + } } } }, @@ -469,7 +732,8 @@ "oneofs": { "dataSink": { "oneof": [ - "gcsDataSink" + "gcsDataSink", + "posixDataSink" ] }, "dataSource": { @@ -477,8 +741,14 @@ "gcsDataSource", "awsS3DataSource", "httpDataSource", + "posixDataSource", "azureBlobStorageDataSource" ] + }, + "intermediateDataLocation": { + "oneof": [ + "gcsIntermediateDataLocation" + ] } }, "fields": { @@ -486,6 +756,10 @@ "type": "GcsData", "id": 4 }, + "posixDataSink": { + "type": "PosixFilesystem", + "id": 13 + }, "gcsDataSource": { "type": "GcsData", "id": 1 @@ -498,10 +772,18 @@ "type": "HttpData", "id": 3 }, + "posixDataSource": { + "type": "PosixFilesystem", + "id": 14 + }, "azureBlobStorageDataSource": { "type": "AzureBlobStorageData", "id": 8 }, + "gcsIntermediateDataLocation": { + "type": "GcsData", + "id": 16 + }, "objectConditions": { "type": "ObjectConditions", "id": 5 @@ -509,6 +791,135 @@ "transferOptions": { "type": "TransferOptions", "id": 6 + }, + "transferManifest": { + "type": "TransferManifest", + "id": 15 + }, + "sourceAgentPoolName": { + "type": "string", + "id": 17 + }, + "sinkAgentPoolName": { + "type": "string", + "id": 18 + } + } + }, + "MetadataOptions": { + "fields": { + "symlink": { + "type": "Symlink", + "id": 1 + }, + "mode": { + "type": "Mode", + "id": 2 + }, + "gid": { + "type": "GID", + "id": 3 + }, + "uid": { + "type": "UID", + "id": 4 + }, + "acl": { + "type": "Acl", + "id": 5 + }, + "storageClass": { + "type": "StorageClass", + "id": 6 + }, + "temporaryHold": { + "type": "TemporaryHold", + "id": 7 + }, + "kmsKey": { + "type": "KmsKey", + "id": 8 + }, + "timeCreated": { + "type": "TimeCreated", + "id": 9 + } + }, + "nested": { + "Symlink": { + "values": { + "SYMLINK_UNSPECIFIED": 0, + "SYMLINK_SKIP": 1, + "SYMLINK_PRESERVE": 2 + } + }, + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "MODE_SKIP": 1, + "MODE_PRESERVE": 2 + } + }, + "GID": { + "values": { + "GID_UNSPECIFIED": 0, + "GID_SKIP": 1, + "GID_NUMBER": 2 + } + }, + "UID": { + "values": { + "UID_UNSPECIFIED": 0, + "UID_SKIP": 1, + "UID_NUMBER": 2 + } + }, + "Acl": { + "values": { + "ACL_UNSPECIFIED": 0, + "ACL_DESTINATION_BUCKET_DEFAULT": 1, + "ACL_PRESERVE": 2 + } + }, + "StorageClass": { + "values": { + "STORAGE_CLASS_UNSPECIFIED": 0, + "STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT": 1, + "STORAGE_CLASS_PRESERVE": 2, + "STORAGE_CLASS_STANDARD": 3, + "STORAGE_CLASS_NEARLINE": 4, + "STORAGE_CLASS_COLDLINE": 5, + "STORAGE_CLASS_ARCHIVE": 6 + } + }, + "TemporaryHold": { + "values": { + "TEMPORARY_HOLD_UNSPECIFIED": 0, + "TEMPORARY_HOLD_SKIP": 1, + "TEMPORARY_HOLD_PRESERVE": 2 + } + }, + "KmsKey": { + "values": { + "KMS_KEY_UNSPECIFIED": 0, + "KMS_KEY_DESTINATION_BUCKET_DEFAULT": 1, + "KMS_KEY_PRESERVE": 2 + } + }, + "TimeCreated": { + "values": { + "TIME_CREATED_UNSPECIFIED": 0, + "TIME_CREATED_SKIP": 1, + "TIME_CREATED_PRESERVE_AS_CUSTOM_TIME": 2 + } + } + } + }, + "TransferManifest": { + "fields": { + "location": { + "type": "string", + "id": 1 } } }, @@ -561,6 +972,10 @@ "type": "NotificationConfig", "id": 11 }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 14 + }, "schedule": { "type": "Schedule", "id": 5 @@ -710,6 +1125,26 @@ "bytesFailedToDeleteFromSink": { "type": "int64", "id": 16 + }, + "directoriesFoundFromSource": { + "type": "int64", + "id": 17 + }, + "directoriesFailedToListFromSource": { + "type": "int64", + "id": 18 + }, + "directoriesSuccessfullyListedFromSource": { + "type": "int64", + "id": 19 + }, + "intermediateObjectsCleanedUp": { + "type": "int64", + "id": 22 + }, + "intermediateObjectsFailedCleanedUp": { + "type": "int64", + "id": 23 } } }, @@ -753,6 +1188,41 @@ } } }, + "LoggingConfig": { + "fields": { + "logActions": { + "rule": "repeated", + "type": "LoggableAction", + "id": 1 + }, + "logActionStates": { + "rule": "repeated", + "type": "LoggableActionState", + "id": 2 + }, + "enableOnpremGcsTransferLogs": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "LoggableAction": { + "values": { + "LOGGABLE_ACTION_UNSPECIFIED": 0, + "FIND": 1, + "DELETE": 2, + "COPY": 3 + } + }, + "LoggableActionState": { + "values": { + "LOGGABLE_ACTION_STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2 + } + } + } + }, "TransferOperation": { "fields": { "name": { @@ -819,7 +1289,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "FieldBehaviorProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -945,6 +1415,83 @@ "UNORDERED_LIST": 6, "NON_EMPTY_DEFAULT": 7 } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } } } }, diff --git a/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json b/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json index 37b94db..8bf69ae 100644 --- a/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json +++ b/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json @@ -15,7 +15,7 @@ "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async", "title": "StorageTransferService getGoogleServiceAccount Sample", "origin": "API_DEFINITION", - "description": " Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud Platform Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", + "description": " Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", "canonical": true, "file": "storage_transfer_service.get_google_service_account.js", "language": "JAVASCRIPT", @@ -102,7 +102,7 @@ "segments": [ { "start": 25, - "end": 84, + "end": 83, "type": "FULL" } ], @@ -154,7 +154,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 56, "type": "FULL" } ], @@ -319,7 +319,7 @@ "regionTag": "storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async", "title": "StorageTransferService runTransferJob Sample", "origin": "API_DEFINITION", - "description": " Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error wil be returned.", + "description": " Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.", "canonical": true, "file": "storage_transfer_service.run_transfer_job.js", "language": "JAVASCRIPT", @@ -358,6 +358,230 @@ } } } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async", + "title": "StorageTransferService createAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Creates an agent pool resource.", + "canonical": true, + "file": "storage_transfer_service.create_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "agent_pool", + "type": ".google.storagetransfer.v1.AgentPool" + }, + { + "name": "agent_pool_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "CreateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async", + "title": "StorageTransferService updateAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing agent pool resource.", + "canonical": true, + "file": "storage_transfer_service.update_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", + "async": true, + "parameters": [ + { + "name": "agent_pool", + "type": ".google.storagetransfer.v1.AgentPool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "UpdateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async", + "title": "StorageTransferService getAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Gets an agent pool.", + "canonical": true, + "file": "storage_transfer_service.get_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "GetAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async", + "title": "StorageTransferService listAgentPools Sample", + "origin": "API_DEFINITION", + "description": " Lists agent pools.", + "canonical": true, + "file": "storage_transfer_service.list_agent_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAgentPools", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.ListAgentPoolsResponse", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "ListAgentPools", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async", + "title": "StorageTransferService deleteAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Deletes an agent pool.", + "canonical": true, + "file": "storage_transfer_service.delete_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "DeleteAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } } ] } diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js b/samples/generated/v1/storage_transfer_service.create_agent_pool.js similarity index 100% rename from owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js rename to samples/generated/v1/storage_transfer_service.create_agent_pool.js diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js b/samples/generated/v1/storage_transfer_service.delete_agent_pool.js similarity index 100% rename from owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js rename to samples/generated/v1/storage_transfer_service.delete_agent_pool.js diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js b/samples/generated/v1/storage_transfer_service.get_agent_pool.js similarity index 100% rename from owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js rename to samples/generated/v1/storage_transfer_service.get_agent_pool.js diff --git a/samples/generated/v1/storage_transfer_service.get_google_service_account.js b/samples/generated/v1/storage_transfer_service.get_google_service_account.js index 47284c6..7c588b9 100644 --- a/samples/generated/v1/storage_transfer_service.get_google_service_account.js +++ b/samples/generated/v1/storage_transfer_service.get_google_service_account.js @@ -26,8 +26,8 @@ function main(projectId) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The ID of the Google Cloud Platform Console project that the - * Google service account is associated with. + * Required. The ID of the Google Cloud project that the Google service + * account is associated with. */ // const projectId = 'abc123' diff --git a/samples/generated/v1/storage_transfer_service.get_transfer_job.js b/samples/generated/v1/storage_transfer_service.get_transfer_job.js index de99857..46ff036 100644 --- a/samples/generated/v1/storage_transfer_service.get_transfer_job.js +++ b/samples/generated/v1/storage_transfer_service.get_transfer_job.js @@ -26,12 +26,11 @@ function main(jobName, projectId) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. - * The job to get. + * Required. The job to get. */ // const jobName = 'abc123' /** - * Required. The ID of the Google Cloud Platform Console project that owns the + * Required. The ID of the Google Cloud project that owns the * job. */ // const projectId = 'abc123' diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js b/samples/generated/v1/storage_transfer_service.list_agent_pools.js similarity index 100% rename from owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js rename to samples/generated/v1/storage_transfer_service.list_agent_pools.js diff --git a/samples/generated/v1/storage_transfer_service.run_transfer_job.js b/samples/generated/v1/storage_transfer_service.run_transfer_job.js index ff4914d..ef1e7da 100644 --- a/samples/generated/v1/storage_transfer_service.run_transfer_job.js +++ b/samples/generated/v1/storage_transfer_service.run_transfer_job.js @@ -30,8 +30,8 @@ function main(jobName, projectId) { */ // const jobName = 'abc123' /** - * Required. The ID of the Google Cloud Platform Console project that owns the - * transfer job. + * Required. The ID of the Google Cloud project that owns the transfer + * job. */ // const projectId = 'abc123' diff --git a/owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js b/samples/generated/v1/storage_transfer_service.update_agent_pool.js similarity index 100% rename from owl-bot-staging/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js rename to samples/generated/v1/storage_transfer_service.update_agent_pool.js diff --git a/samples/generated/v1/storage_transfer_service.update_transfer_job.js b/samples/generated/v1/storage_transfer_service.update_transfer_job.js index 70a11a0..161e303 100644 --- a/samples/generated/v1/storage_transfer_service.update_transfer_job.js +++ b/samples/generated/v1/storage_transfer_service.update_transfer_job.js @@ -30,21 +30,20 @@ function main(jobName, projectId, transferJob) { */ // const jobName = 'abc123' /** - * Required. The ID of the Google Cloud Platform Console project that owns the + * Required. The ID of the Google Cloud project that owns the * job. */ // const projectId = 'abc123' /** - * Required. The job to update. `transferJob` is expected to specify only - * four fields: - * description google.storagetransfer.v1.TransferJob.description, + * Required. The job to update. `transferJob` is expected to specify one or more of + * five fields: description google.storagetransfer.v1.TransferJob.description, * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, * notification_config google.storagetransfer.v1.TransferJob.notification_config, - * and status google.storagetransfer.v1.TransferJob.status. An - * `UpdateTransferJobRequest` that specifies other fields are rejected with - * the error INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. Updating a - * job status to - * DELETED google.storagetransfer.v1.TransferJob.Status.DELETED requires + * logging_config google.storagetransfer.v1.TransferJob.logging_config, and + * status google.storagetransfer.v1.TransferJob.status. An `UpdateTransferJobRequest` that specifies + * other fields are rejected with the error + * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. Updating a job status + * to DELETED google.storagetransfer.v1.TransferJob.Status.DELETED requires * `storagetransfer.jobs.delete` permissions. */ // const transferJob = {} @@ -54,10 +53,10 @@ function main(jobName, projectId, transferJob) { * description google.storagetransfer.v1.TransferJob.description, * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, * notification_config google.storagetransfer.v1.TransferJob.notification_config, - * and status google.storagetransfer.v1.TransferJob.status. To update the - * `transfer_spec` of the job, a complete transfer specification must be - * provided. An incomplete specification missing any required fields is - * rejected with the error + * logging_config google.storagetransfer.v1.TransferJob.logging_config, and + * status google.storagetransfer.v1.TransferJob.status. To update the `transfer_spec` of the job, a + * complete transfer specification must be provided. An incomplete + * specification missing any required fields is rejected with the error * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. */ // const updateTransferJobFieldMask = {} diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json index 030ef57..7f8bdf9 100644 --- a/src/v1/gapic_metadata.json +++ b/src/v1/gapic_metadata.json @@ -40,6 +40,26 @@ "resumeTransferOperation" ] }, + "CreateAgentPool": { + "methods": [ + "createAgentPool" + ] + }, + "UpdateAgentPool": { + "methods": [ + "updateAgentPool" + ] + }, + "GetAgentPool": { + "methods": [ + "getAgentPool" + ] + }, + "DeleteAgentPool": { + "methods": [ + "deleteAgentPool" + ] + }, "RunTransferJob": { "methods": [ "runTransferJob" @@ -51,6 +71,13 @@ "listTransferJobsStream", "listTransferJobsAsync" ] + }, + "ListAgentPools": { + "methods": [ + "listAgentPools", + "listAgentPoolsStream", + "listAgentPoolsAsync" + ] } } }, @@ -87,6 +114,26 @@ "resumeTransferOperation" ] }, + "CreateAgentPool": { + "methods": [ + "createAgentPool" + ] + }, + "UpdateAgentPool": { + "methods": [ + "updateAgentPool" + ] + }, + "GetAgentPool": { + "methods": [ + "getAgentPool" + ] + }, + "DeleteAgentPool": { + "methods": [ + "deleteAgentPool" + ] + }, "RunTransferJob": { "methods": [ "runTransferJob" @@ -98,6 +145,13 @@ "listTransferJobsStream", "listTransferJobsAsync" ] + }, + "ListAgentPools": { + "methods": [ + "listAgentPools", + "listAgentPoolsStream", + "listAgentPoolsAsync" + ] } } } diff --git a/src/v1/storage_transfer_service_client.ts b/src/v1/storage_transfer_service_client.ts index 943dccd..550becb 100644 --- a/src/v1/storage_transfer_service_client.ts +++ b/src/v1/storage_transfer_service_client.ts @@ -65,6 +65,7 @@ export class StorageTransferServiceClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; storageTransferServiceStub?: Promise<{[name: string]: Function}>; @@ -164,6 +165,15 @@ export class StorageTransferServiceClient { // 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 = { + agentPoolsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_id}/agentPools/{agent_pool_id}' + ), + }; + // 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. @@ -173,6 +183,11 @@ export class StorageTransferServiceClient { 'nextPageToken', 'transferJobs' ), + listAgentPools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'agentPools' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -261,6 +276,11 @@ export class StorageTransferServiceClient { 'pauseTransferOperation', 'resumeTransferOperation', 'runTransferJob', + 'createAgentPool', + 'updateAgentPool', + 'getAgentPool', + 'listAgentPools', + 'deleteAgentPool', ]; for (const methodName of storageTransferServiceStubMethods) { const callPromise = this.storageTransferServiceStub.then( @@ -350,7 +370,7 @@ export class StorageTransferServiceClient { * Returns the Google service account that is used by Storage Transfer * Service to access buckets in the project where transfers * run or in other projects. Each Google service account is associated - * with one Google Cloud Platform Console project. Users + * with one Google Cloud project. Users * should add this service account to the Google Cloud Storage bucket * ACLs to grant access to Storage Transfer Service. This service * account is created and owned by Storage Transfer Service and can @@ -359,8 +379,8 @@ export class StorageTransferServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform Console project that the - * Google service account is associated with. + * Required. The ID of the Google Cloud project that the Google service + * account is associated with. * @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. @@ -546,8 +566,8 @@ export class StorageTransferServiceClient { * Updates a transfer job. Updating a job's transfer spec does not affect * transfer operations that are running already. * - * **Note:** The job's {@link google.storagetransfer.v1.TransferJob.status|status} - * field can be modified using this RPC (for example, to set a job's status to + * **Note:** The job's {@link google.storagetransfer.v1.TransferJob.status|status} field can be modified + * using this RPC (for example, to set a job's status to * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}, * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, or * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}). @@ -557,19 +577,18 @@ export class StorageTransferServiceClient { * @param {string} request.jobName * Required. The name of job to update. * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform Console project that owns the + * Required. The ID of the Google Cloud project that owns the * job. * @param {google.storagetransfer.v1.TransferJob} request.transferJob - * Required. The job to update. `transferJob` is expected to specify only - * four fields: - * {@link google.storagetransfer.v1.TransferJob.description|description}, + * Required. The job to update. `transferJob` is expected to specify one or more of + * five fields: {@link google.storagetransfer.v1.TransferJob.description|description}, * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, - * and {@link google.storagetransfer.v1.TransferJob.status|status}. An - * `UpdateTransferJobRequest` that specifies other fields are rejected with - * the error {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. Updating a - * job status to - * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED} requires + * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and + * {@link google.storagetransfer.v1.TransferJob.status|status}. An `UpdateTransferJobRequest` that specifies + * other fields are rejected with the error + * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. Updating a job status + * to {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED} requires * `storagetransfer.jobs.delete` permissions. * @param {google.protobuf.FieldMask} request.updateTransferJobFieldMask * The field mask of the fields in `transferJob` that are to be updated in @@ -577,10 +596,10 @@ export class StorageTransferServiceClient { * {@link google.storagetransfer.v1.TransferJob.description|description}, * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, - * and {@link google.storagetransfer.v1.TransferJob.status|status}. To update the - * `transfer_spec` of the job, a complete transfer specification must be - * provided. An incomplete specification missing any required fields is - * rejected with the error + * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and + * {@link google.storagetransfer.v1.TransferJob.status|status}. To update the `transfer_spec` of the job, a + * complete transfer specification must be provided. An incomplete + * specification missing any required fields is rejected with the error * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -672,10 +691,9 @@ export class StorageTransferServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.jobName - * Required. - * The job to get. + * Required. The job to get. * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform Console project that owns the + * Required. The ID of the Google Cloud project that owns the * job. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -963,19 +981,412 @@ export class StorageTransferServiceClient { callback ); } + /** + * Creates an agent pool resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * agent pool. + * @param {google.storagetransfer.v1.AgentPool} request.agentPool + * Required. The agent pool to create. + * @param {string} request.agentPoolId + * Required. The ID of the agent pool to create. + * + * The `agent_pool_id` must meet the following requirements: + * + * * Length of 128 characters or less. + * * Not start with the string `goog`. + * * Start with a lowercase ASCII character, followed by: + * * Zero or more: lowercase Latin alphabet characters, numerals, + * hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + * * One or more numerals or lowercase ASCII characters. + * + * As expressed by the regular expression: + * `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.create_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async + */ + createAgentPool( + request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest | undefined, + {} | undefined + ] + >; + createAgentPool( + request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAgentPool( + request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAgentPool( + request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest | 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'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); + this.initialize(); + return this.innerApiCalls.createAgentPool(request, options, callback); + } + /** + * Updates an existing agent pool resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storagetransfer.v1.AgentPool} request.agentPool + * Required. The agent pool to update. `agent_pool` is expected to specify following + * fields: + * + * * {@link google.storagetransfer.v1.AgentPool.name|name} + * + * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} + * + * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} + * An `UpdateAgentPoolRequest` with any other fields is rejected + * with the error {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. + * @param {google.protobuf.FieldMask} request.updateMask + * The [field mask] + * (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + * of the fields in `agentPool` to update in this request. + * The following `agentPool` fields can be updated: + * + * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} + * + * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.update_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async + */ + updateAgentPool( + request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | undefined, + {} | undefined + ] + >; + updateAgentPool( + request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAgentPool( + request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAgentPool( + request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | 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'] = + gax.routingHeader.fromParams({ + 'agent_pool.name': request.agentPool!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateAgentPool(request, options, callback); + } + /** + * Gets an agent pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent pool to get. + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.get_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async + */ + getAgentPool( + request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | undefined, + {} | undefined + ] + >; + getAgentPool( + request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, + {} | null | undefined + > + ): void; + getAgentPool( + request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, + {} | null | undefined + > + ): void; + getAgentPool( + request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IGetAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getAgentPool(request, options, callback); + } + /** + * Deletes an agent pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent pool to delete. + * @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 [Empty]{@link google.protobuf.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/storage_transfer_service.delete_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async + */ + deleteAgentPool( + request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | undefined, + {} | undefined + ] + >; + deleteAgentPool( + request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAgentPool( + request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAgentPool( + request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteAgentPool(request, options, callback); + } /** * Attempts to start a new TransferOperation for the current TransferJob. A * TransferJob has a maximum of one active TransferOperation. If this method - * is called while a TransferOperation is active, an error wil be returned. + * is called while a TransferOperation is active, an error will be returned. * * @param {Object} request * The request object that will be sent. * @param {string} request.jobName * Required. The name of the transfer job. * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform Console project that owns the - * transfer job. + * Required. The ID of the Google Cloud project that owns the transfer + * job. * @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. @@ -1316,6 +1727,263 @@ export class StorageTransferServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists agent pools. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The 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 {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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 `listAgentPoolsAsync()` + * 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. + */ + listAgentPools( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool[], + protos.google.storagetransfer.v1.IListAgentPoolsRequest | null, + protos.google.storagetransfer.v1.IListAgentPoolsResponse + ] + >; + listAgentPools( + request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + > + ): void; + listAgentPools( + request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + > + ): void; + listAgentPools( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + >, + callback?: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool[], + protos.google.storagetransfer.v1.IListAgentPoolsRequest | null, + protos.google.storagetransfer.v1.IListAgentPoolsResponse + ] + > | 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'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); + this.initialize(); + return this.innerApiCalls.listAgentPools(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.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The 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 {Stream} + * An object stream which emits an object representing [AgentPool]{@link google.storagetransfer.v1.AgentPool} 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 `listAgentPoolsAsync()` + * 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. + */ + listAgentPoolsStream( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); + const defaultCallSettings = this._defaults['listAgentPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAgentPools.createStream( + this.innerApiCalls.listAgentPools as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAgentPools`, 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.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The 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 + * [AgentPool]{@link google.storagetransfer.v1.AgentPool}. 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/storage_transfer_service.list_agent_pools.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async + */ + listAgentPoolsAsync( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); + const defaultCallSettings = this._defaults['listAgentPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAgentPools.asyncIterate( + this.innerApiCalls['listAgentPools'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agentPools resource name string. + * + * @param {string} project_id + * @param {string} agent_pool_id + * @returns {string} Resource name string. + */ + agentPoolsPath(projectId: string, agentPoolId: string) { + return this.pathTemplates.agentPoolsPathTemplate.render({ + project_id: projectId, + agent_pool_id: agentPoolId, + }); + } + + /** + * Parse the project_id from AgentPools resource. + * + * @param {string} agentPoolsName + * A fully-qualified path representing agentPools resource. + * @returns {string} A string representing the project_id. + */ + matchProjectIdFromAgentPoolsName(agentPoolsName: string) { + return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName) + .project_id; + } + + /** + * Parse the agent_pool_id from AgentPools resource. + * + * @param {string} agentPoolsName + * A fully-qualified path representing agentPools resource. + * @returns {string} A string representing the agent_pool_id. + */ + matchAgentPoolIdFromAgentPoolsName(agentPoolsName: string) { + return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName) + .agent_pool_id; + } /** * Terminate the gRPC channel and close the client. diff --git a/src/v1/storage_transfer_service_client_config.json b/src/v1/storage_transfer_service_client_config.json index 116bacc..6e42410 100644 --- a/src/v1/storage_transfer_service_client_config.json +++ b/src/v1/storage_transfer_service_client_config.json @@ -21,42 +21,67 @@ }, "methods": { "GetGoogleServiceAccount": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateTransferJob": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateTransferJob": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetTransferJob": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListTransferJobs": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "PauseTransferOperation": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ResumeTransferOperation": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "RunTransferJob": { - "timeout_millis": 60000, + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAgentPool": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAgentPool": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAgentPool": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAgentPools": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAgentPool": { + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/test/gapic_storage_transfer_service_v1.ts b/test/gapic_storage_transfer_service_v1.ts index 2eceed7..99d5cd7 100644 --- a/test/gapic_storage_transfer_service_v1.ts +++ b/test/gapic_storage_transfer_service_v1.ts @@ -1026,6 +1026,530 @@ describe('v1.StorageTransferServiceClient', () => { }); }); + describe('createAgentPool', () => { + it('invokes createAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.createAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.createAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.createAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAgentPool( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createAgentPool(request), expectedError); + assert( + (client.innerApiCalls.createAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAgentPool(request), expectedError); + }); + }); + + describe('updateAgentPool', () => { + it('invokes updateAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedHeaderRequestParams = 'agent_pool.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.updateAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.updateAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedHeaderRequestParams = 'agent_pool.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.updateAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAgentPool( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedHeaderRequestParams = 'agent_pool.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAgentPool(request), expectedError); + assert( + (client.innerApiCalls.updateAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool = {}; + request.agentPool.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAgentPool(request), expectedError); + }); + }); + + describe('getAgentPool', () => { + it('invokes getAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.getAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.getAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.getAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgentPool( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAgentPool(request), expectedError); + assert( + (client.innerApiCalls.getAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAgentPool(request), expectedError); + }); + }); + + describe('deleteAgentPool', () => { + it('invokes deleteAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAgentPool( + 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); + assert( + (client.innerApiCalls.deleteAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAgentPool(request), expectedError); + assert( + (client.innerApiCalls.deleteAgentPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAgentPool(request), expectedError); + }); + }); + describe('runTransferJob', () => { it('invokes runTransferJob without error', async () => { const client = @@ -1481,4 +2005,347 @@ describe('v1.StorageTransferServiceClient', () => { ); }); }); + + describe('listAgentPools', () => { + it('invokes listAgentPools without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.innerApiCalls.listAgentPools = stubSimpleCall(expectedResponse); + const [response] = await client.listAgentPools(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAgentPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAgentPools without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.innerApiCalls.listAgentPools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAgentPools( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAgentPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAgentPools with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAgentPools = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAgentPools(request), expectedError); + assert( + (client.innerApiCalls.listAgentPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAgentPoolsStream without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.descriptors.page.listAgentPools.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAgentPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.AgentPool[] = []; + stream.on( + 'data', + (response: protos.google.storagetransfer.v1.AgentPool) => { + 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.listAgentPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgentPools, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listAgentPools.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAgentPoolsStream with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedError = new Error('expected'); + client.descriptors.page.listAgentPools.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAgentPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.AgentPool[] = []; + stream.on( + 'data', + (response: protos.google.storagetransfer.v1.AgentPool) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAgentPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgentPools, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listAgentPools.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAgentPools without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.descriptors.page.listAgentPools.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; + const iterable = client.listAgentPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAgentPools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listAgentPools.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAgentPools with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedError = new Error('expected'); + client.descriptors.page.listAgentPools.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAgentPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAgentPools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listAgentPools.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agentPools', () => { + const fakePath = '/rendered/path/agentPools'; + const expectedParameters = { + project_id: 'projectIdValue', + agent_pool_id: 'agentPoolIdValue', + }; + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPoolsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPoolsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPoolsPath', () => { + const result = client.agentPoolsPath( + 'projectIdValue', + 'agentPoolIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPoolsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectIdFromAgentPoolsName', () => { + const result = client.matchProjectIdFromAgentPoolsName(fakePath); + assert.strictEqual(result, 'projectIdValue'); + assert( + (client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentPoolIdFromAgentPoolsName', () => { + const result = client.matchAgentPoolIdFromAgentPoolsName(fakePath); + assert.strictEqual(result, 'agentPoolIdValue'); + assert( + (client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); });