diff --git a/owl-bot-staging/google-storagetransfer/v1/.eslintignore b/owl-bot-staging/google-storagetransfer/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-storagetransfer/v1/.eslintrc.json b/owl-bot-staging/google-storagetransfer/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-storagetransfer/v1/.gitignore b/owl-bot-staging/google-storagetransfer/v1/.gitignore deleted file mode 100644 index 4e9ab31e1f6..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -!protos/* -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-storagetransfer/v1/.jsdoc.js b/owl-bot-staging/google-storagetransfer/v1/.jsdoc.js deleted file mode 100644 index 30d996aa2ab..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/storage-transfer', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-storagetransfer/v1/.mocharc.js b/owl-bot-staging/google-storagetransfer/v1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-storagetransfer/v1/.prettierrc.js b/owl-bot-staging/google-storagetransfer/v1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-storagetransfer/v1/README.md b/owl-bot-staging/google-storagetransfer/v1/README.md deleted file mode 100644 index dc9f51c118d..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Storagetransfer: Nodejs Client diff --git a/owl-bot-staging/google-storagetransfer/v1/linkinator.config.json b/owl-bot-staging/google-storagetransfer/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-storagetransfer/v1/package.json b/owl-bot-staging/google-storagetransfer/v1/package.json deleted file mode 100644 index 7a74e2294dc..00000000000 --- a/owl-bot-staging/google-storagetransfer/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/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.6" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.2", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-storagetransfer/v1/protos/google/storagetransfer/v1/transfer.proto b/owl-bot-staging/google-storagetransfer/v1/protos/google/storagetransfer/v1/transfer.proto deleted file mode 100644 index 802cc104613..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/protos/google/storagetransfer/v1/transfer.proto +++ /dev/null @@ -1,387 +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" - }; - } - - // Deletes a transfer job. Deleting a transfer job sets its status to - // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. - rpc DeleteTransferJob(DeleteTransferJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{job_name=transferJobs/**}" - }; - } - - // 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` permission. - 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]; -} - -// Request passed to DeleteTransferJob. -message DeleteTransferJobRequest { - // Required. The job to delete. - 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/google-storagetransfer/v1/protos/google/storagetransfer/v1/transfer_types.proto b/owl-bot-staging/google-storagetransfer/v1/protos/google/storagetransfer/v1/transfer_types.proto deleted file mode 100644 index 4e1a3b5f208..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/protos/google/storagetransfer/v1/transfer_types.proto +++ /dev/null @@ -1,1227 +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; -} - -// An AwsS3CompatibleData resource. -message AwsS3CompatibleData { - // Required. Specifies the name of the bucket. - string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Specifies the 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 = 2; - - // Required. Specifies the endpoint of the storage service. - string endpoint = 3 [(google.api.field_behavior) = REQUIRED]; - - // Specifies the region to sign requests with. This can be left blank if - // requests should be signed with an empty region. - string region = 5; - - // Specifies the metadata of the S3 compatible data provider. Each provider - // may contain some attributes that do not apply to all S3-compatible data - // providers. When not specified, S3CompatibleMetadata is used by default. - oneof data_provider { - // A S3 compatible metadata. - S3CompatibleMetadata s3_metadata = 4; - } -} - -// S3CompatibleMetadata contains the metadata fields that apply to the basic -// types of S3-compatible data providers. -message S3CompatibleMetadata { - // The authentication and authorization method used by the storage service. - enum AuthMethod { - // AuthMethod is not specified. - AUTH_METHOD_UNSPECIFIED = 0; - - // Auth requests with AWS SigV4. - AUTH_METHOD_AWS_SIGNATURE_V4 = 1; - - // Auth requests with AWS SigV2. - AUTH_METHOD_AWS_SIGNATURE_V2 = 2; - } - - // The request model of the API. - enum RequestModel { - // RequestModel is not specified. - REQUEST_MODEL_UNSPECIFIED = 0; - - // Perform requests using Virtual Hosted Style. - // Example: https://bucket-name.s3.region.amazonaws.com/key-name - REQUEST_MODEL_VIRTUAL_HOSTED_STYLE = 1; - - // Perform requests using Path Style. - // Example: https://s3.region.amazonaws.com/bucket-name/key-name - REQUEST_MODEL_PATH_STYLE = 2; - } - - // The agent network protocol to access the storage service. - enum NetworkProtocol { - // NetworkProtocol is not specified. - NETWORK_PROTOCOL_UNSPECIFIED = 0; - - // Perform requests using HTTPS. - NETWORK_PROTOCOL_HTTPS = 1; - - // Not recommended: This sends data in clear-text. This is only - // appropriate within a closed network or for publicly available data. - // Perform requests using HTTP. - NETWORK_PROTOCOL_HTTP = 2; - } - - // The Listing API to use for discovering objects. - enum ListApi { - // ListApi is not specified. - LIST_API_UNSPECIFIED = 0; - - // Perform listing using ListObjectsV2 API. - LIST_OBJECTS_V2 = 1; - - // Legacy ListObjects API. - LIST_OBJECTS = 2; - } - - // Specifies the authentication and authorization method used by the storage - // service. When not specified, Transfer Service will attempt to determine - // right auth method to use. - AuthMethod auth_method = 1; - - // Specifies the API request model used to call the storage service. When not - // specified, the default value of RequestModel - // REQUEST_MODEL_VIRTUAL_HOSTED_STYLE is used. - RequestModel request_model = 2; - - // Specifies the network protocol of the agent. When not specified, the - // default value of NetworkProtocol NETWORK_PROTOCOL_HTTPS is used. - NetworkProtocol protocol = 3; - - // The Listing API to use for discovering objects. When not specified, - // Transfer Service will attempt to determine the right API to use. - ListApi list_api = 4; -} - -// 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 { - // Overwrite behavior is unspecified. - OVERWRITE_WHEN_UNSPECIFIED = 0; - - // Overwrites destination objects with the source objects, only if the - // objects have the same name but different HTTP ETags or checksum values. - DIFFERENT = 1; - - // Never overwrites a destination object if a source object has the - // same name. In this case, the source object is not transferred. - NEVER = 2; - - // Always overwrite the destination object with the source object, even if - // the HTTP Etags or checksum values are the same. - 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. - 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; - - // An AWS S3 compatible data source. - AwsS3CompatibleData aws_s3_compatible_data_source = 19; - } - - // 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/google-storagetransfer/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json deleted file mode 100644 index 5dd0a101d49..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json +++ /dev/null @@ -1,631 +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": 54, - "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": 53, - "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": 86, - "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": 59, - "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": 73, - "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": 53, - "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": 53, - "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": 60, - "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_DeleteTransferJob_async", - "title": "StorageTransferService deleteTransferJob Sample", - "origin": "API_DEFINITION", - "description": " Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].", - "canonical": true, - "file": "storage_transfer_service.delete_transfer_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteTransferJob", - "async": true, - "parameters": [ - { - "name": "job_name", - "type": "TYPE_STRING" - }, - { - "name": "project_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "StorageTransferServiceClient", - "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" - }, - "method": { - "shortName": "DeleteTransferJob", - "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteTransferJob", - "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": 73, - "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": 68, - "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": 53, - "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": 72, - "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": 53, - "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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js deleted file mode 100644 index 684d021a66d..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.create_agent_pool.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, agentPool, agentPoolId) { - // [START storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js deleted file mode 100644 index 4e2fdba40be..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.create_transfer_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(transferJob) { - // [START storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js deleted file mode 100644 index 3013f51fd94..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.delete_agent_pool.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.delete_transfer_job.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.delete_transfer_job.js deleted file mode 100644 index 942e62775d3..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.delete_transfer_job.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(jobName, projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The job to delete. - */ - // 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 callDeleteTransferJob() { - // Construct request - const request = { - jobName, - projectId, - }; - - // Run request - const response = await storagetransferClient.deleteTransferJob(request); - console.log(response); - } - - callDeleteTransferJob(); - // [END storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js deleted file mode 100644 index 15791dd9c0f..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_agent_pool.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js deleted file mode 100644 index 27239ad7a47..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_google_service_account.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js deleted file mode 100644 index a91466547b0..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.get_transfer_job.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(jobName, projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js deleted file mode 100644 index 4460c68509a..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.list_agent_pools.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js deleted file mode 100644 index fc317c883ea..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(filter) { - // [START storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js deleted file mode 100644 index c51a9747fa1..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js deleted file mode 100644 index 09b71931b34..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js deleted file mode 100644 index 1c76166da48..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.run_transfer_job.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(jobName, projectId) { - // [START storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js deleted file mode 100644 index be4424e1b37..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.update_agent_pool.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(agentPool) { - // [START storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The 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/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js b/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js deleted file mode 100644 index 279be65876d..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/samples/generated/v1/storage_transfer_service.update_transfer_job.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(jobName, projectId, transferJob) { - // [START storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of 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` permission. - */ - // 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/google-storagetransfer/v1/src/index.ts b/owl-bot-staging/google-storagetransfer/v1/src/index.ts deleted file mode 100644 index af13372fd4c..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const 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/google-storagetransfer/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-storagetransfer/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 4155aeb813c..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,171 +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" - ] - }, - "DeleteTransferJob": { - "methods": [ - "deleteTransferJob" - ] - }, - "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" - ] - }, - "DeleteTransferJob": { - "methods": [ - "deleteTransferJob" - ] - }, - "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/google-storagetransfer/v1/src/v1/index.ts b/owl-bot-staging/google-storagetransfer/v1/src/v1/index.ts deleted file mode 100644 index 767bfeddd95..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {StorageTransferServiceClient} from './storage_transfer_service_client'; diff --git a/owl-bot-staging/google-storagetransfer/v1/src/v1/storage_transfer_service_client.ts b/owl-bot-staging/google-storagetransfer/v1/src/v1/storage_transfer_service_client.ts deleted file mode 100644 index 78c4a565236..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/src/v1/storage_transfer_service_client.ts +++ /dev/null @@ -1,1919 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/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'; -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/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new StorageTransferServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=transferOperations/**}:cancel',body: '*',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=transferOperations/**}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=transferOperations}',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.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', 'deleteTransferJob', '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._opts.fallback - ); - - 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' - ] = this._gaxModule.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` permission. - * @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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.resumeTransferOperation(request, options, callback); - } -/** - * Deletes a transfer job. Deleting a transfer job sets its status to - * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.jobName - * Required. The job to delete. - * @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 [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_transfer_job.js - * region_tag:storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_async - */ - deleteTransferJob( - request?: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteTransferJobRequest|undefined, {}|undefined - ]>; - deleteTransferJob( - request: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteTransferJobRequest|null|undefined, - {}|null|undefined>): void; - deleteTransferJob( - request: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteTransferJobRequest|null|undefined, - {}|null|undefined>): void; - deleteTransferJob( - request?: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteTransferJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteTransferJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.storagetransfer.v1.IDeleteTransferJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'job_name': request.jobName ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteTransferJob(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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runTransferJob, this._gaxModule.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 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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified 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/google-storagetransfer/v1/src/v1/storage_transfer_service_client_config.json b/owl-bot-staging/google-storagetransfer/v1/src/v1/storage_transfer_service_client_config.json deleted file mode 100644 index 93b45375803..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/src/v1/storage_transfer_service_client_config.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "interfaces": { - "google.storagetransfer.v1.StorageTransferService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "264268458a9e88347dbacbd9398202ff5885a40b": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2, - "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": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "CreateTransferJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTransferJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "GetTransferJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ListTransferJobs": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "PauseTransferOperation": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ResumeTransferOperation": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "RunTransferJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "DeleteTransferJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "CreateAgentPool": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "UpdateAgentPool": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "GetAgentPool": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ListAgentPools": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "DeleteAgentPool": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - } - } - } - } -} diff --git a/owl-bot-staging/google-storagetransfer/v1/src/v1/storage_transfer_service_proto_list.json b/owl-bot-staging/google-storagetransfer/v1/src/v1/storage_transfer_service_proto_list.json deleted file mode 100644 index ea755b43ae3..00000000000 --- a/owl-bot-staging/google-storagetransfer/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/google-storagetransfer/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-storagetransfer/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 967959a660a..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const storagetransfer = require('@google-cloud/storage-transfer'); - -function main() { - const storageTransferServiceClient = new storagetransfer.StorageTransferServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-storagetransfer/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-storagetransfer/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 0bd7a99a535..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {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/google-storagetransfer/v1/system-test/install.ts b/owl-bot-staging/google-storagetransfer/v1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-storagetransfer/v1/test/gapic_storage_transfer_service_v1.ts b/owl-bot-staging/google-storagetransfer/v1/test/gapic_storage_transfer_service_v1.ts deleted file mode 100644 index 7d0df1931bb..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/test/gapic_storage_transfer_service_v1.ts +++ /dev/null @@ -1,2242 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as storagetransferserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.StorageTransferServiceClient', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetGoogleServiceAccountRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.storagetransfer.v1.GoogleServiceAccount() - ); - client.innerApiCalls.getGoogleServiceAccount = stubSimpleCall(expectedResponse); - const [response] = await client.getGoogleServiceAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetGoogleServiceAccountRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetGoogleServiceAccountRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getGoogleServiceAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getGoogleServiceAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGoogleServiceAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetGoogleServiceAccountRequest', ['projectId']); - request.projectId = defaultValue1; - 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 expectedResponse = generateSampleMessage( - new protos.google.storagetransfer.v1.TransferJob() - ); - client.innerApiCalls.createTransferJob = stubSimpleCall(expectedResponse); - const [response] = await client.createTransferJob(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - 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 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); - }); - - 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 expectedError = new Error('expected'); - client.innerApiCalls.createTransferJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTransferJob(request), expectedError); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.storagetransfer.v1.TransferJob() - ); - client.innerApiCalls.updateTransferJob = stubSimpleCall(expectedResponse); - const [response] = await client.updateTransferJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTransferJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTransferJob(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.storagetransfer.v1.TransferJob() - ); - client.innerApiCalls.getTransferJob = stubSimpleCall(expectedResponse); - const [response] = await client.getTransferJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTransferJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTransferJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.PauseTransferOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.pauseTransferOperation = stubSimpleCall(expectedResponse); - const [response] = await client.pauseTransferOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.PauseTransferOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.PauseTransferOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseTransferOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pauseTransferOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseTransferOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.PauseTransferOperationRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ResumeTransferOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.resumeTransferOperation = stubSimpleCall(expectedResponse); - const [response] = await client.resumeTransferOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ResumeTransferOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ResumeTransferOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeTransferOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resumeTransferOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeTransferOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ResumeTransferOperationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeTransferOperation(request), expectedError); - }); - }); - - describe('deleteTransferJob', () => { - it('invokes deleteTransferJob 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.DeleteTransferJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTransferJob = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTransferJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTransferJob 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.DeleteTransferJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTransferJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTransferJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTransferJob 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.DeleteTransferJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTransferJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTransferJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTransferJob 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.DeleteTransferJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTransferJob(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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.CreateAgentPoolRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.storagetransfer.v1.AgentPool() - ); - client.innerApiCalls.createAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.createAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.CreateAgentPoolRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.CreateAgentPoolRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAgentPool(request), expectedError); - const actualRequest = (client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.CreateAgentPoolRequest', ['projectId']); - request.projectId = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateAgentPoolRequest', ['agentPool', 'name']); - request.agentPool.name = defaultValue1; - const expectedHeaderRequestParams = `agent_pool.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.storagetransfer.v1.AgentPool() - ); - client.innerApiCalls.updateAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.updateAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateAgentPoolRequest', ['agentPool', 'name']); - request.agentPool.name = defaultValue1; - const expectedHeaderRequestParams = `agent_pool.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateAgentPoolRequest', ['agentPool', 'name']); - request.agentPool.name = defaultValue1; - const expectedHeaderRequestParams = `agent_pool.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAgentPool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.UpdateAgentPoolRequest', ['agentPool', 'name']); - request.agentPool.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetAgentPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.storagetransfer.v1.AgentPool() - ); - client.innerApiCalls.getAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.getAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetAgentPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetAgentPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAgentPool(request), expectedError); - const actualRequest = (client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.GetAgentPoolRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteAgentPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAgentPool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAgentPool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteAgentPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteAgentPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAgentPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAgentPool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAgentPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.DeleteAgentPoolRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.RunTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.RunTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.RunTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.runTransferJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.runTransferJob(request), expectedError); - const actualRequest = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.RunTransferJobRequest', ['jobName']); - request.jobName = defaultValue1; - const expectedHeaderRequestParams = `job_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.runTransferJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.runTransferJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runTransferJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 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); - }); - - 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 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); - }); - - 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 expectedError = new Error('expected'); - client.innerApiCalls.listTransferJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTransferJobs(request), expectedError); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ListAgentPoolsRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ListAgentPoolsRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ListAgentPoolsRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAgentPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAgentPools(request), expectedError); - const actualRequest = (client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAgentPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ListAgentPoolsRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - 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( - (client.descriptors.page.listAgentPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ListAgentPoolsRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - 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( - (client.descriptors.page.listAgentPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ListAgentPoolsRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - 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( - (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('.google.storagetransfer.v1.ListAgentPoolsRequest', ['projectId']); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1}`; - 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( - (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new storagetransferserviceModule.v1.StorageTransferServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('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/google-storagetransfer/v1/tsconfig.json b/owl-bot-staging/google-storagetransfer/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-storagetransfer/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-storagetransfer/v1/webpack.config.js b/owl-bot-staging/google-storagetransfer/v1/webpack.config.js deleted file mode 100644 index 08a3efca8f8..00000000000 --- a/owl-bot-staging/google-storagetransfer/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/owl-bot-staging/grafeas/v1/.eslintignore b/owl-bot-staging/grafeas/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/grafeas/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/grafeas/v1/.eslintrc.json b/owl-bot-staging/grafeas/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/grafeas/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/grafeas/v1/.gitignore b/owl-bot-staging/grafeas/v1/.gitignore deleted file mode 100644 index 4e9ab31e1f6..00000000000 --- a/owl-bot-staging/grafeas/v1/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -!protos/* -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/grafeas/v1/.jsdoc.js b/owl-bot-staging/grafeas/v1/.jsdoc.js deleted file mode 100644 index 2b15c2e365e..00000000000 --- a/owl-bot-staging/grafeas/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/grafeas', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/grafeas/v1/.mocharc.js b/owl-bot-staging/grafeas/v1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/grafeas/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/grafeas/v1/.prettierrc.js b/owl-bot-staging/grafeas/v1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/grafeas/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/grafeas/v1/README.md b/owl-bot-staging/grafeas/v1/README.md deleted file mode 100644 index fd6804dfd24..00000000000 --- a/owl-bot-staging/grafeas/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Grafeas: Nodejs Client diff --git a/owl-bot-staging/grafeas/v1/linkinator.config.json b/owl-bot-staging/grafeas/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/grafeas/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/grafeas/v1/package.json b/owl-bot-staging/grafeas/v1/package.json deleted file mode 100644 index d6520aeaa96..00000000000 --- a/owl-bot-staging/grafeas/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/grafeas", - "version": "0.1.0", - "description": "Grafeas client for Node.js", - "repository": "googleapis/nodejs-grafeas", - "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 grafeas", - "grafeas", - "grafeas" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.6" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.2", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/attestation.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/attestation.proto deleted file mode 100644 index f2854fe686b..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/attestation.proto +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "grafeas/v1/common.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// An attestation wrapper with a PGP-compatible signature. This message only -// supports `ATTACHED` signatures, where the payload that is signed is included -// alongside the signature itself in the same file. - -// Note kind that represents a logical attestation "role" or "authority". For -// example, an organization might have one `Authority` for "QA" and one for -// "build". This note is intended to act strictly as a grouping mechanism for -// the attached occurrences (Attestations). This grouping mechanism also -// provides a security boundary, since IAM ACLs gate the ability for a principle -// to attach an occurrence to a given note. It also provides a single point of -// lookup to find all attached attestation occurrences, even if they don't all -// live in the same project. -message AttestationNote { - // This submessage provides human-readable hints about the purpose of the - // authority. Because the name of a note acts as its resource reference, it is - // important to disambiguate the canonical name of the Note (which might be a - // UUID for security purposes) from "readable" names more suitable for debug - // output. Note that these hints should not be used to look up authorities in - // security sensitive contexts, such as when looking up attestations to - // verify. - message Hint { - // Required. The human readable name of this attestation authority, for - // example "qa". - string human_readable_name = 1; - } - - // Hint hints at the purpose of the attestation authority. - Hint hint = 1; -} - -message Jwt { - // The compact encoding of a JWS, which is always three base64 encoded strings - // joined by periods. For details, see: - // https://tools.ietf.org/html/rfc7515.html#section-3.1 - string compact_jwt = 1; -} - -// Occurrence that represents a single "attestation". The authenticity of an -// attestation can be verified using the attached signature. If the verifier -// trusts the public key of the signer, then verifying the signature is -// sufficient to establish trust. In this circumstance, the authority to which -// this attestation is attached is primarily useful for lookup (how to find -// this attestation if you already know the authority and artifact to be -// verified) and intent (for which authority this attestation was intended to -// sign. -message AttestationOccurrence { - // Required. The serialized payload that is verified by one or more - // `signatures`. - bytes serialized_payload = 1; - // One or more signatures over `serialized_payload`. Verifier implementations - // should consider this attestation message verified if at least one - // `signature` verifies `serialized_payload`. See `Signature` in common.proto - // for more details on signature structure and verification. - repeated Signature signatures = 2; - // One or more JWTs encoding a self-contained attestation. - // Each JWT encodes the payload that it verifies within the JWT itself. - // Verifier implementation SHOULD ignore the `serialized_payload` field - // when verifying these JWTs. - // If only JWTs are present on this AttestationOccurrence, then the - // `serialized_payload` SHOULD be left empty. - // Each JWT SHOULD encode a claim specific to the `resource_uri` of this - // Occurrence, but this is not validated by Grafeas metadata API - // implementations. The JWT itself is opaque to Grafeas. - repeated Jwt jwts = 3; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/build.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/build.proto deleted file mode 100644 index 172637fd459..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/build.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "grafeas/v1/intoto_provenance.proto"; -import "grafeas/v1/intoto_statement.proto"; -import "grafeas/v1/provenance.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// Note holding the version of the provider's builder and the signature of the -// provenance message in the build details occurrence. -message BuildNote { - // Required. Immutable. Version of the builder which produced this build. - string builder_version = 1; -} - -// Details of a build occurrence. -message BuildOccurrence { - // The actual provenance for the build. - grafeas.v1.BuildProvenance provenance = 1; - - // Serialized JSON representation of the provenance, used in generating the - // build signature in the corresponding build note. After verifying the - // signature, `provenance_bytes` can be unmarshalled and compared to the - // provenance to confirm that it is unchanged. A base64-encoded string - // representation of the provenance bytes is used for the signature in order - // to interoperate with openssl which expects this format for signature - // verification. - // - // The serialized form is captured both to avoid ambiguity in how the - // provenance is marshalled to json as well to prevent incompatibilities with - // future changes. - string provenance_bytes = 2; - - // Deprecated. See InTotoStatement for the replacement. - // In-toto Provenance representation as defined in spec. - InTotoProvenance intoto_provenance = 3; - - // In-toto Statement representation as defined in spec. - // The intoto_statement can contain any type of provenance. The serialized - // payload of the statement can be stored and signed in the Occurrence's - // envelope. - InTotoStatement intoto_statement = 4; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/common.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/common.proto deleted file mode 100644 index 80bd7869968..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/common.proto +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// Kind represents the kinds of notes supported. -enum NoteKind { - // Default value. This value is unused. - NOTE_KIND_UNSPECIFIED = 0; - // The note and occurrence represent a package vulnerability. - VULNERABILITY = 1; - // The note and occurrence assert build provenance. - BUILD = 2; - // This represents an image basis relationship. - IMAGE = 3; - // This represents a package installed via a package manager. - PACKAGE = 4; - // The note and occurrence track deployment events. - DEPLOYMENT = 5; - // The note and occurrence track the initial discovery status of a resource. - DISCOVERY = 6; - // This represents a logical "role" that can attest to artifacts. - ATTESTATION = 7; - // This represents an available package upgrade. - UPGRADE = 8; - // This represents a Compliance Note - COMPLIANCE = 9; - // This represents a DSSE attestation Note - DSSE_ATTESTATION = 10; -} - -// Metadata for any related URL information. -message RelatedUrl { - // Specific URL associated with the resource. - string url = 1; - // Label to describe usage of the URL. - string label = 2; -} - -// Verifiers (e.g. Kritis implementations) MUST verify signatures -// with respect to the trust anchors defined in policy (e.g. a Kritis policy). -// Typically this means that the verifier has been configured with a map from -// `public_key_id` to public key material (and any required parameters, e.g. -// signing algorithm). -// -// In particular, verification implementations MUST NOT treat the signature -// `public_key_id` as anything more than a key lookup hint. The `public_key_id` -// DOES NOT validate or authenticate a public key; it only provides a mechanism -// for quickly selecting a public key ALREADY CONFIGURED on the verifier through -// a trusted channel. Verification implementations MUST reject signatures in any -// of the following circumstances: -// * The `public_key_id` is not recognized by the verifier. -// * The public key that `public_key_id` refers to does not verify the -// signature with respect to the payload. -// -// The `signature` contents SHOULD NOT be "attached" (where the payload is -// included with the serialized `signature` bytes). Verifiers MUST ignore any -// "attached" payload and only verify signatures with respect to explicitly -// provided payload (e.g. a `payload` field on the proto message that holds -// this Signature, or the canonical serialization of the proto message that -// holds this signature). -message Signature { - // The content of the signature, an opaque bytestring. - // The payload that this signature verifies MUST be unambiguously provided - // with the Signature during verification. A wrapper message might provide - // the payload explicitly. Alternatively, a message might have a canonical - // serialization that can always be unambiguously computed to derive the - // payload. - bytes signature = 1; - - // The identifier for the public key that verifies this signature. - // * The `public_key_id` is required. - // * The `public_key_id` SHOULD be an RFC3986 conformant URI. - // * When possible, the `public_key_id` SHOULD be an immutable reference, - // such as a cryptographic digest. - // - // Examples of valid `public_key_id`s: - // - // OpenPGP V4 public key fingerprint: - // * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA" - // See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more - // details on this scheme. - // - // RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER - // serialization): - // * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU" - // * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5" - string public_key_id = 2; -} - -// MUST match -// https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An -// authenticated message of arbitrary type. -message Envelope { - bytes payload = 1; - string payload_type = 2; - repeated EnvelopeSignature signatures = 3; -} - -message EnvelopeSignature { - bytes sig = 1; - string keyid = 2; -} - -// Indicates the location at which a package was found. -message FileLocation { - // For jars that are contained inside .war files, this filepath - // can indicate the path to war file combined with the path to jar file. - string file_path = 1; -} - -// License information. -message License { - // Often a single license can be used to represent the licensing terms. - // Sometimes it is necessary to include a choice of one or more licenses - // or some combination of license identifiers. - // Examples: "LGPL-2.1-only OR MIT", "LGPL-2.1-only AND MIT", - // "GPL-2.0-or-later WITH Bison-exception-2.2". - string expression = 1; - - // Comments - string comments = 2; -} - -// Digest information. -message Digest { - // `SHA1`, `SHA512` etc. - string algo = 1; - - // Value of the digest. - bytes digest_bytes = 2; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/compliance.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/compliance.proto deleted file mode 100644 index 688fa82596b..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/compliance.proto +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2021 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "grafeas/v1/severity.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -message ComplianceNote { - // The title that identifies this compliance check. - string title = 1; - // A description about this compliance check. - string description = 2; - // The OS and config versions the benchmark applies to. - repeated grafeas.v1.ComplianceVersion version = 3; - // A rationale for the existence of this compliance check. - string rationale = 4; - // A description of remediation steps if the compliance check fails. - string remediation = 5; - // A compliance check that is a CIS benchmark. - message CisBenchmark { - int32 profile_level = 1; - grafeas.v1.Severity severity = 2; - } - oneof compliance_type { - CisBenchmark cis_benchmark = 6; - } - // Serialized scan instructions with a predefined format. - bytes scan_instructions = 7; -} - -// Describes the CIS benchmark version that is applicable to a given OS and -// os version. -message ComplianceVersion { - // The CPE URI (https://cpe.mitre.org/specification/) this benchmark is - // applicable to. - string cpe_uri = 1; - // The name of the document that defines this benchmark, e.g. "CIS - // Container-Optimized OS". - string benchmark_document = 3; - // The version of the benchmark. This is set to the version of the OS-specific - // CIS document the benchmark is defined in. - string version = 2; -} - -// An indication that the compliance checks in the associated ComplianceNote -// were not satisfied for particular resources or a specified reason. -message ComplianceOccurrence { - repeated NonCompliantFile non_compliant_files = 2; - string non_compliance_reason = 3; -} - -// Details about files that caused a compliance check to fail. -message NonCompliantFile { - // display_command is a single command that can be used to display a list of - // non compliant files. When there is no such command, we can also iterate a - // list of non compliant file using 'path'. - - // Empty if `display_command` is set. - string path = 1; - // Command to display the non-compliant files. - string display_command = 2; - // Explains why a file is non compliant for a CIS check. - string reason = 3; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/cvss.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/cvss.proto deleted file mode 100644 index 181ec052fe4..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/cvss.proto +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; -option java_outer_classname = "CVSSProto"; - -// Common Vulnerability Scoring System version 3. -// For details, see https://www.first.org/cvss/specification-document -message CVSSv3 { - // The base score is a function of the base metric scores. - float base_score = 1; - - float exploitability_score = 2; - - float impact_score = 3; - - // Base Metrics - // Represents the intrinsic characteristics of a vulnerability that are - // constant over time and across user environments. - AttackVector attack_vector = 5; - AttackComplexity attack_complexity = 6; - PrivilegesRequired privileges_required = 7; - UserInteraction user_interaction = 8; - Scope scope = 9; - Impact confidentiality_impact = 10; - Impact integrity_impact = 11; - Impact availability_impact = 12; - - enum AttackVector { - ATTACK_VECTOR_UNSPECIFIED = 0; - ATTACK_VECTOR_NETWORK = 1; - ATTACK_VECTOR_ADJACENT = 2; - ATTACK_VECTOR_LOCAL = 3; - ATTACK_VECTOR_PHYSICAL = 4; - } - - enum AttackComplexity { - ATTACK_COMPLEXITY_UNSPECIFIED = 0; - ATTACK_COMPLEXITY_LOW = 1; - ATTACK_COMPLEXITY_HIGH = 2; - } - - enum PrivilegesRequired { - PRIVILEGES_REQUIRED_UNSPECIFIED = 0; - PRIVILEGES_REQUIRED_NONE = 1; - PRIVILEGES_REQUIRED_LOW = 2; - PRIVILEGES_REQUIRED_HIGH = 3; - } - - enum UserInteraction { - USER_INTERACTION_UNSPECIFIED = 0; - USER_INTERACTION_NONE = 1; - USER_INTERACTION_REQUIRED = 2; - } - - enum Scope { - SCOPE_UNSPECIFIED = 0; - SCOPE_UNCHANGED = 1; - SCOPE_CHANGED = 2; - } - - enum Impact { - IMPACT_UNSPECIFIED = 0; - IMPACT_HIGH = 1; - IMPACT_LOW = 2; - IMPACT_NONE = 3; - } -} - -// Common Vulnerability Scoring System. -// For details, see https://www.first.org/cvss/specification-document -// This is a message we will try to use for storing various versions of CVSS -// rather than making a separate proto for storing a specific version. -message CVSS { - // The base score is a function of the base metric scores. - float base_score = 1; - - float exploitability_score = 2; - - float impact_score = 3; - - // Base Metrics - // Represents the intrinsic characteristics of a vulnerability that are - // constant over time and across user environments. - AttackVector attack_vector = 4; - AttackComplexity attack_complexity = 5; - Authentication authentication = 6; - PrivilegesRequired privileges_required = 7; - UserInteraction user_interaction = 8; - Scope scope = 9; - Impact confidentiality_impact = 10; - Impact integrity_impact = 11; - Impact availability_impact = 12; - - enum AttackVector { - ATTACK_VECTOR_UNSPECIFIED = 0; - ATTACK_VECTOR_NETWORK = 1; - ATTACK_VECTOR_ADJACENT = 2; - ATTACK_VECTOR_LOCAL = 3; - ATTACK_VECTOR_PHYSICAL = 4; - } - - enum AttackComplexity { - ATTACK_COMPLEXITY_UNSPECIFIED = 0; - ATTACK_COMPLEXITY_LOW = 1; - ATTACK_COMPLEXITY_HIGH = 2; - } - - enum Authentication { - AUTHENTICATION_UNSPECIFIED = 0; - AUTHENTICATION_MULTIPLE = 1; - AUTHENTICATION_SINGLE = 2; - AUTHENTICATION_NONE = 3; - } - - enum PrivilegesRequired { - PRIVILEGES_REQUIRED_UNSPECIFIED = 0; - PRIVILEGES_REQUIRED_NONE = 1; - PRIVILEGES_REQUIRED_LOW = 2; - PRIVILEGES_REQUIRED_HIGH = 3; - } - - enum UserInteraction { - USER_INTERACTION_UNSPECIFIED = 0; - USER_INTERACTION_NONE = 1; - USER_INTERACTION_REQUIRED = 2; - } - - enum Scope { - SCOPE_UNSPECIFIED = 0; - SCOPE_UNCHANGED = 1; - SCOPE_CHANGED = 2; - } - - enum Impact { - IMPACT_UNSPECIFIED = 0; - IMPACT_HIGH = 1; - IMPACT_LOW = 2; - IMPACT_NONE = 3; - } -} - -// CVSS Version. -enum CVSSVersion { - CVSS_VERSION_UNSPECIFIED = 0; - CVSS_VERSION_2 = 1; - CVSS_VERSION_3 = 2; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/deployment.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/deployment.proto deleted file mode 100644 index 5204004fd64..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/deployment.proto +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// An artifact that can be deployed in some runtime. -message DeploymentNote { - // Required. Resource URI for the artifact being deployed. - repeated string resource_uri = 1; -} - -// The period during which some deployable was active in a runtime. -message DeploymentOccurrence { - // Identity of the user that triggered this deployment. - string user_email = 1; - - // Required. Beginning of the lifetime of this deployment. - google.protobuf.Timestamp deploy_time = 2; - - // End of the lifetime of this deployment. - google.protobuf.Timestamp undeploy_time = 3; - - // Configuration used to create this deployment. - string config = 4; - - // Address of the runtime element hosting this deployment. - string address = 5; - - // Output only. Resource URI for the artifact being deployed taken from - // the deployable field with the same name. - repeated string resource_uri = 6; - - // Types of platforms. - enum Platform { - // Unknown. - PLATFORM_UNSPECIFIED = 0; - // Google Container Engine. - GKE = 1; - // Google App Engine: Flexible Environment. - FLEX = 2; - // Custom user-defined platform. - CUSTOM = 3; - } - // Platform hosting this deployment. - Platform platform = 7; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/discovery.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/discovery.proto deleted file mode 100644 index bfb94e4a347..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/discovery.proto +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "grafeas/v1/common.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// A note that indicates a type of analysis a provider would perform. This note -// exists in a provider's project. A `Discovery` occurrence is created in a -// consumer's project at the start of analysis. -message DiscoveryNote { - // Required. Immutable. The kind of analysis that is handled by this - // discovery. - grafeas.v1.NoteKind analysis_kind = 1; -} - -// Provides information about the analysis status of a discovered resource. -message DiscoveryOccurrence { - // Whether the resource is continuously analyzed. - enum ContinuousAnalysis { - // Unknown. - CONTINUOUS_ANALYSIS_UNSPECIFIED = 0; - // The resource is continuously analyzed. - ACTIVE = 1; - // The resource is ignored for continuous analysis. - INACTIVE = 2; - } - - // Whether the resource is continuously analyzed. - ContinuousAnalysis continuous_analysis = 1; - - // Analysis status for a resource. Currently for initial analysis only (not - // updated in continuous analysis). - enum AnalysisStatus { - option allow_alias = true; - - // Unknown. - ANALYSIS_STATUS_UNSPECIFIED = 0; - // Resource is known but no action has been taken yet. - PENDING = 1; - // Resource is being analyzed. - SCANNING = 2; - // Analysis has finished successfully. - FINISHED_SUCCESS = 3; - // Analysis has completed. - COMPLETE = 3; - // Analysis has finished unsuccessfully, the analysis itself is in a bad - // state. - FINISHED_FAILED = 4; - // The resource is known not to be supported. - FINISHED_UNSUPPORTED = 5; - } - - // The status of discovery for the resource. - AnalysisStatus analysis_status = 2; - - // Indicates which analysis completed successfully. Multiple types of - // analysis can be performed on a single resource. - message AnalysisCompleted { - repeated string analysis_type = 1; - } - - AnalysisCompleted analysis_completed = 7; - - // Indicates any errors encountered during analysis of a resource. There - // could be 0 or more of these errors. - repeated google.rpc.Status analysis_error = 8; - - // When an error is encountered this will contain a LocalizedMessage under - // details to show to the user. The LocalizedMessage is output only and - // populated by the API. - google.rpc.Status analysis_status_error = 3; - - // The CPE of the resource being scanned. - string cpe = 4; - - // The last time this resource was scanned. - google.protobuf.Timestamp last_scan_time = 5; - - // The time occurrences related to this discovery occurrence were archived. - google.protobuf.Timestamp archive_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/dsse_attestation.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/dsse_attestation.proto deleted file mode 100644 index 34ba3df9f9b..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/dsse_attestation.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2021 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "grafeas/v1/common.proto"; -import "grafeas/v1/intoto_statement.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -message DSSEAttestationNote { - // This submessage provides human-readable hints about the purpose of the - // authority. Because the name of a note acts as its resource reference, it is - // important to disambiguate the canonical name of the Note (which might be a - // UUID for security purposes) from "readable" names more suitable for debug - // output. Note that these hints should not be used to look up authorities in - // security sensitive contexts, such as when looking up attestations to - // verify. - message DSSEHint { - // Required. The human readable name of this attestation authority, for - // example "cloudbuild-prod". - string human_readable_name = 1; - } - // DSSEHint hints at the purpose of the attestation authority. - DSSEHint hint = 1; -} - -// Deprecated. Prefer to use a regular Occurrence, and populate the -// Envelope at the top level of the Occurrence. -message DSSEAttestationOccurrence { - // If doing something security critical, make sure to verify the signatures in - // this metadata. - Envelope envelope = 1; - oneof decoded_payload { - InTotoStatement statement = 2; - } -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/grafeas.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/grafeas.proto deleted file mode 100644 index 5665fe3623e..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/grafeas.proto +++ /dev/null @@ -1,544 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "grafeas/v1/attestation.proto"; -import "grafeas/v1/build.proto"; -import "grafeas/v1/common.proto"; -import "grafeas/v1/compliance.proto"; -import "grafeas/v1/deployment.proto"; -import "grafeas/v1/discovery.proto"; -import "grafeas/v1/dsse_attestation.proto"; -import "grafeas/v1/image.proto"; -import "grafeas/v1/package.proto"; -import "grafeas/v1/upgrade.proto"; -import "grafeas/v1/vulnerability.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; -option (google.api.resource_definition) = { - type: "grafeas.io/Project" - pattern: "projects/{project}" -}; - -// [Grafeas](https://grafeas.io) API. -// -// Retrieves analysis results of Cloud components such as Docker container -// images. -// -// Analysis results are stored as a series of occurrences. An `Occurrence` -// contains information about a specific analysis instance on a resource. An -// occurrence refers to a `Note`. A note contains details describing the -// analysis and is generally stored in a separate project, called a `Provider`. -// Multiple occurrences can refer to the same note. -// -// For example, an SSL vulnerability could affect multiple images. In this case, -// there would be one note for the vulnerability and an occurrence for each -// image with the vulnerability referring to that note. -service Grafeas { - option (google.api.default_host) = "containeranalysis.googleapis.com"; - - // Gets the specified occurrence. - rpc GetOccurrence(GetOccurrenceRequest) returns (Occurrence) { - option (google.api.http) = { - get: "/v1/{name=projects/*/occurrences/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists occurrences for the specified project. - rpc ListOccurrences(ListOccurrencesRequest) - returns (ListOccurrencesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/occurrences" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Deletes the specified occurrence. For example, use this method to delete an - // occurrence when the occurrence is no longer applicable for the given - // resource. - rpc DeleteOccurrence(DeleteOccurrenceRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/occurrences/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new occurrence. - rpc CreateOccurrence(CreateOccurrenceRequest) returns (Occurrence) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/occurrences" - body: "occurrence" - }; - option (google.api.method_signature) = "parent,occurrence"; - } - - // Creates new occurrences in batch. - rpc BatchCreateOccurrences(BatchCreateOccurrencesRequest) - returns (BatchCreateOccurrencesResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/occurrences:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,occurrences"; - } - - // Updates the specified occurrence. - rpc UpdateOccurrence(UpdateOccurrenceRequest) returns (Occurrence) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/occurrences/*}" - body: "occurrence" - }; - option (google.api.method_signature) = "name,occurrence,update_mask"; - } - - // Gets the note attached to the specified occurrence. Consumer projects can - // use this method to get a note that belongs to a provider project. - rpc GetOccurrenceNote(GetOccurrenceNoteRequest) returns (Note) { - option (google.api.http) = { - get: "/v1/{name=projects/*/occurrences/*}/notes" - }; - option (google.api.method_signature) = "name"; - } - - // Gets the specified note. - rpc GetNote(GetNoteRequest) returns (Note) { - option (google.api.http) = { - get: "/v1/{name=projects/*/notes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists notes for the specified project. - rpc ListNotes(ListNotesRequest) returns (ListNotesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/notes" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Deletes the specified note. - rpc DeleteNote(DeleteNoteRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/notes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new note. - rpc CreateNote(CreateNoteRequest) returns (Note) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/notes" - body: "note" - }; - option (google.api.method_signature) = "parent,note_id,note"; - } - - // Creates new notes in batch. - rpc BatchCreateNotes(BatchCreateNotesRequest) - returns (BatchCreateNotesResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*}/notes:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,notes"; - } - - // Updates the specified note. - rpc UpdateNote(UpdateNoteRequest) returns (Note) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/notes/*}" - body: "note" - }; - option (google.api.method_signature) = "name,note,update_mask"; - } - - // Lists occurrences referencing the specified note. Provider projects can use - // this method to get all occurrences across consumer projects referencing the - // specified note. - rpc ListNoteOccurrences(ListNoteOccurrencesRequest) - returns (ListNoteOccurrencesResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/notes/*}/occurrences" - }; - option (google.api.method_signature) = "name,filter"; - } -} - -// An instance of an analysis type that has been found on a resource. -message Occurrence { - option (google.api.resource) = { - type: "grafeas.io/Occurrence" - pattern: "projects/{project}/occurrences/{occurrence}" - }; - - // Output only. The name of the occurrence in the form of - // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - string name = 1; - - // Required. Immutable. A URI that represents the resource for which the - // occurrence applies. For example, - // `https://gcr.io/project/image@sha256:123abc` for a Docker image. - string resource_uri = 2; - - // Required. Immutable. The analysis note associated with this occurrence, in - // the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be - // used as a filter in list requests. - string note_name = 3; - - // Output only. This explicitly denotes which of the occurrence details are - // specified. This field can be used as a filter in list requests. - grafeas.v1.NoteKind kind = 4; - - // A description of actions that can be taken to remedy the note. - string remediation = 5; - - // Output only. The time this occurrence was created. - google.protobuf.Timestamp create_time = 6; - - // Output only. The time this occurrence was last updated. - google.protobuf.Timestamp update_time = 7; - - // Required. Immutable. Describes the details of the note kind found on this - // resource. - oneof details { - // Describes a security vulnerability. - grafeas.v1.VulnerabilityOccurrence vulnerability = 8; - // Describes a verifiable build. - grafeas.v1.BuildOccurrence build = 9; - // Describes how this resource derives from the basis in the associated - // note. - grafeas.v1.ImageOccurrence image = 10; - // Describes the installation of a package on the linked resource. - grafeas.v1.PackageOccurrence package = 11; - // Describes the deployment of an artifact on a runtime. - grafeas.v1.DeploymentOccurrence deployment = 12; - // Describes when a resource was discovered. - grafeas.v1.DiscoveryOccurrence discovery = 13; - // Describes an attestation of an artifact. - grafeas.v1.AttestationOccurrence attestation = 14; - // Describes an available package upgrade on the linked resource. - grafeas.v1.UpgradeOccurrence upgrade = 15; - // Describes a compliance violation on a linked resource. - grafeas.v1.ComplianceOccurrence compliance = 16; - // Describes an attestation of an artifact using dsse. - grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; - } - - // https://github.com/secure-systems-lab/dsse - grafeas.v1.Envelope envelope = 18; -} - -// A type of analysis that can be done for a resource. -message Note { - option (google.api.resource) = { - type: "grafeas.io/Note" - pattern: "projects/{project}/notes/{note}" - }; - - // Output only. The name of the note in the form of - // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - string name = 1; - - // A one sentence description of this note. - string short_description = 2; - - // A detailed description of this note. - string long_description = 3; - - // Output only. The type of analysis. This field can be used as a filter in - // list requests. - grafeas.v1.NoteKind kind = 4; - - // URLs associated with this note. - repeated grafeas.v1.RelatedUrl related_url = 5; - - // Time of expiration for this note. Empty if note does not expire. - google.protobuf.Timestamp expiration_time = 6; - - // Output only. The time this note was created. This field can be used as a - // filter in list requests. - google.protobuf.Timestamp create_time = 7; - - // Output only. The time this note was last updated. This field can be used as - // a filter in list requests. - google.protobuf.Timestamp update_time = 8; - - // Other notes related to this note. - repeated string related_note_names = 9; - - // Required. Immutable. The type of analysis this note represents. - oneof type { - // A note describing a package vulnerability. - grafeas.v1.VulnerabilityNote vulnerability = 10; - // A note describing build provenance for a verifiable build. - grafeas.v1.BuildNote build = 11; - // A note describing a base image. - grafeas.v1.ImageNote image = 12; - // A note describing a package hosted by various package managers. - grafeas.v1.PackageNote package = 13; - // A note describing something that can be deployed. - grafeas.v1.DeploymentNote deployment = 14; - // A note describing the initial analysis of a resource. - grafeas.v1.DiscoveryNote discovery = 15; - // A note describing an attestation role. - grafeas.v1.AttestationNote attestation = 16; - // A note describing available package upgrades. - grafeas.v1.UpgradeNote upgrade = 17; - // A note describing a compliance check. - grafeas.v1.ComplianceNote compliance = 18; - // A note describing a dsse attestation note. - grafeas.v1.DSSEAttestationNote dsse_attestation = 19; - } -} - -// Request to get an occurrence. -message GetOccurrenceRequest { - // The name of the occurrence in the form of - // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Occurrence" - ]; -} - -// Request to list occurrences. -message ListOccurrencesRequest { - // The name of the project to list occurrences for in the form of - // `projects/[PROJECT_ID]`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Project" - ]; - - // The filter expression. - string filter = 2; - - // Number of occurrences to return in the list. Must be positive. Max allowed - // page size is 1000. If not specified, page size defaults to 20. - int32 page_size = 3; - - // Token to provide to skip to a particular spot in the list. - string page_token = 4; -} - -// Response for listing occurrences. -message ListOccurrencesResponse { - // The occurrences requested. - repeated Occurrence occurrences = 1; - // The next pagination token in the list response. It should be used as - // `page_token` for the following request. An empty value means no more - // results. - string next_page_token = 2; -} - -// Request to delete an occurrence. -message DeleteOccurrenceRequest { - // The name of the occurrence in the form of - // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Occurrence" - ]; -} - -// Request to create a new occurrence. -message CreateOccurrenceRequest { - // The name of the project in the form of `projects/[PROJECT_ID]`, under which - // the occurrence is to be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Project" - ]; - // The occurrence to create. - Occurrence occurrence = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to update an occurrence. -message UpdateOccurrenceRequest { - // The name of the occurrence in the form of - // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Occurrence" - ]; - // The updated occurrence. - Occurrence occurrence = 2 [(google.api.field_behavior) = REQUIRED]; - // The fields to update. - google.protobuf.FieldMask update_mask = 3; -} - -// Request to get a note. -message GetNoteRequest { - // The name of the note in the form of - // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Note" - ]; -} - -// Request to get the note to which the specified occurrence is attached. -message GetOccurrenceNoteRequest { - // The name of the occurrence in the form of - // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Occurrence" - ]; -} - -// Request to list notes. -message ListNotesRequest { - // The name of the project to list notes for in the form of - // `projects/[PROJECT_ID]`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Project" - ]; - - // The filter expression. - string filter = 2; - - // Number of notes to return in the list. Must be positive. Max allowed page - // size is 1000. If not specified, page size defaults to 20. - int32 page_size = 3; - - // Token to provide to skip to a particular spot in the list. - string page_token = 4; -} - -// Response for listing notes. -message ListNotesResponse { - // The notes requested. - repeated Note notes = 1; - // The next pagination token in the list response. It should be used as - // `page_token` for the following request. An empty value means no more - // results. - string next_page_token = 2; -} - -// Request to delete a note. -message DeleteNoteRequest { - // The name of the note in the form of - // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Note" - ]; -} - -// Request to create a new note. -message CreateNoteRequest { - // The name of the project in the form of `projects/[PROJECT_ID]`, under which - // the note is to be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Project" - ]; - // The ID to use for this note. - string note_id = 2 [(google.api.field_behavior) = REQUIRED]; - // The note to create. - Note note = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to update a note. -message UpdateNoteRequest { - // The name of the note in the form of - // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Note" - ]; - // The updated note. - Note note = 2 [(google.api.field_behavior) = REQUIRED]; - // The fields to update. - google.protobuf.FieldMask update_mask = 3; -} - -// Request to list occurrences for a note. -message ListNoteOccurrencesRequest { - // The name of the note to list occurrences for in the form of - // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Note" - ]; - // The filter expression. - string filter = 2; - // Number of occurrences to return in the list. - int32 page_size = 3; - // Token to provide to skip to a particular spot in the list. - string page_token = 4; -} - -// Response for listing occurrences for a note. -message ListNoteOccurrencesResponse { - // The occurrences attached to the specified note. - repeated Occurrence occurrences = 1; - // Token to provide to skip to a particular spot in the list. - string next_page_token = 2; -} - -// Request to create notes in batch. -message BatchCreateNotesRequest { - // The name of the project in the form of `projects/[PROJECT_ID]`, under which - // the notes are to be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Project" - ]; - - // The notes to create. Max allowed length is 1000. - map notes = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for creating notes in batch. -message BatchCreateNotesResponse { - // The notes that were created. - repeated Note notes = 1; -} - -// Request to create occurrences in batch. -message BatchCreateOccurrencesRequest { - // The name of the project in the form of `projects/[PROJECT_ID]`, under which - // the occurrences are to be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference).type = "grafeas.io/Project" - ]; - - // The occurrences to create. Max allowed length is 1000. - repeated Occurrence occurrences = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for creating occurrences in batch. -message BatchCreateOccurrencesResponse { - // The occurrences that were created. - repeated Occurrence occurrences = 1; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/image.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/image.proto deleted file mode 100644 index 9ac162cec22..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/image.proto +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// Layer holds metadata specific to a layer of a Docker image. -message Layer { - // Required. The recovered Dockerfile directive used to construct this layer. - // See https://docs.docker.com/engine/reference/builder/ for more information. - string directive = 1; - - // The recovered arguments to the Dockerfile directive. - string arguments = 2; -} - -// A set of properties that uniquely identify a given Docker image. -message Fingerprint { - // Required. The layer ID of the final layer in the Docker image's v1 - // representation. - string v1_name = 1; - - // Required. The ordered list of v2 blobs that represent a given image. - repeated string v2_blob = 2; - - // Output only. The name of the image's v2 blobs computed via: - // [bottom] := v2_blob[bottom] - // [N] := sha256(v2_blob[N] + " " + v2_name[N+1]) - // Only the name of the final blob is kept. - string v2_name = 3; -} - -// Basis describes the base image portion (Note) of the DockerImage -// relationship. Linked occurrences are derived from this or an equivalent image -// via: -// FROM -// Or an equivalent reference, e.g., a tag of the resource_url. -message ImageNote { - // Required. Immutable. The resource_url for the resource representing the - // basis of associated occurrence images. - string resource_url = 1; - - // Required. Immutable. The fingerprint of the base image. - Fingerprint fingerprint = 2; -} - -// Details of the derived image portion of the DockerImage relationship. This -// image would be produced from a Dockerfile with FROM . -message ImageOccurrence { - // Required. The fingerprint of the derived image. - Fingerprint fingerprint = 1; - - // Output only. The number of layers by which this image differs from the - // associated image basis. - int32 distance = 2; - - // This contains layer-specific metadata, if populated it has length - // "distance" and is ordered with [distance] being the layer immediately - // following the base image and [1] being the final layer. - repeated Layer layer_info = 3; - - // Output only. This contains the base image URL for the derived image - // occurrence. - string base_resource_url = 4; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/intoto_provenance.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/intoto_provenance.proto deleted file mode 100644 index 78886b66e48..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/intoto_provenance.proto +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2021 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; -option java_outer_classname = "InTotoProvenanceProto"; - -// Spec defined at -// https://github.com/in-toto/attestation/blob/main/spec/predicates/provenance.md - -// Steps taken to build the artifact. -// For a TaskRun, typically each container corresponds to one step in the -// recipe. -message Recipe { - // URI indicating what type of recipe was performed. It determines the meaning - // of recipe.entryPoint, recipe.arguments, recipe.environment, and materials. - string type = 1; - // Index in materials containing the recipe steps that are not implied by - // recipe.type. For example, if the recipe type were "make", then this would - // point to the source containing the Makefile, not the make program itself. - // Set to -1 if the recipe doesn't come from a material, as zero is default - // unset value for int64. - int64 defined_in_material = 2; - // String identifying the entry point into the build. - // This is often a path to a configuration file and/or a target label within - // that file. The syntax and meaning are defined by recipe.type. For example, - // if the recipe type were "make", then this would reference the directory in - // which to run make as well as which target to use. - string entry_point = 3; - // Collection of all external inputs that influenced the build on top of - // recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe - // type were "make", then this might be the flags passed to make aside from - // the target, which is captured in recipe.entryPoint. Since the arguments - // field can greatly vary in structure, depending on the builder and recipe - // type, this is of form "Any". - repeated google.protobuf.Any arguments = 4; - // Any other builder-controlled inputs necessary for correctly evaluating the - // recipe. Usually only needed for reproducing the build but not evaluated as - // part of policy. Since the environment field can greatly vary in structure, - // depending on the builder and recipe type, this is of form "Any". - repeated google.protobuf.Any environment = 5; -} - -// Indicates that the builder claims certain fields in this message to be -// complete. -message Completeness { - // If true, the builder claims that recipe.arguments is complete, meaning that - // all external inputs are properly captured in the recipe. - bool arguments = 1; - // If true, the builder claims that recipe.environment is claimed to be - // complete. - bool environment = 2; - // If true, the builder claims that materials are complete, usually through - // some controls to prevent network access. Sometimes called "hermetic". - bool materials = 3; -} - -// Other properties of the build. -message Metadata { - // Identifies the particular build invocation, which can be useful for finding - // associated logs or other ad-hoc analysis. The value SHOULD be globally - // unique, per in-toto Provenance spec. - string build_invocation_id = 1; - // The timestamp of when the build started. - google.protobuf.Timestamp build_started_on = 2; - // The timestamp of when the build completed. - google.protobuf.Timestamp build_finished_on = 3; - // Indicates that the builder claims certain fields in this message to be - // complete. - Completeness completeness = 4; - // If true, the builder claims that running the recipe on materials will - // produce bit-for-bit identical output. - bool reproducible = 5; -} - -message BuilderConfig { - string id = 1; -} - -message InTotoProvenance { - BuilderConfig builder_config = 1; // required - // Identifies the configuration used for the build. - // When combined with materials, this SHOULD fully describe the build, - // such that re-running this recipe results in bit-for-bit identical output - // (if the build is reproducible). - Recipe recipe = 2; // required - Metadata metadata = 3; - // The collection of artifacts that influenced the build including sources, - // dependencies, build tools, base images, and so on. This is considered to be - // incomplete unless metadata.completeness.materials is true. Unset or null is - // equivalent to empty. - repeated string materials = 4; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/intoto_statement.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/intoto_statement.proto deleted file mode 100644 index 1f798d0d65f..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/intoto_statement.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2021 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "grafeas/v1/intoto_provenance.proto"; -import "grafeas/v1/slsa_provenance.proto"; -import "grafeas/v1/slsa_provenance_zero_two.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; -option java_outer_classname = "InTotoStatementProto"; - -// Spec defined at -// https://github.com/in-toto/attestation/tree/main/spec#statement The -// serialized InTotoStatement will be stored as Envelope.payload. -// Envelope.payloadType is always "application/vnd.in-toto+json". -message InTotoStatement { - // Always `https://in-toto.io/Statement/v0.1`. - string type = 1 [json_name = "_type"]; - repeated Subject subject = 2; - // `https://slsa.dev/provenance/v0.1` for SlsaProvenance. - string predicate_type = 3; - oneof predicate { - InTotoProvenance provenance = 4; - SlsaProvenance slsa_provenance = 5; - SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6; - } -} -message Subject { - string name = 1; - // `"": ""` - // Algorithms can be e.g. sha256, sha512 - // See - // https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet - map digest = 2; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/package.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/package.proto deleted file mode 100644 index 61b21dbf032..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/package.proto +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/api/field_behavior.proto"; -import "grafeas/v1/common.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// Instruction set architectures supported by various package managers. -enum Architecture { - // Unknown architecture. - ARCHITECTURE_UNSPECIFIED = 0; - // X86 architecture. - X86 = 1; - // X64 architecture. - X64 = 2; -} - -// This represents a particular channel of distribution for a given package. -// E.g., Debian's jessie-backports dpkg mirror. -message Distribution { - // The cpe_uri in [CPE format](https://cpe.mitre.org/specification/) - // denoting the package manager version distributing a package. - string cpe_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // The CPU architecture for which packages in this distribution channel were - // built. - Architecture architecture = 2; - - // The latest available version of this package in this distribution channel. - Version latest_version = 3; - - // A freeform string denoting the maintainer of this package. - string maintainer = 4; - - // The distribution channel-specific homepage for this package. - string url = 5; - - // The distribution channel-specific description of this package. - string description = 6; -} - -// An occurrence of a particular package installation found within a system's -// filesystem. E.g., glibc was found in `/var/lib/dpkg/status`. -message Location { - // Deprecated. - // The CPE URI in [CPE format](https://cpe.mitre.org/specification/) - string cpe_uri = 1; - - // Deprecated. - // The version installed at this location. - Version version = 2; - - // The path from which we gathered that this package/version is installed. - string path = 3; -} - -// PackageNote represents a particular package version. -message PackageNote { - // The name of the package. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Deprecated. - // The various channels by which a package is distributed. - repeated Distribution distribution = 10; - - // The type of package; whether native or non native (e.g., ruby gems, - // node.js packages, etc.). - string package_type = 11; - - // The cpe_uri in [CPE format](https://cpe.mitre.org/specification/) - // denoting the package manager version distributing a package. - // The cpe_uri will be blank for language packages. - string cpe_uri = 12; - - // The CPU architecture for which packages in this distribution channel were - // built. Architecture will be blank for language packages. - Architecture architecture = 13; - - // The version of the package. - Version version = 14; - - // A freeform text denoting the maintainer of this package. - string maintainer = 15; - - // The homepage for this package. - string url = 16; - - // The description of this package. - string description = 17; - - // Licenses that have been declared by the authors of the package. - License license = 18; - - // Hash value, typically a file digest, that allows unique - // identification a specific package. - repeated Digest digest = 19; -} - -// Details on how a particular software package was installed on a system. -message PackageOccurrence { - // The name of the installed package. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // All of the places within the filesystem versions of this package - // have been found. - repeated Location location = 2; - - // The type of package; whether native or non native (e.g., ruby gems, - // node.js packages, etc.). - string package_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The cpe_uri in [CPE format](https://cpe.mitre.org/specification/) - // denoting the package manager version distributing a package. - // The cpe_uri will be blank for language packages. - string cpe_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The CPU architecture for which packages in this distribution channel were - // built. Architecture will be blank for language packages. - Architecture architecture = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Licenses that have been declared by the authors of the package. - License license = 6; - - // The version of the package. - Version version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Version contains structured information about the version of a package. -message Version { - // Used to correct mistakes in the version numbering scheme. - int32 epoch = 1; - - // Required only when version kind is NORMAL. The main part of the version - // name. - string name = 2; - - // The iteration of the package build from the above version. - string revision = 3; - - // Whether this version is specifying part of an inclusive range. Grafeas - // does not have the capability to specify version ranges; instead we have - // fields that specify start version and end versions. At times this is - // insufficient - we also need to specify whether the version is included in - // the range or is excluded from the range. This boolean is expected to be set - // to true when the version is included in a range. - bool inclusive = 6; - - // Whether this is an ordinary package version or a sentinel MIN/MAX version. - enum VersionKind { - // Unknown. - VERSION_KIND_UNSPECIFIED = 0; - // A standard package version. - NORMAL = 1; - // A special version representing negative infinity. - MINIMUM = 2; - // A special version representing positive infinity. - MAXIMUM = 3; - } - - // Required. Distinguishes between sentinel MIN/MAX versions and normal - // versions. - VersionKind kind = 4; - - // Human readable version string. This string is of the form - // :- and is only set when kind is NORMAL. - string full_name = 5; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/provenance.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/provenance.proto deleted file mode 100644 index 06b109785f8..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/provenance.proto +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// Provenance of a build. Contains all information needed to verify the full -// details about the build from source to completion. -message BuildProvenance { - // Required. Unique identifier of the build. - string id = 1; - - // ID of the project. - string project_id = 2; - - // Commands requested by the build. - repeated Command commands = 3; - - // Output of the build. - repeated Artifact built_artifacts = 4; - - // Time at which the build was created. - google.protobuf.Timestamp create_time = 5; - - // Time at which execution of the build was started. - google.protobuf.Timestamp start_time = 6; - - // Time at which execution of the build was finished. - google.protobuf.Timestamp end_time = 7; - - // E-mail address of the user who initiated this build. Note that this was the - // user's e-mail address at the time the build was initiated; this address may - // not represent the same end-user for all time. - string creator = 8; - - // URI where any logs for this provenance were written. - string logs_uri = 9; - - // Details of the Source input to the build. - Source source_provenance = 10; - - // Trigger identifier if the build was triggered automatically; empty if not. - string trigger_id = 11; - - // Special options applied to this build. This is a catch-all field where - // build providers can enter any desired additional details. - map build_options = 12; - - // Version string of the builder at the time this build was executed. - string builder_version = 13; -} - -// Source describes the location of the source used for the build. -message Source { - // If provided, the input binary artifacts for the build came from this - // location. - string artifact_storage_source_uri = 1; - - // Hash(es) of the build source, which can be used to verify that the original - // source integrity was maintained in the build. - // - // The keys to this map are file paths used as build source and the values - // contain the hash values for those files. - // - // If the build source came in a single package such as a gzipped tarfile - // (.tar.gz), the FileHash will be for the single path to that file. - map file_hashes = 2; - - // If provided, the source code used for the build came from this location. - SourceContext context = 3; - - // If provided, some of the source code used for the build may be found in - // these locations, in the case where the source repository had multiple - // remotes or submodules. This list will not include the context specified in - // the context field. - repeated SourceContext additional_contexts = 4; -} - -// Container message for hashes of byte content of files, used in source -// messages to verify integrity of source input to the build. -message FileHashes { - // Required. Collection of file hashes. - repeated Hash file_hash = 1; -} - -// Container message for hash values. -message Hash { - // Required. The type of hash that was performed, e.g. "SHA-256". - string type = 1; - // Required. The hash value. - bytes value = 2; -} - -// Command describes a step performed as part of the build pipeline. -message Command { - // Required. Name of the command, as presented on the command line, or if the - // command is packaged as a Docker container, as presented to `docker pull`. - string name = 1; - - // Environment variables set before running this command. - repeated string env = 2; - - // Command-line arguments used when executing this command. - repeated string args = 3; - - // Working directory (relative to project source root) used when running this - // command. - string dir = 4; - - // Optional unique identifier for this command, used in wait_for to reference - // this command as a dependency. - string id = 5; - - // The ID(s) of the command(s) that this command depends on. - repeated string wait_for = 6; -} - -// Artifact describes a build product. -message Artifact { - // Hash or checksum value of a binary, or Docker Registry 2.0 digest of a - // container. - string checksum = 1; - - // Artifact ID, if any; for container images, this will be a URL by digest - // like `gcr.io/projectID/imagename@sha256:123456`. - string id = 2; - - // Related artifact names. This may be the path to a binary or jar file, or in - // the case of a container build, the name used to push the container image to - // Google Container Registry, as presented to `docker push`. Note that a - // single Artifact ID can have multiple names, for example if two tags are - // applied to one image. - repeated string names = 3; -} - -// A SourceContext is a reference to a tree of files. A SourceContext together -// with a path point to a unique revision of a single file or directory. -message SourceContext { - // A SourceContext can refer any one of the following types of repositories. - oneof context { - // A SourceContext referring to a revision in a Google Cloud Source Repo. - CloudRepoSourceContext cloud_repo = 1; - - // A SourceContext referring to a Gerrit project. - GerritSourceContext gerrit = 2; - - // A SourceContext referring to any third party Git repo (e.g., GitHub). - GitSourceContext git = 3; - } - - // Labels with user defined metadata. - map labels = 4; -} - -// An alias to a repo revision. -message AliasContext { - // The type of an alias. - enum Kind { - // Unknown. - KIND_UNSPECIFIED = 0; - // Git tag. - FIXED = 1; - // Git branch. - MOVABLE = 2; - // Used to specify non-standard aliases. For example, if a Git repo has a - // ref named "refs/foo/bar". - OTHER = 4; - } - - // The alias kind. - Kind kind = 1; - - // The alias name. - string name = 2; -} - -// A CloudRepoSourceContext denotes a particular revision in a Google Cloud -// Source Repo. -message CloudRepoSourceContext { - // The ID of the repo. - RepoId repo_id = 1; - - // A revision in a Cloud Repo can be identified by either its revision ID or - // its alias. - oneof revision { - // A revision ID. - string revision_id = 2; - - // An alias, which may be a branch or tag. - AliasContext alias_context = 3; - } -} - -// A SourceContext referring to a Gerrit project. -message GerritSourceContext { - // The URI of a running Gerrit instance. - string host_uri = 1; - - // The full project name within the host. Projects may be nested, so - // "project/subproject" is a valid project name. The "repo name" is the - // hostURI/project. - string gerrit_project = 2; - - // A revision in a Gerrit project can be identified by either its revision ID - // or its alias. - oneof revision { - // A revision (commit) ID. - string revision_id = 3; - - // An alias, which may be a branch or tag. - AliasContext alias_context = 4; - } -} - -// A GitSourceContext denotes a particular revision in a third party Git -// repository (e.g., GitHub). -message GitSourceContext { - // Git repository URL. - string url = 1; - - // Git commit hash. - string revision_id = 2; -} - -// A unique identifier for a Cloud Repo. -message RepoId { - // A cloud repo can be identified by either its project ID and repository name - // combination, or its globally unique identifier. - oneof id { - // A combination of a project ID and a repo name. - ProjectRepoId project_repo_id = 1; - - // A server-assigned, globally unique identifier. - string uid = 2; - } -} - -// Selects a repo using a Google Cloud Platform project ID (e.g., -// winged-cargo-31) and a repo name within that project. -message ProjectRepoId { - // The ID of the project. - string project_id = 1; - - // The name of the repo. Leave empty for the default repo. - string repo_name = 2; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/severity.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/severity.proto deleted file mode 100644 index cc9cc384535..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/severity.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// Note provider assigned severity/impact ranking. -enum Severity { - // Unknown. - SEVERITY_UNSPECIFIED = 0; - // Minimal severity. - MINIMAL = 1; - // Low severity. - LOW = 2; - // Medium severity. - MEDIUM = 3; - // High severity. - HIGH = 4; - // Critical severity. - CRITICAL = 5; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/slsa_provenance.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/slsa_provenance.proto deleted file mode 100644 index c038af064e0..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/slsa_provenance.proto +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2021 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; -option java_outer_classname = "SlsaProvenanceProto"; - -message SlsaProvenance { - // Steps taken to build the artifact. - // For a TaskRun, typically each container corresponds to one step in the - // recipe. - message SlsaRecipe { - // URI indicating what type of recipe was performed. It determines the - // meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and - // materials. - string type = 1; - // Index in materials containing the recipe steps that are not implied by - // recipe.type. For example, if the recipe type were "make", then this would - // point to the source containing the Makefile, not the make program itself. - // Set to -1 if the recipe doesn't come from a material, as zero is default - // unset value for int64. - int64 defined_in_material = 2; - // String identifying the entry point into the build. - // This is often a path to a configuration file and/or a target label within - // that file. The syntax and meaning are defined by recipe.type. For - // example, if the recipe type were "make", then this would reference the - // directory in which to run make as well as which target to use. - string entry_point = 3; - // Collection of all external inputs that influenced the build on top of - // recipe.definedInMaterial and recipe.entryPoint. For example, if the - // recipe type were "make", then this might be the flags passed to make - // aside from the target, which is captured in recipe.entryPoint. Depending - // on the recipe Type, the structure may be different. - google.protobuf.Any arguments = 4; - // Any other builder-controlled inputs necessary for correctly evaluating - // the recipe. Usually only needed for reproducing the build but not - // evaluated as part of policy. Depending on the recipe Type, the structure - // may be different. - google.protobuf.Any environment = 5; - } - - // Indicates that the builder claims certain fields in this message to be - // complete. - message SlsaCompleteness { - // If true, the builder claims that recipe.arguments is complete, meaning - // that all external inputs are properly captured in the recipe. - bool arguments = 1; - // If true, the builder claims that recipe.environment is claimed to be - // complete. - bool environment = 2; - // If true, the builder claims that materials are complete, usually through - // some controls to prevent network access. Sometimes called "hermetic". - bool materials = 3; - } - - // Other properties of the build. - message SlsaMetadata { - // Identifies the particular build invocation, which can be useful for - // finding associated logs or other ad-hoc analysis. The value SHOULD be - // globally unique, per in-toto Provenance spec. - string build_invocation_id = 1; - // The timestamp of when the build started. - google.protobuf.Timestamp build_started_on = 2; - // The timestamp of when the build completed. - google.protobuf.Timestamp build_finished_on = 3; - // Indicates that the builder claims certain fields in this message to be - // complete. - SlsaCompleteness completeness = 4; - // If true, the builder claims that running the recipe on materials will - // produce bit-for-bit identical output. - bool reproducible = 5; - } - - message SlsaBuilder { - string id = 1; - } - - message Material { - string uri = 1; - map digest = 2; - } - - SlsaBuilder builder = 1; // required - // Identifies the configuration used for the build. - // When combined with materials, this SHOULD fully describe the build, - // such that re-running this recipe results in bit-for-bit identical output - // (if the build is reproducible). - SlsaRecipe recipe = 2; // required - SlsaMetadata metadata = 3; - // The collection of artifacts that influenced the build including sources, - // dependencies, build tools, base images, and so on. This is considered to be - // incomplete unless metadata.completeness.materials is true. Unset or null is - // equivalent to empty. - repeated Material materials = 4; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/slsa_provenance_zero_two.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/slsa_provenance_zero_two.proto deleted file mode 100644 index 11cdd1c0ba5..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/slsa_provenance_zero_two.proto +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2021 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; -option java_outer_classname = "SlsaProvenanceZeroTwoProto"; - -message SlsaProvenanceZeroTwo { - // See full explanation of fields at slsa.dev/provenance/v0.2. - - // Identifies the entity that executed the recipe, which is trusted to have - // correctly performed the operation and populated this provenance. - message SlsaBuilder { - string id = 1; - } - - // The collection of artifacts that influenced the build including sources, - // dependencies, build tools, base images, and so on. - message SlsaMaterial { - string uri = 1; - map digest = 2; - } - - // Identifies the event that kicked off the build. - message SlsaInvocation { - SlsaConfigSource config_source = 1; - google.protobuf.Struct parameters = 2; - google.protobuf.Struct environment = 3; - } - - // Describes where the config file that kicked off the build came from. - // This is effectively a pointer to the source where buildConfig came from. - message SlsaConfigSource { - string uri = 1; - map digest = 2; - string entry_point = 3; - } - - // Other properties of the build. - message SlsaMetadata { - string build_invocation_id = 1; - google.protobuf.Timestamp build_started_on = 2; - google.protobuf.Timestamp build_finished_on = 3; - SlsaCompleteness completeness = 4; - bool reproducible = 5; - } - - // Indicates that the builder claims certain fields in this message to be - // complete. - message SlsaCompleteness { - bool parameters = 1; - bool environment = 2; - bool materials = 3; - } - - SlsaBuilder builder = 1; - string build_type = 2; - SlsaInvocation invocation = 3; - google.protobuf.Struct build_config = 4; - SlsaMetadata metadata = 5; - repeated SlsaMaterial materials = 6; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/upgrade.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/upgrade.proto deleted file mode 100644 index 89d38929919..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/upgrade.proto +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/protobuf/timestamp.proto"; -import "grafeas/v1/package.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// An Upgrade Note represents a potential upgrade of a package to a given -// version. For each package version combination (i.e. bash 4.0, bash 4.1, -// bash 4.1.2), there will be an Upgrade Note. For Windows, windows_update field -// represents the information related to the update. -message UpgradeNote { - // Required for non-Windows OS. The package this Upgrade is for. - string package = 1; - // Required for non-Windows OS. The version of the package in machine + human - // readable form. - grafeas.v1.Version version = 2; - // Metadata about the upgrade for each specific operating system. - repeated UpgradeDistribution distributions = 3; - // Required for Windows OS. Represents the metadata about the Windows update. - WindowsUpdate windows_update = 4; -} - -// The Upgrade Distribution represents metadata about the Upgrade for each -// operating system (CPE). Some distributions have additional metadata around -// updates, classifying them into various categories and severities. -message UpgradeDistribution { - // Required - The specific operating system this metadata applies to. See - // https://cpe.mitre.org/specification/. - string cpe_uri = 1; - // The operating system classification of this Upgrade, as specified by the - // upstream operating system upgrade feed. For Windows the classification is - // one of the category_ids listed at - // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ff357803(v=vs.85) - string classification = 2; - // The severity as specified by the upstream operating system. - string severity = 3; - // The cve tied to this Upgrade. - repeated string cve = 4; -} - -// Windows Update represents the metadata about the update for the Windows -// operating system. The fields in this message come from the Windows Update API -// documented at -// https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdate. -message WindowsUpdate { - // The unique identifier of the update. - message Identity { - // The revision independent identifier of the update. - string update_id = 1; - // The revision number of the update. - int32 revision = 2; - } - // Required - The unique identifier for the update. - Identity identity = 1; - // The localized title of the update. - string title = 2; - // The localized description of the update. - string description = 3; - // The category to which the update belongs. - message Category { - // The identifier of the category. - string category_id = 1; - // The localized name of the category. - string name = 2; - } - // The list of categories to which the update belongs. - repeated Category categories = 4; - // The Microsoft Knowledge Base article IDs that are associated with the - // update. - repeated string kb_article_ids = 5; - // The hyperlink to the support information for the update. - string support_url = 6; - // The last published timestamp of the update. - google.protobuf.Timestamp last_published_timestamp = 7; -} - -// An Upgrade Occurrence represents that a specific resource_url could install a -// specific upgrade. This presence is supplied via local sources (i.e. it is -// present in the mirror and the running system has noticed its availability). -// For Windows, both distribution and windows_update contain information for the -// Windows update. -message UpgradeOccurrence { - // Required for non-Windows OS. The package this Upgrade is for. - string package = 1; - // Required for non-Windows OS. The version of the package in a machine + - // human readable form. - grafeas.v1.Version parsed_version = 3; - // Metadata about the upgrade for available for the specific operating system - // for the resource_url. This allows efficient filtering, as well as - // making it easier to use the occurrence. - UpgradeDistribution distribution = 4; - // Required for Windows OS. Represents the metadata about the Windows update. - WindowsUpdate windows_update = 5; -} diff --git a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/vulnerability.proto b/owl-bot-staging/grafeas/v1/protos/grafeas/v1/vulnerability.proto deleted file mode 100644 index cea4558b144..00000000000 --- a/owl-bot-staging/grafeas/v1/protos/grafeas/v1/vulnerability.proto +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright 2019 The Grafeas Authors. All rights reserved. -// -// 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 grafeas.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; -import "grafeas/v1/common.proto"; -import "grafeas/v1/cvss.proto"; -import "grafeas/v1/package.proto"; -import "grafeas/v1/severity.proto"; - -option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; -option java_multiple_files = true; -option java_package = "io.grafeas.v1"; -option objc_class_prefix = "GRA"; - -// A security vulnerability that can be found in resources. -message VulnerabilityNote { - // The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10 - // where 0 indicates low severity and 10 indicates high severity. - float cvss_score = 1; - - // The note provider assigned severity of this vulnerability. - grafeas.v1.Severity severity = 2; - - // Details of all known distros and packages affected by this vulnerability. - repeated Detail details = 3; - - // A detail for a distro and package affected by this vulnerability and its - // associated fix (if one is available). - message Detail { - // The distro assigned severity of this vulnerability. - string severity_name = 1; - - // A vendor-specific description of this vulnerability. - string description = 2; - - // The type of package; whether native or non native (e.g., ruby gems, - // node.js packages, etc.). - string package_type = 3; - - // Required. The [CPE URI](https://cpe.mitre.org/specification/) this - // vulnerability affects. - string affected_cpe_uri = 4; - - // Required. The package this vulnerability affects. - string affected_package = 5; - - // The version number at the start of an interval in which this - // vulnerability exists. A vulnerability can affect a package between - // version numbers that are disjoint sets of intervals (example: - // [1.0.0-1.1.0], [2.4.6-2.4.8] and [4.5.6-4.6.8]) each of which will be - // represented in its own Detail. If a specific affected version is provided - // by a vulnerability database, affected_version_start and - // affected_version_end will be the same in that Detail. - grafeas.v1.Version affected_version_start = 6; - - // The version number at the end of an interval in which this vulnerability - // exists. A vulnerability can affect a package between version numbers - // that are disjoint sets of intervals (example: [1.0.0-1.1.0], - // [2.4.6-2.4.8] and [4.5.6-4.6.8]) each of which will be represented in its - // own Detail. If a specific affected version is provided by a vulnerability - // database, affected_version_start and affected_version_end will be the - // same in that Detail. - grafeas.v1.Version affected_version_end = 7; - - // The distro recommended [CPE URI](https://cpe.mitre.org/specification/) - // to update to that contains a fix for this vulnerability. It is possible - // for this to be different from the affected_cpe_uri. - string fixed_cpe_uri = 8; - - // The distro recommended package to update to that contains a fix for this - // vulnerability. It is possible for this to be different from the - // affected_package. - string fixed_package = 9; - - // The distro recommended version to update to that contains a - // fix for this vulnerability. Setting this to VersionKind.MAXIMUM means no - // such version is yet available. - grafeas.v1.Version fixed_version = 10; - - // Whether this detail is obsolete. Occurrences are expected not to point to - // obsolete details. - bool is_obsolete = 11; - - // The time this information was last changed at the source. This is an - // upstream timestamp from the underlying information source - e.g. Ubuntu - // security tracker. - google.protobuf.Timestamp source_update_time = 12; - - // The source from which the information in this Detail was obtained. - string source = 13; - - // The name of the vendor of the product. - string vendor = 14; - } - - // The full description of the CVSSv3 for this vulnerability. - CVSSv3 cvss_v3 = 4; - - // Windows details get their own format because the information format and - // model don't match a normal detail. Specifically Windows updates are done as - // patches, thus Windows vulnerabilities really are a missing package, rather - // than a package being at an incorrect version. - repeated WindowsDetail windows_details = 5; - - message WindowsDetail { - // Required. The [CPE URI](https://cpe.mitre.org/specification/) this - // vulnerability affects. - string cpe_uri = 1; - - // Required. The name of this vulnerability. - string name = 2; - - // The description of this vulnerability. - string description = 3; - - // Required. The names of the KBs which have hotfixes to mitigate this - // vulnerability. Note that there may be multiple hotfixes (and thus - // multiple KBs) that mitigate a given vulnerability. Currently any listed - // KBs presence is considered a fix. - repeated KnowledgeBase fixing_kbs = 4; - - message KnowledgeBase { - // The KB name (generally of the form KB[0-9]+ (e.g., KB123456)). - string name = 1; - // A link to the KB in the [Windows update catalog] - // (https://www.catalog.update.microsoft.com/). - string url = 2; - } - } - - // The time this information was last changed at the source. This is an - // upstream timestamp from the underlying information source - e.g. Ubuntu - // security tracker. - google.protobuf.Timestamp source_update_time = 6; - - // CVSS version used to populate cvss_score and severity. - grafeas.v1.CVSSVersion cvss_version = 7; - - // Next free ID is 8. -} - -// An occurrence of a severity vulnerability on a resource. -message VulnerabilityOccurrence { - // The type of package; whether native or non native (e.g., ruby gems, node.js - // packages, etc.). - string type = 1; - - // Output only. The note provider assigned severity of this vulnerability. - grafeas.v1.Severity severity = 2; - - // Output only. The CVSS score of this vulnerability. CVSS score is on a - // scale of 0 - 10 where 0 indicates low severity and 10 indicates high - // severity. - float cvss_score = 3; - - // The cvss v3 score for the vulnerability. - CVSS cvssv3 = 10; - - // Required. The set of affected locations and their fixes (if available) - // within the associated resource. - repeated PackageIssue package_issue = 4; - - // A detail for a distro and package this vulnerability occurrence was found - // in and its associated fix (if one is available). - message PackageIssue { - // Required. The [CPE URI](https://cpe.mitre.org/specification/) this - // vulnerability was found in. - string affected_cpe_uri = 1; - - // Required. The package this vulnerability was found in. - string affected_package = 2; - - // Required. The version of the package that is installed on the resource - // affected by this vulnerability. - grafeas.v1.Version affected_version = 3; - - // The [CPE URI](https://cpe.mitre.org/specification/) this vulnerability - // was fixed in. It is possible for this to be different from the - // affected_cpe_uri. - string fixed_cpe_uri = 4; - - // The package this vulnerability was fixed in. It is possible for this to - // be different from the affected_package. - string fixed_package = 5; - - // Required. The version of the package this vulnerability was fixed in. - // Setting this to VersionKind.MAXIMUM means no fix is yet available. - grafeas.v1.Version fixed_version = 6; - - // Output only. Whether a fix is available for this package. - bool fix_available = 7; - - // The type of package (e.g. OS, MAVEN, GO). - string package_type = 8; - - // The distro or language system assigned severity for this vulnerability - // when that is available and note provider assigned severity when it is not - // available. - grafeas.v1.Severity effective_severity = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The location at which this package was found. - repeated FileLocation file_location = 10; - } - - // Output only. A one sentence description of this vulnerability. - string short_description = 5; - - // Output only. A detailed description of this vulnerability. - string long_description = 6; - - // Output only. URLs related to this vulnerability. - repeated grafeas.v1.RelatedUrl related_urls = 7; - - // The distro assigned severity for this vulnerability when it is available, - // otherwise this is the note provider assigned severity. - // - // When there are multiple PackageIssues for this vulnerability, they can have - // different effective severities because some might be provided by the distro - // while others are provided by the language ecosystem for a language pack. - // For this reason, it is advised to use the effective severity on the - // PackageIssue level. In the case where multiple PackageIssues have differing - // effective severities, this field should be the highest severity for any of - // the PackageIssues. - grafeas.v1.Severity effective_severity = 8; - - // Output only. Whether at least one of the affected packages has a fix - // available. - bool fix_available = 9; - - // Output only. CVSS version used to populate cvss_score and severity. - grafeas.v1.CVSSVersion cvss_version = 11; - - // Next free ID is 12. -} diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.batch_create_notes.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.batch_create_notes.js deleted file mode 100644 index ca9482725ca..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.batch_create_notes.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, notes) { - // [START containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the notes are to be created. - */ - // const parent = 'abc123' - /** - * The notes to create. Max allowed length is 1000. - */ - // const notes = 1234 - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callBatchCreateNotes() { - // Construct request - const request = { - parent, - notes, - }; - - // Run request - const response = await grafeasClient.batchCreateNotes(request); - console.log(response); - } - - callBatchCreateNotes(); - // [END containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.batch_create_occurrences.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.batch_create_occurrences.js deleted file mode 100644 index 644516c0ac6..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.batch_create_occurrences.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, occurrences) { - // [START containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the occurrences are to be created. - */ - // const parent = 'abc123' - /** - * The occurrences to create. Max allowed length is 1000. - */ - // const occurrences = 1234 - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callBatchCreateOccurrences() { - // Construct request - const request = { - parent, - occurrences, - }; - - // Run request - const response = await grafeasClient.batchCreateOccurrences(request); - console.log(response); - } - - callBatchCreateOccurrences(); - // [END containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.create_note.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.create_note.js deleted file mode 100644 index 7f1cdcd1f3a..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.create_note.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, noteId, note) { - // [START containeranalysis_v1_generated_Grafeas_CreateNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the note is to be created. - */ - // const parent = 'abc123' - /** - * The ID to use for this note. - */ - // const noteId = 'abc123' - /** - * The note to create. - */ - // const note = {} - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callCreateNote() { - // Construct request - const request = { - parent, - noteId, - note, - }; - - // Run request - const response = await grafeasClient.createNote(request); - console.log(response); - } - - callCreateNote(); - // [END containeranalysis_v1_generated_Grafeas_CreateNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.create_occurrence.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.create_occurrence.js deleted file mode 100644 index f70f2945197..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.create_occurrence.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, occurrence) { - // [START containeranalysis_v1_generated_Grafeas_CreateOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the occurrence is to be created. - */ - // const parent = 'abc123' - /** - * The occurrence to create. - */ - // const occurrence = {} - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callCreateOccurrence() { - // Construct request - const request = { - parent, - occurrence, - }; - - // Run request - const response = await grafeasClient.createOccurrence(request); - console.log(response); - } - - callCreateOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_CreateOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.delete_note.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.delete_note.js deleted file mode 100644 index 181c78945f7..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.delete_note.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_DeleteNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callDeleteNote() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await grafeasClient.deleteNote(request); - console.log(response); - } - - callDeleteNote(); - // [END containeranalysis_v1_generated_Grafeas_DeleteNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.delete_occurrence.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.delete_occurrence.js deleted file mode 100644 index ae790ec0f0f..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.delete_occurrence.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callDeleteOccurrence() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await grafeasClient.deleteOccurrence(request); - console.log(response); - } - - callDeleteOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_note.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_note.js deleted file mode 100644 index b48344ee861..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_note.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_GetNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callGetNote() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await grafeasClient.getNote(request); - console.log(response); - } - - callGetNote(); - // [END containeranalysis_v1_generated_Grafeas_GetNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_occurrence.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_occurrence.js deleted file mode 100644 index 1f7cf250584..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_occurrence.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_GetOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callGetOccurrence() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await grafeasClient.getOccurrence(request); - console.log(response); - } - - callGetOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_GetOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_occurrence_note.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_occurrence_note.js deleted file mode 100644 index 81af75dfddc..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.get_occurrence_note.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_GetOccurrenceNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callGetOccurrenceNote() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await grafeasClient.getOccurrenceNote(request); - console.log(response); - } - - callGetOccurrenceNote(); - // [END containeranalysis_v1_generated_Grafeas_GetOccurrenceNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_note_occurrences.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_note_occurrences.js deleted file mode 100644 index a24053aa9a3..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_note_occurrences.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_ListNoteOccurrences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note to list occurrences for in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - /** - * The filter expression. - */ - // const filter = 'abc123' - /** - * Number of occurrences to return in the list. - */ - // const pageSize = 1234 - /** - * Token to provide to skip to a particular spot in the list. - */ - // const pageToken = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callListNoteOccurrences() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = await grafeasClient.listNoteOccurrencesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListNoteOccurrences(); - // [END containeranalysis_v1_generated_Grafeas_ListNoteOccurrences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_notes.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_notes.js deleted file mode 100644 index 810e567fa40..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_notes.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START containeranalysis_v1_generated_Grafeas_ListNotes_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project to list notes for in the form of - * `projects/[PROJECT_ID]`. - */ - // const parent = 'abc123' - /** - * The filter expression. - */ - // const filter = 'abc123' - /** - * Number of notes to return in the list. Must be positive. Max allowed page - * size is 1000. If not specified, page size defaults to 20. - */ - // const pageSize = 1234 - /** - * Token to provide to skip to a particular spot in the list. - */ - // const pageToken = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callListNotes() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await grafeasClient.listNotesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListNotes(); - // [END containeranalysis_v1_generated_Grafeas_ListNotes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_occurrences.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_occurrences.js deleted file mode 100644 index 9a640398ec1..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.list_occurrences.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START containeranalysis_v1_generated_Grafeas_ListOccurrences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project to list occurrences for in the form of - * `projects/[PROJECT_ID]`. - */ - // const parent = 'abc123' - /** - * The filter expression. - */ - // const filter = 'abc123' - /** - * Number of occurrences to return in the list. Must be positive. Max allowed - * page size is 1000. If not specified, page size defaults to 20. - */ - // const pageSize = 1234 - /** - * Token to provide to skip to a particular spot in the list. - */ - // const pageToken = 'abc123' - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callListOccurrences() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await grafeasClient.listOccurrencesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListOccurrences(); - // [END containeranalysis_v1_generated_Grafeas_ListOccurrences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.update_note.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.update_note.js deleted file mode 100644 index d7f5c7a3ff8..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.update_note.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, note) { - // [START containeranalysis_v1_generated_Grafeas_UpdateNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - /** - * The updated note. - */ - // const note = {} - /** - * The fields to update. - */ - // const updateMask = {} - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callUpdateNote() { - // Construct request - const request = { - name, - note, - }; - - // Run request - const response = await grafeasClient.updateNote(request); - console.log(response); - } - - callUpdateNote(); - // [END containeranalysis_v1_generated_Grafeas_UpdateNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.update_occurrence.js b/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.update_occurrence.js deleted file mode 100644 index de5167f50e9..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/grafeas.update_occurrence.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, occurrence) { - // [START containeranalysis_v1_generated_Grafeas_UpdateOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - /** - * The updated occurrence. - */ - // const occurrence = {} - /** - * The fields to update. - */ - // const updateMask = {} - - // Imports the Grafeas library - const {GrafeasClient} = require('@google-cloud/grafeas').v1; - - // Instantiates a client - const grafeasClient = new GrafeasClient(); - - async function callUpdateOccurrence() { - // Construct request - const request = { - name, - occurrence, - }; - - // Run request - const response = await grafeasClient.updateOccurrence(request); - console.log(response); - } - - callUpdateOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_UpdateOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/grafeas/v1/samples/generated/v1/snippet_metadata.grafeas.v1.json b/owl-bot-staging/grafeas/v1/samples/generated/v1/snippet_metadata.grafeas.v1.json deleted file mode 100644 index f1b6f8b84c5..00000000000 --- a/owl-bot-staging/grafeas/v1/samples/generated/v1/snippet_metadata.grafeas.v1.json +++ /dev/null @@ -1,647 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-grafeas", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "grafeas.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "containeranalysis_v1_generated_Grafeas_GetOccurrence_async", - "title": "Grafeas getOccurrence Sample", - "origin": "API_DEFINITION", - "description": " Gets the specified occurrence.", - "canonical": true, - "file": "grafeas.get_occurrence.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOccurrence", - "fullName": "grafeas.v1.Grafeas.GetOccurrence", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".grafeas.v1.Occurrence", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "GetOccurrence", - "fullName": "grafeas.v1.Grafeas.GetOccurrence", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_ListOccurrences_async", - "title": "Grafeas listOccurrences Sample", - "origin": "API_DEFINITION", - "description": " Lists occurrences for the specified project.", - "canonical": true, - "file": "grafeas.list_occurrences.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListOccurrences", - "fullName": "grafeas.v1.Grafeas.ListOccurrences", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".grafeas.v1.ListOccurrencesResponse", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "ListOccurrences", - "fullName": "grafeas.v1.Grafeas.ListOccurrences", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async", - "title": "Grafeas deleteOccurrence Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.", - "canonical": true, - "file": "grafeas.delete_occurrence.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteOccurrence", - "fullName": "grafeas.v1.Grafeas.DeleteOccurrence", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "DeleteOccurrence", - "fullName": "grafeas.v1.Grafeas.DeleteOccurrence", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_CreateOccurrence_async", - "title": "Grafeas createOccurrence Sample", - "origin": "API_DEFINITION", - "description": " Creates a new occurrence.", - "canonical": true, - "file": "grafeas.create_occurrence.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateOccurrence", - "fullName": "grafeas.v1.Grafeas.CreateOccurrence", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "occurrence", - "type": ".grafeas.v1.Occurrence" - } - ], - "resultType": ".grafeas.v1.Occurrence", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "CreateOccurrence", - "fullName": "grafeas.v1.Grafeas.CreateOccurrence", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async", - "title": "Grafeas batchCreateOccurrences Sample", - "origin": "API_DEFINITION", - "description": " Creates new occurrences in batch.", - "canonical": true, - "file": "grafeas.batch_create_occurrences.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateOccurrences", - "fullName": "grafeas.v1.Grafeas.BatchCreateOccurrences", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "occurrences", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".grafeas.v1.BatchCreateOccurrencesResponse", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "BatchCreateOccurrences", - "fullName": "grafeas.v1.Grafeas.BatchCreateOccurrences", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_UpdateOccurrence_async", - "title": "Grafeas updateOccurrence Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified occurrence.", - "canonical": true, - "file": "grafeas.update_occurrence.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateOccurrence", - "fullName": "grafeas.v1.Grafeas.UpdateOccurrence", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "occurrence", - "type": ".grafeas.v1.Occurrence" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".grafeas.v1.Occurrence", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "UpdateOccurrence", - "fullName": "grafeas.v1.Grafeas.UpdateOccurrence", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_GetOccurrenceNote_async", - "title": "Grafeas getOccurrenceNote Sample", - "origin": "API_DEFINITION", - "description": " Gets the note attached to the specified occurrence. Consumer projects can use this method to get a note that belongs to a provider project.", - "canonical": true, - "file": "grafeas.get_occurrence_note.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOccurrenceNote", - "fullName": "grafeas.v1.Grafeas.GetOccurrenceNote", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".grafeas.v1.Note", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "GetOccurrenceNote", - "fullName": "grafeas.v1.Grafeas.GetOccurrenceNote", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_GetNote_async", - "title": "Grafeas getNote Sample", - "origin": "API_DEFINITION", - "description": " Gets the specified note.", - "canonical": true, - "file": "grafeas.get_note.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNote", - "fullName": "grafeas.v1.Grafeas.GetNote", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".grafeas.v1.Note", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "GetNote", - "fullName": "grafeas.v1.Grafeas.GetNote", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_ListNotes_async", - "title": "Grafeas listNotes Sample", - "origin": "API_DEFINITION", - "description": " Lists notes for the specified project.", - "canonical": true, - "file": "grafeas.list_notes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNotes", - "fullName": "grafeas.v1.Grafeas.ListNotes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".grafeas.v1.ListNotesResponse", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "ListNotes", - "fullName": "grafeas.v1.Grafeas.ListNotes", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_DeleteNote_async", - "title": "Grafeas deleteNote Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified note.", - "canonical": true, - "file": "grafeas.delete_note.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteNote", - "fullName": "grafeas.v1.Grafeas.DeleteNote", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "DeleteNote", - "fullName": "grafeas.v1.Grafeas.DeleteNote", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_CreateNote_async", - "title": "Grafeas createNote Sample", - "origin": "API_DEFINITION", - "description": " Creates a new note.", - "canonical": true, - "file": "grafeas.create_note.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNote", - "fullName": "grafeas.v1.Grafeas.CreateNote", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "note_id", - "type": "TYPE_STRING" - }, - { - "name": "note", - "type": ".grafeas.v1.Note" - } - ], - "resultType": ".grafeas.v1.Note", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "CreateNote", - "fullName": "grafeas.v1.Grafeas.CreateNote", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async", - "title": "Grafeas batchCreateNotes Sample", - "origin": "API_DEFINITION", - "description": " Creates new notes in batch.", - "canonical": true, - "file": "grafeas.batch_create_notes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateNotes", - "fullName": "grafeas.v1.Grafeas.BatchCreateNotes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "notes", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".grafeas.v1.BatchCreateNotesResponse", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "BatchCreateNotes", - "fullName": "grafeas.v1.Grafeas.BatchCreateNotes", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_UpdateNote_async", - "title": "Grafeas updateNote Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified note.", - "canonical": true, - "file": "grafeas.update_note.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateNote", - "fullName": "grafeas.v1.Grafeas.UpdateNote", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "note", - "type": ".grafeas.v1.Note" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".grafeas.v1.Note", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "UpdateNote", - "fullName": "grafeas.v1.Grafeas.UpdateNote", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - }, - { - "regionTag": "containeranalysis_v1_generated_Grafeas_ListNoteOccurrences_async", - "title": "Grafeas listNoteOccurrences Sample", - "origin": "API_DEFINITION", - "description": " Lists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.", - "canonical": true, - "file": "grafeas.list_note_occurrences.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNoteOccurrences", - "fullName": "grafeas.v1.Grafeas.ListNoteOccurrences", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".grafeas.v1.ListNoteOccurrencesResponse", - "client": { - "shortName": "GrafeasClient", - "fullName": "grafeas.v1.GrafeasClient" - }, - "method": { - "shortName": "ListNoteOccurrences", - "fullName": "grafeas.v1.Grafeas.ListNoteOccurrences", - "service": { - "shortName": "Grafeas", - "fullName": "grafeas.v1.Grafeas" - } - } - } - } - ] -} diff --git a/owl-bot-staging/grafeas/v1/src/index.ts b/owl-bot-staging/grafeas/v1/src/index.ts deleted file mode 100644 index ec5edcd5ac3..00000000000 --- a/owl-bot-staging/grafeas/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const GrafeasClient = v1.GrafeasClient; -type GrafeasClient = v1.GrafeasClient; -export {v1, GrafeasClient}; -export default {v1, GrafeasClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/grafeas/v1/src/v1/gapic_metadata.json b/owl-bot-staging/grafeas/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 1f3003f8d8d..00000000000 --- a/owl-bot-staging/grafeas/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "grafeas.v1", - "libraryPackage": "@google-cloud/grafeas", - "services": { - "Grafeas": { - "clients": { - "grpc": { - "libraryClient": "GrafeasClient", - "rpcs": { - "GetOccurrence": { - "methods": [ - "getOccurrence" - ] - }, - "DeleteOccurrence": { - "methods": [ - "deleteOccurrence" - ] - }, - "CreateOccurrence": { - "methods": [ - "createOccurrence" - ] - }, - "BatchCreateOccurrences": { - "methods": [ - "batchCreateOccurrences" - ] - }, - "UpdateOccurrence": { - "methods": [ - "updateOccurrence" - ] - }, - "GetOccurrenceNote": { - "methods": [ - "getOccurrenceNote" - ] - }, - "GetNote": { - "methods": [ - "getNote" - ] - }, - "DeleteNote": { - "methods": [ - "deleteNote" - ] - }, - "CreateNote": { - "methods": [ - "createNote" - ] - }, - "BatchCreateNotes": { - "methods": [ - "batchCreateNotes" - ] - }, - "UpdateNote": { - "methods": [ - "updateNote" - ] - }, - "ListOccurrences": { - "methods": [ - "listOccurrences", - "listOccurrencesStream", - "listOccurrencesAsync" - ] - }, - "ListNotes": { - "methods": [ - "listNotes", - "listNotesStream", - "listNotesAsync" - ] - }, - "ListNoteOccurrences": { - "methods": [ - "listNoteOccurrences", - "listNoteOccurrencesStream", - "listNoteOccurrencesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "GrafeasClient", - "rpcs": { - "GetOccurrence": { - "methods": [ - "getOccurrence" - ] - }, - "DeleteOccurrence": { - "methods": [ - "deleteOccurrence" - ] - }, - "CreateOccurrence": { - "methods": [ - "createOccurrence" - ] - }, - "BatchCreateOccurrences": { - "methods": [ - "batchCreateOccurrences" - ] - }, - "UpdateOccurrence": { - "methods": [ - "updateOccurrence" - ] - }, - "GetOccurrenceNote": { - "methods": [ - "getOccurrenceNote" - ] - }, - "GetNote": { - "methods": [ - "getNote" - ] - }, - "DeleteNote": { - "methods": [ - "deleteNote" - ] - }, - "CreateNote": { - "methods": [ - "createNote" - ] - }, - "BatchCreateNotes": { - "methods": [ - "batchCreateNotes" - ] - }, - "UpdateNote": { - "methods": [ - "updateNote" - ] - }, - "ListOccurrences": { - "methods": [ - "listOccurrences", - "listOccurrencesStream", - "listOccurrencesAsync" - ] - }, - "ListNotes": { - "methods": [ - "listNotes", - "listNotesStream", - "listNotesAsync" - ] - }, - "ListNoteOccurrences": { - "methods": [ - "listNoteOccurrences", - "listNoteOccurrencesStream", - "listNoteOccurrencesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/grafeas/v1/src/v1/grafeas_client.ts b/owl-bot-staging/grafeas/v1/src/v1/grafeas_client.ts deleted file mode 100644 index 015487fbe2b..00000000000 --- a/owl-bot-staging/grafeas/v1/src/v1/grafeas_client.ts +++ /dev/null @@ -1,1812 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/grafeas_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './grafeas_client_config.json'; -const version = require('../../../package.json').version; - -/** - * [Grafeas](https://grafeas.io) API. - * - * Retrieves analysis results of Cloud components such as Docker container - * images. - * - * Analysis results are stored as a series of occurrences. An `Occurrence` - * contains information about a specific analysis instance on a resource. An - * occurrence refers to a `Note`. A note contains details describing the - * analysis and is generally stored in a separate project, called a `Provider`. - * Multiple occurrences can refer to the same note. - * - * For example, an SSL vulnerability could affect multiple images. In this case, - * there would be one note for the vulnerability and an occurrence for each - * image with the vulnerability referring to that note. - * @class - * @memberof v1 - */ -export class GrafeasClient { - 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}; - grafeasStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of GrafeasClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new GrafeasClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof GrafeasClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // 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 = { - notePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/notes/{note}' - ), - occurrencePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/occurrences/{occurrence}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listOccurrences: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'occurrences'), - listNotes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'notes'), - listNoteOccurrences: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'occurrences') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'grafeas.v1.Grafeas', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.grafeasStub) { - return this.grafeasStub; - } - - // Put together the "service stub" for - // grafeas.v1.Grafeas. - this.grafeasStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('grafeas.v1.Grafeas') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).grafeas.v1.Grafeas, - 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 grafeasStubMethods = - ['getOccurrence', 'listOccurrences', 'deleteOccurrence', 'createOccurrence', 'batchCreateOccurrences', 'updateOccurrence', 'getOccurrenceNote', 'getNote', 'listNotes', 'deleteNote', 'createNote', 'batchCreateNotes', 'updateNote', 'listNoteOccurrences']; - for (const methodName of grafeasStubMethods) { - const callPromise = this.grafeasStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.grafeasStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'containeranalysis.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 'containeranalysis.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 []; - } - - 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 -- - // ------------------- -/** - * Gets the specified occurrence. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - * @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 [Occurrence]{@link grafeas.v1.Occurrence}. - * 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/grafeas.get_occurrence.js - * region_tag:containeranalysis_v1_generated_Grafeas_GetOccurrence_async - */ - getOccurrence( - request?: protos.grafeas.v1.IGetOccurrenceRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IGetOccurrenceRequest|undefined, {}|undefined - ]>; - getOccurrence( - request: protos.grafeas.v1.IGetOccurrenceRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IGetOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - getOccurrence( - request: protos.grafeas.v1.IGetOccurrenceRequest, - callback: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IGetOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - getOccurrence( - request?: protos.grafeas.v1.IGetOccurrenceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IGetOccurrenceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IGetOccurrenceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IGetOccurrenceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getOccurrence(request, options, callback); - } -/** - * Deletes the specified occurrence. For example, use this method to delete an - * occurrence when the occurrence is no longer applicable for the given - * resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - * @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/grafeas.delete_occurrence.js - * region_tag:containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async - */ - deleteOccurrence( - request?: protos.grafeas.v1.IDeleteOccurrenceRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteOccurrenceRequest|undefined, {}|undefined - ]>; - deleteOccurrence( - request: protos.grafeas.v1.IDeleteOccurrenceRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - deleteOccurrence( - request: protos.grafeas.v1.IDeleteOccurrenceRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - deleteOccurrence( - request?: protos.grafeas.v1.IDeleteOccurrenceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteOccurrenceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteOccurrenceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteOccurrenceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteOccurrence(request, options, callback); - } -/** - * Creates a new occurrence. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the occurrence is to be created. - * @param {grafeas.v1.Occurrence} request.occurrence - * The occurrence 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 [Occurrence]{@link grafeas.v1.Occurrence}. - * 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/grafeas.create_occurrence.js - * region_tag:containeranalysis_v1_generated_Grafeas_CreateOccurrence_async - */ - createOccurrence( - request?: protos.grafeas.v1.ICreateOccurrenceRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.ICreateOccurrenceRequest|undefined, {}|undefined - ]>; - createOccurrence( - request: protos.grafeas.v1.ICreateOccurrenceRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.ICreateOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - createOccurrence( - request: protos.grafeas.v1.ICreateOccurrenceRequest, - callback: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.ICreateOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - createOccurrence( - request?: protos.grafeas.v1.ICreateOccurrenceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.ICreateOccurrenceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.ICreateOccurrenceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.ICreateOccurrenceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createOccurrence(request, options, callback); - } -/** - * Creates new occurrences in batch. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the occurrences are to be created. - * @param {number[]} request.occurrences - * The occurrences to create. Max allowed length is 1000. - * @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 [BatchCreateOccurrencesResponse]{@link grafeas.v1.BatchCreateOccurrencesResponse}. - * 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/grafeas.batch_create_occurrences.js - * region_tag:containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async - */ - batchCreateOccurrences( - request?: protos.grafeas.v1.IBatchCreateOccurrencesRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.IBatchCreateOccurrencesResponse, - protos.grafeas.v1.IBatchCreateOccurrencesRequest|undefined, {}|undefined - ]>; - batchCreateOccurrences( - request: protos.grafeas.v1.IBatchCreateOccurrencesRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.IBatchCreateOccurrencesResponse, - protos.grafeas.v1.IBatchCreateOccurrencesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateOccurrences( - request: protos.grafeas.v1.IBatchCreateOccurrencesRequest, - callback: Callback< - protos.grafeas.v1.IBatchCreateOccurrencesResponse, - protos.grafeas.v1.IBatchCreateOccurrencesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateOccurrences( - request?: protos.grafeas.v1.IBatchCreateOccurrencesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.IBatchCreateOccurrencesResponse, - protos.grafeas.v1.IBatchCreateOccurrencesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.IBatchCreateOccurrencesResponse, - protos.grafeas.v1.IBatchCreateOccurrencesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.IBatchCreateOccurrencesResponse, - protos.grafeas.v1.IBatchCreateOccurrencesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateOccurrences(request, options, callback); - } -/** - * Updates the specified occurrence. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - * @param {grafeas.v1.Occurrence} request.occurrence - * The updated occurrence. - * @param {google.protobuf.FieldMask} request.updateMask - * The fields to update. - * @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 [Occurrence]{@link grafeas.v1.Occurrence}. - * 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/grafeas.update_occurrence.js - * region_tag:containeranalysis_v1_generated_Grafeas_UpdateOccurrence_async - */ - updateOccurrence( - request?: protos.grafeas.v1.IUpdateOccurrenceRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IUpdateOccurrenceRequest|undefined, {}|undefined - ]>; - updateOccurrence( - request: protos.grafeas.v1.IUpdateOccurrenceRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IUpdateOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - updateOccurrence( - request: protos.grafeas.v1.IUpdateOccurrenceRequest, - callback: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IUpdateOccurrenceRequest|null|undefined, - {}|null|undefined>): void; - updateOccurrence( - request?: protos.grafeas.v1.IUpdateOccurrenceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IUpdateOccurrenceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IUpdateOccurrenceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.IOccurrence, - protos.grafeas.v1.IUpdateOccurrenceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateOccurrence(request, options, callback); - } -/** - * Gets the note attached to the specified occurrence. Consumer projects can - * use this method to get a note that belongs to a provider project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - * @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 [Note]{@link grafeas.v1.Note}. - * 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/grafeas.get_occurrence_note.js - * region_tag:containeranalysis_v1_generated_Grafeas_GetOccurrenceNote_async - */ - getOccurrenceNote( - request?: protos.grafeas.v1.IGetOccurrenceNoteRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetOccurrenceNoteRequest|undefined, {}|undefined - ]>; - getOccurrenceNote( - request: protos.grafeas.v1.IGetOccurrenceNoteRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetOccurrenceNoteRequest|null|undefined, - {}|null|undefined>): void; - getOccurrenceNote( - request: protos.grafeas.v1.IGetOccurrenceNoteRequest, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetOccurrenceNoteRequest|null|undefined, - {}|null|undefined>): void; - getOccurrenceNote( - request?: protos.grafeas.v1.IGetOccurrenceNoteRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetOccurrenceNoteRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetOccurrenceNoteRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetOccurrenceNoteRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getOccurrenceNote(request, options, callback); - } -/** - * Gets the specified note. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - * @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 [Note]{@link grafeas.v1.Note}. - * 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/grafeas.get_note.js - * region_tag:containeranalysis_v1_generated_Grafeas_GetNote_async - */ - getNote( - request?: protos.grafeas.v1.IGetNoteRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetNoteRequest|undefined, {}|undefined - ]>; - getNote( - request: protos.grafeas.v1.IGetNoteRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetNoteRequest|null|undefined, - {}|null|undefined>): void; - getNote( - request: protos.grafeas.v1.IGetNoteRequest, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetNoteRequest|null|undefined, - {}|null|undefined>): void; - getNote( - request?: protos.grafeas.v1.IGetNoteRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetNoteRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetNoteRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.IGetNoteRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getNote(request, options, callback); - } -/** - * Deletes the specified note. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - * @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/grafeas.delete_note.js - * region_tag:containeranalysis_v1_generated_Grafeas_DeleteNote_async - */ - deleteNote( - request?: protos.grafeas.v1.IDeleteNoteRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteNoteRequest|undefined, {}|undefined - ]>; - deleteNote( - request: protos.grafeas.v1.IDeleteNoteRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteNoteRequest|null|undefined, - {}|null|undefined>): void; - deleteNote( - request: protos.grafeas.v1.IDeleteNoteRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteNoteRequest|null|undefined, - {}|null|undefined>): void; - deleteNote( - request?: protos.grafeas.v1.IDeleteNoteRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteNoteRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteNoteRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.grafeas.v1.IDeleteNoteRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteNote(request, options, callback); - } -/** - * Creates a new note. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the note is to be created. - * @param {string} request.noteId - * The ID to use for this note. - * @param {grafeas.v1.Note} request.note - * The note 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 [Note]{@link grafeas.v1.Note}. - * 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/grafeas.create_note.js - * region_tag:containeranalysis_v1_generated_Grafeas_CreateNote_async - */ - createNote( - request?: protos.grafeas.v1.ICreateNoteRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.ICreateNoteRequest|undefined, {}|undefined - ]>; - createNote( - request: protos.grafeas.v1.ICreateNoteRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.ICreateNoteRequest|null|undefined, - {}|null|undefined>): void; - createNote( - request: protos.grafeas.v1.ICreateNoteRequest, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.ICreateNoteRequest|null|undefined, - {}|null|undefined>): void; - createNote( - request?: protos.grafeas.v1.ICreateNoteRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.ICreateNoteRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.ICreateNoteRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.ICreateNoteRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createNote(request, options, callback); - } -/** - * Creates new notes in batch. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the notes are to be created. - * @param {number[]} request.notes - * The notes to create. Max allowed length is 1000. - * @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 [BatchCreateNotesResponse]{@link grafeas.v1.BatchCreateNotesResponse}. - * 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/grafeas.batch_create_notes.js - * region_tag:containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async - */ - batchCreateNotes( - request?: protos.grafeas.v1.IBatchCreateNotesRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.IBatchCreateNotesResponse, - protos.grafeas.v1.IBatchCreateNotesRequest|undefined, {}|undefined - ]>; - batchCreateNotes( - request: protos.grafeas.v1.IBatchCreateNotesRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.IBatchCreateNotesResponse, - protos.grafeas.v1.IBatchCreateNotesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateNotes( - request: protos.grafeas.v1.IBatchCreateNotesRequest, - callback: Callback< - protos.grafeas.v1.IBatchCreateNotesResponse, - protos.grafeas.v1.IBatchCreateNotesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateNotes( - request?: protos.grafeas.v1.IBatchCreateNotesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.IBatchCreateNotesResponse, - protos.grafeas.v1.IBatchCreateNotesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.IBatchCreateNotesResponse, - protos.grafeas.v1.IBatchCreateNotesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.IBatchCreateNotesResponse, - protos.grafeas.v1.IBatchCreateNotesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateNotes(request, options, callback); - } -/** - * Updates the specified note. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - * @param {grafeas.v1.Note} request.note - * The updated note. - * @param {google.protobuf.FieldMask} request.updateMask - * The fields to update. - * @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 [Note]{@link grafeas.v1.Note}. - * 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/grafeas.update_note.js - * region_tag:containeranalysis_v1_generated_Grafeas_UpdateNote_async - */ - updateNote( - request?: protos.grafeas.v1.IUpdateNoteRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.IUpdateNoteRequest|undefined, {}|undefined - ]>; - updateNote( - request: protos.grafeas.v1.IUpdateNoteRequest, - options: CallOptions, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IUpdateNoteRequest|null|undefined, - {}|null|undefined>): void; - updateNote( - request: protos.grafeas.v1.IUpdateNoteRequest, - callback: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IUpdateNoteRequest|null|undefined, - {}|null|undefined>): void; - updateNote( - request?: protos.grafeas.v1.IUpdateNoteRequest, - optionsOrCallback?: CallOptions|Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IUpdateNoteRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.grafeas.v1.INote, - protos.grafeas.v1.IUpdateNoteRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.grafeas.v1.INote, - protos.grafeas.v1.IUpdateNoteRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateNote(request, options, callback); - } - - /** - * Lists occurrences for the specified project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project to list occurrences for in the form of - * `projects/[PROJECT_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of occurrences to return in the list. Must be positive. Max allowed - * page size is 1000. If not specified, page size defaults to 20. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 [Occurrence]{@link grafeas.v1.Occurrence}. - * 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 `listOccurrencesAsync()` - * 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. - */ - listOccurrences( - request?: protos.grafeas.v1.IListOccurrencesRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.IOccurrence[], - protos.grafeas.v1.IListOccurrencesRequest|null, - protos.grafeas.v1.IListOccurrencesResponse - ]>; - listOccurrences( - request: protos.grafeas.v1.IListOccurrencesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.grafeas.v1.IListOccurrencesRequest, - protos.grafeas.v1.IListOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>): void; - listOccurrences( - request: protos.grafeas.v1.IListOccurrencesRequest, - callback: PaginationCallback< - protos.grafeas.v1.IListOccurrencesRequest, - protos.grafeas.v1.IListOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>): void; - listOccurrences( - request?: protos.grafeas.v1.IListOccurrencesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.grafeas.v1.IListOccurrencesRequest, - protos.grafeas.v1.IListOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>, - callback?: PaginationCallback< - protos.grafeas.v1.IListOccurrencesRequest, - protos.grafeas.v1.IListOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>): - Promise<[ - protos.grafeas.v1.IOccurrence[], - protos.grafeas.v1.IListOccurrencesRequest|null, - protos.grafeas.v1.IListOccurrencesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listOccurrences(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project to list occurrences for in the form of - * `projects/[PROJECT_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of occurrences to return in the list. Must be positive. Max allowed - * page size is 1000. If not specified, page size defaults to 20. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 [Occurrence]{@link grafeas.v1.Occurrence} 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 `listOccurrencesAsync()` - * 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. - */ - listOccurrencesStream( - request?: protos.grafeas.v1.IListOccurrencesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listOccurrences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listOccurrences.createStream( - this.innerApiCalls.listOccurrences as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listOccurrences`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project to list occurrences for in the form of - * `projects/[PROJECT_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of occurrences to return in the list. Must be positive. Max allowed - * page size is 1000. If not specified, page size defaults to 20. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 - * [Occurrence]{@link grafeas.v1.Occurrence}. 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/grafeas.list_occurrences.js - * region_tag:containeranalysis_v1_generated_Grafeas_ListOccurrences_async - */ - listOccurrencesAsync( - request?: protos.grafeas.v1.IListOccurrencesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listOccurrences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listOccurrences.asyncIterate( - this.innerApiCalls['listOccurrences'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists notes for the specified project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project to list notes for in the form of - * `projects/[PROJECT_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of notes to return in the list. Must be positive. Max allowed page - * size is 1000. If not specified, page size defaults to 20. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 [Note]{@link grafeas.v1.Note}. - * 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 `listNotesAsync()` - * 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. - */ - listNotes( - request?: protos.grafeas.v1.IListNotesRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.INote[], - protos.grafeas.v1.IListNotesRequest|null, - protos.grafeas.v1.IListNotesResponse - ]>; - listNotes( - request: protos.grafeas.v1.IListNotesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.grafeas.v1.IListNotesRequest, - protos.grafeas.v1.IListNotesResponse|null|undefined, - protos.grafeas.v1.INote>): void; - listNotes( - request: protos.grafeas.v1.IListNotesRequest, - callback: PaginationCallback< - protos.grafeas.v1.IListNotesRequest, - protos.grafeas.v1.IListNotesResponse|null|undefined, - protos.grafeas.v1.INote>): void; - listNotes( - request?: protos.grafeas.v1.IListNotesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.grafeas.v1.IListNotesRequest, - protos.grafeas.v1.IListNotesResponse|null|undefined, - protos.grafeas.v1.INote>, - callback?: PaginationCallback< - protos.grafeas.v1.IListNotesRequest, - protos.grafeas.v1.IListNotesResponse|null|undefined, - protos.grafeas.v1.INote>): - Promise<[ - protos.grafeas.v1.INote[], - protos.grafeas.v1.IListNotesRequest|null, - protos.grafeas.v1.IListNotesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNotes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project to list notes for in the form of - * `projects/[PROJECT_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of notes to return in the list. Must be positive. Max allowed page - * size is 1000. If not specified, page size defaults to 20. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 [Note]{@link grafeas.v1.Note} 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 `listNotesAsync()` - * 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. - */ - listNotesStream( - request?: protos.grafeas.v1.IListNotesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNotes.createStream( - this.innerApiCalls.listNotes as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listNotes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The name of the project to list notes for in the form of - * `projects/[PROJECT_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of notes to return in the list. Must be positive. Max allowed page - * size is 1000. If not specified, page size defaults to 20. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 - * [Note]{@link grafeas.v1.Note}. 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/grafeas.list_notes.js - * region_tag:containeranalysis_v1_generated_Grafeas_ListNotes_async - */ - listNotesAsync( - request?: protos.grafeas.v1.IListNotesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listNotes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNotes.asyncIterate( - this.innerApiCalls['listNotes'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists occurrences referencing the specified note. Provider projects can use - * this method to get all occurrences across consumer projects referencing the - * specified note. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the note to list occurrences for in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of occurrences to return in the list. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 [Occurrence]{@link grafeas.v1.Occurrence}. - * 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 `listNoteOccurrencesAsync()` - * 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. - */ - listNoteOccurrences( - request?: protos.grafeas.v1.IListNoteOccurrencesRequest, - options?: CallOptions): - Promise<[ - protos.grafeas.v1.IOccurrence[], - protos.grafeas.v1.IListNoteOccurrencesRequest|null, - protos.grafeas.v1.IListNoteOccurrencesResponse - ]>; - listNoteOccurrences( - request: protos.grafeas.v1.IListNoteOccurrencesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.grafeas.v1.IListNoteOccurrencesRequest, - protos.grafeas.v1.IListNoteOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>): void; - listNoteOccurrences( - request: protos.grafeas.v1.IListNoteOccurrencesRequest, - callback: PaginationCallback< - protos.grafeas.v1.IListNoteOccurrencesRequest, - protos.grafeas.v1.IListNoteOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>): void; - listNoteOccurrences( - request?: protos.grafeas.v1.IListNoteOccurrencesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.grafeas.v1.IListNoteOccurrencesRequest, - protos.grafeas.v1.IListNoteOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>, - callback?: PaginationCallback< - protos.grafeas.v1.IListNoteOccurrencesRequest, - protos.grafeas.v1.IListNoteOccurrencesResponse|null|undefined, - protos.grafeas.v1.IOccurrence>): - Promise<[ - protos.grafeas.v1.IOccurrence[], - protos.grafeas.v1.IListNoteOccurrencesRequest|null, - protos.grafeas.v1.IListNoteOccurrencesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.listNoteOccurrences(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.name - * The name of the note to list occurrences for in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of occurrences to return in the list. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 [Occurrence]{@link grafeas.v1.Occurrence} 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 `listNoteOccurrencesAsync()` - * 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. - */ - listNoteOccurrencesStream( - request?: protos.grafeas.v1.IListNoteOccurrencesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listNoteOccurrences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNoteOccurrences.createStream( - this.innerApiCalls.listNoteOccurrences as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listNoteOccurrences`, 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.name - * The name of the note to list occurrences for in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - * @param {string} request.filter - * The filter expression. - * @param {number} request.pageSize - * Number of occurrences to return in the list. - * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. - * @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 - * [Occurrence]{@link grafeas.v1.Occurrence}. 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/grafeas.list_note_occurrences.js - * region_tag:containeranalysis_v1_generated_Grafeas_ListNoteOccurrences_async - */ - listNoteOccurrencesAsync( - request?: protos.grafeas.v1.IListNoteOccurrencesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listNoteOccurrences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNoteOccurrences.asyncIterate( - this.innerApiCalls['listNoteOccurrences'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified note resource name string. - * - * @param {string} project - * @param {string} note - * @returns {string} Resource name string. - */ - notePath(project:string,note:string) { - return this.pathTemplates.notePathTemplate.render({ - project: project, - note: note, - }); - } - - /** - * Parse the project from Note resource. - * - * @param {string} noteName - * A fully-qualified path representing Note resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNoteName(noteName: string) { - return this.pathTemplates.notePathTemplate.match(noteName).project; - } - - /** - * Parse the note from Note resource. - * - * @param {string} noteName - * A fully-qualified path representing Note resource. - * @returns {string} A string representing the note. - */ - matchNoteFromNoteName(noteName: string) { - return this.pathTemplates.notePathTemplate.match(noteName).note; - } - - /** - * Return a fully-qualified occurrence resource name string. - * - * @param {string} project - * @param {string} occurrence - * @returns {string} Resource name string. - */ - occurrencePath(project:string,occurrence:string) { - return this.pathTemplates.occurrencePathTemplate.render({ - project: project, - occurrence: occurrence, - }); - } - - /** - * Parse the project from Occurrence resource. - * - * @param {string} occurrenceName - * A fully-qualified path representing Occurrence resource. - * @returns {string} A string representing the project. - */ - matchProjectFromOccurrenceName(occurrenceName: string) { - return this.pathTemplates.occurrencePathTemplate.match(occurrenceName).project; - } - - /** - * Parse the occurrence from Occurrence resource. - * - * @param {string} occurrenceName - * A fully-qualified path representing Occurrence resource. - * @returns {string} A string representing the occurrence. - */ - matchOccurrenceFromOccurrenceName(occurrenceName: string) { - return this.pathTemplates.occurrencePathTemplate.match(occurrenceName).occurrence; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.grafeasStub && !this._terminated) { - return this.grafeasStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/grafeas/v1/src/v1/grafeas_client_config.json b/owl-bot-staging/grafeas/v1/src/v1/grafeas_client_config.json deleted file mode 100644 index 47876c07899..00000000000 --- a/owl-bot-staging/grafeas/v1/src/v1/grafeas_client_config.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "interfaces": { - "grafeas.v1.Grafeas": { - "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": { - "GetOccurrence": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListOccurrences": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteOccurrence": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateOccurrence": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateOccurrences": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateOccurrence": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetOccurrenceNote": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetNote": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListNotes": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteNote": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateNote": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateNotes": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateNote": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNoteOccurrences": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/grafeas/v1/src/v1/grafeas_proto_list.json b/owl-bot-staging/grafeas/v1/src/v1/grafeas_proto_list.json deleted file mode 100644 index 09b27b8e50c..00000000000 --- a/owl-bot-staging/grafeas/v1/src/v1/grafeas_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/grafeas/v1/attestation.proto", - "../../protos/grafeas/v1/build.proto", - "../../protos/grafeas/v1/common.proto", - "../../protos/grafeas/v1/compliance.proto", - "../../protos/grafeas/v1/cvss.proto", - "../../protos/grafeas/v1/deployment.proto", - "../../protos/grafeas/v1/discovery.proto", - "../../protos/grafeas/v1/dsse_attestation.proto", - "../../protos/grafeas/v1/grafeas.proto", - "../../protos/grafeas/v1/image.proto", - "../../protos/grafeas/v1/intoto_provenance.proto", - "../../protos/grafeas/v1/intoto_statement.proto", - "../../protos/grafeas/v1/package.proto", - "../../protos/grafeas/v1/provenance.proto", - "../../protos/grafeas/v1/severity.proto", - "../../protos/grafeas/v1/slsa_provenance.proto", - "../../protos/grafeas/v1/slsa_provenance_zero_two.proto", - "../../protos/grafeas/v1/upgrade.proto", - "../../protos/grafeas/v1/vulnerability.proto" -] diff --git a/owl-bot-staging/grafeas/v1/src/v1/index.ts b/owl-bot-staging/grafeas/v1/src/v1/index.ts deleted file mode 100644 index 9c71579f06d..00000000000 --- a/owl-bot-staging/grafeas/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {GrafeasClient} from './grafeas_client'; diff --git a/owl-bot-staging/grafeas/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/grafeas/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 79febe42045..00000000000 --- a/owl-bot-staging/grafeas/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const grafeas = require('@google-cloud/grafeas'); - -function main() { - const grafeasClient = new grafeas.GrafeasClient(); -} - -main(); diff --git a/owl-bot-staging/grafeas/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/grafeas/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 5e65529fa41..00000000000 --- a/owl-bot-staging/grafeas/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {GrafeasClient} from '@google-cloud/grafeas'; - -// check that the client class type name can be used -function doStuffWithGrafeasClient(client: GrafeasClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const grafeasClient = new GrafeasClient(); - doStuffWithGrafeasClient(grafeasClient); -} - -main(); diff --git a/owl-bot-staging/grafeas/v1/system-test/install.ts b/owl-bot-staging/grafeas/v1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/grafeas/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/grafeas/v1/test/gapic_grafeas_v1.ts b/owl-bot-staging/grafeas/v1/test/gapic_grafeas_v1.ts deleted file mode 100644 index 3cb11ce1fd7..00000000000 --- a/owl-bot-staging/grafeas/v1/test/gapic_grafeas_v1.ts +++ /dev/null @@ -1,2229 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as grafeasModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function 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.GrafeasClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = grafeasModule.v1.GrafeasClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = grafeasModule.v1.GrafeasClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = grafeasModule.v1.GrafeasClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new grafeasModule.v1.GrafeasClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new grafeasModule.v1.GrafeasClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.grafeasStub, undefined); - await client.initialize(); - assert(client.grafeasStub); - }); - - it('has close method for the initialized client', done => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.grafeasStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.grafeasStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new grafeasModule.v1.GrafeasClient({ - 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 grafeasModule.v1.GrafeasClient({ - 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('getOccurrence', () => { - it('invokes getOccurrence without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Occurrence() - ); - client.innerApiCalls.getOccurrence = stubSimpleCall(expectedResponse); - const [response] = await client.getOccurrence(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOccurrence without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Occurrence() - ); - client.innerApiCalls.getOccurrence = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getOccurrence( - request, - (err?: Error|null, result?: protos.grafeas.v1.IOccurrence|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOccurrence with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOccurrence = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOccurrence(request), expectedError); - const actualRequest = (client.innerApiCalls.getOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOccurrence with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getOccurrence(request), expectedError); - }); - }); - - describe('deleteOccurrence', () => { - it('invokes deleteOccurrence without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteOccurrence = stubSimpleCall(expectedResponse); - const [response] = await client.deleteOccurrence(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteOccurrence without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteOccurrence = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteOccurrence( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteOccurrence with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteOccurrence = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteOccurrence(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteOccurrence with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteOccurrence(request), expectedError); - }); - }); - - describe('createOccurrence', () => { - it('invokes createOccurrence without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateOccurrenceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Occurrence() - ); - client.innerApiCalls.createOccurrence = stubSimpleCall(expectedResponse); - const [response] = await client.createOccurrence(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createOccurrence without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateOccurrenceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Occurrence() - ); - client.innerApiCalls.createOccurrence = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createOccurrence( - request, - (err?: Error|null, result?: protos.grafeas.v1.IOccurrence|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createOccurrence with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateOccurrenceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createOccurrence = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createOccurrence(request), expectedError); - const actualRequest = (client.innerApiCalls.createOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createOccurrence with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateOccurrenceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createOccurrence(request), expectedError); - }); - }); - - describe('batchCreateOccurrences', () => { - it('invokes batchCreateOccurrences without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.BatchCreateOccurrencesResponse() - ); - client.innerApiCalls.batchCreateOccurrences = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateOccurrences(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateOccurrences without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.BatchCreateOccurrencesResponse() - ); - client.innerApiCalls.batchCreateOccurrences = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateOccurrences( - request, - (err?: Error|null, result?: protos.grafeas.v1.IBatchCreateOccurrencesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateOccurrences with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateOccurrences = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateOccurrences(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateOccurrences with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateOccurrences(request), expectedError); - }); - }); - - describe('updateOccurrence', () => { - it('invokes updateOccurrence without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Occurrence() - ); - client.innerApiCalls.updateOccurrence = stubSimpleCall(expectedResponse); - const [response] = await client.updateOccurrence(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateOccurrence without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Occurrence() - ); - client.innerApiCalls.updateOccurrence = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateOccurrence( - request, - (err?: Error|null, result?: protos.grafeas.v1.IOccurrence|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateOccurrence with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateOccurrence = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateOccurrence(request), expectedError); - const actualRequest = (client.innerApiCalls.updateOccurrence as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateOccurrence as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateOccurrence with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateOccurrenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateOccurrenceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateOccurrence(request), expectedError); - }); - }); - - describe('getOccurrenceNote', () => { - it('invokes getOccurrenceNote without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.getOccurrenceNote = stubSimpleCall(expectedResponse); - const [response] = await client.getOccurrenceNote(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOccurrenceNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOccurrenceNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOccurrenceNote without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.getOccurrenceNote = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getOccurrenceNote( - request, - (err?: Error|null, result?: protos.grafeas.v1.INote|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOccurrenceNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOccurrenceNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOccurrenceNote with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOccurrenceNote = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOccurrenceNote(request), expectedError); - const actualRequest = (client.innerApiCalls.getOccurrenceNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOccurrenceNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOccurrenceNote with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetOccurrenceNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetOccurrenceNoteRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getOccurrenceNote(request), expectedError); - }); - }); - - describe('getNote', () => { - it('invokes getNote without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.getNote = stubSimpleCall(expectedResponse); - const [response] = await client.getNote(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNote without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.getNote = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNote( - request, - (err?: Error|null, result?: protos.grafeas.v1.INote|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNote with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNote = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNote(request), expectedError); - const actualRequest = (client.innerApiCalls.getNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNote with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.GetNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.GetNoteRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getNote(request), expectedError); - }); - }); - - describe('deleteNote', () => { - it('invokes deleteNote without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteNote = stubSimpleCall(expectedResponse); - const [response] = await client.deleteNote(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNote without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteNote = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteNote( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNote with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteNote = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteNote(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteNote with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.DeleteNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.DeleteNoteRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteNote(request), expectedError); - }); - }); - - describe('createNote', () => { - it('invokes createNote without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateNoteRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.createNote = stubSimpleCall(expectedResponse); - const [response] = await client.createNote(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNote without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateNoteRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.createNote = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNote( - request, - (err?: Error|null, result?: protos.grafeas.v1.INote|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNote with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateNoteRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNote = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createNote(request), expectedError); - const actualRequest = (client.innerApiCalls.createNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNote with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.CreateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.CreateNoteRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createNote(request), expectedError); - }); - }); - - describe('batchCreateNotes', () => { - it('invokes batchCreateNotes without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.BatchCreateNotesResponse() - ); - client.innerApiCalls.batchCreateNotes = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateNotes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateNotes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateNotes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateNotes without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.BatchCreateNotesResponse() - ); - client.innerApiCalls.batchCreateNotes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateNotes( - request, - (err?: Error|null, result?: protos.grafeas.v1.IBatchCreateNotesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateNotes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateNotes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateNotes with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateNotes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateNotes(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateNotes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateNotes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateNotes with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.BatchCreateNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.BatchCreateNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateNotes(request), expectedError); - }); - }); - - describe('updateNote', () => { - it('invokes updateNote without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.updateNote = stubSimpleCall(expectedResponse); - const [response] = await client.updateNote(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNote without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.grafeas.v1.Note() - ); - client.innerApiCalls.updateNote = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateNote( - request, - (err?: Error|null, result?: protos.grafeas.v1.INote|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNote with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateNoteRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateNote = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateNote(request), expectedError); - const actualRequest = (client.innerApiCalls.updateNote as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateNote as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateNote with closed client', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.UpdateNoteRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.UpdateNoteRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateNote(request), expectedError); - }); - }); - - describe('listOccurrences', () => { - it('invokes listOccurrences without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.innerApiCalls.listOccurrences = stubSimpleCall(expectedResponse); - const [response] = await client.listOccurrences(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOccurrences without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.innerApiCalls.listOccurrences = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOccurrences( - request, - (err?: Error|null, result?: protos.grafeas.v1.IOccurrence[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOccurrences with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOccurrences = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOccurrences(request), expectedError); - const actualRequest = (client.innerApiCalls.listOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOccurrencesStream without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.descriptors.page.listOccurrences.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listOccurrencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.grafeas.v1.Occurrence[] = []; - stream.on('data', (response: protos.grafeas.v1.Occurrence) => { - 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.listOccurrences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listOccurrences, request)); - assert( - (client.descriptors.page.listOccurrences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listOccurrencesStream with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listOccurrences.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listOccurrencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.grafeas.v1.Occurrence[] = []; - stream.on('data', (response: protos.grafeas.v1.Occurrence) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listOccurrences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listOccurrences, request)); - assert( - (client.descriptors.page.listOccurrences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listOccurrences without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.descriptors.page.listOccurrences.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.grafeas.v1.IOccurrence[] = []; - const iterable = client.listOccurrencesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listOccurrences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listOccurrences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listOccurrences with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListOccurrencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listOccurrences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listOccurrencesAsync(request); - await assert.rejects(async () => { - const responses: protos.grafeas.v1.IOccurrence[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listOccurrences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listOccurrences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listNotes', () => { - it('invokes listNotes without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - ]; - client.innerApiCalls.listNotes = stubSimpleCall(expectedResponse); - const [response] = await client.listNotes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNotes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNotes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNotes without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - ]; - client.innerApiCalls.listNotes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNotes( - request, - (err?: Error|null, result?: protos.grafeas.v1.INote[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNotes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNotes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNotes with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNotes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNotes(request), expectedError); - const actualRequest = (client.innerApiCalls.listNotes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNotes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNotesStream without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - ]; - client.descriptors.page.listNotes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNotesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.grafeas.v1.Note[] = []; - stream.on('data', (response: protos.grafeas.v1.Note) => { - 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.listNotes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNotes, request)); - assert( - (client.descriptors.page.listNotes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNotesStream with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNotes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNotesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.grafeas.v1.Note[] = []; - stream.on('data', (response: protos.grafeas.v1.Note) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNotes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNotes, request)); - assert( - (client.descriptors.page.listNotes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNotes without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - generateSampleMessage(new protos.grafeas.v1.Note()), - ]; - client.descriptors.page.listNotes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.grafeas.v1.INote[] = []; - const iterable = client.listNotesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNotes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNotes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNotes with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNotesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNotesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNotes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNotesAsync(request); - await assert.rejects(async () => { - const responses: protos.grafeas.v1.INote[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNotes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNotes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listNoteOccurrences', () => { - it('invokes listNoteOccurrences without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNoteOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNoteOccurrencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.innerApiCalls.listNoteOccurrences = stubSimpleCall(expectedResponse); - const [response] = await client.listNoteOccurrences(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNoteOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNoteOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNoteOccurrences without error using callback', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNoteOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNoteOccurrencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.innerApiCalls.listNoteOccurrences = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNoteOccurrences( - request, - (err?: Error|null, result?: protos.grafeas.v1.IOccurrence[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listNoteOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNoteOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNoteOccurrences with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNoteOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNoteOccurrencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listNoteOccurrences = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNoteOccurrences(request), expectedError); - const actualRequest = (client.innerApiCalls.listNoteOccurrences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listNoteOccurrences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listNoteOccurrencesStream without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNoteOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNoteOccurrencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.descriptors.page.listNoteOccurrences.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNoteOccurrencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.grafeas.v1.Occurrence[] = []; - stream.on('data', (response: protos.grafeas.v1.Occurrence) => { - 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.listNoteOccurrences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNoteOccurrences, request)); - assert( - (client.descriptors.page.listNoteOccurrences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listNoteOccurrencesStream with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNoteOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNoteOccurrencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNoteOccurrences.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNoteOccurrencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.grafeas.v1.Occurrence[] = []; - stream.on('data', (response: protos.grafeas.v1.Occurrence) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNoteOccurrences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNoteOccurrences, request)); - assert( - (client.descriptors.page.listNoteOccurrences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNoteOccurrences without error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNoteOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNoteOccurrencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - generateSampleMessage(new protos.grafeas.v1.Occurrence()), - ]; - client.descriptors.page.listNoteOccurrences.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.grafeas.v1.IOccurrence[] = []; - const iterable = client.listNoteOccurrencesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listNoteOccurrences with error', async () => { - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.grafeas.v1.ListNoteOccurrencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.grafeas.v1.ListNoteOccurrencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listNoteOccurrences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNoteOccurrencesAsync(request); - await assert.rejects(async () => { - const responses: protos.grafeas.v1.IOccurrence[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('note', () => { - const fakePath = "/rendered/path/note"; - const expectedParameters = { - project: "projectValue", - note: "noteValue", - }; - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.notePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.notePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('notePath', () => { - const result = client.notePath("projectValue", "noteValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.notePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNoteName', () => { - const result = client.matchProjectFromNoteName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.notePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNoteFromNoteName', () => { - const result = client.matchNoteFromNoteName(fakePath); - assert.strictEqual(result, "noteValue"); - assert((client.pathTemplates.notePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('occurrence', () => { - const fakePath = "/rendered/path/occurrence"; - const expectedParameters = { - project: "projectValue", - occurrence: "occurrenceValue", - }; - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.occurrencePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.occurrencePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('occurrencePath', () => { - const result = client.occurrencePath("projectValue", "occurrenceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.occurrencePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromOccurrenceName', () => { - const result = client.matchProjectFromOccurrenceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.occurrencePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOccurrenceFromOccurrenceName', () => { - const result = client.matchOccurrenceFromOccurrenceName(fakePath); - assert.strictEqual(result, "occurrenceValue"); - assert((client.pathTemplates.occurrencePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new grafeasModule.v1.GrafeasClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/grafeas/v1/tsconfig.json b/owl-bot-staging/grafeas/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/grafeas/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/grafeas/v1/webpack.config.js b/owl-bot-staging/grafeas/v1/webpack.config.js deleted file mode 100644 index a51f5e182e4..00000000000 --- a/owl-bot-staging/grafeas/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: 'Grafeas', - filename: './grafeas.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-storagetransfer/.gitignore b/packages/google-storagetransfer/.gitignore index 5d32b23782f..4e9ab31e1f6 100644 --- a/packages/google-storagetransfer/.gitignore +++ b/packages/google-storagetransfer/.gitignore @@ -4,6 +4,7 @@ coverage .nyc_output docs/ +!protos/* out/ build/ system-test/secrets.js diff --git a/packages/grafeas/.gitignore b/packages/grafeas/.gitignore index 5d32b23782f..4e9ab31e1f6 100644 --- a/packages/grafeas/.gitignore +++ b/packages/grafeas/.gitignore @@ -4,6 +4,7 @@ coverage .nyc_output docs/ +!protos/* out/ build/ system-test/secrets.js