From 2333391ef028caa63c2fa8c460d66012622ad9df Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 30 Mar 2021 12:14:25 -0700 Subject: [PATCH] fix: Specify `build` as the body of a `CreateBuild` call. The Cloud Build API has always assumed this, but now we are actually specifying it. (#202) feat: Add `ReceiveTriggerWebhook` for webhooks activating specific triggers. feat: Add `SecretManager`-related resources and messages for corresponding integration. feat: Add `COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY` for corresponding comment control feat: Committer: @lozord PiperOrigin-RevId: 363244566 Source-Author: Google APIs Source-Date: Tue Mar 16 12:32:12 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 913f5553d5ff5940cddd8245313136449b2a3571 Source-Link: https://github.com/googleapis/googleapis/commit/913f5553d5ff5940cddd8245313136449b2a3571 Co-authored-by: Megan O'Keefe <3137106+askmeegs@users.noreply.github.com> --- .../devtools/cloudbuild/v1/cloudbuild.proto | 136 +- .../protos/protos.d.ts | 616 +- .../protos/protos.js | 6707 ++++++++++------- .../protos/protos.json | 125 +- .../src/v1/cloud_build_client.ts | 268 +- .../src/v1/cloud_build_client_config.json | 4 + .../src/v1/gapic_metadata.json | 10 + .../google-devtools-cloudbuild/synth.metadata | 6 +- .../test/gapic_cloud_build_v1.ts | 257 + 9 files changed, 5481 insertions(+), 2648 deletions(-) diff --git a/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto b/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto index 689e87984b0..b5a3c09d248 100644 --- a/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto +++ b/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -19,6 +19,7 @@ package google.devtools.cloudbuild.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; @@ -40,6 +41,18 @@ option (google.api.resource_definition) = { type: "iam.googleapis.com/ServiceAccount" pattern: "projects/{project}/serviceAccounts/{service_account}" }; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/Secret" + pattern: "projects/{project}/secrets/{secret}" +}; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}" +}; // Creates and manages builds on Google Cloud Platform. // @@ -65,7 +78,7 @@ service CloudBuild { body: "build" additional_bindings { post: "/v1/{parent=projects/*/locations/*}/builds" - body: "*" + body: "build" } }; option (google.api.method_signature) = "project_id,build"; @@ -223,6 +236,16 @@ service CloudBuild { }; } + // ReceiveTriggerWebhook [Experimental] is called when the API receives a + // webhook request targeted at a specific trigger. + rpc ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest) + returns (ReceiveTriggerWebhookResponse) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/triggers/{trigger}:webhook" + body: "body" + }; + } + // Creates a `WorkerPool` to run the builds, and returns the new worker pool. // // This API is experimental. @@ -274,8 +297,8 @@ message RunBuildTriggerRequest { // Required. ID of the trigger. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. Source to build against this trigger. - RepoSource source = 3 [(google.api.field_behavior) = REQUIRED]; + // Source to build against this trigger. + RepoSource source = 3; } // Location of the source in an archive file in Google Cloud Storage. @@ -302,7 +325,7 @@ message RepoSource { // project ID requesting the build is assumed. string project_id = 1; - // Required. Name of the Cloud Source Repository. + // Name of the Cloud Source Repository. string repo_name = 2; // A revision within the Cloud Source Repository must be specified in @@ -525,6 +548,7 @@ message ArtifactResult { // build is created: // // - $PROJECT_ID: the project ID of the build. +// - $PROJECT_NUMBER: the project number of the build. // - $BUILD_ID: the autogenerated ID of the build. // - $REPO_NAME: the source repository name specified by RepoSource. // - $BRANCH_NAME: the branch name specified by RepoSource. @@ -669,6 +693,10 @@ message Build { repeated string tags = 31; // Secrets to decrypt using Cloud Key Management Service. + // Note: Secret Manager is the recommended technique + // for managing sensitive data with Cloud Build. Use `available_secrets` to + // configure builds to access secrets from Secret Manager. For instructions, + // see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets repeated Secret secrets = 32; // Output only. Stores timing information for phases of the build. Valid keys @@ -686,10 +714,13 @@ message Build { // Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. // ACCOUNT can be email address or uniqueId of the service account. // - // This field is in alpha and is not publicly available. + // This field is in beta. string service_account = 42 [(google.api.resource_reference) = { type: "iam.googleapis.com/ServiceAccount" }]; + + // Secrets and secret environment variables. + Secrets available_secrets = 47; } // Artifacts produced by a build that should be uploaded upon @@ -806,8 +837,53 @@ message Hash { bytes value = 2; } +// Secrets and secret environment variables. +message Secrets { + // Secrets in Secret Manager and associated secret environment variable. + repeated SecretManagerSecret secret_manager = 1; + + // Secrets encrypted with KMS key and the associated secret environment + // variable. + repeated InlineSecret inline = 2; +} + +// Pairs a set of secret environment variables mapped to encrypted +// values with the Cloud KMS key to use to decrypt the value. +message InlineSecret { + // Resource name of Cloud KMS crypto key to decrypt the encrypted value. + // In format: projects/*/locations/*/keyRings/*/cryptoKeys/* + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Map of environment variable name to its encrypted value. + // + // Secret environment variables must be unique across all of a build's + // secrets, and must be used by at least one build step. Values can be at most + // 64 KB in size. There can be at most 100 secret values across all of a + // build's secrets. + map env_map = 2; +} + +// Pairs a secret environment variable with a SecretVersion in Secret Manager. +message SecretManagerSecret { + // Resource name of the SecretVersion. In format: + // projects/*/secrets/*/versions/* + string version_name = 1 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; + + // Environment variable name to associate with the secret. + // Secret environment variables must be unique across all of a build's + // secrets, and must be used by at least one build step. + string env = 2; +} + // Pairs a set of secret environment variables containing encrypted // values with the Cloud KMS key to use to decrypt the value. +// Note: Use `kmsKeyName` with `available_secrets` instead of using +// `kmsKeyName` with `secret`. For instructions see: +// https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials. message Secret { // Cloud KMS key name to use to decrypt these envs. string kms_key_name = 1; @@ -865,7 +941,15 @@ message ListBuildsRequest { // Number of results to return in the list. int32 page_size = 2; - // Token to provide to skip to a particular spot in the list. + // The page token for the next page of Builds. + // + // If unspecified, the first page of results is returned. + // + // If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + // In this case, the token should be discarded, and pagination should be + // restarted from the first page of results. + // + // See https://google.aip.dev/158 for more. string page_token = 3; // The raw filter text to constrain the results. @@ -878,12 +962,13 @@ message ListBuildsResponse { repeated Build builds = 1; // Token to receive the next page of results. + // This will be absent if the end of the response list has been reached. string next_page_token = 2; } // Request to cancel an ongoing build. message CancelBuildRequest { - // The name of the `Build` to retrieve. + // The name of the `Build` to cancel. // Format: `projects/{project}/locations/{location}/builds/{build}` string name = 4 [(google.api.resource_reference) = { type: "cloudbuild.googleapis.com/Build" @@ -941,8 +1026,8 @@ message BuildTrigger { // Contents of the build template. Build build = 4; - // Path, from the source root, to a file whose contents is used for the - // template. + // Path, from the source root, to the build configuration file + // (i.e. cloudbuild.yaml). string filename = 8; } @@ -1018,6 +1103,10 @@ message PullRequestFilter { // Enforce that repository owners or collaborators must comment on Pull // Requests before builds are triggered. COMMENTS_ENABLED = 1; + + // Enforce that repository owners or collaborators must comment on external + // contributors' Pull Requests before builds are triggered. + COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2; } // Target refs to match. @@ -1144,6 +1233,12 @@ message BuildOptions { // Highcpu machine with 32 CPUs. N1_HIGHCPU_32 = 2; + + // Highcpu e2 machine with 8 CPUs. + E2_HIGHCPU_8 = 5; + + // Highcpu e2 machine with 32 CPUs. + E2_HIGHCPU_32 = 6; } // Specifies the behavior when there is an error in the substitution checks. @@ -1190,7 +1285,6 @@ message BuildOptions { CLOUD_LOGGING_ONLY = 5; // Turn off all logging. No build logs will be captured. - // Next ID: 6 NONE = 4; } @@ -1265,6 +1359,26 @@ message BuildOptions { repeated Volume volumes = 14; } +// ReceiveTriggerWebhookRequest [Experimental] is the request object accepted by +// the ReceiveTriggerWebhook method. +message ReceiveTriggerWebhookRequest { + // HTTP request body. + google.api.HttpBody body = 1; + + // Project in which the specified trigger lives + string project_id = 2; + + // Name of the trigger to run the payload against + string trigger = 3; + + // Secret token used for authorization if an OAuth token isn't provided. + string secret = 4; +} + +// ReceiveTriggerWebhookResponse [Experimental] is the response object for the +// ReceiveTriggerWebhook method. +message ReceiveTriggerWebhookResponse {} + // Configuration for a WorkerPool to run the builds. // // Workers are machines that Cloud Build uses to run your builds. By default, diff --git a/packages/google-devtools-cloudbuild/protos/protos.d.ts b/packages/google-devtools-cloudbuild/protos/protos.d.ts index cc6271c797a..e03d94b01d8 100644 --- a/packages/google-devtools-cloudbuild/protos/protos.d.ts +++ b/packages/google-devtools-cloudbuild/protos/protos.d.ts @@ -200,6 +200,20 @@ export namespace google { */ public runBuildTrigger(request: google.devtools.cloudbuild.v1.IRunBuildTriggerRequest): Promise; + /** + * Calls ReceiveTriggerWebhook. + * @param request ReceiveTriggerWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReceiveTriggerWebhookResponse + */ + public receiveTriggerWebhook(request: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.ReceiveTriggerWebhookCallback): void; + + /** + * Calls ReceiveTriggerWebhook. + * @param request ReceiveTriggerWebhookRequest message or plain object + * @returns Promise + */ + public receiveTriggerWebhook(request: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest): Promise; + /** * Calls CreateWorkerPool. * @param request CreateWorkerPoolRequest message or plain object @@ -350,6 +364,13 @@ export namespace google { */ type RunBuildTriggerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#receiveTriggerWebhook}. + * @param error Error, if any + * @param [response] ReceiveTriggerWebhookResponse + */ + type ReceiveTriggerWebhookCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse) => void; + /** * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#createWorkerPool}. * @param error Error, if any @@ -1579,6 +1600,9 @@ export namespace google { /** Build serviceAccount */ serviceAccount?: (string|null); + + /** Build availableSecrets */ + availableSecrets?: (google.devtools.cloudbuild.v1.ISecrets|null); } /** Represents a Build. */ @@ -1665,6 +1689,9 @@ export namespace google { /** Build serviceAccount. */ public serviceAccount: string; + /** Build availableSecrets. */ + public availableSecrets?: (google.devtools.cloudbuild.v1.ISecrets|null); + /** * Creates a new Build instance using the specified properties. * @param [properties] Properties to set @@ -2437,6 +2464,294 @@ export namespace google { } } + /** Properties of a Secrets. */ + interface ISecrets { + + /** Secrets secretManager */ + secretManager?: (google.devtools.cloudbuild.v1.ISecretManagerSecret[]|null); + + /** Secrets inline */ + inline?: (google.devtools.cloudbuild.v1.IInlineSecret[]|null); + } + + /** Represents a Secrets. */ + class Secrets implements ISecrets { + + /** + * Constructs a new Secrets. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ISecrets); + + /** Secrets secretManager. */ + public secretManager: google.devtools.cloudbuild.v1.ISecretManagerSecret[]; + + /** Secrets inline. */ + public inline: google.devtools.cloudbuild.v1.IInlineSecret[]; + + /** + * Creates a new Secrets instance using the specified properties. + * @param [properties] Properties to set + * @returns Secrets instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ISecrets): google.devtools.cloudbuild.v1.Secrets; + + /** + * Encodes the specified Secrets message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. + * @param message Secrets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ISecrets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Secrets message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. + * @param message Secrets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ISecrets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Secrets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Secrets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Secrets; + + /** + * Decodes a Secrets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Secrets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Secrets; + + /** + * Verifies a Secrets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Secrets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Secrets + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Secrets; + + /** + * Creates a plain object from a Secrets message. Also converts values to other types if specified. + * @param message Secrets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Secrets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Secrets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InlineSecret. */ + interface IInlineSecret { + + /** InlineSecret kmsKeyName */ + kmsKeyName?: (string|null); + + /** InlineSecret envMap */ + envMap?: ({ [k: string]: Uint8Array }|null); + } + + /** Represents an InlineSecret. */ + class InlineSecret implements IInlineSecret { + + /** + * Constructs a new InlineSecret. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IInlineSecret); + + /** InlineSecret kmsKeyName. */ + public kmsKeyName: string; + + /** InlineSecret envMap. */ + public envMap: { [k: string]: Uint8Array }; + + /** + * Creates a new InlineSecret instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSecret instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IInlineSecret): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Encodes the specified InlineSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. + * @param message InlineSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IInlineSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. + * @param message InlineSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IInlineSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSecret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Decodes an InlineSecret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Verifies an InlineSecret message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InlineSecret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSecret + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Creates a plain object from an InlineSecret message. Also converts values to other types if specified. + * @param message InlineSecret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.InlineSecret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSecret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecretManagerSecret. */ + interface ISecretManagerSecret { + + /** SecretManagerSecret versionName */ + versionName?: (string|null); + + /** SecretManagerSecret env */ + env?: (string|null); + } + + /** Represents a SecretManagerSecret. */ + class SecretManagerSecret implements ISecretManagerSecret { + + /** + * Constructs a new SecretManagerSecret. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ISecretManagerSecret); + + /** SecretManagerSecret versionName. */ + public versionName: string; + + /** SecretManagerSecret env. */ + public env: string; + + /** + * Creates a new SecretManagerSecret instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretManagerSecret instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ISecretManagerSecret): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Encodes the specified SecretManagerSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. + * @param message SecretManagerSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ISecretManagerSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretManagerSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. + * @param message SecretManagerSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ISecretManagerSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretManagerSecret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretManagerSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Decodes a SecretManagerSecret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretManagerSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Verifies a SecretManagerSecret message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecretManagerSecret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretManagerSecret + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Creates a plain object from a SecretManagerSecret message. Also converts values to other types if specified. + * @param message SecretManagerSecret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.SecretManagerSecret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretManagerSecret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Secret. */ interface ISecret { @@ -3441,7 +3756,8 @@ export namespace google { /** CommentControl enum. */ enum CommentControl { COMMENTS_DISABLED = 0, - COMMENTS_ENABLED = 1 + COMMENTS_ENABLED = 1, + COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2 } } @@ -4306,7 +4622,9 @@ export namespace google { enum MachineType { UNSPECIFIED = 0, N1_HIGHCPU_8 = 1, - N1_HIGHCPU_32 = 2 + N1_HIGHCPU_32 = 2, + E2_HIGHCPU_8 = 5, + E2_HIGHCPU_32 = 6 } /** SubstitutionOption enum. */ @@ -4333,6 +4651,198 @@ export namespace google { } } + /** Properties of a ReceiveTriggerWebhookRequest. */ + interface IReceiveTriggerWebhookRequest { + + /** ReceiveTriggerWebhookRequest body */ + body?: (google.api.IHttpBody|null); + + /** ReceiveTriggerWebhookRequest projectId */ + projectId?: (string|null); + + /** ReceiveTriggerWebhookRequest trigger */ + trigger?: (string|null); + + /** ReceiveTriggerWebhookRequest secret */ + secret?: (string|null); + } + + /** Represents a ReceiveTriggerWebhookRequest. */ + class ReceiveTriggerWebhookRequest implements IReceiveTriggerWebhookRequest { + + /** + * Constructs a new ReceiveTriggerWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest); + + /** ReceiveTriggerWebhookRequest body. */ + public body?: (google.api.IHttpBody|null); + + /** ReceiveTriggerWebhookRequest projectId. */ + public projectId: string; + + /** ReceiveTriggerWebhookRequest trigger. */ + public trigger: string; + + /** ReceiveTriggerWebhookRequest secret. */ + public secret: string; + + /** + * Creates a new ReceiveTriggerWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceiveTriggerWebhookRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @param message ReceiveTriggerWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @param message ReceiveTriggerWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Verifies a ReceiveTriggerWebhookRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceiveTriggerWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceiveTriggerWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Creates a plain object from a ReceiveTriggerWebhookRequest message. Also converts values to other types if specified. + * @param message ReceiveTriggerWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceiveTriggerWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReceiveTriggerWebhookResponse. */ + interface IReceiveTriggerWebhookResponse { + } + + /** Represents a ReceiveTriggerWebhookResponse. */ + class ReceiveTriggerWebhookResponse implements IReceiveTriggerWebhookResponse { + + /** + * Constructs a new ReceiveTriggerWebhookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse); + + /** + * Creates a new ReceiveTriggerWebhookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceiveTriggerWebhookResponse instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @param message ReceiveTriggerWebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @param message ReceiveTriggerWebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Verifies a ReceiveTriggerWebhookResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceiveTriggerWebhookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceiveTriggerWebhookResponse + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Creates a plain object from a ReceiveTriggerWebhookResponse message. Also converts values to other types if specified. + * @param message ReceiveTriggerWebhookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceiveTriggerWebhookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a WorkerPool. */ interface IWorkerPool { @@ -5616,6 +6126,108 @@ export namespace google { UNORDERED_LIST = 6 } + /** Properties of a HttpBody. */ + interface IHttpBody { + + /** HttpBody contentType */ + contentType?: (string|null); + + /** HttpBody data */ + data?: (Uint8Array|string|null); + + /** HttpBody extensions */ + extensions?: (google.protobuf.IAny[]|null); + } + + /** Represents a HttpBody. */ + class HttpBody implements IHttpBody { + + /** + * Constructs a new HttpBody. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpBody); + + /** HttpBody contentType. */ + public contentType: string; + + /** HttpBody data. */ + public data: (Uint8Array|string); + + /** HttpBody extensions. */ + public extensions: google.protobuf.IAny[]; + + /** + * Creates a new HttpBody instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpBody instance + */ + public static create(properties?: google.api.IHttpBody): google.api.HttpBody; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpBody; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpBody; + + /** + * Verifies a HttpBody message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpBody + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpBody; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @param message HttpBody + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpBody to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { diff --git a/packages/google-devtools-cloudbuild/protos/protos.js b/packages/google-devtools-cloudbuild/protos/protos.js index 1a6918ffcad..033032535d2 100644 --- a/packages/google-devtools-cloudbuild/protos/protos.js +++ b/packages/google-devtools-cloudbuild/protos/protos.js @@ -461,6 +461,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#receiveTriggerWebhook}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef ReceiveTriggerWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} [response] ReceiveTriggerWebhookResponse + */ + + /** + * Calls ReceiveTriggerWebhook. + * @function receiveTriggerWebhook + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} request ReceiveTriggerWebhookRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.ReceiveTriggerWebhookCallback} callback Node-style callback called with the error, if any, and ReceiveTriggerWebhookResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.receiveTriggerWebhook = function receiveTriggerWebhook(request, callback) { + return this.rpcCall(receiveTriggerWebhook, $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest, $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse, request, callback); + }, "name", { value: "ReceiveTriggerWebhook" }); + + /** + * Calls ReceiveTriggerWebhook. + * @function receiveTriggerWebhook + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} request ReceiveTriggerWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#createWorkerPool}. * @memberof google.devtools.cloudbuild.v1.CloudBuild @@ -3684,6 +3717,7 @@ * @property {Array.|null} [secrets] Build secrets * @property {Object.|null} [timing] Build timing * @property {string|null} [serviceAccount] Build serviceAccount + * @property {google.devtools.cloudbuild.v1.ISecrets|null} [availableSecrets] Build availableSecrets */ /** @@ -3907,6 +3941,14 @@ */ Build.prototype.serviceAccount = ""; + /** + * Build availableSecrets. + * @member {google.devtools.cloudbuild.v1.ISecrets|null|undefined} availableSecrets + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.availableSecrets = null; + /** * Creates a new Build instance using the specified properties. * @function create @@ -3989,6 +4031,8 @@ writer.uint32(/* id 42, wireType 2 =*/338).string(message.serviceAccount); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.name); + if (message.availableSecrets != null && Object.hasOwnProperty.call(message, "availableSecrets")) + $root.google.devtools.cloudbuild.v1.Secrets.encode(message.availableSecrets, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); return writer; }; @@ -4144,6 +4188,9 @@ case 42: message.serviceAccount = reader.string(); break; + case 47: + message.availableSecrets = $root.google.devtools.cloudbuild.v1.Secrets.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -4318,6 +4365,11 @@ if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) if (!$util.isString(message.serviceAccount)) return "serviceAccount: string expected"; + if (message.availableSecrets != null && message.hasOwnProperty("availableSecrets")) { + var error = $root.google.devtools.cloudbuild.v1.Secrets.verify(message.availableSecrets); + if (error) + return "availableSecrets." + error; + } return null; }; @@ -4488,6 +4540,11 @@ } if (object.serviceAccount != null) message.serviceAccount = String(object.serviceAccount); + if (object.availableSecrets != null) { + if (typeof object.availableSecrets !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.availableSecrets: object expected"); + message.availableSecrets = $root.google.devtools.cloudbuild.v1.Secrets.fromObject(object.availableSecrets); + } return message; }; @@ -4534,6 +4591,7 @@ object.queueTtl = null; object.serviceAccount = ""; object.name = ""; + object.availableSecrets = null; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -4604,6 +4662,8 @@ object.serviceAccount = message.serviceAccount; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.availableSecrets != null && message.hasOwnProperty("availableSecrets")) + object.availableSecrets = $root.google.devtools.cloudbuild.v1.Secrets.toObject(message.availableSecrets, options); return object; }; @@ -6292,26 +6352,27 @@ return Hash; })(); - v1.Secret = (function() { + v1.Secrets = (function() { /** - * Properties of a Secret. + * Properties of a Secrets. * @memberof google.devtools.cloudbuild.v1 - * @interface ISecret - * @property {string|null} [kmsKeyName] Secret kmsKeyName - * @property {Object.|null} [secretEnv] Secret secretEnv + * @interface ISecrets + * @property {Array.|null} [secretManager] Secrets secretManager + * @property {Array.|null} [inline] Secrets inline */ /** - * Constructs a new Secret. + * Constructs a new Secrets. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a Secret. - * @implements ISecret + * @classdesc Represents a Secrets. + * @implements ISecrets * @constructor - * @param {google.devtools.cloudbuild.v1.ISecret=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.ISecrets=} [properties] Properties to set */ - function Secret(properties) { - this.secretEnv = {}; + function Secrets(properties) { + this.secretManager = []; + this.inline = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6319,108 +6380,94 @@ } /** - * Secret kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.devtools.cloudbuild.v1.Secret + * Secrets secretManager. + * @member {Array.} secretManager + * @memberof google.devtools.cloudbuild.v1.Secrets * @instance */ - Secret.prototype.kmsKeyName = ""; + Secrets.prototype.secretManager = $util.emptyArray; /** - * Secret secretEnv. - * @member {Object.} secretEnv - * @memberof google.devtools.cloudbuild.v1.Secret + * Secrets inline. + * @member {Array.} inline + * @memberof google.devtools.cloudbuild.v1.Secrets * @instance */ - Secret.prototype.secretEnv = $util.emptyObject; + Secrets.prototype.inline = $util.emptyArray; /** - * Creates a new Secret instance using the specified properties. + * Creates a new Secrets instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static - * @param {google.devtools.cloudbuild.v1.ISecret=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.Secret} Secret instance + * @param {google.devtools.cloudbuild.v1.ISecrets=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets instance */ - Secret.create = function create(properties) { - return new Secret(properties); + Secrets.create = function create(properties) { + return new Secrets(properties); }; /** - * Encodes the specified Secret message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. + * Encodes the specified Secrets message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static - * @param {google.devtools.cloudbuild.v1.ISecret} message Secret message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ISecrets} message Secrets message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Secret.encode = function encode(message, writer) { + Secrets.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); - if (message.secretEnv != null && Object.hasOwnProperty.call(message, "secretEnv")) - for (var keys = Object.keys(message.secretEnv), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.secretEnv[keys[i]]).ldelim(); + if (message.secretManager != null && message.secretManager.length) + for (var i = 0; i < message.secretManager.length; ++i) + $root.google.devtools.cloudbuild.v1.SecretManagerSecret.encode(message.secretManager[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inline != null && message.inline.length) + for (var i = 0; i < message.inline.length; ++i) + $root.google.devtools.cloudbuild.v1.InlineSecret.encode(message.inline[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. + * Encodes the specified Secrets message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static - * @param {google.devtools.cloudbuild.v1.ISecret} message Secret message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ISecrets} message Secrets message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Secret.encodeDelimited = function encodeDelimited(message, writer) { + Secrets.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Secret message from the specified reader or buffer. + * Decodes a Secrets message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.Secret} Secret + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Secret.decode = function decode(reader, length) { + Secrets.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Secret(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Secrets(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kmsKeyName = reader.string(); + if (!(message.secretManager && message.secretManager.length)) + message.secretManager = []; + message.secretManager.push($root.google.devtools.cloudbuild.v1.SecretManagerSecret.decode(reader, reader.uint32())); break; - case 3: - if (message.secretEnv === $util.emptyObject) - message.secretEnv = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = []; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.bytes(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.secretEnv[key] = value; + case 2: + if (!(message.inline && message.inline.length)) + message.inline = []; + message.inline.push($root.google.devtools.cloudbuild.v1.InlineSecret.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -6431,135 +6478,152 @@ }; /** - * Decodes a Secret message from the specified reader or buffer, length delimited. + * Decodes a Secrets message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.Secret} Secret + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Secret.decodeDelimited = function decodeDelimited(reader) { + Secrets.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Secret message. + * Verifies a Secrets message. * @function verify - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Secret.verify = function verify(message) { + Secrets.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.secretEnv != null && message.hasOwnProperty("secretEnv")) { - if (!$util.isObject(message.secretEnv)) - return "secretEnv: object expected"; - var key = Object.keys(message.secretEnv); - for (var i = 0; i < key.length; ++i) - if (!(message.secretEnv[key[i]] && typeof message.secretEnv[key[i]].length === "number" || $util.isString(message.secretEnv[key[i]]))) - return "secretEnv: buffer{k:string} expected"; + if (message.secretManager != null && message.hasOwnProperty("secretManager")) { + if (!Array.isArray(message.secretManager)) + return "secretManager: array expected"; + for (var i = 0; i < message.secretManager.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.SecretManagerSecret.verify(message.secretManager[i]); + if (error) + return "secretManager." + error; + } + } + if (message.inline != null && message.hasOwnProperty("inline")) { + if (!Array.isArray(message.inline)) + return "inline: array expected"; + for (var i = 0; i < message.inline.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.InlineSecret.verify(message.inline[i]); + if (error) + return "inline." + error; + } } return null; }; /** - * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * Creates a Secrets message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.Secret} Secret + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets */ - Secret.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.Secret) + Secrets.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Secrets) return object; - var message = new $root.google.devtools.cloudbuild.v1.Secret(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.secretEnv) { - if (typeof object.secretEnv !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.Secret.secretEnv: object expected"); - message.secretEnv = {}; - for (var keys = Object.keys(object.secretEnv), i = 0; i < keys.length; ++i) - if (typeof object.secretEnv[keys[i]] === "string") - $util.base64.decode(object.secretEnv[keys[i]], message.secretEnv[keys[i]] = $util.newBuffer($util.base64.length(object.secretEnv[keys[i]])), 0); - else if (object.secretEnv[keys[i]].length) - message.secretEnv[keys[i]] = object.secretEnv[keys[i]]; + var message = new $root.google.devtools.cloudbuild.v1.Secrets(); + if (object.secretManager) { + if (!Array.isArray(object.secretManager)) + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.secretManager: array expected"); + message.secretManager = []; + for (var i = 0; i < object.secretManager.length; ++i) { + if (typeof object.secretManager[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.secretManager: object expected"); + message.secretManager[i] = $root.google.devtools.cloudbuild.v1.SecretManagerSecret.fromObject(object.secretManager[i]); + } + } + if (object.inline) { + if (!Array.isArray(object.inline)) + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.inline: array expected"); + message.inline = []; + for (var i = 0; i < object.inline.length; ++i) { + if (typeof object.inline[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.inline: object expected"); + message.inline[i] = $root.google.devtools.cloudbuild.v1.InlineSecret.fromObject(object.inline[i]); + } } return message; }; /** - * Creates a plain object from a Secret message. Also converts values to other types if specified. + * Creates a plain object from a Secrets message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @static - * @param {google.devtools.cloudbuild.v1.Secret} message Secret + * @param {google.devtools.cloudbuild.v1.Secrets} message Secrets * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Secret.toObject = function toObject(message, options) { + Secrets.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.secretEnv = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - var keys2; - if (message.secretEnv && (keys2 = Object.keys(message.secretEnv)).length) { - object.secretEnv = {}; - for (var j = 0; j < keys2.length; ++j) - object.secretEnv[keys2[j]] = options.bytes === String ? $util.base64.encode(message.secretEnv[keys2[j]], 0, message.secretEnv[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.secretEnv[keys2[j]]) : message.secretEnv[keys2[j]]; + if (options.arrays || options.defaults) { + object.secretManager = []; + object.inline = []; + } + if (message.secretManager && message.secretManager.length) { + object.secretManager = []; + for (var j = 0; j < message.secretManager.length; ++j) + object.secretManager[j] = $root.google.devtools.cloudbuild.v1.SecretManagerSecret.toObject(message.secretManager[j], options); + } + if (message.inline && message.inline.length) { + object.inline = []; + for (var j = 0; j < message.inline.length; ++j) + object.inline[j] = $root.google.devtools.cloudbuild.v1.InlineSecret.toObject(message.inline[j], options); } return object; }; /** - * Converts this Secret to JSON. + * Converts this Secrets to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.Secret + * @memberof google.devtools.cloudbuild.v1.Secrets * @instance * @returns {Object.} JSON object */ - Secret.prototype.toJSON = function toJSON() { + Secrets.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Secret; + return Secrets; })(); - v1.CreateBuildRequest = (function() { + v1.InlineSecret = (function() { /** - * Properties of a CreateBuildRequest. + * Properties of an InlineSecret. * @memberof google.devtools.cloudbuild.v1 - * @interface ICreateBuildRequest - * @property {string|null} [parent] CreateBuildRequest parent - * @property {string|null} [projectId] CreateBuildRequest projectId - * @property {google.devtools.cloudbuild.v1.IBuild|null} [build] CreateBuildRequest build + * @interface IInlineSecret + * @property {string|null} [kmsKeyName] InlineSecret kmsKeyName + * @property {Object.|null} [envMap] InlineSecret envMap */ /** - * Constructs a new CreateBuildRequest. + * Constructs a new InlineSecret. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a CreateBuildRequest. - * @implements ICreateBuildRequest + * @classdesc Represents an InlineSecret. + * @implements IInlineSecret * @constructor - * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IInlineSecret=} [properties] Properties to set */ - function CreateBuildRequest(properties) { + function InlineSecret(properties) { + this.envMap = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6567,101 +6631,108 @@ } /** - * CreateBuildRequest parent. - * @member {string} parent - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest - * @instance - */ - CreateBuildRequest.prototype.parent = ""; - - /** - * CreateBuildRequest projectId. - * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * InlineSecret kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @instance */ - CreateBuildRequest.prototype.projectId = ""; + InlineSecret.prototype.kmsKeyName = ""; /** - * CreateBuildRequest build. - * @member {google.devtools.cloudbuild.v1.IBuild|null|undefined} build - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * InlineSecret envMap. + * @member {Object.} envMap + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @instance */ - CreateBuildRequest.prototype.build = null; + InlineSecret.prototype.envMap = $util.emptyObject; /** - * Creates a new CreateBuildRequest instance using the specified properties. + * Creates a new InlineSecret instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static - * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest instance + * @param {google.devtools.cloudbuild.v1.IInlineSecret=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret instance */ - CreateBuildRequest.create = function create(properties) { - return new CreateBuildRequest(properties); + InlineSecret.create = function create(properties) { + return new InlineSecret(properties); }; /** - * Encodes the specified CreateBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. + * Encodes the specified InlineSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static - * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} message CreateBuildRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IInlineSecret} message InlineSecret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBuildRequest.encode = function encode(message, writer) { + InlineSecret.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.build != null && Object.hasOwnProperty.call(message, "build")) - $root.google.devtools.cloudbuild.v1.Build.encode(message.build, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + if (message.envMap != null && Object.hasOwnProperty.call(message, "envMap")) + for (var keys = Object.keys(message.envMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.envMap[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified CreateBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. + * Encodes the specified InlineSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static - * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} message CreateBuildRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IInlineSecret} message InlineSecret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + InlineSecret.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateBuildRequest message from the specified reader or buffer. + * Decodes an InlineSecret message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBuildRequest.decode = function decode(reader, length) { + InlineSecret.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateBuildRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.InlineSecret(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.parent = reader.string(); - break; case 1: - message.projectId = reader.string(); + message.kmsKeyName = reader.string(); break; case 2: - message.build = $root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32()); + if (message.envMap === $util.emptyObject) + message.envMap = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = []; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.envMap[key] = value; break; default: reader.skipType(tag & 7); @@ -6672,131 +6743,134 @@ }; /** - * Decodes a CreateBuildRequest message from the specified reader or buffer, length delimited. + * Decodes an InlineSecret message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBuildRequest.decodeDelimited = function decodeDelimited(reader) { + InlineSecret.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateBuildRequest message. + * Verifies an InlineSecret message. * @function verify - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateBuildRequest.verify = function verify(message) { + InlineSecret.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.build != null && message.hasOwnProperty("build")) { - var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.build); - if (error) - return "build." + error; - } - return null; - }; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.envMap != null && message.hasOwnProperty("envMap")) { + if (!$util.isObject(message.envMap)) + return "envMap: object expected"; + var key = Object.keys(message.envMap); + for (var i = 0; i < key.length; ++i) + if (!(message.envMap[key[i]] && typeof message.envMap[key[i]].length === "number" || $util.isString(message.envMap[key[i]]))) + return "envMap: buffer{k:string} expected"; + } + return null; + }; /** - * Creates a CreateBuildRequest message from a plain object. Also converts values to their respective internal types. + * Creates an InlineSecret message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret */ - CreateBuildRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.CreateBuildRequest) + InlineSecret.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.InlineSecret) return object; - var message = new $root.google.devtools.cloudbuild.v1.CreateBuildRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.build != null) { - if (typeof object.build !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.CreateBuildRequest.build: object expected"); - message.build = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.build); + var message = new $root.google.devtools.cloudbuild.v1.InlineSecret(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.envMap) { + if (typeof object.envMap !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.InlineSecret.envMap: object expected"); + message.envMap = {}; + for (var keys = Object.keys(object.envMap), i = 0; i < keys.length; ++i) + if (typeof object.envMap[keys[i]] === "string") + $util.base64.decode(object.envMap[keys[i]], message.envMap[keys[i]] = $util.newBuffer($util.base64.length(object.envMap[keys[i]])), 0); + else if (object.envMap[keys[i]].length) + message.envMap[keys[i]] = object.envMap[keys[i]]; } return message; }; /** - * Creates a plain object from a CreateBuildRequest message. Also converts values to other types if specified. + * Creates a plain object from an InlineSecret message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @static - * @param {google.devtools.cloudbuild.v1.CreateBuildRequest} message CreateBuildRequest + * @param {google.devtools.cloudbuild.v1.InlineSecret} message InlineSecret * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBuildRequest.toObject = function toObject(message, options) { + InlineSecret.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.projectId = ""; - object.build = null; - object.parent = ""; + if (options.objects || options.defaults) + object.envMap = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + var keys2; + if (message.envMap && (keys2 = Object.keys(message.envMap)).length) { + object.envMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.envMap[keys2[j]] = options.bytes === String ? $util.base64.encode(message.envMap[keys2[j]], 0, message.envMap[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.envMap[keys2[j]]) : message.envMap[keys2[j]]; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.build != null && message.hasOwnProperty("build")) - object.build = $root.google.devtools.cloudbuild.v1.Build.toObject(message.build, options); - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; return object; }; /** - * Converts this CreateBuildRequest to JSON. + * Converts this InlineSecret to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @memberof google.devtools.cloudbuild.v1.InlineSecret * @instance * @returns {Object.} JSON object */ - CreateBuildRequest.prototype.toJSON = function toJSON() { + InlineSecret.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateBuildRequest; + return InlineSecret; })(); - v1.GetBuildRequest = (function() { + v1.SecretManagerSecret = (function() { /** - * Properties of a GetBuildRequest. + * Properties of a SecretManagerSecret. * @memberof google.devtools.cloudbuild.v1 - * @interface IGetBuildRequest - * @property {string|null} [name] GetBuildRequest name - * @property {string|null} [projectId] GetBuildRequest projectId - * @property {string|null} [id] GetBuildRequest id + * @interface ISecretManagerSecret + * @property {string|null} [versionName] SecretManagerSecret versionName + * @property {string|null} [env] SecretManagerSecret env */ /** - * Constructs a new GetBuildRequest. + * Constructs a new SecretManagerSecret. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a GetBuildRequest. - * @implements IGetBuildRequest + * @classdesc Represents a SecretManagerSecret. + * @implements ISecretManagerSecret * @constructor - * @param {google.devtools.cloudbuild.v1.IGetBuildRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret=} [properties] Properties to set */ - function GetBuildRequest(properties) { + function SecretManagerSecret(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6804,101 +6878,88 @@ } /** - * GetBuildRequest name. - * @member {string} name - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest - * @instance - */ - GetBuildRequest.prototype.name = ""; - - /** - * GetBuildRequest projectId. - * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * SecretManagerSecret versionName. + * @member {string} versionName + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @instance */ - GetBuildRequest.prototype.projectId = ""; + SecretManagerSecret.prototype.versionName = ""; /** - * GetBuildRequest id. - * @member {string} id - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * SecretManagerSecret env. + * @member {string} env + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @instance */ - GetBuildRequest.prototype.id = ""; + SecretManagerSecret.prototype.env = ""; /** - * Creates a new GetBuildRequest instance using the specified properties. + * Creates a new SecretManagerSecret instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static - * @param {google.devtools.cloudbuild.v1.IGetBuildRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest instance + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret instance */ - GetBuildRequest.create = function create(properties) { - return new GetBuildRequest(properties); + SecretManagerSecret.create = function create(properties) { + return new SecretManagerSecret(properties); }; /** - * Encodes the specified GetBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. + * Encodes the specified SecretManagerSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static - * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} message GetBuildRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret} message SecretManagerSecret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBuildRequest.encode = function encode(message, writer) { + SecretManagerSecret.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.versionName != null && Object.hasOwnProperty.call(message, "versionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.versionName); + if (message.env != null && Object.hasOwnProperty.call(message, "env")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.env); return writer; }; /** - * Encodes the specified GetBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. + * Encodes the specified SecretManagerSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static - * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} message GetBuildRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret} message SecretManagerSecret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + SecretManagerSecret.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBuildRequest message from the specified reader or buffer. + * Decodes a SecretManagerSecret message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBuildRequest.decode = function decode(reader, length) { + SecretManagerSecret.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetBuildRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.SecretManagerSecret(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.name = reader.string(); - break; case 1: - message.projectId = reader.string(); + message.versionName = reader.string(); break; case 2: - message.id = reader.string(); + message.env = reader.string(); break; default: reader.skipType(tag & 7); @@ -6909,128 +6970,118 @@ }; /** - * Decodes a GetBuildRequest message from the specified reader or buffer, length delimited. + * Decodes a SecretManagerSecret message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBuildRequest.decodeDelimited = function decodeDelimited(reader) { + SecretManagerSecret.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBuildRequest message. + * Verifies a SecretManagerSecret message. * @function verify - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBuildRequest.verify = function verify(message) { + SecretManagerSecret.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; + if (message.versionName != null && message.hasOwnProperty("versionName")) + if (!$util.isString(message.versionName)) + return "versionName: string expected"; + if (message.env != null && message.hasOwnProperty("env")) + if (!$util.isString(message.env)) + return "env: string expected"; return null; }; /** - * Creates a GetBuildRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SecretManagerSecret message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret */ - GetBuildRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.GetBuildRequest) + SecretManagerSecret.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.SecretManagerSecret) return object; - var message = new $root.google.devtools.cloudbuild.v1.GetBuildRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.id != null) - message.id = String(object.id); + var message = new $root.google.devtools.cloudbuild.v1.SecretManagerSecret(); + if (object.versionName != null) + message.versionName = String(object.versionName); + if (object.env != null) + message.env = String(object.env); return message; }; /** - * Creates a plain object from a GetBuildRequest message. Also converts values to other types if specified. + * Creates a plain object from a SecretManagerSecret message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @static - * @param {google.devtools.cloudbuild.v1.GetBuildRequest} message GetBuildRequest + * @param {google.devtools.cloudbuild.v1.SecretManagerSecret} message SecretManagerSecret * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBuildRequest.toObject = function toObject(message, options) { + SecretManagerSecret.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.projectId = ""; - object.id = ""; - object.name = ""; + object.versionName = ""; + object.env = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.versionName != null && message.hasOwnProperty("versionName")) + object.versionName = message.versionName; + if (message.env != null && message.hasOwnProperty("env")) + object.env = message.env; return object; }; /** - * Converts this GetBuildRequest to JSON. + * Converts this SecretManagerSecret to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret * @instance * @returns {Object.} JSON object */ - GetBuildRequest.prototype.toJSON = function toJSON() { + SecretManagerSecret.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetBuildRequest; + return SecretManagerSecret; })(); - v1.ListBuildsRequest = (function() { + v1.Secret = (function() { /** - * Properties of a ListBuildsRequest. + * Properties of a Secret. * @memberof google.devtools.cloudbuild.v1 - * @interface IListBuildsRequest - * @property {string|null} [parent] ListBuildsRequest parent - * @property {string|null} [projectId] ListBuildsRequest projectId - * @property {number|null} [pageSize] ListBuildsRequest pageSize - * @property {string|null} [pageToken] ListBuildsRequest pageToken - * @property {string|null} [filter] ListBuildsRequest filter + * @interface ISecret + * @property {string|null} [kmsKeyName] Secret kmsKeyName + * @property {Object.|null} [secretEnv] Secret secretEnv */ /** - * Constructs a new ListBuildsRequest. + * Constructs a new Secret. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a ListBuildsRequest. - * @implements IListBuildsRequest + * @classdesc Represents a Secret. + * @implements ISecret * @constructor - * @param {google.devtools.cloudbuild.v1.IListBuildsRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.ISecret=} [properties] Properties to set */ - function ListBuildsRequest(properties) { + function Secret(properties) { + this.secretEnv = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7038,127 +7089,108 @@ } /** - * ListBuildsRequest parent. - * @member {string} parent - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest - * @instance - */ - ListBuildsRequest.prototype.parent = ""; - - /** - * ListBuildsRequest projectId. - * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest - * @instance - */ - ListBuildsRequest.prototype.projectId = ""; - - /** - * ListBuildsRequest pageSize. - * @member {number} pageSize - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest - * @instance - */ - ListBuildsRequest.prototype.pageSize = 0; - - /** - * ListBuildsRequest pageToken. - * @member {string} pageToken - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * Secret kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.devtools.cloudbuild.v1.Secret * @instance */ - ListBuildsRequest.prototype.pageToken = ""; + Secret.prototype.kmsKeyName = ""; /** - * ListBuildsRequest filter. - * @member {string} filter - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * Secret secretEnv. + * @member {Object.} secretEnv + * @memberof google.devtools.cloudbuild.v1.Secret * @instance */ - ListBuildsRequest.prototype.filter = ""; + Secret.prototype.secretEnv = $util.emptyObject; /** - * Creates a new ListBuildsRequest instance using the specified properties. + * Creates a new Secret instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static - * @param {google.devtools.cloudbuild.v1.IListBuildsRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest instance + * @param {google.devtools.cloudbuild.v1.ISecret=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Secret} Secret instance */ - ListBuildsRequest.create = function create(properties) { - return new ListBuildsRequest(properties); + Secret.create = function create(properties) { + return new Secret(properties); }; /** - * Encodes the specified ListBuildsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. + * Encodes the specified Secret message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static - * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} message ListBuildsRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ISecret} message Secret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildsRequest.encode = function encode(message, writer) { + Secret.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.parent); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + if (message.secretEnv != null && Object.hasOwnProperty.call(message, "secretEnv")) + for (var keys = Object.keys(message.secretEnv), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.secretEnv[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified ListBuildsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static - * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} message ListBuildsRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ISecret} message Secret message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Secret.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBuildsRequest message from the specified reader or buffer. + * Decodes a Secret message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest + * @returns {google.devtools.cloudbuild.v1.Secret} Secret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildsRequest.decode = function decode(reader, length) { + Secret.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Secret(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 9: - message.parent = reader.string(); - break; case 1: - message.projectId = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); + message.kmsKeyName = reader.string(); break; case 3: - message.pageToken = reader.string(); - break; - case 8: - message.filter = reader.string(); + if (message.secretEnv === $util.emptyObject) + message.secretEnv = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = []; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secretEnv[key] = value; break; default: reader.skipType(tag & 7); @@ -7169,142 +7201,135 @@ }; /** - * Decodes a ListBuildsRequest message from the specified reader or buffer, length delimited. + * Decodes a Secret message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest + * @returns {google.devtools.cloudbuild.v1.Secret} Secret * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildsRequest.decodeDelimited = function decodeDelimited(reader) { + Secret.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBuildsRequest message. + * Verifies a Secret message. * @function verify - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBuildsRequest.verify = function verify(message) { + Secret.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.secretEnv != null && message.hasOwnProperty("secretEnv")) { + if (!$util.isObject(message.secretEnv)) + return "secretEnv: object expected"; + var key = Object.keys(message.secretEnv); + for (var i = 0; i < key.length; ++i) + if (!(message.secretEnv[key[i]] && typeof message.secretEnv[key[i]].length === "number" || $util.isString(message.secretEnv[key[i]]))) + return "secretEnv: buffer{k:string} expected"; + } return null; }; /** - * Creates a ListBuildsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Secret message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest + * @returns {google.devtools.cloudbuild.v1.Secret} Secret */ - ListBuildsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildsRequest) + Secret.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Secret) return object; - var message = new $root.google.devtools.cloudbuild.v1.ListBuildsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.devtools.cloudbuild.v1.Secret(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.secretEnv) { + if (typeof object.secretEnv !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Secret.secretEnv: object expected"); + message.secretEnv = {}; + for (var keys = Object.keys(object.secretEnv), i = 0; i < keys.length; ++i) + if (typeof object.secretEnv[keys[i]] === "string") + $util.base64.decode(object.secretEnv[keys[i]], message.secretEnv[keys[i]] = $util.newBuffer($util.base64.length(object.secretEnv[keys[i]])), 0); + else if (object.secretEnv[keys[i]].length) + message.secretEnv[keys[i]] = object.secretEnv[keys[i]]; + } return message; }; /** - * Creates a plain object from a ListBuildsRequest message. Also converts values to other types if specified. + * Creates a plain object from a Secret message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @static - * @param {google.devtools.cloudbuild.v1.ListBuildsRequest} message ListBuildsRequest + * @param {google.devtools.cloudbuild.v1.Secret} message Secret * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBuildsRequest.toObject = function toObject(message, options) { + Secret.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.projectId = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.parent = ""; + if (options.objects || options.defaults) + object.secretEnv = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + var keys2; + if (message.secretEnv && (keys2 = Object.keys(message.secretEnv)).length) { + object.secretEnv = {}; + for (var j = 0; j < keys2.length; ++j) + object.secretEnv[keys2[j]] = options.bytes === String ? $util.base64.encode(message.secretEnv[keys2[j]], 0, message.secretEnv[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.secretEnv[keys2[j]]) : message.secretEnv[keys2[j]]; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; return object; }; /** - * Converts this ListBuildsRequest to JSON. + * Converts this Secret to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @memberof google.devtools.cloudbuild.v1.Secret * @instance * @returns {Object.} JSON object */ - ListBuildsRequest.prototype.toJSON = function toJSON() { + Secret.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListBuildsRequest; + return Secret; })(); - v1.ListBuildsResponse = (function() { + v1.CreateBuildRequest = (function() { /** - * Properties of a ListBuildsResponse. + * Properties of a CreateBuildRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface IListBuildsResponse - * @property {Array.|null} [builds] ListBuildsResponse builds - * @property {string|null} [nextPageToken] ListBuildsResponse nextPageToken + * @interface ICreateBuildRequest + * @property {string|null} [parent] CreateBuildRequest parent + * @property {string|null} [projectId] CreateBuildRequest projectId + * @property {google.devtools.cloudbuild.v1.IBuild|null} [build] CreateBuildRequest build */ /** - * Constructs a new ListBuildsResponse. + * Constructs a new CreateBuildRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a ListBuildsResponse. - * @implements IListBuildsResponse + * @classdesc Represents a CreateBuildRequest. + * @implements ICreateBuildRequest * @constructor - * @param {google.devtools.cloudbuild.v1.IListBuildsResponse=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest=} [properties] Properties to set */ - function ListBuildsResponse(properties) { - this.builds = []; + function CreateBuildRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7312,91 +7337,101 @@ } /** - * ListBuildsResponse builds. - * @member {Array.} builds - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * CreateBuildRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @instance */ - ListBuildsResponse.prototype.builds = $util.emptyArray; + CreateBuildRequest.prototype.parent = ""; /** - * ListBuildsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * CreateBuildRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @instance */ - ListBuildsResponse.prototype.nextPageToken = ""; + CreateBuildRequest.prototype.projectId = ""; /** - * Creates a new ListBuildsResponse instance using the specified properties. + * CreateBuildRequest build. + * @member {google.devtools.cloudbuild.v1.IBuild|null|undefined} build + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @instance + */ + CreateBuildRequest.prototype.build = null; + + /** + * Creates a new CreateBuildRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.IListBuildsResponse=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse instance + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest instance */ - ListBuildsResponse.create = function create(properties) { - return new ListBuildsResponse(properties); + CreateBuildRequest.create = function create(properties) { + return new CreateBuildRequest(properties); }; /** - * Encodes the specified ListBuildsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. + * Encodes the specified CreateBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.IListBuildsResponse} message ListBuildsResponse message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} message CreateBuildRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildsResponse.encode = function encode(message, writer) { + CreateBuildRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.builds != null && message.builds.length) - for (var i = 0; i < message.builds.length; ++i) - $root.google.devtools.cloudbuild.v1.Build.encode(message.builds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + $root.google.devtools.cloudbuild.v1.Build.encode(message.build, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); return writer; }; /** - * Encodes the specified ListBuildsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. + * Encodes the specified CreateBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.IListBuildsResponse} message ListBuildsResponse message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} message CreateBuildRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBuildsResponse message from the specified reader or buffer. + * Decodes a CreateBuildRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildsResponse.decode = function decode(reader, length) { + CreateBuildRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateBuildRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.builds && message.builds.length)) - message.builds = []; - message.builds.push($root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32())); + case 4: + message.parent = reader.string(); + break; + case 1: + message.projectId = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.build = $root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7407,135 +7442,131 @@ }; /** - * Decodes a ListBuildsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateBuildRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateBuildRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBuildsResponse message. + * Verifies a CreateBuildRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBuildsResponse.verify = function verify(message) { + CreateBuildRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.builds != null && message.hasOwnProperty("builds")) { - if (!Array.isArray(message.builds)) - return "builds: array expected"; - for (var i = 0; i < message.builds.length; ++i) { - var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.builds[i]); - if (error) - return "builds." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.build != null && message.hasOwnProperty("build")) { + var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.build); + if (error) + return "build." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListBuildsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBuildRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest */ - ListBuildsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildsResponse) + CreateBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateBuildRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.ListBuildsResponse(); - if (object.builds) { - if (!Array.isArray(object.builds)) - throw TypeError(".google.devtools.cloudbuild.v1.ListBuildsResponse.builds: array expected"); - message.builds = []; - for (var i = 0; i < object.builds.length; ++i) { - if (typeof object.builds[i] !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.ListBuildsResponse.builds: object expected"); - message.builds[i] = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.builds[i]); - } + var message = new $root.google.devtools.cloudbuild.v1.CreateBuildRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.build != null) { + if (typeof object.build !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateBuildRequest.build: object expected"); + message.build = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.build); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListBuildsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateBuildRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.ListBuildsResponse} message ListBuildsResponse + * @param {google.devtools.cloudbuild.v1.CreateBuildRequest} message CreateBuildRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBuildsResponse.toObject = function toObject(message, options) { + CreateBuildRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.builds = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.builds && message.builds.length) { - object.builds = []; - for (var j = 0; j < message.builds.length; ++j) - object.builds[j] = $root.google.devtools.cloudbuild.v1.Build.toObject(message.builds[j], options); + if (options.defaults) { + object.projectId = ""; + object.build = null; + object.parent = ""; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.build != null && message.hasOwnProperty("build")) + object.build = $root.google.devtools.cloudbuild.v1.Build.toObject(message.build, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this ListBuildsResponse to JSON. + * Converts this CreateBuildRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest * @instance * @returns {Object.} JSON object */ - ListBuildsResponse.prototype.toJSON = function toJSON() { + CreateBuildRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListBuildsResponse; + return CreateBuildRequest; })(); - v1.CancelBuildRequest = (function() { + v1.GetBuildRequest = (function() { /** - * Properties of a CancelBuildRequest. + * Properties of a GetBuildRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface ICancelBuildRequest - * @property {string|null} [name] CancelBuildRequest name - * @property {string|null} [projectId] CancelBuildRequest projectId - * @property {string|null} [id] CancelBuildRequest id + * @interface IGetBuildRequest + * @property {string|null} [name] GetBuildRequest name + * @property {string|null} [projectId] GetBuildRequest projectId + * @property {string|null} [id] GetBuildRequest id */ /** - * Constructs a new CancelBuildRequest. + * Constructs a new GetBuildRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a CancelBuildRequest. - * @implements ICancelBuildRequest + * @classdesc Represents a GetBuildRequest. + * @implements IGetBuildRequest * @constructor - * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest=} [properties] Properties to set */ - function CancelBuildRequest(properties) { + function GetBuildRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7543,51 +7574,51 @@ } /** - * CancelBuildRequest name. + * GetBuildRequest name. * @member {string} name - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @instance */ - CancelBuildRequest.prototype.name = ""; + GetBuildRequest.prototype.name = ""; /** - * CancelBuildRequest projectId. + * GetBuildRequest projectId. * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @instance */ - CancelBuildRequest.prototype.projectId = ""; + GetBuildRequest.prototype.projectId = ""; /** - * CancelBuildRequest id. + * GetBuildRequest id. * @member {string} id - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @instance */ - CancelBuildRequest.prototype.id = ""; + GetBuildRequest.prototype.id = ""; /** - * Creates a new CancelBuildRequest instance using the specified properties. + * Creates a new GetBuildRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest instance + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest instance */ - CancelBuildRequest.create = function create(properties) { - return new CancelBuildRequest(properties); + GetBuildRequest.create = function create(properties) { + return new GetBuildRequest(properties); }; /** - * Encodes the specified CancelBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. + * Encodes the specified GetBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} message CancelBuildRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} message GetBuildRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelBuildRequest.encode = function encode(message, writer) { + GetBuildRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -7600,33 +7631,33 @@ }; /** - * Encodes the specified CancelBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. + * Encodes the specified GetBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} message CancelBuildRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} message GetBuildRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CancelBuildRequest message from the specified reader or buffer. + * Decodes a GetBuildRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CancelBuildRequest.decode = function decode(reader, length) { + GetBuildRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CancelBuildRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetBuildRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -7648,30 +7679,30 @@ }; /** - * Decodes a CancelBuildRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBuildRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CancelBuildRequest.decodeDelimited = function decodeDelimited(reader) { + GetBuildRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CancelBuildRequest message. + * Verifies a GetBuildRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CancelBuildRequest.verify = function verify(message) { + GetBuildRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -7687,17 +7718,17 @@ }; /** - * Creates a CancelBuildRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBuildRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest */ - CancelBuildRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.CancelBuildRequest) + GetBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GetBuildRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.CancelBuildRequest(); + var message = new $root.google.devtools.cloudbuild.v1.GetBuildRequest(); if (object.name != null) message.name = String(object.name); if (object.projectId != null) @@ -7708,15 +7739,15 @@ }; /** - * Creates a plain object from a CancelBuildRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetBuildRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.CancelBuildRequest} message CancelBuildRequest + * @param {google.devtools.cloudbuild.v1.GetBuildRequest} message GetBuildRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CancelBuildRequest.toObject = function toObject(message, options) { + GetBuildRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -7735,53 +7766,41 @@ }; /** - * Converts this CancelBuildRequest to JSON. + * Converts this GetBuildRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest * @instance * @returns {Object.} JSON object */ - CancelBuildRequest.prototype.toJSON = function toJSON() { + GetBuildRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CancelBuildRequest; + return GetBuildRequest; })(); - v1.BuildTrigger = (function() { + v1.ListBuildsRequest = (function() { /** - * Properties of a BuildTrigger. + * Properties of a ListBuildsRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface IBuildTrigger - * @property {string|null} [id] BuildTrigger id - * @property {string|null} [description] BuildTrigger description - * @property {string|null} [name] BuildTrigger name - * @property {Array.|null} [tags] BuildTrigger tags - * @property {google.devtools.cloudbuild.v1.IRepoSource|null} [triggerTemplate] BuildTrigger triggerTemplate - * @property {google.devtools.cloudbuild.v1.IGitHubEventsConfig|null} [github] BuildTrigger github - * @property {google.devtools.cloudbuild.v1.IBuild|null} [build] BuildTrigger build - * @property {string|null} [filename] BuildTrigger filename - * @property {google.protobuf.ITimestamp|null} [createTime] BuildTrigger createTime - * @property {boolean|null} [disabled] BuildTrigger disabled - * @property {Object.|null} [substitutions] BuildTrigger substitutions - * @property {Array.|null} [ignoredFiles] BuildTrigger ignoredFiles - * @property {Array.|null} [includedFiles] BuildTrigger includedFiles + * @interface IListBuildsRequest + * @property {string|null} [parent] ListBuildsRequest parent + * @property {string|null} [projectId] ListBuildsRequest projectId + * @property {number|null} [pageSize] ListBuildsRequest pageSize + * @property {string|null} [pageToken] ListBuildsRequest pageToken + * @property {string|null} [filter] ListBuildsRequest filter */ /** - * Constructs a new BuildTrigger. + * Constructs a new ListBuildsRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a BuildTrigger. - * @implements IBuildTrigger + * @classdesc Represents a ListBuildsRequest. + * @implements IListBuildsRequest * @constructor - * @param {google.devtools.cloudbuild.v1.IBuildTrigger=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest=} [properties] Properties to set */ - function BuildTrigger(properties) { - this.tags = []; - this.substitutions = {}; - this.ignoredFiles = []; - this.includedFiles = []; + function ListBuildsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7789,277 +7808,130 @@ } /** - * BuildTrigger id. - * @member {string} id - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.id = ""; - - /** - * BuildTrigger description. - * @member {string} description - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.description = ""; - - /** - * BuildTrigger name. - * @member {string} name - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.name = ""; - - /** - * BuildTrigger tags. - * @member {Array.} tags - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.tags = $util.emptyArray; - - /** - * BuildTrigger triggerTemplate. - * @member {google.devtools.cloudbuild.v1.IRepoSource|null|undefined} triggerTemplate - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.triggerTemplate = null; - - /** - * BuildTrigger github. - * @member {google.devtools.cloudbuild.v1.IGitHubEventsConfig|null|undefined} github - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.github = null; - - /** - * BuildTrigger build. - * @member {google.devtools.cloudbuild.v1.IBuild|null|undefined} build - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.build = null; - - /** - * BuildTrigger filename. - * @member {string} filename - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.filename = ""; - - /** - * BuildTrigger createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.devtools.cloudbuild.v1.BuildTrigger - * @instance - */ - BuildTrigger.prototype.createTime = null; - - /** - * BuildTrigger disabled. - * @member {boolean} disabled - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * ListBuildsRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @instance */ - BuildTrigger.prototype.disabled = false; + ListBuildsRequest.prototype.parent = ""; /** - * BuildTrigger substitutions. - * @member {Object.} substitutions - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * ListBuildsRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @instance */ - BuildTrigger.prototype.substitutions = $util.emptyObject; + ListBuildsRequest.prototype.projectId = ""; /** - * BuildTrigger ignoredFiles. - * @member {Array.} ignoredFiles - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * ListBuildsRequest pageSize. + * @member {number} pageSize + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @instance */ - BuildTrigger.prototype.ignoredFiles = $util.emptyArray; + ListBuildsRequest.prototype.pageSize = 0; /** - * BuildTrigger includedFiles. - * @member {Array.} includedFiles - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * ListBuildsRequest pageToken. + * @member {string} pageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @instance */ - BuildTrigger.prototype.includedFiles = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListBuildsRequest.prototype.pageToken = ""; /** - * BuildTrigger buildTemplate. - * @member {"build"|"filename"|undefined} buildTemplate - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * ListBuildsRequest filter. + * @member {string} filter + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @instance */ - Object.defineProperty(BuildTrigger.prototype, "buildTemplate", { - get: $util.oneOfGetter($oneOfFields = ["build", "filename"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListBuildsRequest.prototype.filter = ""; /** - * Creates a new BuildTrigger instance using the specified properties. + * Creates a new ListBuildsRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static - * @param {google.devtools.cloudbuild.v1.IBuildTrigger=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger instance + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest instance */ - BuildTrigger.create = function create(properties) { - return new BuildTrigger(properties); + ListBuildsRequest.create = function create(properties) { + return new ListBuildsRequest(properties); }; /** - * Encodes the specified BuildTrigger message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. + * Encodes the specified ListBuildsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static - * @param {google.devtools.cloudbuild.v1.IBuildTrigger} message BuildTrigger message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} message ListBuildsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildTrigger.encode = function encode(message, writer) { + ListBuildsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.build != null && Object.hasOwnProperty.call(message, "build")) - $root.google.devtools.cloudbuild.v1.Build.encode(message.build, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.triggerTemplate != null && Object.hasOwnProperty.call(message, "triggerTemplate")) - $root.google.devtools.cloudbuild.v1.RepoSource.encode(message.triggerTemplate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.filename); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.disabled); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); - if (message.substitutions != null && Object.hasOwnProperty.call(message, "substitutions")) - for (var keys = Object.keys(message.substitutions), i = 0; i < keys.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.substitutions[keys[i]]).ldelim(); - if (message.github != null && Object.hasOwnProperty.call(message, "github")) - $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.encode(message.github, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.ignoredFiles != null && message.ignoredFiles.length) - for (var i = 0; i < message.ignoredFiles.length; ++i) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.ignoredFiles[i]); - if (message.includedFiles != null && message.includedFiles.length) - for (var i = 0; i < message.includedFiles.length; ++i) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.includedFiles[i]); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 19, wireType 2 =*/154).string(message.tags[i]); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.name); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.parent); return writer; }; /** - * Encodes the specified BuildTrigger message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. + * Encodes the specified ListBuildsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static - * @param {google.devtools.cloudbuild.v1.IBuildTrigger} message BuildTrigger message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} message ListBuildsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildTrigger.encodeDelimited = function encodeDelimited(message, writer) { + ListBuildsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BuildTrigger message from the specified reader or buffer. + * Decodes a ListBuildsRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildTrigger.decode = function decode(reader, length) { + ListBuildsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildTrigger(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 10: - message.description = reader.string(); - break; - case 21: - message.name = reader.string(); - break; - case 19: - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); + case 9: + message.parent = reader.string(); break; - case 7: - message.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.decode(reader, reader.uint32()); + case 1: + message.projectId = reader.string(); break; - case 13: - message.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.decode(reader, reader.uint32()); + case 2: + message.pageSize = reader.int32(); break; - case 4: - message.build = $root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32()); + case 3: + message.pageToken = reader.string(); break; case 8: - message.filename = reader.string(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.filter = reader.string(); break; - case 9: - message.disabled = reader.bool(); - break; - case 11: - if (message.substitutions === $util.emptyObject) - message.substitutions = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.substitutions[key] = value; - break; - case 15: - if (!(message.ignoredFiles && message.ignoredFiles.length)) - message.ignoredFiles = []; - message.ignoredFiles.push(reader.string()); - break; - case 16: - if (!(message.includedFiles && message.includedFiles.length)) - message.includedFiles = []; - message.includedFiles.push(reader.string()); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -8067,293 +7939,142 @@ }; /** - * Decodes a BuildTrigger message from the specified reader or buffer, length delimited. + * Decodes a ListBuildsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildTrigger.decodeDelimited = function decodeDelimited(reader) { + ListBuildsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BuildTrigger message. + * Verifies a ListBuildsRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildTrigger.verify = function verify(message) { + ListBuildsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - if (message.triggerTemplate != null && message.hasOwnProperty("triggerTemplate")) { - var error = $root.google.devtools.cloudbuild.v1.RepoSource.verify(message.triggerTemplate); - if (error) - return "triggerTemplate." + error; - } - if (message.github != null && message.hasOwnProperty("github")) { - var error = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.verify(message.github); - if (error) - return "github." + error; - } - if (message.build != null && message.hasOwnProperty("build")) { - properties.buildTemplate = 1; - { - var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.build); - if (error) - return "build." + error; - } - } - if (message.filename != null && message.hasOwnProperty("filename")) { - if (properties.buildTemplate === 1) - return "buildTemplate: multiple values"; - properties.buildTemplate = 1; - if (!$util.isString(message.filename)) - return "filename: string expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - if (message.substitutions != null && message.hasOwnProperty("substitutions")) { - if (!$util.isObject(message.substitutions)) - return "substitutions: object expected"; - var key = Object.keys(message.substitutions); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.substitutions[key[i]])) - return "substitutions: string{k:string} expected"; - } - if (message.ignoredFiles != null && message.hasOwnProperty("ignoredFiles")) { - if (!Array.isArray(message.ignoredFiles)) - return "ignoredFiles: array expected"; - for (var i = 0; i < message.ignoredFiles.length; ++i) - if (!$util.isString(message.ignoredFiles[i])) - return "ignoredFiles: string[] expected"; - } - if (message.includedFiles != null && message.hasOwnProperty("includedFiles")) { - if (!Array.isArray(message.includedFiles)) - return "includedFiles: array expected"; - for (var i = 0; i < message.includedFiles.length; ++i) - if (!$util.isString(message.includedFiles[i])) - return "includedFiles: string[] expected"; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates a BuildTrigger message from a plain object. Also converts values to their respective internal types. + * Creates a ListBuildsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest */ - BuildTrigger.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.BuildTrigger) + ListBuildsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildsRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.BuildTrigger(); - if (object.id != null) - message.id = String(object.id); - if (object.description != null) - message.description = String(object.description); - if (object.name != null) - message.name = String(object.name); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.triggerTemplate != null) { - if (typeof object.triggerTemplate !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.triggerTemplate: object expected"); - message.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.fromObject(object.triggerTemplate); - } - if (object.github != null) { - if (typeof object.github !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.github: object expected"); - message.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.fromObject(object.github); - } - if (object.build != null) { - if (typeof object.build !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.build: object expected"); - message.build = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.build); - } - if (object.filename != null) - message.filename = String(object.filename); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - if (object.substitutions) { - if (typeof object.substitutions !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.substitutions: object expected"); - message.substitutions = {}; - for (var keys = Object.keys(object.substitutions), i = 0; i < keys.length; ++i) - message.substitutions[keys[i]] = String(object.substitutions[keys[i]]); - } - if (object.ignoredFiles) { - if (!Array.isArray(object.ignoredFiles)) - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.ignoredFiles: array expected"); - message.ignoredFiles = []; - for (var i = 0; i < object.ignoredFiles.length; ++i) - message.ignoredFiles[i] = String(object.ignoredFiles[i]); - } - if (object.includedFiles) { - if (!Array.isArray(object.includedFiles)) - throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.includedFiles: array expected"); - message.includedFiles = []; - for (var i = 0; i < object.includedFiles.length; ++i) - message.includedFiles[i] = String(object.includedFiles[i]); - } + var message = new $root.google.devtools.cloudbuild.v1.ListBuildsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); return message; }; /** - * Creates a plain object from a BuildTrigger message. Also converts values to other types if specified. + * Creates a plain object from a ListBuildsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @static - * @param {google.devtools.cloudbuild.v1.BuildTrigger} message BuildTrigger + * @param {google.devtools.cloudbuild.v1.ListBuildsRequest} message ListBuildsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BuildTrigger.toObject = function toObject(message, options) { + ListBuildsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.ignoredFiles = []; - object.includedFiles = []; - object.tags = []; - } - if (options.objects || options.defaults) - object.substitutions = {}; if (options.defaults) { - object.id = ""; - object.createTime = null; - object.triggerTemplate = null; - object.disabled = false; - object.description = ""; - object.github = null; - object.name = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.build != null && message.hasOwnProperty("build")) { - object.build = $root.google.devtools.cloudbuild.v1.Build.toObject(message.build, options); - if (options.oneofs) - object.buildTemplate = "build"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.triggerTemplate != null && message.hasOwnProperty("triggerTemplate")) - object.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.toObject(message.triggerTemplate, options); - if (message.filename != null && message.hasOwnProperty("filename")) { - object.filename = message.filename; - if (options.oneofs) - object.buildTemplate = "filename"; + object.projectId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.parent = ""; } - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - var keys2; - if (message.substitutions && (keys2 = Object.keys(message.substitutions)).length) { - object.substitutions = {}; - for (var j = 0; j < keys2.length; ++j) - object.substitutions[keys2[j]] = message.substitutions[keys2[j]]; - } - if (message.github != null && message.hasOwnProperty("github")) - object.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.toObject(message.github, options); - if (message.ignoredFiles && message.ignoredFiles.length) { - object.ignoredFiles = []; - for (var j = 0; j < message.ignoredFiles.length; ++j) - object.ignoredFiles[j] = message.ignoredFiles[j]; - } - if (message.includedFiles && message.includedFiles.length) { - object.includedFiles = []; - for (var j = 0; j < message.includedFiles.length; ++j) - object.includedFiles[j] = message.includedFiles[j]; - } - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this BuildTrigger to JSON. + * Converts this ListBuildsRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest * @instance * @returns {Object.} JSON object */ - BuildTrigger.prototype.toJSON = function toJSON() { + ListBuildsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BuildTrigger; + return ListBuildsRequest; })(); - v1.GitHubEventsConfig = (function() { + v1.ListBuildsResponse = (function() { /** - * Properties of a GitHubEventsConfig. + * Properties of a ListBuildsResponse. * @memberof google.devtools.cloudbuild.v1 - * @interface IGitHubEventsConfig - * @property {number|Long|null} [installationId] GitHubEventsConfig installationId - * @property {string|null} [owner] GitHubEventsConfig owner - * @property {string|null} [name] GitHubEventsConfig name - * @property {google.devtools.cloudbuild.v1.IPullRequestFilter|null} [pullRequest] GitHubEventsConfig pullRequest - * @property {google.devtools.cloudbuild.v1.IPushFilter|null} [push] GitHubEventsConfig push + * @interface IListBuildsResponse + * @property {Array.|null} [builds] ListBuildsResponse builds + * @property {string|null} [nextPageToken] ListBuildsResponse nextPageToken */ /** - * Constructs a new GitHubEventsConfig. + * Constructs a new ListBuildsResponse. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a GitHubEventsConfig. - * @implements IGitHubEventsConfig + * @classdesc Represents a ListBuildsResponse. + * @implements IListBuildsResponse * @constructor - * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse=} [properties] Properties to set */ - function GitHubEventsConfig(properties) { + function ListBuildsResponse(properties) { + this.builds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8361,141 +8082,91 @@ } /** - * GitHubEventsConfig installationId. - * @member {number|Long} installationId - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig - * @instance - */ - GitHubEventsConfig.prototype.installationId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * GitHubEventsConfig owner. - * @member {string} owner - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig - * @instance - */ - GitHubEventsConfig.prototype.owner = ""; - - /** - * GitHubEventsConfig name. - * @member {string} name - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig - * @instance - */ - GitHubEventsConfig.prototype.name = ""; - - /** - * GitHubEventsConfig pullRequest. - * @member {google.devtools.cloudbuild.v1.IPullRequestFilter|null|undefined} pullRequest - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig - * @instance - */ - GitHubEventsConfig.prototype.pullRequest = null; - - /** - * GitHubEventsConfig push. - * @member {google.devtools.cloudbuild.v1.IPushFilter|null|undefined} push - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * ListBuildsResponse builds. + * @member {Array.} builds + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @instance */ - GitHubEventsConfig.prototype.push = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListBuildsResponse.prototype.builds = $util.emptyArray; /** - * GitHubEventsConfig event. - * @member {"pullRequest"|"push"|undefined} event - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * ListBuildsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @instance */ - Object.defineProperty(GitHubEventsConfig.prototype, "event", { - get: $util.oneOfGetter($oneOfFields = ["pullRequest", "push"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListBuildsResponse.prototype.nextPageToken = ""; /** - * Creates a new GitHubEventsConfig instance using the specified properties. + * Creates a new ListBuildsResponse instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static - * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig instance + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse instance */ - GitHubEventsConfig.create = function create(properties) { - return new GitHubEventsConfig(properties); + ListBuildsResponse.create = function create(properties) { + return new ListBuildsResponse(properties); }; /** - * Encodes the specified GitHubEventsConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. + * Encodes the specified ListBuildsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static - * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig} message GitHubEventsConfig message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse} message ListBuildsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GitHubEventsConfig.encode = function encode(message, writer) { + ListBuildsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.installationId != null && Object.hasOwnProperty.call(message, "installationId")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.installationId); - if (message.pullRequest != null && Object.hasOwnProperty.call(message, "pullRequest")) - $root.google.devtools.cloudbuild.v1.PullRequestFilter.encode(message.pullRequest, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.push != null && Object.hasOwnProperty.call(message, "push")) - $root.google.devtools.cloudbuild.v1.PushFilter.encode(message.push, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.owner); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); + if (message.builds != null && message.builds.length) + for (var i = 0; i < message.builds.length; ++i) + $root.google.devtools.cloudbuild.v1.Build.encode(message.builds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified GitHubEventsConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. + * Encodes the specified ListBuildsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static - * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig} message GitHubEventsConfig message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse} message ListBuildsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GitHubEventsConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListBuildsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GitHubEventsConfig message from the specified reader or buffer. + * Decodes a ListBuildsResponse message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GitHubEventsConfig.decode = function decode(reader, length) { + ListBuildsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GitHubEventsConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.installationId = reader.int64(); - break; - case 6: - message.owner = reader.string(); - break; - case 7: - message.name = reader.string(); - break; - case 4: - message.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.decode(reader, reader.uint32()); + if (!(message.builds && message.builds.length)) + message.builds = []; + message.builds.push($root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32())); break; - case 5: - message.push = $root.google.devtools.cloudbuild.v1.PushFilter.decode(reader, reader.uint32()); + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8506,179 +8177,135 @@ }; /** - * Decodes a GitHubEventsConfig message from the specified reader or buffer, length delimited. + * Decodes a ListBuildsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GitHubEventsConfig.decodeDelimited = function decodeDelimited(reader) { + ListBuildsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GitHubEventsConfig message. + * Verifies a ListBuildsResponse message. * @function verify - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GitHubEventsConfig.verify = function verify(message) { + ListBuildsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.installationId != null && message.hasOwnProperty("installationId")) - if (!$util.isInteger(message.installationId) && !(message.installationId && $util.isInteger(message.installationId.low) && $util.isInteger(message.installationId.high))) - return "installationId: integer|Long expected"; - if (message.owner != null && message.hasOwnProperty("owner")) - if (!$util.isString(message.owner)) - return "owner: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.pullRequest != null && message.hasOwnProperty("pullRequest")) { - properties.event = 1; - { - var error = $root.google.devtools.cloudbuild.v1.PullRequestFilter.verify(message.pullRequest); - if (error) - return "pullRequest." + error; - } - } - if (message.push != null && message.hasOwnProperty("push")) { - if (properties.event === 1) - return "event: multiple values"; - properties.event = 1; - { - var error = $root.google.devtools.cloudbuild.v1.PushFilter.verify(message.push); + if (message.builds != null && message.hasOwnProperty("builds")) { + if (!Array.isArray(message.builds)) + return "builds: array expected"; + for (var i = 0; i < message.builds.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.builds[i]); if (error) - return "push." + error; + return "builds." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GitHubEventsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListBuildsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse */ - GitHubEventsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.GitHubEventsConfig) + ListBuildsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildsResponse) return object; - var message = new $root.google.devtools.cloudbuild.v1.GitHubEventsConfig(); - if (object.installationId != null) - if ($util.Long) - (message.installationId = $util.Long.fromValue(object.installationId)).unsigned = false; - else if (typeof object.installationId === "string") - message.installationId = parseInt(object.installationId, 10); - else if (typeof object.installationId === "number") - message.installationId = object.installationId; - else if (typeof object.installationId === "object") - message.installationId = new $util.LongBits(object.installationId.low >>> 0, object.installationId.high >>> 0).toNumber(); - if (object.owner != null) - message.owner = String(object.owner); - if (object.name != null) - message.name = String(object.name); - if (object.pullRequest != null) { - if (typeof object.pullRequest !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.GitHubEventsConfig.pullRequest: object expected"); - message.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.fromObject(object.pullRequest); - } - if (object.push != null) { - if (typeof object.push !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.GitHubEventsConfig.push: object expected"); - message.push = $root.google.devtools.cloudbuild.v1.PushFilter.fromObject(object.push); + var message = new $root.google.devtools.cloudbuild.v1.ListBuildsResponse(); + if (object.builds) { + if (!Array.isArray(object.builds)) + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildsResponse.builds: array expected"); + message.builds = []; + for (var i = 0; i < object.builds.length; ++i) { + if (typeof object.builds[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildsResponse.builds: object expected"); + message.builds[i] = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.builds[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GitHubEventsConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListBuildsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @static - * @param {google.devtools.cloudbuild.v1.GitHubEventsConfig} message GitHubEventsConfig + * @param {google.devtools.cloudbuild.v1.ListBuildsResponse} message ListBuildsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GitHubEventsConfig.toObject = function toObject(message, options) { + ListBuildsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.installationId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.installationId = options.longs === String ? "0" : 0; - object.owner = ""; - object.name = ""; - } - if (message.installationId != null && message.hasOwnProperty("installationId")) - if (typeof message.installationId === "number") - object.installationId = options.longs === String ? String(message.installationId) : message.installationId; - else - object.installationId = options.longs === String ? $util.Long.prototype.toString.call(message.installationId) : options.longs === Number ? new $util.LongBits(message.installationId.low >>> 0, message.installationId.high >>> 0).toNumber() : message.installationId; - if (message.pullRequest != null && message.hasOwnProperty("pullRequest")) { - object.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.toObject(message.pullRequest, options); - if (options.oneofs) - object.event = "pullRequest"; - } - if (message.push != null && message.hasOwnProperty("push")) { - object.push = $root.google.devtools.cloudbuild.v1.PushFilter.toObject(message.push, options); - if (options.oneofs) - object.event = "push"; + if (options.arrays || options.defaults) + object.builds = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.builds && message.builds.length) { + object.builds = []; + for (var j = 0; j < message.builds.length; ++j) + object.builds[j] = $root.google.devtools.cloudbuild.v1.Build.toObject(message.builds[j], options); } - if (message.owner != null && message.hasOwnProperty("owner")) - object.owner = message.owner; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GitHubEventsConfig to JSON. + * Converts this ListBuildsResponse to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse * @instance * @returns {Object.} JSON object */ - GitHubEventsConfig.prototype.toJSON = function toJSON() { + ListBuildsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GitHubEventsConfig; + return ListBuildsResponse; })(); - v1.PullRequestFilter = (function() { + v1.CancelBuildRequest = (function() { /** - * Properties of a PullRequestFilter. + * Properties of a CancelBuildRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface IPullRequestFilter - * @property {string|null} [branch] PullRequestFilter branch - * @property {google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|null} [commentControl] PullRequestFilter commentControl - * @property {boolean|null} [invertRegex] PullRequestFilter invertRegex + * @interface ICancelBuildRequest + * @property {string|null} [name] CancelBuildRequest name + * @property {string|null} [projectId] CancelBuildRequest projectId + * @property {string|null} [id] CancelBuildRequest id */ /** - * Constructs a new PullRequestFilter. + * Constructs a new CancelBuildRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a PullRequestFilter. - * @implements IPullRequestFilter + * @classdesc Represents a CancelBuildRequest. + * @implements ICancelBuildRequest * @constructor - * @param {google.devtools.cloudbuild.v1.IPullRequestFilter=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest=} [properties] Properties to set */ - function PullRequestFilter(properties) { + function CancelBuildRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8686,115 +8313,101 @@ } /** - * PullRequestFilter branch. - * @member {string} branch - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter - * @instance - */ - PullRequestFilter.prototype.branch = ""; - - /** - * PullRequestFilter commentControl. - * @member {google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl} commentControl - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * CancelBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @instance */ - PullRequestFilter.prototype.commentControl = 0; + CancelBuildRequest.prototype.name = ""; /** - * PullRequestFilter invertRegex. - * @member {boolean} invertRegex - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * CancelBuildRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @instance */ - PullRequestFilter.prototype.invertRegex = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CancelBuildRequest.prototype.projectId = ""; /** - * PullRequestFilter gitRef. - * @member {"branch"|undefined} gitRef - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * CancelBuildRequest id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @instance */ - Object.defineProperty(PullRequestFilter.prototype, "gitRef", { - get: $util.oneOfGetter($oneOfFields = ["branch"]), - set: $util.oneOfSetter($oneOfFields) - }); + CancelBuildRequest.prototype.id = ""; /** - * Creates a new PullRequestFilter instance using the specified properties. + * Creates a new CancelBuildRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.IPullRequestFilter=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter instance + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest instance */ - PullRequestFilter.create = function create(properties) { - return new PullRequestFilter(properties); + CancelBuildRequest.create = function create(properties) { + return new CancelBuildRequest(properties); }; /** - * Encodes the specified PullRequestFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. + * Encodes the specified CancelBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.IPullRequestFilter} message PullRequestFilter message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} message CancelBuildRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PullRequestFilter.encode = function encode(message, writer) { + CancelBuildRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); - if (message.commentControl != null && Object.hasOwnProperty.call(message, "commentControl")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.commentControl); - if (message.invertRegex != null && Object.hasOwnProperty.call(message, "invertRegex")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.invertRegex); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; /** - * Encodes the specified PullRequestFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. + * Encodes the specified CancelBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.IPullRequestFilter} message PullRequestFilter message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} message CancelBuildRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PullRequestFilter.encodeDelimited = function encodeDelimited(message, writer) { + CancelBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PullRequestFilter message from the specified reader or buffer. + * Decodes a CancelBuildRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PullRequestFilter.decode = function decode(reader, length) { + CancelBuildRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PullRequestFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CancelBuildRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.branch = reader.string(); + case 4: + message.name = reader.string(); break; - case 5: - message.commentControl = reader.int32(); + case 1: + message.projectId = reader.string(); break; - case 6: - message.invertRegex = reader.bool(); + case 2: + message.id = reader.string(); break; default: reader.skipType(tag & 7); @@ -8805,158 +8418,140 @@ }; /** - * Decodes a PullRequestFilter message from the specified reader or buffer, length delimited. + * Decodes a CancelBuildRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PullRequestFilter.decodeDelimited = function decodeDelimited(reader) { + CancelBuildRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PullRequestFilter message. + * Verifies a CancelBuildRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PullRequestFilter.verify = function verify(message) { + CancelBuildRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.branch != null && message.hasOwnProperty("branch")) { - properties.gitRef = 1; - if (!$util.isString(message.branch)) - return "branch: string expected"; - } - if (message.commentControl != null && message.hasOwnProperty("commentControl")) - switch (message.commentControl) { - default: - return "commentControl: enum value expected"; - case 0: - case 1: - break; - } - if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) - if (typeof message.invertRegex !== "boolean") - return "invertRegex: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; return null; }; /** - * Creates a PullRequestFilter message from a plain object. Also converts values to their respective internal types. + * Creates a CancelBuildRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest */ - PullRequestFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.PullRequestFilter) + CancelBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CancelBuildRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.PullRequestFilter(); - if (object.branch != null) - message.branch = String(object.branch); - switch (object.commentControl) { - case "COMMENTS_DISABLED": - case 0: - message.commentControl = 0; - break; - case "COMMENTS_ENABLED": - case 1: - message.commentControl = 1; - break; - } - if (object.invertRegex != null) - message.invertRegex = Boolean(object.invertRegex); + var message = new $root.google.devtools.cloudbuild.v1.CancelBuildRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.id != null) + message.id = String(object.id); return message; }; /** - * Creates a plain object from a PullRequestFilter message. Also converts values to other types if specified. + * Creates a plain object from a CancelBuildRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @static - * @param {google.devtools.cloudbuild.v1.PullRequestFilter} message PullRequestFilter + * @param {google.devtools.cloudbuild.v1.CancelBuildRequest} message CancelBuildRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PullRequestFilter.toObject = function toObject(message, options) { + CancelBuildRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.commentControl = options.enums === String ? "COMMENTS_DISABLED" : 0; - object.invertRegex = false; - } - if (message.branch != null && message.hasOwnProperty("branch")) { - object.branch = message.branch; - if (options.oneofs) - object.gitRef = "branch"; + object.projectId = ""; + object.id = ""; + object.name = ""; } - if (message.commentControl != null && message.hasOwnProperty("commentControl")) - object.commentControl = options.enums === String ? $root.google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl[message.commentControl] : message.commentControl; - if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) - object.invertRegex = message.invertRegex; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this PullRequestFilter to JSON. + * Converts this CancelBuildRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest * @instance * @returns {Object.} JSON object */ - PullRequestFilter.prototype.toJSON = function toJSON() { + CancelBuildRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * CommentControl enum. - * @name google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl - * @enum {number} - * @property {number} COMMENTS_DISABLED=0 COMMENTS_DISABLED value - * @property {number} COMMENTS_ENABLED=1 COMMENTS_ENABLED value - */ - PullRequestFilter.CommentControl = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMMENTS_DISABLED"] = 0; - values[valuesById[1] = "COMMENTS_ENABLED"] = 1; - return values; - })(); - - return PullRequestFilter; + return CancelBuildRequest; })(); - v1.PushFilter = (function() { + v1.BuildTrigger = (function() { /** - * Properties of a PushFilter. + * Properties of a BuildTrigger. * @memberof google.devtools.cloudbuild.v1 - * @interface IPushFilter - * @property {string|null} [branch] PushFilter branch - * @property {string|null} [tag] PushFilter tag - * @property {boolean|null} [invertRegex] PushFilter invertRegex + * @interface IBuildTrigger + * @property {string|null} [id] BuildTrigger id + * @property {string|null} [description] BuildTrigger description + * @property {string|null} [name] BuildTrigger name + * @property {Array.|null} [tags] BuildTrigger tags + * @property {google.devtools.cloudbuild.v1.IRepoSource|null} [triggerTemplate] BuildTrigger triggerTemplate + * @property {google.devtools.cloudbuild.v1.IGitHubEventsConfig|null} [github] BuildTrigger github + * @property {google.devtools.cloudbuild.v1.IBuild|null} [build] BuildTrigger build + * @property {string|null} [filename] BuildTrigger filename + * @property {google.protobuf.ITimestamp|null} [createTime] BuildTrigger createTime + * @property {boolean|null} [disabled] BuildTrigger disabled + * @property {Object.|null} [substitutions] BuildTrigger substitutions + * @property {Array.|null} [ignoredFiles] BuildTrigger ignoredFiles + * @property {Array.|null} [includedFiles] BuildTrigger includedFiles */ /** - * Constructs a new PushFilter. + * Constructs a new BuildTrigger. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a PushFilter. - * @implements IPushFilter + * @classdesc Represents a BuildTrigger. + * @implements IBuildTrigger * @constructor - * @param {google.devtools.cloudbuild.v1.IPushFilter=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IBuildTrigger=} [properties] Properties to set */ - function PushFilter(properties) { + function BuildTrigger(properties) { + this.tags = []; + this.substitutions = {}; + this.ignoredFiles = []; + this.includedFiles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8964,115 +8559,274 @@ } /** - * PushFilter branch. - * @member {string} branch - * @memberof google.devtools.cloudbuild.v1.PushFilter + * BuildTrigger id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @instance */ - PushFilter.prototype.branch = ""; + BuildTrigger.prototype.id = ""; /** - * PushFilter tag. - * @member {string} tag - * @memberof google.devtools.cloudbuild.v1.PushFilter + * BuildTrigger description. + * @member {string} description + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @instance */ - PushFilter.prototype.tag = ""; + BuildTrigger.prototype.description = ""; /** - * PushFilter invertRegex. - * @member {boolean} invertRegex - * @memberof google.devtools.cloudbuild.v1.PushFilter + * BuildTrigger name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @instance */ - PushFilter.prototype.invertRegex = false; + BuildTrigger.prototype.name = ""; + + /** + * BuildTrigger tags. + * @member {Array.} tags + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.tags = $util.emptyArray; + + /** + * BuildTrigger triggerTemplate. + * @member {google.devtools.cloudbuild.v1.IRepoSource|null|undefined} triggerTemplate + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.triggerTemplate = null; + + /** + * BuildTrigger github. + * @member {google.devtools.cloudbuild.v1.IGitHubEventsConfig|null|undefined} github + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.github = null; + + /** + * BuildTrigger build. + * @member {google.devtools.cloudbuild.v1.IBuild|null|undefined} build + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.build = null; + + /** + * BuildTrigger filename. + * @member {string} filename + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.filename = ""; + + /** + * BuildTrigger createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.createTime = null; + + /** + * BuildTrigger disabled. + * @member {boolean} disabled + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.disabled = false; + + /** + * BuildTrigger substitutions. + * @member {Object.} substitutions + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.substitutions = $util.emptyObject; + + /** + * BuildTrigger ignoredFiles. + * @member {Array.} ignoredFiles + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.ignoredFiles = $util.emptyArray; + + /** + * BuildTrigger includedFiles. + * @member {Array.} includedFiles + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.includedFiles = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * PushFilter gitRef. - * @member {"branch"|"tag"|undefined} gitRef - * @memberof google.devtools.cloudbuild.v1.PushFilter + * BuildTrigger buildTemplate. + * @member {"build"|"filename"|undefined} buildTemplate + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @instance */ - Object.defineProperty(PushFilter.prototype, "gitRef", { - get: $util.oneOfGetter($oneOfFields = ["branch", "tag"]), + Object.defineProperty(BuildTrigger.prototype, "buildTemplate", { + get: $util.oneOfGetter($oneOfFields = ["build", "filename"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new PushFilter instance using the specified properties. + * Creates a new BuildTrigger instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.PushFilter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @static - * @param {google.devtools.cloudbuild.v1.IPushFilter=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter instance + * @param {google.devtools.cloudbuild.v1.IBuildTrigger=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger instance */ - PushFilter.create = function create(properties) { - return new PushFilter(properties); + BuildTrigger.create = function create(properties) { + return new BuildTrigger(properties); }; /** - * Encodes the specified PushFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. + * Encodes the specified BuildTrigger message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.PushFilter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @static - * @param {google.devtools.cloudbuild.v1.IPushFilter} message PushFilter message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IBuildTrigger} message BuildTrigger message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PushFilter.encode = function encode(message, writer) { + BuildTrigger.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tag); - if (message.invertRegex != null && Object.hasOwnProperty.call(message, "invertRegex")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.invertRegex); - return writer; - }; - - /** - * Encodes the specified PushFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.PushFilter - * @static - * @param {google.devtools.cloudbuild.v1.IPushFilter} message PushFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PushFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + $root.google.devtools.cloudbuild.v1.Build.encode(message.build, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.triggerTemplate != null && Object.hasOwnProperty.call(message, "triggerTemplate")) + $root.google.devtools.cloudbuild.v1.RepoSource.encode(message.triggerTemplate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filename); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.disabled); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.substitutions != null && Object.hasOwnProperty.call(message, "substitutions")) + for (var keys = Object.keys(message.substitutions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.substitutions[keys[i]]).ldelim(); + if (message.github != null && Object.hasOwnProperty.call(message, "github")) + $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.encode(message.github, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.ignoredFiles != null && message.ignoredFiles.length) + for (var i = 0; i < message.ignoredFiles.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ignoredFiles[i]); + if (message.includedFiles != null && message.includedFiles.length) + for (var i = 0; i < message.includedFiles.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.includedFiles[i]); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.tags[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.name); + return writer; }; /** - * Decodes a PushFilter message from the specified reader or buffer. + * Encodes the specified BuildTrigger message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {google.devtools.cloudbuild.v1.IBuildTrigger} message BuildTrigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildTrigger.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildTrigger message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.PushFilter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PushFilter.decode = function decode(reader, length) { + BuildTrigger.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PushFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildTrigger(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.branch = reader.string(); + case 1: + message.id = reader.string(); break; - case 3: - message.tag = reader.string(); + case 10: + message.description = reader.string(); + break; + case 21: + message.name = reader.string(); + break; + case 19: + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + case 7: + message.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.decode(reader, reader.uint32()); + break; + case 13: + message.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.decode(reader, reader.uint32()); break; case 4: - message.invertRegex = reader.bool(); + message.build = $root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32()); + break; + case 8: + message.filename = reader.string(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.disabled = reader.bool(); + break; + case 11: + if (message.substitutions === $util.emptyObject) + message.substitutions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.substitutions[key] = value; + break; + case 15: + if (!(message.ignoredFiles && message.ignoredFiles.length)) + message.ignoredFiles = []; + message.ignoredFiles.push(reader.string()); + break; + case 16: + if (!(message.includedFiles && message.includedFiles.length)) + message.includedFiles = []; + message.includedFiles.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -9083,135 +8837,293 @@ }; /** - * Decodes a PushFilter message from the specified reader or buffer, length delimited. + * Decodes a BuildTrigger message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.PushFilter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PushFilter.decodeDelimited = function decodeDelimited(reader) { + BuildTrigger.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PushFilter message. + * Verifies a BuildTrigger message. * @function verify - * @memberof google.devtools.cloudbuild.v1.PushFilter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PushFilter.verify = function verify(message) { + BuildTrigger.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.branch != null && message.hasOwnProperty("branch")) { - properties.gitRef = 1; - if (!$util.isString(message.branch)) - return "branch: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; } - if (message.tag != null && message.hasOwnProperty("tag")) { - if (properties.gitRef === 1) - return "gitRef: multiple values"; - properties.gitRef = 1; - if (!$util.isString(message.tag)) - return "tag: string expected"; + if (message.triggerTemplate != null && message.hasOwnProperty("triggerTemplate")) { + var error = $root.google.devtools.cloudbuild.v1.RepoSource.verify(message.triggerTemplate); + if (error) + return "triggerTemplate." + error; + } + if (message.github != null && message.hasOwnProperty("github")) { + var error = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.verify(message.github); + if (error) + return "github." + error; + } + if (message.build != null && message.hasOwnProperty("build")) { + properties.buildTemplate = 1; + { + var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.build); + if (error) + return "build." + error; + } + } + if (message.filename != null && message.hasOwnProperty("filename")) { + if (properties.buildTemplate === 1) + return "buildTemplate: multiple values"; + properties.buildTemplate = 1; + if (!$util.isString(message.filename)) + return "filename: string expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.substitutions != null && message.hasOwnProperty("substitutions")) { + if (!$util.isObject(message.substitutions)) + return "substitutions: object expected"; + var key = Object.keys(message.substitutions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.substitutions[key[i]])) + return "substitutions: string{k:string} expected"; + } + if (message.ignoredFiles != null && message.hasOwnProperty("ignoredFiles")) { + if (!Array.isArray(message.ignoredFiles)) + return "ignoredFiles: array expected"; + for (var i = 0; i < message.ignoredFiles.length; ++i) + if (!$util.isString(message.ignoredFiles[i])) + return "ignoredFiles: string[] expected"; + } + if (message.includedFiles != null && message.hasOwnProperty("includedFiles")) { + if (!Array.isArray(message.includedFiles)) + return "includedFiles: array expected"; + for (var i = 0; i < message.includedFiles.length; ++i) + if (!$util.isString(message.includedFiles[i])) + return "includedFiles: string[] expected"; } - if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) - if (typeof message.invertRegex !== "boolean") - return "invertRegex: boolean expected"; return null; }; /** - * Creates a PushFilter message from a plain object. Also converts values to their respective internal types. + * Creates a BuildTrigger message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.PushFilter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger */ - PushFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.PushFilter) + BuildTrigger.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildTrigger) return object; - var message = new $root.google.devtools.cloudbuild.v1.PushFilter(); - if (object.branch != null) - message.branch = String(object.branch); - if (object.tag != null) - message.tag = String(object.tag); - if (object.invertRegex != null) - message.invertRegex = Boolean(object.invertRegex); - return message; - }; - - /** - * Creates a plain object from a PushFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.devtools.cloudbuild.v1.PushFilter - * @static - * @param {google.devtools.cloudbuild.v1.PushFilter} message PushFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PushFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.invertRegex = false; - if (message.branch != null && message.hasOwnProperty("branch")) { - object.branch = message.branch; - if (options.oneofs) - object.gitRef = "branch"; - } - if (message.tag != null && message.hasOwnProperty("tag")) { - object.tag = message.tag; + var message = new $root.google.devtools.cloudbuild.v1.BuildTrigger(); + if (object.id != null) + message.id = String(object.id); + if (object.description != null) + message.description = String(object.description); + if (object.name != null) + message.name = String(object.name); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.triggerTemplate != null) { + if (typeof object.triggerTemplate !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.triggerTemplate: object expected"); + message.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.fromObject(object.triggerTemplate); + } + if (object.github != null) { + if (typeof object.github !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.github: object expected"); + message.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.fromObject(object.github); + } + if (object.build != null) { + if (typeof object.build !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.build: object expected"); + message.build = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.build); + } + if (object.filename != null) + message.filename = String(object.filename); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.substitutions) { + if (typeof object.substitutions !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.substitutions: object expected"); + message.substitutions = {}; + for (var keys = Object.keys(object.substitutions), i = 0; i < keys.length; ++i) + message.substitutions[keys[i]] = String(object.substitutions[keys[i]]); + } + if (object.ignoredFiles) { + if (!Array.isArray(object.ignoredFiles)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.ignoredFiles: array expected"); + message.ignoredFiles = []; + for (var i = 0; i < object.ignoredFiles.length; ++i) + message.ignoredFiles[i] = String(object.ignoredFiles[i]); + } + if (object.includedFiles) { + if (!Array.isArray(object.includedFiles)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.includedFiles: array expected"); + message.includedFiles = []; + for (var i = 0; i < object.includedFiles.length; ++i) + message.includedFiles[i] = String(object.includedFiles[i]); + } + return message; + }; + + /** + * Creates a plain object from a BuildTrigger message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {google.devtools.cloudbuild.v1.BuildTrigger} message BuildTrigger + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildTrigger.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredFiles = []; + object.includedFiles = []; + object.tags = []; + } + if (options.objects || options.defaults) + object.substitutions = {}; + if (options.defaults) { + object.id = ""; + object.createTime = null; + object.triggerTemplate = null; + object.disabled = false; + object.description = ""; + object.github = null; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.build != null && message.hasOwnProperty("build")) { + object.build = $root.google.devtools.cloudbuild.v1.Build.toObject(message.build, options); if (options.oneofs) - object.gitRef = "tag"; + object.buildTemplate = "build"; } - if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) - object.invertRegex = message.invertRegex; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.triggerTemplate != null && message.hasOwnProperty("triggerTemplate")) + object.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.toObject(message.triggerTemplate, options); + if (message.filename != null && message.hasOwnProperty("filename")) { + object.filename = message.filename; + if (options.oneofs) + object.buildTemplate = "filename"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.substitutions && (keys2 = Object.keys(message.substitutions)).length) { + object.substitutions = {}; + for (var j = 0; j < keys2.length; ++j) + object.substitutions[keys2[j]] = message.substitutions[keys2[j]]; + } + if (message.github != null && message.hasOwnProperty("github")) + object.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.toObject(message.github, options); + if (message.ignoredFiles && message.ignoredFiles.length) { + object.ignoredFiles = []; + for (var j = 0; j < message.ignoredFiles.length; ++j) + object.ignoredFiles[j] = message.ignoredFiles[j]; + } + if (message.includedFiles && message.includedFiles.length) { + object.includedFiles = []; + for (var j = 0; j < message.includedFiles.length; ++j) + object.includedFiles[j] = message.includedFiles[j]; + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this PushFilter to JSON. + * Converts this BuildTrigger to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.PushFilter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger * @instance * @returns {Object.} JSON object */ - PushFilter.prototype.toJSON = function toJSON() { + BuildTrigger.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PushFilter; + return BuildTrigger; })(); - v1.CreateBuildTriggerRequest = (function() { + v1.GitHubEventsConfig = (function() { /** - * Properties of a CreateBuildTriggerRequest. + * Properties of a GitHubEventsConfig. * @memberof google.devtools.cloudbuild.v1 - * @interface ICreateBuildTriggerRequest - * @property {string|null} [projectId] CreateBuildTriggerRequest projectId - * @property {google.devtools.cloudbuild.v1.IBuildTrigger|null} [trigger] CreateBuildTriggerRequest trigger + * @interface IGitHubEventsConfig + * @property {number|Long|null} [installationId] GitHubEventsConfig installationId + * @property {string|null} [owner] GitHubEventsConfig owner + * @property {string|null} [name] GitHubEventsConfig name + * @property {google.devtools.cloudbuild.v1.IPullRequestFilter|null} [pullRequest] GitHubEventsConfig pullRequest + * @property {google.devtools.cloudbuild.v1.IPushFilter|null} [push] GitHubEventsConfig push */ /** - * Constructs a new CreateBuildTriggerRequest. + * Constructs a new GitHubEventsConfig. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a CreateBuildTriggerRequest. - * @implements ICreateBuildTriggerRequest + * @classdesc Represents a GitHubEventsConfig. + * @implements IGitHubEventsConfig * @constructor - * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig=} [properties] Properties to set */ - function CreateBuildTriggerRequest(properties) { + function GitHubEventsConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9219,88 +9131,141 @@ } /** - * CreateBuildTriggerRequest projectId. - * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * GitHubEventsConfig installationId. + * @member {number|Long} installationId + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @instance */ - CreateBuildTriggerRequest.prototype.projectId = ""; + GitHubEventsConfig.prototype.installationId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * CreateBuildTriggerRequest trigger. - * @member {google.devtools.cloudbuild.v1.IBuildTrigger|null|undefined} trigger - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * GitHubEventsConfig owner. + * @member {string} owner + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @instance */ - CreateBuildTriggerRequest.prototype.trigger = null; + GitHubEventsConfig.prototype.owner = ""; /** - * Creates a new CreateBuildTriggerRequest instance using the specified properties. + * GitHubEventsConfig name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.name = ""; + + /** + * GitHubEventsConfig pullRequest. + * @member {google.devtools.cloudbuild.v1.IPullRequestFilter|null|undefined} pullRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.pullRequest = null; + + /** + * GitHubEventsConfig push. + * @member {google.devtools.cloudbuild.v1.IPushFilter|null|undefined} push + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.push = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GitHubEventsConfig event. + * @member {"pullRequest"|"push"|undefined} event + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + Object.defineProperty(GitHubEventsConfig.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["pullRequest", "push"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GitHubEventsConfig instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @static - * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest instance + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig instance */ - CreateBuildTriggerRequest.create = function create(properties) { - return new CreateBuildTriggerRequest(properties); + GitHubEventsConfig.create = function create(properties) { + return new GitHubEventsConfig(properties); }; /** - * Encodes the specified CreateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. + * Encodes the specified GitHubEventsConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @static - * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} message CreateBuildTriggerRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig} message GitHubEventsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBuildTriggerRequest.encode = function encode(message, writer) { + GitHubEventsConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) - $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.trigger, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest - * @static - * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} message CreateBuildTriggerRequest message or plain object to encode + if (message.installationId != null && Object.hasOwnProperty.call(message, "installationId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.installationId); + if (message.pullRequest != null && Object.hasOwnProperty.call(message, "pullRequest")) + $root.google.devtools.cloudbuild.v1.PullRequestFilter.encode(message.pullRequest, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.push != null && Object.hasOwnProperty.call(message, "push")) + $root.google.devtools.cloudbuild.v1.PushFilter.encode(message.push, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.owner); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); + return writer; + }; + + /** + * Encodes the specified GitHubEventsConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig} message GitHubEventsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + GitHubEventsConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer. + * Decodes a GitHubEventsConfig message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBuildTriggerRequest.decode = function decode(reader, length) { + GitHubEventsConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GitHubEventsConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.projectId = reader.string(); + message.installationId = reader.int64(); break; - case 2: - message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32()); + case 6: + message.owner = reader.string(); + break; + case 7: + message.name = reader.string(); + break; + case 4: + message.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.decode(reader, reader.uint32()); + break; + case 5: + message.push = $root.google.devtools.cloudbuild.v1.PushFilter.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9311,122 +9276,179 @@ }; /** - * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer, length delimited. + * Decodes a GitHubEventsConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + GitHubEventsConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateBuildTriggerRequest message. + * Verifies a GitHubEventsConfig message. * @function verify - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateBuildTriggerRequest.verify = function verify(message) { + GitHubEventsConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.trigger != null && message.hasOwnProperty("trigger")) { - var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.trigger); - if (error) - return "trigger." + error; + var properties = {}; + if (message.installationId != null && message.hasOwnProperty("installationId")) + if (!$util.isInteger(message.installationId) && !(message.installationId && $util.isInteger(message.installationId.low) && $util.isInteger(message.installationId.high))) + return "installationId: integer|Long expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pullRequest != null && message.hasOwnProperty("pullRequest")) { + properties.event = 1; + { + var error = $root.google.devtools.cloudbuild.v1.PullRequestFilter.verify(message.pullRequest); + if (error) + return "pullRequest." + error; + } + } + if (message.push != null && message.hasOwnProperty("push")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.google.devtools.cloudbuild.v1.PushFilter.verify(message.push); + if (error) + return "push." + error; + } } return null; }; /** - * Creates a CreateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GitHubEventsConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig */ - CreateBuildTriggerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest) + GitHubEventsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GitHubEventsConfig) return object; - var message = new $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.trigger != null) { - if (typeof object.trigger !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.trigger: object expected"); - message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.trigger); + var message = new $root.google.devtools.cloudbuild.v1.GitHubEventsConfig(); + if (object.installationId != null) + if ($util.Long) + (message.installationId = $util.Long.fromValue(object.installationId)).unsigned = false; + else if (typeof object.installationId === "string") + message.installationId = parseInt(object.installationId, 10); + else if (typeof object.installationId === "number") + message.installationId = object.installationId; + else if (typeof object.installationId === "object") + message.installationId = new $util.LongBits(object.installationId.low >>> 0, object.installationId.high >>> 0).toNumber(); + if (object.owner != null) + message.owner = String(object.owner); + if (object.name != null) + message.name = String(object.name); + if (object.pullRequest != null) { + if (typeof object.pullRequest !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.GitHubEventsConfig.pullRequest: object expected"); + message.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.fromObject(object.pullRequest); + } + if (object.push != null) { + if (typeof object.push !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.GitHubEventsConfig.push: object expected"); + message.push = $root.google.devtools.cloudbuild.v1.PushFilter.fromObject(object.push); } return message; }; /** - * Creates a plain object from a CreateBuildTriggerRequest message. Also converts values to other types if specified. + * Creates a plain object from a GitHubEventsConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @static - * @param {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} message CreateBuildTriggerRequest + * @param {google.devtools.cloudbuild.v1.GitHubEventsConfig} message GitHubEventsConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBuildTriggerRequest.toObject = function toObject(message, options) { + GitHubEventsConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.projectId = ""; - object.trigger = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.installationId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.installationId = options.longs === String ? "0" : 0; + object.owner = ""; + object.name = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.trigger != null && message.hasOwnProperty("trigger")) - object.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.trigger, options); + if (message.installationId != null && message.hasOwnProperty("installationId")) + if (typeof message.installationId === "number") + object.installationId = options.longs === String ? String(message.installationId) : message.installationId; + else + object.installationId = options.longs === String ? $util.Long.prototype.toString.call(message.installationId) : options.longs === Number ? new $util.LongBits(message.installationId.low >>> 0, message.installationId.high >>> 0).toNumber() : message.installationId; + if (message.pullRequest != null && message.hasOwnProperty("pullRequest")) { + object.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.toObject(message.pullRequest, options); + if (options.oneofs) + object.event = "pullRequest"; + } + if (message.push != null && message.hasOwnProperty("push")) { + object.push = $root.google.devtools.cloudbuild.v1.PushFilter.toObject(message.push, options); + if (options.oneofs) + object.event = "push"; + } + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateBuildTriggerRequest to JSON. + * Converts this GitHubEventsConfig to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig * @instance * @returns {Object.} JSON object */ - CreateBuildTriggerRequest.prototype.toJSON = function toJSON() { + GitHubEventsConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateBuildTriggerRequest; + return GitHubEventsConfig; })(); - v1.GetBuildTriggerRequest = (function() { + v1.PullRequestFilter = (function() { /** - * Properties of a GetBuildTriggerRequest. + * Properties of a PullRequestFilter. * @memberof google.devtools.cloudbuild.v1 - * @interface IGetBuildTriggerRequest - * @property {string|null} [projectId] GetBuildTriggerRequest projectId - * @property {string|null} [triggerId] GetBuildTriggerRequest triggerId + * @interface IPullRequestFilter + * @property {string|null} [branch] PullRequestFilter branch + * @property {google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|null} [commentControl] PullRequestFilter commentControl + * @property {boolean|null} [invertRegex] PullRequestFilter invertRegex */ /** - * Constructs a new GetBuildTriggerRequest. + * Constructs a new PullRequestFilter. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a GetBuildTriggerRequest. - * @implements IGetBuildTriggerRequest + * @classdesc Represents a PullRequestFilter. + * @implements IPullRequestFilter * @constructor - * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter=} [properties] Properties to set */ - function GetBuildTriggerRequest(properties) { + function PullRequestFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9434,88 +9456,115 @@ } /** - * GetBuildTriggerRequest projectId. - * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * PullRequestFilter branch. + * @member {string} branch + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @instance */ - GetBuildTriggerRequest.prototype.projectId = ""; + PullRequestFilter.prototype.branch = ""; /** - * GetBuildTriggerRequest triggerId. - * @member {string} triggerId - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * PullRequestFilter commentControl. + * @member {google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl} commentControl + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @instance */ - GetBuildTriggerRequest.prototype.triggerId = ""; + PullRequestFilter.prototype.commentControl = 0; /** - * Creates a new GetBuildTriggerRequest instance using the specified properties. + * PullRequestFilter invertRegex. + * @member {boolean} invertRegex + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @instance + */ + PullRequestFilter.prototype.invertRegex = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PullRequestFilter gitRef. + * @member {"branch"|undefined} gitRef + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @instance + */ + Object.defineProperty(PullRequestFilter.prototype, "gitRef", { + get: $util.oneOfGetter($oneOfFields = ["branch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PullRequestFilter instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static - * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest instance + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter instance */ - GetBuildTriggerRequest.create = function create(properties) { - return new GetBuildTriggerRequest(properties); + PullRequestFilter.create = function create(properties) { + return new PullRequestFilter(properties); }; /** - * Encodes the specified GetBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. + * Encodes the specified PullRequestFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static - * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} message GetBuildTriggerRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter} message PullRequestFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBuildTriggerRequest.encode = function encode(message, writer) { + PullRequestFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.commentControl != null && Object.hasOwnProperty.call(message, "commentControl")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.commentControl); + if (message.invertRegex != null && Object.hasOwnProperty.call(message, "invertRegex")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.invertRegex); return writer; }; /** - * Encodes the specified GetBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. + * Encodes the specified PullRequestFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static - * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} message GetBuildTriggerRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter} message PullRequestFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + PullRequestFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBuildTriggerRequest message from the specified reader or buffer. + * Decodes a PullRequestFilter message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBuildTriggerRequest.decode = function decode(reader, length) { + PullRequestFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PullRequestFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; case 2: - message.triggerId = reader.string(); + message.branch = reader.string(); + break; + case 5: + message.commentControl = reader.int32(); + break; + case 6: + message.invertRegex = reader.bool(); break; default: reader.skipType(tag & 7); @@ -9526,118 +9575,165 @@ }; /** - * Decodes a GetBuildTriggerRequest message from the specified reader or buffer, length delimited. + * Decodes a PullRequestFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + PullRequestFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBuildTriggerRequest message. + * Verifies a PullRequestFilter message. * @function verify - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBuildTriggerRequest.verify = function verify(message) { + PullRequestFilter.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.triggerId != null && message.hasOwnProperty("triggerId")) - if (!$util.isString(message.triggerId)) - return "triggerId: string expected"; + var properties = {}; + if (message.branch != null && message.hasOwnProperty("branch")) { + properties.gitRef = 1; + if (!$util.isString(message.branch)) + return "branch: string expected"; + } + if (message.commentControl != null && message.hasOwnProperty("commentControl")) + switch (message.commentControl) { + default: + return "commentControl: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + if (typeof message.invertRegex !== "boolean") + return "invertRegex: boolean expected"; return null; }; /** - * Creates a GetBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PullRequestFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter */ - GetBuildTriggerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest) + PullRequestFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PullRequestFilter) return object; - var message = new $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.triggerId != null) - message.triggerId = String(object.triggerId); + var message = new $root.google.devtools.cloudbuild.v1.PullRequestFilter(); + if (object.branch != null) + message.branch = String(object.branch); + switch (object.commentControl) { + case "COMMENTS_DISABLED": + case 0: + message.commentControl = 0; + break; + case "COMMENTS_ENABLED": + case 1: + message.commentControl = 1; + break; + case "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY": + case 2: + message.commentControl = 2; + break; + } + if (object.invertRegex != null) + message.invertRegex = Boolean(object.invertRegex); return message; }; /** - * Creates a plain object from a GetBuildTriggerRequest message. Also converts values to other types if specified. + * Creates a plain object from a PullRequestFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @static - * @param {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} message GetBuildTriggerRequest + * @param {google.devtools.cloudbuild.v1.PullRequestFilter} message PullRequestFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBuildTriggerRequest.toObject = function toObject(message, options) { + PullRequestFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.projectId = ""; - object.triggerId = ""; + object.commentControl = options.enums === String ? "COMMENTS_DISABLED" : 0; + object.invertRegex = false; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.triggerId != null && message.hasOwnProperty("triggerId")) - object.triggerId = message.triggerId; + if (message.branch != null && message.hasOwnProperty("branch")) { + object.branch = message.branch; + if (options.oneofs) + object.gitRef = "branch"; + } + if (message.commentControl != null && message.hasOwnProperty("commentControl")) + object.commentControl = options.enums === String ? $root.google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl[message.commentControl] : message.commentControl; + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + object.invertRegex = message.invertRegex; return object; }; /** - * Converts this GetBuildTriggerRequest to JSON. + * Converts this PullRequestFilter to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter * @instance * @returns {Object.} JSON object */ - GetBuildTriggerRequest.prototype.toJSON = function toJSON() { + PullRequestFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetBuildTriggerRequest; + /** + * CommentControl enum. + * @name google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl + * @enum {number} + * @property {number} COMMENTS_DISABLED=0 COMMENTS_DISABLED value + * @property {number} COMMENTS_ENABLED=1 COMMENTS_ENABLED value + * @property {number} COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY=2 COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY value + */ + PullRequestFilter.CommentControl = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMENTS_DISABLED"] = 0; + values[valuesById[1] = "COMMENTS_ENABLED"] = 1; + values[valuesById[2] = "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY"] = 2; + return values; + })(); + + return PullRequestFilter; })(); - v1.ListBuildTriggersRequest = (function() { + v1.PushFilter = (function() { /** - * Properties of a ListBuildTriggersRequest. + * Properties of a PushFilter. * @memberof google.devtools.cloudbuild.v1 - * @interface IListBuildTriggersRequest - * @property {string|null} [projectId] ListBuildTriggersRequest projectId - * @property {number|null} [pageSize] ListBuildTriggersRequest pageSize - * @property {string|null} [pageToken] ListBuildTriggersRequest pageToken + * @interface IPushFilter + * @property {string|null} [branch] PushFilter branch + * @property {string|null} [tag] PushFilter tag + * @property {boolean|null} [invertRegex] PushFilter invertRegex */ /** - * Constructs a new ListBuildTriggersRequest. + * Constructs a new PushFilter. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a ListBuildTriggersRequest. - * @implements IListBuildTriggersRequest + * @classdesc Represents a PushFilter. + * @implements IPushFilter * @constructor - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IPushFilter=} [properties] Properties to set */ - function ListBuildTriggersRequest(properties) { + function PushFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9645,101 +9741,115 @@ } /** - * ListBuildTriggersRequest projectId. - * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * PushFilter branch. + * @member {string} branch + * @memberof google.devtools.cloudbuild.v1.PushFilter * @instance */ - ListBuildTriggersRequest.prototype.projectId = ""; + PushFilter.prototype.branch = ""; /** - * ListBuildTriggersRequest pageSize. - * @member {number} pageSize - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * PushFilter tag. + * @member {string} tag + * @memberof google.devtools.cloudbuild.v1.PushFilter * @instance */ - ListBuildTriggersRequest.prototype.pageSize = 0; + PushFilter.prototype.tag = ""; /** - * ListBuildTriggersRequest pageToken. - * @member {string} pageToken - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * PushFilter invertRegex. + * @member {boolean} invertRegex + * @memberof google.devtools.cloudbuild.v1.PushFilter * @instance */ - ListBuildTriggersRequest.prototype.pageToken = ""; + PushFilter.prototype.invertRegex = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ListBuildTriggersRequest instance using the specified properties. + * PushFilter gitRef. + * @member {"branch"|"tag"|undefined} gitRef + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @instance + */ + Object.defineProperty(PushFilter.prototype, "gitRef", { + get: $util.oneOfGetter($oneOfFields = ["branch", "tag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PushFilter instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest instance + * @param {google.devtools.cloudbuild.v1.IPushFilter=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter instance */ - ListBuildTriggersRequest.create = function create(properties) { - return new ListBuildTriggersRequest(properties); + PushFilter.create = function create(properties) { + return new PushFilter(properties); }; /** - * Encodes the specified ListBuildTriggersRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. + * Encodes the specified PushFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} message ListBuildTriggersRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IPushFilter} message PushFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildTriggersRequest.encode = function encode(message, writer) { + PushFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tag); + if (message.invertRegex != null && Object.hasOwnProperty.call(message, "invertRegex")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.invertRegex); return writer; }; /** - * Encodes the specified ListBuildTriggersRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. + * Encodes the specified PushFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} message ListBuildTriggersRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IPushFilter} message PushFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildTriggersRequest.encodeDelimited = function encodeDelimited(message, writer) { + PushFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBuildTriggersRequest message from the specified reader or buffer. + * Decodes a PushFilter message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildTriggersRequest.decode = function decode(reader, length) { + PushFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PushFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; case 2: - message.pageSize = reader.int32(); + message.branch = reader.string(); break; case 3: - message.pageToken = reader.string(); + message.tag = reader.string(); + break; + case 4: + message.invertRegex = reader.bool(); break; default: reader.skipType(tag & 7); @@ -9750,126 +9860,135 @@ }; /** - * Decodes a ListBuildTriggersRequest message from the specified reader or buffer, length delimited. + * Decodes a PushFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildTriggersRequest.decodeDelimited = function decodeDelimited(reader) { + PushFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBuildTriggersRequest message. + * Verifies a PushFilter message. * @function verify - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBuildTriggersRequest.verify = function verify(message) { + PushFilter.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + var properties = {}; + if (message.branch != null && message.hasOwnProperty("branch")) { + properties.gitRef = 1; + if (!$util.isString(message.branch)) + return "branch: string expected"; + } + if (message.tag != null && message.hasOwnProperty("tag")) { + if (properties.gitRef === 1) + return "gitRef: multiple values"; + properties.gitRef = 1; + if (!$util.isString(message.tag)) + return "tag: string expected"; + } + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + if (typeof message.invertRegex !== "boolean") + return "invertRegex: boolean expected"; return null; }; /** - * Creates a ListBuildTriggersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PushFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter */ - ListBuildTriggersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest) + PushFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PushFilter) return object; - var message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.devtools.cloudbuild.v1.PushFilter(); + if (object.branch != null) + message.branch = String(object.branch); + if (object.tag != null) + message.tag = String(object.tag); + if (object.invertRegex != null) + message.invertRegex = Boolean(object.invertRegex); return message; }; /** - * Creates a plain object from a ListBuildTriggersRequest message. Also converts values to other types if specified. + * Creates a plain object from a PushFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @static - * @param {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} message ListBuildTriggersRequest + * @param {google.devtools.cloudbuild.v1.PushFilter} message PushFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBuildTriggersRequest.toObject = function toObject(message, options) { + PushFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.projectId = ""; - object.pageSize = 0; - object.pageToken = ""; + if (options.defaults) + object.invertRegex = false; + if (message.branch != null && message.hasOwnProperty("branch")) { + object.branch = message.branch; + if (options.oneofs) + object.gitRef = "branch"; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.tag != null && message.hasOwnProperty("tag")) { + object.tag = message.tag; + if (options.oneofs) + object.gitRef = "tag"; + } + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + object.invertRegex = message.invertRegex; return object; }; /** - * Converts this ListBuildTriggersRequest to JSON. + * Converts this PushFilter to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @memberof google.devtools.cloudbuild.v1.PushFilter * @instance * @returns {Object.} JSON object */ - ListBuildTriggersRequest.prototype.toJSON = function toJSON() { + PushFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListBuildTriggersRequest; + return PushFilter; })(); - v1.ListBuildTriggersResponse = (function() { + v1.CreateBuildTriggerRequest = (function() { /** - * Properties of a ListBuildTriggersResponse. + * Properties of a CreateBuildTriggerRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface IListBuildTriggersResponse - * @property {Array.|null} [triggers] ListBuildTriggersResponse triggers - * @property {string|null} [nextPageToken] ListBuildTriggersResponse nextPageToken + * @interface ICreateBuildTriggerRequest + * @property {string|null} [projectId] CreateBuildTriggerRequest projectId + * @property {google.devtools.cloudbuild.v1.IBuildTrigger|null} [trigger] CreateBuildTriggerRequest trigger */ /** - * Constructs a new ListBuildTriggersResponse. + * Constructs a new CreateBuildTriggerRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a ListBuildTriggersResponse. - * @implements IListBuildTriggersResponse + * @classdesc Represents a CreateBuildTriggerRequest. + * @implements ICreateBuildTriggerRequest * @constructor - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest=} [properties] Properties to set */ - function ListBuildTriggersResponse(properties) { - this.triggers = []; + function CreateBuildTriggerRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9877,91 +9996,88 @@ } /** - * ListBuildTriggersResponse triggers. - * @member {Array.} triggers - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * CreateBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @instance */ - ListBuildTriggersResponse.prototype.triggers = $util.emptyArray; + CreateBuildTriggerRequest.prototype.projectId = ""; /** - * ListBuildTriggersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * CreateBuildTriggerRequest trigger. + * @member {google.devtools.cloudbuild.v1.IBuildTrigger|null|undefined} trigger + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @instance */ - ListBuildTriggersResponse.prototype.nextPageToken = ""; + CreateBuildTriggerRequest.prototype.trigger = null; /** - * Creates a new ListBuildTriggersResponse instance using the specified properties. + * Creates a new CreateBuildTriggerRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse instance + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest instance */ - ListBuildTriggersResponse.create = function create(properties) { - return new ListBuildTriggersResponse(properties); + CreateBuildTriggerRequest.create = function create(properties) { + return new CreateBuildTriggerRequest(properties); }; /** - * Encodes the specified ListBuildTriggersResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * Encodes the specified CreateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse} message ListBuildTriggersResponse message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} message CreateBuildTriggerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildTriggersResponse.encode = function encode(message, writer) { + CreateBuildTriggerRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.triggers != null && message.triggers.length) - for (var i = 0; i < message.triggers.length; ++i) - $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.triggers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) + $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.trigger, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListBuildTriggersResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * Encodes the specified CreateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse} message ListBuildTriggersResponse message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} message CreateBuildTriggerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBuildTriggersResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBuildTriggersResponse message from the specified reader or buffer. + * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildTriggersResponse.decode = function decode(reader, length) { + CreateBuildTriggerRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.triggers && message.triggers.length)) - message.triggers = []; - message.triggers.push($root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32())); + message.projectId = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9972,134 +10088,122 @@ }; /** - * Decodes a ListBuildTriggersResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBuildTriggersResponse.decodeDelimited = function decodeDelimited(reader) { + CreateBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBuildTriggersResponse message. + * Verifies a CreateBuildTriggerRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBuildTriggersResponse.verify = function verify(message) { + CreateBuildTriggerRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.triggers != null && message.hasOwnProperty("triggers")) { - if (!Array.isArray(message.triggers)) - return "triggers: array expected"; - for (var i = 0; i < message.triggers.length; ++i) { - var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.triggers[i]); - if (error) - return "triggers." + error; - } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.trigger != null && message.hasOwnProperty("trigger")) { + var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.trigger); + if (error) + return "trigger." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListBuildTriggersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest */ - ListBuildTriggersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse) + CreateBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse(); - if (object.triggers) { - if (!Array.isArray(object.triggers)) - throw TypeError(".google.devtools.cloudbuild.v1.ListBuildTriggersResponse.triggers: array expected"); - message.triggers = []; - for (var i = 0; i < object.triggers.length; ++i) { - if (typeof object.triggers[i] !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.ListBuildTriggersResponse.triggers: object expected"); - message.triggers[i] = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.triggers[i]); - } + var message = new $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.trigger != null) { + if (typeof object.trigger !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.trigger: object expected"); + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.trigger); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListBuildTriggersResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateBuildTriggerRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} message ListBuildTriggersResponse + * @param {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} message CreateBuildTriggerRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBuildTriggersResponse.toObject = function toObject(message, options) { + CreateBuildTriggerRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.triggers = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.triggers && message.triggers.length) { - object.triggers = []; - for (var j = 0; j < message.triggers.length; ++j) - object.triggers[j] = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.triggers[j], options); + if (options.defaults) { + object.projectId = ""; + object.trigger = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.trigger, options); return object; }; /** - * Converts this ListBuildTriggersResponse to JSON. + * Converts this CreateBuildTriggerRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest * @instance * @returns {Object.} JSON object */ - ListBuildTriggersResponse.prototype.toJSON = function toJSON() { + CreateBuildTriggerRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListBuildTriggersResponse; + return CreateBuildTriggerRequest; })(); - v1.DeleteBuildTriggerRequest = (function() { + v1.GetBuildTriggerRequest = (function() { /** - * Properties of a DeleteBuildTriggerRequest. + * Properties of a GetBuildTriggerRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface IDeleteBuildTriggerRequest - * @property {string|null} [projectId] DeleteBuildTriggerRequest projectId - * @property {string|null} [triggerId] DeleteBuildTriggerRequest triggerId + * @interface IGetBuildTriggerRequest + * @property {string|null} [projectId] GetBuildTriggerRequest projectId + * @property {string|null} [triggerId] GetBuildTriggerRequest triggerId */ /** - * Constructs a new DeleteBuildTriggerRequest. + * Constructs a new GetBuildTriggerRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a DeleteBuildTriggerRequest. - * @implements IDeleteBuildTriggerRequest + * @classdesc Represents a GetBuildTriggerRequest. + * @implements IGetBuildTriggerRequest * @constructor - * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest=} [properties] Properties to set */ - function DeleteBuildTriggerRequest(properties) { + function GetBuildTriggerRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10107,43 +10211,43 @@ } /** - * DeleteBuildTriggerRequest projectId. + * GetBuildTriggerRequest projectId. * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @instance */ - DeleteBuildTriggerRequest.prototype.projectId = ""; + GetBuildTriggerRequest.prototype.projectId = ""; /** - * DeleteBuildTriggerRequest triggerId. + * GetBuildTriggerRequest triggerId. * @member {string} triggerId - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @instance */ - DeleteBuildTriggerRequest.prototype.triggerId = ""; + GetBuildTriggerRequest.prototype.triggerId = ""; /** - * Creates a new DeleteBuildTriggerRequest instance using the specified properties. + * Creates a new GetBuildTriggerRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest instance + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest instance */ - DeleteBuildTriggerRequest.create = function create(properties) { - return new DeleteBuildTriggerRequest(properties); + GetBuildTriggerRequest.create = function create(properties) { + return new GetBuildTriggerRequest(properties); }; /** - * Encodes the specified DeleteBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. + * Encodes the specified GetBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} message DeleteBuildTriggerRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} message GetBuildTriggerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBuildTriggerRequest.encode = function encode(message, writer) { + GetBuildTriggerRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -10154,33 +10258,33 @@ }; /** - * Encodes the specified DeleteBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. + * Encodes the specified GetBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} message DeleteBuildTriggerRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} message GetBuildTriggerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer. + * Decodes a GetBuildTriggerRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBuildTriggerRequest.decode = function decode(reader, length) { + GetBuildTriggerRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -10199,30 +10303,30 @@ }; /** - * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBuildTriggerRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + GetBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteBuildTriggerRequest message. + * Verifies a GetBuildTriggerRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteBuildTriggerRequest.verify = function verify(message) { + GetBuildTriggerRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.projectId != null && message.hasOwnProperty("projectId")) @@ -10235,17 +10339,17 @@ }; /** - * Creates a DeleteBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest */ - DeleteBuildTriggerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest) + GetBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest(); + var message = new $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest(); if (object.projectId != null) message.projectId = String(object.projectId); if (object.triggerId != null) @@ -10254,15 +10358,15 @@ }; /** - * Creates a plain object from a DeleteBuildTriggerRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetBuildTriggerRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} message DeleteBuildTriggerRequest + * @param {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} message GetBuildTriggerRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteBuildTriggerRequest.toObject = function toObject(message, options) { + GetBuildTriggerRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -10278,39 +10382,39 @@ }; /** - * Converts this DeleteBuildTriggerRequest to JSON. + * Converts this GetBuildTriggerRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest * @instance * @returns {Object.} JSON object */ - DeleteBuildTriggerRequest.prototype.toJSON = function toJSON() { + GetBuildTriggerRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteBuildTriggerRequest; + return GetBuildTriggerRequest; })(); - v1.UpdateBuildTriggerRequest = (function() { + v1.ListBuildTriggersRequest = (function() { /** - * Properties of an UpdateBuildTriggerRequest. + * Properties of a ListBuildTriggersRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface IUpdateBuildTriggerRequest - * @property {string|null} [projectId] UpdateBuildTriggerRequest projectId - * @property {string|null} [triggerId] UpdateBuildTriggerRequest triggerId - * @property {google.devtools.cloudbuild.v1.IBuildTrigger|null} [trigger] UpdateBuildTriggerRequest trigger + * @interface IListBuildTriggersRequest + * @property {string|null} [projectId] ListBuildTriggersRequest projectId + * @property {number|null} [pageSize] ListBuildTriggersRequest pageSize + * @property {string|null} [pageToken] ListBuildTriggersRequest pageToken */ /** - * Constructs a new UpdateBuildTriggerRequest. + * Constructs a new ListBuildTriggersRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents an UpdateBuildTriggerRequest. - * @implements IUpdateBuildTriggerRequest + * @classdesc Represents a ListBuildTriggersRequest. + * @implements IListBuildTriggersRequest * @constructor - * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest=} [properties] Properties to set */ - function UpdateBuildTriggerRequest(properties) { + function ListBuildTriggersRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10318,90 +10422,90 @@ } /** - * UpdateBuildTriggerRequest projectId. + * ListBuildTriggersRequest projectId. * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @instance */ - UpdateBuildTriggerRequest.prototype.projectId = ""; + ListBuildTriggersRequest.prototype.projectId = ""; /** - * UpdateBuildTriggerRequest triggerId. - * @member {string} triggerId - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * ListBuildTriggersRequest pageSize. + * @member {number} pageSize + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @instance */ - UpdateBuildTriggerRequest.prototype.triggerId = ""; + ListBuildTriggersRequest.prototype.pageSize = 0; /** - * UpdateBuildTriggerRequest trigger. - * @member {google.devtools.cloudbuild.v1.IBuildTrigger|null|undefined} trigger - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * ListBuildTriggersRequest pageToken. + * @member {string} pageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @instance */ - UpdateBuildTriggerRequest.prototype.trigger = null; + ListBuildTriggersRequest.prototype.pageToken = ""; /** - * Creates a new UpdateBuildTriggerRequest instance using the specified properties. + * Creates a new ListBuildTriggersRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static - * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest instance + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest instance */ - UpdateBuildTriggerRequest.create = function create(properties) { - return new UpdateBuildTriggerRequest(properties); + ListBuildTriggersRequest.create = function create(properties) { + return new ListBuildTriggersRequest(properties); }; /** - * Encodes the specified UpdateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * Encodes the specified ListBuildTriggersRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static - * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} message UpdateBuildTriggerRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} message ListBuildTriggersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBuildTriggerRequest.encode = function encode(message, writer) { + ListBuildTriggersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); - if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) - $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.trigger, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified UpdateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * Encodes the specified ListBuildTriggersRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static - * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} message UpdateBuildTriggerRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} message ListBuildTriggersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListBuildTriggersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer. + * Decodes a ListBuildTriggersRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBuildTriggerRequest.decode = function decode(reader, length) { + ListBuildTriggersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -10409,10 +10513,10 @@ message.projectId = reader.string(); break; case 2: - message.triggerId = reader.string(); + message.pageSize = reader.int32(); break; case 3: - message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -10423,144 +10527,126 @@ }; /** - * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer, length delimited. + * Decodes a ListBuildTriggersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + ListBuildTriggersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateBuildTriggerRequest message. + * Verifies a ListBuildTriggersRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateBuildTriggerRequest.verify = function verify(message) { + ListBuildTriggersRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.projectId != null && message.hasOwnProperty("projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.triggerId != null && message.hasOwnProperty("triggerId")) - if (!$util.isString(message.triggerId)) - return "triggerId: string expected"; - if (message.trigger != null && message.hasOwnProperty("trigger")) { - var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.trigger); - if (error) - return "trigger." + error; - } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an UpdateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListBuildTriggersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest */ - UpdateBuildTriggerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest) + ListBuildTriggersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest(); + var message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest(); if (object.projectId != null) message.projectId = String(object.projectId); - if (object.triggerId != null) - message.triggerId = String(object.triggerId); - if (object.trigger != null) { - if (typeof object.trigger !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.trigger: object expected"); - message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.trigger); - } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from an UpdateBuildTriggerRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListBuildTriggersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @static - * @param {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} message UpdateBuildTriggerRequest + * @param {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} message ListBuildTriggersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBuildTriggerRequest.toObject = function toObject(message, options) { + ListBuildTriggersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.projectId = ""; - object.triggerId = ""; - object.trigger = null; + object.pageSize = 0; + object.pageToken = ""; } if (message.projectId != null && message.hasOwnProperty("projectId")) object.projectId = message.projectId; - if (message.triggerId != null && message.hasOwnProperty("triggerId")) - object.triggerId = message.triggerId; - if (message.trigger != null && message.hasOwnProperty("trigger")) - object.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.trigger, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this UpdateBuildTriggerRequest to JSON. + * Converts this ListBuildTriggersRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest * @instance * @returns {Object.} JSON object */ - UpdateBuildTriggerRequest.prototype.toJSON = function toJSON() { + ListBuildTriggersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateBuildTriggerRequest; + return ListBuildTriggersRequest; })(); - v1.BuildOptions = (function() { + v1.ListBuildTriggersResponse = (function() { /** - * Properties of a BuildOptions. + * Properties of a ListBuildTriggersResponse. * @memberof google.devtools.cloudbuild.v1 - * @interface IBuildOptions - * @property {Array.|null} [sourceProvenanceHash] BuildOptions sourceProvenanceHash - * @property {google.devtools.cloudbuild.v1.BuildOptions.VerifyOption|null} [requestedVerifyOption] BuildOptions requestedVerifyOption - * @property {google.devtools.cloudbuild.v1.BuildOptions.MachineType|null} [machineType] BuildOptions machineType - * @property {number|Long|null} [diskSizeGb] BuildOptions diskSizeGb - * @property {google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|null} [substitutionOption] BuildOptions substitutionOption - * @property {boolean|null} [dynamicSubstitutions] BuildOptions dynamicSubstitutions - * @property {google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|null} [logStreamingOption] BuildOptions logStreamingOption - * @property {string|null} [workerPool] BuildOptions workerPool - * @property {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|null} [logging] BuildOptions logging - * @property {Array.|null} [env] BuildOptions env - * @property {Array.|null} [secretEnv] BuildOptions secretEnv - * @property {Array.|null} [volumes] BuildOptions volumes + * @interface IListBuildTriggersResponse + * @property {Array.|null} [triggers] ListBuildTriggersResponse triggers + * @property {string|null} [nextPageToken] ListBuildTriggersResponse nextPageToken */ /** - * Constructs a new BuildOptions. + * Constructs a new ListBuildTriggersResponse. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a BuildOptions. - * @implements IBuildOptions + * @classdesc Represents a ListBuildTriggersResponse. + * @implements IListBuildTriggersResponse * @constructor - * @param {google.devtools.cloudbuild.v1.IBuildOptions=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse=} [properties] Properties to set */ - function BuildOptions(properties) { - this.sourceProvenanceHash = []; - this.env = []; - this.secretEnv = []; - this.volumes = []; + function ListBuildTriggersResponse(properties) { + this.triggers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10568,238 +10654,318 @@ } /** - * BuildOptions sourceProvenanceHash. - * @member {Array.} sourceProvenanceHash - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * ListBuildTriggersResponse triggers. + * @member {Array.} triggers + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse * @instance */ - BuildOptions.prototype.sourceProvenanceHash = $util.emptyArray; + ListBuildTriggersResponse.prototype.triggers = $util.emptyArray; /** - * BuildOptions requestedVerifyOption. - * @member {google.devtools.cloudbuild.v1.BuildOptions.VerifyOption} requestedVerifyOption - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * ListBuildTriggersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse * @instance */ - BuildOptions.prototype.requestedVerifyOption = 0; + ListBuildTriggersResponse.prototype.nextPageToken = ""; /** - * BuildOptions machineType. - * @member {google.devtools.cloudbuild.v1.BuildOptions.MachineType} machineType - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance + * Creates a new ListBuildTriggersResponse instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse instance */ - BuildOptions.prototype.machineType = 0; + ListBuildTriggersResponse.create = function create(properties) { + return new ListBuildTriggersResponse(properties); + }; /** - * BuildOptions diskSizeGb. - * @member {number|Long} diskSizeGb - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance + * Encodes the specified ListBuildTriggersResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse} message ListBuildTriggersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - BuildOptions.prototype.diskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListBuildTriggersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.triggers != null && message.triggers.length) + for (var i = 0; i < message.triggers.length; ++i) + $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.triggers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * BuildOptions substitutionOption. - * @member {google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption} substitutionOption - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance + * Encodes the specified ListBuildTriggersResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse} message ListBuildTriggersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - BuildOptions.prototype.substitutionOption = 0; + ListBuildTriggersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * BuildOptions dynamicSubstitutions. - * @member {boolean} dynamicSubstitutions - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance + * Decodes a ListBuildTriggersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildOptions.prototype.dynamicSubstitutions = false; + ListBuildTriggersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.triggers && message.triggers.length)) + message.triggers = []; + message.triggers.push($root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * BuildOptions logStreamingOption. - * @member {google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption} logStreamingOption - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance + * Decodes a ListBuildTriggersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildOptions.prototype.logStreamingOption = 0; + ListBuildTriggersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * BuildOptions workerPool. - * @member {string} workerPool - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance + * Verifies a ListBuildTriggersResponse message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildOptions.prototype.workerPool = ""; - - /** - * BuildOptions logging. - * @member {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode} logging - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance + ListBuildTriggersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.triggers != null && message.hasOwnProperty("triggers")) { + if (!Array.isArray(message.triggers)) + return "triggers: array expected"; + for (var i = 0; i < message.triggers.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.triggers[i]); + if (error) + return "triggers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBuildTriggersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse */ - BuildOptions.prototype.logging = 0; + ListBuildTriggersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse(); + if (object.triggers) { + if (!Array.isArray(object.triggers)) + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildTriggersResponse.triggers: array expected"); + message.triggers = []; + for (var i = 0; i < object.triggers.length; ++i) { + if (typeof object.triggers[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildTriggersResponse.triggers: object expected"); + message.triggers[i] = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.triggers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; /** - * BuildOptions env. - * @member {Array.} env - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * Creates a plain object from a ListBuildTriggersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} message ListBuildTriggersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBuildTriggersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.triggers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.triggers && message.triggers.length) { + object.triggers = []; + for (var j = 0; j < message.triggers.length; ++j) + object.triggers[j] = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.triggers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBuildTriggersResponse to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse * @instance + * @returns {Object.} JSON object */ - BuildOptions.prototype.env = $util.emptyArray; + ListBuildTriggersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBuildTriggersResponse; + })(); + + v1.DeleteBuildTriggerRequest = (function() { /** - * BuildOptions secretEnv. - * @member {Array.} secretEnv - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * Properties of a DeleteBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IDeleteBuildTriggerRequest + * @property {string|null} [projectId] DeleteBuildTriggerRequest projectId + * @property {string|null} [triggerId] DeleteBuildTriggerRequest triggerId + */ + + /** + * Constructs a new DeleteBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a DeleteBuildTriggerRequest. + * @implements IDeleteBuildTriggerRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest=} [properties] Properties to set + */ + function DeleteBuildTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @instance */ - BuildOptions.prototype.secretEnv = $util.emptyArray; + DeleteBuildTriggerRequest.prototype.projectId = ""; /** - * BuildOptions volumes. - * @member {Array.} volumes - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * DeleteBuildTriggerRequest triggerId. + * @member {string} triggerId + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @instance */ - BuildOptions.prototype.volumes = $util.emptyArray; + DeleteBuildTriggerRequest.prototype.triggerId = ""; /** - * Creates a new BuildOptions instance using the specified properties. + * Creates a new DeleteBuildTriggerRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IBuildOptions=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions instance + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest instance */ - BuildOptions.create = function create(properties) { - return new BuildOptions(properties); + DeleteBuildTriggerRequest.create = function create(properties) { + return new DeleteBuildTriggerRequest(properties); }; /** - * Encodes the specified BuildOptions message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * Encodes the specified DeleteBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IBuildOptions} message BuildOptions message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} message DeleteBuildTriggerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildOptions.encode = function encode(message, writer) { + DeleteBuildTriggerRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceProvenanceHash != null && message.sourceProvenanceHash.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.sourceProvenanceHash.length; ++i) - writer.int32(message.sourceProvenanceHash[i]); - writer.ldelim(); - } - if (message.requestedVerifyOption != null && Object.hasOwnProperty.call(message, "requestedVerifyOption")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestedVerifyOption); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.machineType); - if (message.substitutionOption != null && Object.hasOwnProperty.call(message, "substitutionOption")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.substitutionOption); - if (message.logStreamingOption != null && Object.hasOwnProperty.call(message, "logStreamingOption")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.logStreamingOption); - if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.diskSizeGb); - if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); - if (message.logging != null && Object.hasOwnProperty.call(message, "logging")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.logging); - if (message.env != null && message.env.length) - for (var i = 0; i < message.env.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.env[i]); - if (message.secretEnv != null && message.secretEnv.length) - for (var i = 0; i < message.secretEnv.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.secretEnv[i]); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.devtools.cloudbuild.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.dynamicSubstitutions != null && Object.hasOwnProperty.call(message, "dynamicSubstitutions")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.dynamicSubstitutions); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); return writer; }; /** - * Encodes the specified BuildOptions message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * Encodes the specified DeleteBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.IBuildOptions} message BuildOptions message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} message DeleteBuildTriggerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildOptions.encodeDelimited = function encodeDelimited(message, writer) { + DeleteBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BuildOptions message from the specified reader or buffer. + * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildOptions.decode = function decode(reader, length) { + DeleteBuildTriggerRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.sourceProvenanceHash && message.sourceProvenanceHash.length)) - message.sourceProvenanceHash = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.sourceProvenanceHash.push(reader.int32()); - } else - message.sourceProvenanceHash.push(reader.int32()); + message.projectId = reader.string(); break; case 2: - message.requestedVerifyOption = reader.int32(); - break; - case 3: - message.machineType = reader.int32(); - break; - case 6: - message.diskSizeGb = reader.int64(); - break; - case 4: - message.substitutionOption = reader.int32(); - break; - case 17: - message.dynamicSubstitutions = reader.bool(); - break; - case 5: - message.logStreamingOption = reader.int32(); - break; - case 7: - message.workerPool = reader.string(); - break; - case 11: - message.logging = reader.int32(); - break; - case 12: - if (!(message.env && message.env.length)) - message.env = []; - message.env.push(reader.string()); - break; - case 13: - if (!(message.secretEnv && message.secretEnv.length)) - message.secretEnv = []; - message.secretEnv.push(reader.string()); - break; - case 14: - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.devtools.cloudbuild.v1.Volume.decode(reader, reader.uint32())); + message.triggerId = reader.string(); break; default: reader.skipType(tag & 7); @@ -10810,442 +10976,1486 @@ }; /** - * Decodes a BuildOptions message from the specified reader or buffer, length delimited. + * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildOptions.decodeDelimited = function decodeDelimited(reader) { + DeleteBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BuildOptions message. + * Verifies a DeleteBuildTriggerRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildOptions.verify = function verify(message) { + DeleteBuildTriggerRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sourceProvenanceHash != null && message.hasOwnProperty("sourceProvenanceHash")) { - if (!Array.isArray(message.sourceProvenanceHash)) - return "sourceProvenanceHash: array expected"; - for (var i = 0; i < message.sourceProvenanceHash.length; ++i) - switch (message.sourceProvenanceHash[i]) { - default: - return "sourceProvenanceHash: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.requestedVerifyOption != null && message.hasOwnProperty("requestedVerifyOption")) - switch (message.requestedVerifyOption) { - default: - return "requestedVerifyOption: enum value expected"; - case 0: - case 1: - break; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - switch (message.machineType) { - default: - return "machineType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) - return "diskSizeGb: integer|Long expected"; - if (message.substitutionOption != null && message.hasOwnProperty("substitutionOption")) - switch (message.substitutionOption) { - default: - return "substitutionOption: enum value expected"; - case 0: - case 1: - break; - } - if (message.dynamicSubstitutions != null && message.hasOwnProperty("dynamicSubstitutions")) - if (typeof message.dynamicSubstitutions !== "boolean") - return "dynamicSubstitutions: boolean expected"; - if (message.logStreamingOption != null && message.hasOwnProperty("logStreamingOption")) - switch (message.logStreamingOption) { - default: - return "logStreamingOption: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - if (!$util.isString(message.workerPool)) - return "workerPool: string expected"; - if (message.logging != null && message.hasOwnProperty("logging")) - switch (message.logging) { - default: - return "logging: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 5: - case 4: - break; - } - if (message.env != null && message.hasOwnProperty("env")) { - if (!Array.isArray(message.env)) - return "env: array expected"; - for (var i = 0; i < message.env.length; ++i) - if (!$util.isString(message.env[i])) - return "env: string[] expected"; - } - if (message.secretEnv != null && message.hasOwnProperty("secretEnv")) { - if (!Array.isArray(message.secretEnv)) - return "secretEnv: array expected"; - for (var i = 0; i < message.secretEnv.length; ++i) - if (!$util.isString(message.secretEnv[i])) - return "secretEnv: string[] expected"; - } - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) { - var error = $root.google.devtools.cloudbuild.v1.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; return null; }; /** - * Creates a BuildOptions message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest */ - BuildOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.BuildOptions) + DeleteBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.BuildOptions(); - if (object.sourceProvenanceHash) { - if (!Array.isArray(object.sourceProvenanceHash)) - throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.sourceProvenanceHash: array expected"); - message.sourceProvenanceHash = []; - for (var i = 0; i < object.sourceProvenanceHash.length; ++i) - switch (object.sourceProvenanceHash[i]) { - default: - case "NONE": - case 0: - message.sourceProvenanceHash[i] = 0; - break; - case "SHA256": - case 1: - message.sourceProvenanceHash[i] = 1; - break; - case "MD5": - case 2: - message.sourceProvenanceHash[i] = 2; - break; - } - } - switch (object.requestedVerifyOption) { - case "NOT_VERIFIED": - case 0: - message.requestedVerifyOption = 0; - break; - case "VERIFIED": - case 1: - message.requestedVerifyOption = 1; - break; - } - switch (object.machineType) { - case "UNSPECIFIED": - case 0: - message.machineType = 0; - break; - case "N1_HIGHCPU_8": - case 1: - message.machineType = 1; - break; - case "N1_HIGHCPU_32": - case 2: - message.machineType = 2; - break; - } - if (object.diskSizeGb != null) - if ($util.Long) - (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; - else if (typeof object.diskSizeGb === "string") - message.diskSizeGb = parseInt(object.diskSizeGb, 10); - else if (typeof object.diskSizeGb === "number") - message.diskSizeGb = object.diskSizeGb; - else if (typeof object.diskSizeGb === "object") - message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); - switch (object.substitutionOption) { - case "MUST_MATCH": - case 0: - message.substitutionOption = 0; - break; - case "ALLOW_LOOSE": - case 1: - message.substitutionOption = 1; - break; - } - if (object.dynamicSubstitutions != null) - message.dynamicSubstitutions = Boolean(object.dynamicSubstitutions); - switch (object.logStreamingOption) { - case "STREAM_DEFAULT": - case 0: - message.logStreamingOption = 0; - break; - case "STREAM_ON": - case 1: - message.logStreamingOption = 1; - break; - case "STREAM_OFF": - case 2: - message.logStreamingOption = 2; - break; - } - if (object.workerPool != null) - message.workerPool = String(object.workerPool); - switch (object.logging) { - case "LOGGING_UNSPECIFIED": - case 0: - message.logging = 0; - break; - case "LEGACY": - case 1: - message.logging = 1; - break; - case "GCS_ONLY": - case 2: - message.logging = 2; - break; - case "STACKDRIVER_ONLY": - case 3: - message.logging = 3; - break; - case "CLOUD_LOGGING_ONLY": - case 5: - message.logging = 5; - break; - case "NONE": - case 4: - message.logging = 4; - break; - } - if (object.env) { - if (!Array.isArray(object.env)) - throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.env: array expected"); - message.env = []; - for (var i = 0; i < object.env.length; ++i) - message.env[i] = String(object.env[i]); - } - if (object.secretEnv) { - if (!Array.isArray(object.secretEnv)) - throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.secretEnv: array expected"); - message.secretEnv = []; - for (var i = 0; i < object.secretEnv.length; ++i) - message.secretEnv[i] = String(object.secretEnv[i]); - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.volumes: object expected"); - message.volumes[i] = $root.google.devtools.cloudbuild.v1.Volume.fromObject(object.volumes[i]); - } - } + var message = new $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.triggerId != null) + message.triggerId = String(object.triggerId); return message; }; /** - * Creates a plain object from a BuildOptions message. Also converts values to other types if specified. + * Creates a plain object from a DeleteBuildTriggerRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest * @static - * @param {google.devtools.cloudbuild.v1.BuildOptions} message BuildOptions + * @param {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} message DeleteBuildTriggerRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BuildOptions.toObject = function toObject(message, options) { + DeleteBuildTriggerRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.sourceProvenanceHash = []; - object.env = []; - object.secretEnv = []; - object.volumes = []; - } if (options.defaults) { - object.requestedVerifyOption = options.enums === String ? "NOT_VERIFIED" : 0; - object.machineType = options.enums === String ? "UNSPECIFIED" : 0; - object.substitutionOption = options.enums === String ? "MUST_MATCH" : 0; - object.logStreamingOption = options.enums === String ? "STREAM_DEFAULT" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.diskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.diskSizeGb = options.longs === String ? "0" : 0; - object.workerPool = ""; - object.logging = options.enums === String ? "LOGGING_UNSPECIFIED" : 0; - object.dynamicSubstitutions = false; - } - if (message.sourceProvenanceHash && message.sourceProvenanceHash.length) { - object.sourceProvenanceHash = []; - for (var j = 0; j < message.sourceProvenanceHash.length; ++j) - object.sourceProvenanceHash[j] = options.enums === String ? $root.google.devtools.cloudbuild.v1.Hash.HashType[message.sourceProvenanceHash[j]] : message.sourceProvenanceHash[j]; - } - if (message.requestedVerifyOption != null && message.hasOwnProperty("requestedVerifyOption")) - object.requestedVerifyOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.VerifyOption[message.requestedVerifyOption] : message.requestedVerifyOption; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.MachineType[message.machineType] : message.machineType; - if (message.substitutionOption != null && message.hasOwnProperty("substitutionOption")) - object.substitutionOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption[message.substitutionOption] : message.substitutionOption; - if (message.logStreamingOption != null && message.hasOwnProperty("logStreamingOption")) - object.logStreamingOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption[message.logStreamingOption] : message.logStreamingOption; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - if (typeof message.diskSizeGb === "number") - object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; - else - object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = message.workerPool; - if (message.logging != null && message.hasOwnProperty("logging")) - object.logging = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.LoggingMode[message.logging] : message.logging; - if (message.env && message.env.length) { - object.env = []; - for (var j = 0; j < message.env.length; ++j) - object.env[j] = message.env[j]; + object.projectId = ""; + object.triggerId = ""; } - if (message.secretEnv && message.secretEnv.length) { - object.secretEnv = []; - for (var j = 0; j < message.secretEnv.length; ++j) - object.secretEnv[j] = message.secretEnv[j]; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + return object; + }; + + /** + * Converts this DeleteBuildTriggerRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBuildTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteBuildTriggerRequest; + })(); + + v1.UpdateBuildTriggerRequest = (function() { + + /** + * Properties of an UpdateBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IUpdateBuildTriggerRequest + * @property {string|null} [projectId] UpdateBuildTriggerRequest projectId + * @property {string|null} [triggerId] UpdateBuildTriggerRequest triggerId + * @property {google.devtools.cloudbuild.v1.IBuildTrigger|null} [trigger] UpdateBuildTriggerRequest trigger + */ + + /** + * Constructs a new UpdateBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an UpdateBuildTriggerRequest. + * @implements IUpdateBuildTriggerRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest=} [properties] Properties to set + */ + function UpdateBuildTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + */ + UpdateBuildTriggerRequest.prototype.projectId = ""; + + /** + * UpdateBuildTriggerRequest triggerId. + * @member {string} triggerId + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + */ + UpdateBuildTriggerRequest.prototype.triggerId = ""; + + /** + * UpdateBuildTriggerRequest trigger. + * @member {google.devtools.cloudbuild.v1.IBuildTrigger|null|undefined} trigger + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + */ + UpdateBuildTriggerRequest.prototype.trigger = null; + + /** + * Creates a new UpdateBuildTriggerRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest instance + */ + UpdateBuildTriggerRequest.create = function create(properties) { + return new UpdateBuildTriggerRequest(properties); + }; + + /** + * Encodes the specified UpdateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} message UpdateBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBuildTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); + if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) + $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.trigger, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} message UpdateBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBuildTriggerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.triggerId = reader.string(); + break; + case 3: + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.devtools.cloudbuild.v1.Volume.toObject(message.volumes[j], options); + return message; + }; + + /** + * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBuildTriggerRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBuildTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; + if (message.trigger != null && message.hasOwnProperty("trigger")) { + var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.trigger); + if (error) + return "trigger." + error; } - if (message.dynamicSubstitutions != null && message.hasOwnProperty("dynamicSubstitutions")) - object.dynamicSubstitutions = message.dynamicSubstitutions; - return object; + return null; + }; + + /** + * Creates an UpdateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + */ + UpdateBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.triggerId != null) + message.triggerId = String(object.triggerId); + if (object.trigger != null) { + if (typeof object.trigger !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.trigger: object expected"); + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.trigger); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBuildTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} message UpdateBuildTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBuildTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.triggerId = ""; + object.trigger = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.trigger, options); + return object; + }; + + /** + * Converts this UpdateBuildTriggerRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBuildTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateBuildTriggerRequest; + })(); + + v1.BuildOptions = (function() { + + /** + * Properties of a BuildOptions. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuildOptions + * @property {Array.|null} [sourceProvenanceHash] BuildOptions sourceProvenanceHash + * @property {google.devtools.cloudbuild.v1.BuildOptions.VerifyOption|null} [requestedVerifyOption] BuildOptions requestedVerifyOption + * @property {google.devtools.cloudbuild.v1.BuildOptions.MachineType|null} [machineType] BuildOptions machineType + * @property {number|Long|null} [diskSizeGb] BuildOptions diskSizeGb + * @property {google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|null} [substitutionOption] BuildOptions substitutionOption + * @property {boolean|null} [dynamicSubstitutions] BuildOptions dynamicSubstitutions + * @property {google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|null} [logStreamingOption] BuildOptions logStreamingOption + * @property {string|null} [workerPool] BuildOptions workerPool + * @property {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|null} [logging] BuildOptions logging + * @property {Array.|null} [env] BuildOptions env + * @property {Array.|null} [secretEnv] BuildOptions secretEnv + * @property {Array.|null} [volumes] BuildOptions volumes + */ + + /** + * Constructs a new BuildOptions. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a BuildOptions. + * @implements IBuildOptions + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuildOptions=} [properties] Properties to set + */ + function BuildOptions(properties) { + this.sourceProvenanceHash = []; + this.env = []; + this.secretEnv = []; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildOptions sourceProvenanceHash. + * @member {Array.} sourceProvenanceHash + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.sourceProvenanceHash = $util.emptyArray; + + /** + * BuildOptions requestedVerifyOption. + * @member {google.devtools.cloudbuild.v1.BuildOptions.VerifyOption} requestedVerifyOption + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.requestedVerifyOption = 0; + + /** + * BuildOptions machineType. + * @member {google.devtools.cloudbuild.v1.BuildOptions.MachineType} machineType + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.machineType = 0; + + /** + * BuildOptions diskSizeGb. + * @member {number|Long} diskSizeGb + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.diskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BuildOptions substitutionOption. + * @member {google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption} substitutionOption + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.substitutionOption = 0; + + /** + * BuildOptions dynamicSubstitutions. + * @member {boolean} dynamicSubstitutions + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.dynamicSubstitutions = false; + + /** + * BuildOptions logStreamingOption. + * @member {google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption} logStreamingOption + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.logStreamingOption = 0; + + /** + * BuildOptions workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.workerPool = ""; + + /** + * BuildOptions logging. + * @member {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode} logging + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.logging = 0; + + /** + * BuildOptions env. + * @member {Array.} env + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.env = $util.emptyArray; + + /** + * BuildOptions secretEnv. + * @member {Array.} secretEnv + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.secretEnv = $util.emptyArray; + + /** + * BuildOptions volumes. + * @member {Array.} volumes + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.volumes = $util.emptyArray; + + /** + * Creates a new BuildOptions instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOptions=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions instance + */ + BuildOptions.create = function create(properties) { + return new BuildOptions(properties); + }; + + /** + * Encodes the specified BuildOptions message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOptions} message BuildOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceProvenanceHash != null && message.sourceProvenanceHash.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.sourceProvenanceHash.length; ++i) + writer.int32(message.sourceProvenanceHash[i]); + writer.ldelim(); + } + if (message.requestedVerifyOption != null && Object.hasOwnProperty.call(message, "requestedVerifyOption")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestedVerifyOption); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.machineType); + if (message.substitutionOption != null && Object.hasOwnProperty.call(message, "substitutionOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.substitutionOption); + if (message.logStreamingOption != null && Object.hasOwnProperty.call(message, "logStreamingOption")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.logStreamingOption); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.diskSizeGb); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); + if (message.logging != null && Object.hasOwnProperty.call(message, "logging")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.logging); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.env[i]); + if (message.secretEnv != null && message.secretEnv.length) + for (var i = 0; i < message.secretEnv.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.secretEnv[i]); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.devtools.cloudbuild.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dynamicSubstitutions != null && Object.hasOwnProperty.call(message, "dynamicSubstitutions")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.dynamicSubstitutions); + return writer; + }; + + /** + * Encodes the specified BuildOptions message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOptions} message BuildOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildOptions message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sourceProvenanceHash && message.sourceProvenanceHash.length)) + message.sourceProvenanceHash = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sourceProvenanceHash.push(reader.int32()); + } else + message.sourceProvenanceHash.push(reader.int32()); + break; + case 2: + message.requestedVerifyOption = reader.int32(); + break; + case 3: + message.machineType = reader.int32(); + break; + case 6: + message.diskSizeGb = reader.int64(); + break; + case 4: + message.substitutionOption = reader.int32(); + break; + case 17: + message.dynamicSubstitutions = reader.bool(); + break; + case 5: + message.logStreamingOption = reader.int32(); + break; + case 7: + message.workerPool = reader.string(); + break; + case 11: + message.logging = reader.int32(); + break; + case 12: + if (!(message.env && message.env.length)) + message.env = []; + message.env.push(reader.string()); + break; + case 13: + if (!(message.secretEnv && message.secretEnv.length)) + message.secretEnv = []; + message.secretEnv.push(reader.string()); + break; + case 14: + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.devtools.cloudbuild.v1.Volume.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildOptions message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceProvenanceHash != null && message.hasOwnProperty("sourceProvenanceHash")) { + if (!Array.isArray(message.sourceProvenanceHash)) + return "sourceProvenanceHash: array expected"; + for (var i = 0; i < message.sourceProvenanceHash.length; ++i) + switch (message.sourceProvenanceHash[i]) { + default: + return "sourceProvenanceHash: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.requestedVerifyOption != null && message.hasOwnProperty("requestedVerifyOption")) + switch (message.requestedVerifyOption) { + default: + return "requestedVerifyOption: enum value expected"; + case 0: + case 1: + break; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + switch (message.machineType) { + default: + return "machineType: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 6: + break; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + if (message.substitutionOption != null && message.hasOwnProperty("substitutionOption")) + switch (message.substitutionOption) { + default: + return "substitutionOption: enum value expected"; + case 0: + case 1: + break; + } + if (message.dynamicSubstitutions != null && message.hasOwnProperty("dynamicSubstitutions")) + if (typeof message.dynamicSubstitutions !== "boolean") + return "dynamicSubstitutions: boolean expected"; + if (message.logStreamingOption != null && message.hasOwnProperty("logStreamingOption")) + switch (message.logStreamingOption) { + default: + return "logStreamingOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.logging != null && message.hasOwnProperty("logging")) + switch (message.logging) { + default: + return "logging: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 4: + break; + } + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) + if (!$util.isString(message.env[i])) + return "env: string[] expected"; + } + if (message.secretEnv != null && message.hasOwnProperty("secretEnv")) { + if (!Array.isArray(message.secretEnv)) + return "secretEnv: array expected"; + for (var i = 0; i < message.secretEnv.length; ++i) + if (!$util.isString(message.secretEnv[i])) + return "secretEnv: string[] expected"; + } + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + return null; + }; + + /** + * Creates a BuildOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + */ + BuildOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildOptions) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildOptions(); + if (object.sourceProvenanceHash) { + if (!Array.isArray(object.sourceProvenanceHash)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.sourceProvenanceHash: array expected"); + message.sourceProvenanceHash = []; + for (var i = 0; i < object.sourceProvenanceHash.length; ++i) + switch (object.sourceProvenanceHash[i]) { + default: + case "NONE": + case 0: + message.sourceProvenanceHash[i] = 0; + break; + case "SHA256": + case 1: + message.sourceProvenanceHash[i] = 1; + break; + case "MD5": + case 2: + message.sourceProvenanceHash[i] = 2; + break; + } + } + switch (object.requestedVerifyOption) { + case "NOT_VERIFIED": + case 0: + message.requestedVerifyOption = 0; + break; + case "VERIFIED": + case 1: + message.requestedVerifyOption = 1; + break; + } + switch (object.machineType) { + case "UNSPECIFIED": + case 0: + message.machineType = 0; + break; + case "N1_HIGHCPU_8": + case 1: + message.machineType = 1; + break; + case "N1_HIGHCPU_32": + case 2: + message.machineType = 2; + break; + case "E2_HIGHCPU_8": + case 5: + message.machineType = 5; + break; + case "E2_HIGHCPU_32": + case 6: + message.machineType = 6; + break; + } + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + switch (object.substitutionOption) { + case "MUST_MATCH": + case 0: + message.substitutionOption = 0; + break; + case "ALLOW_LOOSE": + case 1: + message.substitutionOption = 1; + break; + } + if (object.dynamicSubstitutions != null) + message.dynamicSubstitutions = Boolean(object.dynamicSubstitutions); + switch (object.logStreamingOption) { + case "STREAM_DEFAULT": + case 0: + message.logStreamingOption = 0; + break; + case "STREAM_ON": + case 1: + message.logStreamingOption = 1; + break; + case "STREAM_OFF": + case 2: + message.logStreamingOption = 2; + break; + } + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + switch (object.logging) { + case "LOGGING_UNSPECIFIED": + case 0: + message.logging = 0; + break; + case "LEGACY": + case 1: + message.logging = 1; + break; + case "GCS_ONLY": + case 2: + message.logging = 2; + break; + case "STACKDRIVER_ONLY": + case 3: + message.logging = 3; + break; + case "CLOUD_LOGGING_ONLY": + case 5: + message.logging = 5; + break; + case "NONE": + case 4: + message.logging = 4; + break; + } + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) + message.env[i] = String(object.env[i]); + } + if (object.secretEnv) { + if (!Array.isArray(object.secretEnv)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.secretEnv: array expected"); + message.secretEnv = []; + for (var i = 0; i < object.secretEnv.length; ++i) + message.secretEnv[i] = String(object.secretEnv[i]); + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.volumes: object expected"); + message.volumes[i] = $root.google.devtools.cloudbuild.v1.Volume.fromObject(object.volumes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BuildOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions} message BuildOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sourceProvenanceHash = []; + object.env = []; + object.secretEnv = []; + object.volumes = []; + } + if (options.defaults) { + object.requestedVerifyOption = options.enums === String ? "NOT_VERIFIED" : 0; + object.machineType = options.enums === String ? "UNSPECIFIED" : 0; + object.substitutionOption = options.enums === String ? "MUST_MATCH" : 0; + object.logStreamingOption = options.enums === String ? "STREAM_DEFAULT" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskSizeGb = options.longs === String ? "0" : 0; + object.workerPool = ""; + object.logging = options.enums === String ? "LOGGING_UNSPECIFIED" : 0; + object.dynamicSubstitutions = false; + } + if (message.sourceProvenanceHash && message.sourceProvenanceHash.length) { + object.sourceProvenanceHash = []; + for (var j = 0; j < message.sourceProvenanceHash.length; ++j) + object.sourceProvenanceHash[j] = options.enums === String ? $root.google.devtools.cloudbuild.v1.Hash.HashType[message.sourceProvenanceHash[j]] : message.sourceProvenanceHash[j]; + } + if (message.requestedVerifyOption != null && message.hasOwnProperty("requestedVerifyOption")) + object.requestedVerifyOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.VerifyOption[message.requestedVerifyOption] : message.requestedVerifyOption; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.MachineType[message.machineType] : message.machineType; + if (message.substitutionOption != null && message.hasOwnProperty("substitutionOption")) + object.substitutionOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption[message.substitutionOption] : message.substitutionOption; + if (message.logStreamingOption != null && message.hasOwnProperty("logStreamingOption")) + object.logStreamingOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption[message.logStreamingOption] : message.logStreamingOption; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.logging != null && message.hasOwnProperty("logging")) + object.logging = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.LoggingMode[message.logging] : message.logging; + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = message.env[j]; + } + if (message.secretEnv && message.secretEnv.length) { + object.secretEnv = []; + for (var j = 0; j < message.secretEnv.length; ++j) + object.secretEnv[j] = message.secretEnv[j]; + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.devtools.cloudbuild.v1.Volume.toObject(message.volumes[j], options); + } + if (message.dynamicSubstitutions != null && message.hasOwnProperty("dynamicSubstitutions")) + object.dynamicSubstitutions = message.dynamicSubstitutions; + return object; + }; + + /** + * Converts this BuildOptions to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + * @returns {Object.} JSON object + */ + BuildOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * VerifyOption enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.VerifyOption + * @enum {number} + * @property {number} NOT_VERIFIED=0 NOT_VERIFIED value + * @property {number} VERIFIED=1 VERIFIED value + */ + BuildOptions.VerifyOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NOT_VERIFIED"] = 0; + values[valuesById[1] = "VERIFIED"] = 1; + return values; + })(); + + /** + * MachineType enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.MachineType + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} N1_HIGHCPU_8=1 N1_HIGHCPU_8 value + * @property {number} N1_HIGHCPU_32=2 N1_HIGHCPU_32 value + * @property {number} E2_HIGHCPU_8=5 E2_HIGHCPU_8 value + * @property {number} E2_HIGHCPU_32=6 E2_HIGHCPU_32 value + */ + BuildOptions.MachineType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "N1_HIGHCPU_8"] = 1; + values[valuesById[2] = "N1_HIGHCPU_32"] = 2; + values[valuesById[5] = "E2_HIGHCPU_8"] = 5; + values[valuesById[6] = "E2_HIGHCPU_32"] = 6; + return values; + })(); + + /** + * SubstitutionOption enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption + * @enum {number} + * @property {number} MUST_MATCH=0 MUST_MATCH value + * @property {number} ALLOW_LOOSE=1 ALLOW_LOOSE value + */ + BuildOptions.SubstitutionOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUST_MATCH"] = 0; + values[valuesById[1] = "ALLOW_LOOSE"] = 1; + return values; + })(); + + /** + * LogStreamingOption enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption + * @enum {number} + * @property {number} STREAM_DEFAULT=0 STREAM_DEFAULT value + * @property {number} STREAM_ON=1 STREAM_ON value + * @property {number} STREAM_OFF=2 STREAM_OFF value + */ + BuildOptions.LogStreamingOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STREAM_DEFAULT"] = 0; + values[valuesById[1] = "STREAM_ON"] = 1; + values[valuesById[2] = "STREAM_OFF"] = 2; + return values; + })(); + + /** + * LoggingMode enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.LoggingMode + * @enum {number} + * @property {number} LOGGING_UNSPECIFIED=0 LOGGING_UNSPECIFIED value + * @property {number} LEGACY=1 LEGACY value + * @property {number} GCS_ONLY=2 GCS_ONLY value + * @property {number} STACKDRIVER_ONLY=3 STACKDRIVER_ONLY value + * @property {number} CLOUD_LOGGING_ONLY=5 CLOUD_LOGGING_ONLY value + * @property {number} NONE=4 NONE value + */ + BuildOptions.LoggingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGGING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEGACY"] = 1; + values[valuesById[2] = "GCS_ONLY"] = 2; + values[valuesById[3] = "STACKDRIVER_ONLY"] = 3; + values[valuesById[5] = "CLOUD_LOGGING_ONLY"] = 5; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + return BuildOptions; + })(); + + v1.ReceiveTriggerWebhookRequest = (function() { + + /** + * Properties of a ReceiveTriggerWebhookRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IReceiveTriggerWebhookRequest + * @property {google.api.IHttpBody|null} [body] ReceiveTriggerWebhookRequest body + * @property {string|null} [projectId] ReceiveTriggerWebhookRequest projectId + * @property {string|null} [trigger] ReceiveTriggerWebhookRequest trigger + * @property {string|null} [secret] ReceiveTriggerWebhookRequest secret + */ + + /** + * Constructs a new ReceiveTriggerWebhookRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ReceiveTriggerWebhookRequest. + * @implements IReceiveTriggerWebhookRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest=} [properties] Properties to set + */ + function ReceiveTriggerWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceiveTriggerWebhookRequest body. + * @member {google.api.IHttpBody|null|undefined} body + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.body = null; + + /** + * ReceiveTriggerWebhookRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.projectId = ""; + + /** + * ReceiveTriggerWebhookRequest trigger. + * @member {string} trigger + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.trigger = ""; + + /** + * ReceiveTriggerWebhookRequest secret. + * @member {string} secret + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.secret = ""; + + /** + * Creates a new ReceiveTriggerWebhookRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest instance + */ + ReceiveTriggerWebhookRequest.create = function create(properties) { + return new ReceiveTriggerWebhookRequest(properties); + }; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} message ReceiveTriggerWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.google.api.HttpBody.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.trigger); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.secret); + return writer; + }; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} message ReceiveTriggerWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveTriggerWebhookRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = $root.google.api.HttpBody.decode(reader, reader.uint32()); + break; + case 2: + message.projectId = reader.string(); + break; + case 3: + message.trigger = reader.string(); + break; + case 4: + message.secret = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveTriggerWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceiveTriggerWebhookRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceiveTriggerWebhookRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.google.api.HttpBody.verify(message.body); + if (error) + return "body." + error; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.trigger != null && message.hasOwnProperty("trigger")) + if (!$util.isString(message.trigger)) + return "trigger: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + if (!$util.isString(message.secret)) + return "secret: string expected"; + return null; + }; + + /** + * Creates a ReceiveTriggerWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest + */ + ReceiveTriggerWebhookRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest(); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.body: object expected"); + message.body = $root.google.api.HttpBody.fromObject(object.body); + } + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.trigger != null) + message.trigger = String(object.trigger); + if (object.secret != null) + message.secret = String(object.secret); + return message; + }; + + /** + * Creates a plain object from a ReceiveTriggerWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} message ReceiveTriggerWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceiveTriggerWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.body = null; + object.projectId = ""; + object.trigger = ""; + object.secret = ""; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.google.api.HttpBody.toObject(message.body, options); + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = message.trigger; + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = message.secret; + return object; + }; + + /** + * Converts this ReceiveTriggerWebhookRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + ReceiveTriggerWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReceiveTriggerWebhookRequest; + })(); + + v1.ReceiveTriggerWebhookResponse = (function() { + + /** + * Properties of a ReceiveTriggerWebhookResponse. + * @memberof google.devtools.cloudbuild.v1 + * @interface IReceiveTriggerWebhookResponse + */ + + /** + * Constructs a new ReceiveTriggerWebhookResponse. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ReceiveTriggerWebhookResponse. + * @implements IReceiveTriggerWebhookResponse + * @constructor + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse=} [properties] Properties to set + */ + function ReceiveTriggerWebhookResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ReceiveTriggerWebhookResponse instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse instance + */ + ReceiveTriggerWebhookResponse.create = function create(properties) { + return new ReceiveTriggerWebhookResponse(properties); + }; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse} message ReceiveTriggerWebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse} message ReceiveTriggerWebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveTriggerWebhookResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; }; /** - * Converts this BuildOptions to JSON. - * @function toJSON - * @memberof google.devtools.cloudbuild.v1.BuildOptions - * @instance - * @returns {Object.} JSON object + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + ReceiveTriggerWebhookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; /** - * VerifyOption enum. - * @name google.devtools.cloudbuild.v1.BuildOptions.VerifyOption - * @enum {number} - * @property {number} NOT_VERIFIED=0 NOT_VERIFIED value - * @property {number} VERIFIED=1 VERIFIED value - */ - BuildOptions.VerifyOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NOT_VERIFIED"] = 0; - values[valuesById[1] = "VERIFIED"] = 1; - return values; - })(); - - /** - * MachineType enum. - * @name google.devtools.cloudbuild.v1.BuildOptions.MachineType - * @enum {number} - * @property {number} UNSPECIFIED=0 UNSPECIFIED value - * @property {number} N1_HIGHCPU_8=1 N1_HIGHCPU_8 value - * @property {number} N1_HIGHCPU_32=2 N1_HIGHCPU_32 value + * Verifies a ReceiveTriggerWebhookResponse message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildOptions.MachineType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNSPECIFIED"] = 0; - values[valuesById[1] = "N1_HIGHCPU_8"] = 1; - values[valuesById[2] = "N1_HIGHCPU_32"] = 2; - return values; - })(); + ReceiveTriggerWebhookResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * SubstitutionOption enum. - * @name google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption - * @enum {number} - * @property {number} MUST_MATCH=0 MUST_MATCH value - * @property {number} ALLOW_LOOSE=1 ALLOW_LOOSE value + * Creates a ReceiveTriggerWebhookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse */ - BuildOptions.SubstitutionOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MUST_MATCH"] = 0; - values[valuesById[1] = "ALLOW_LOOSE"] = 1; - return values; - })(); + ReceiveTriggerWebhookResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse) + return object; + return new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse(); + }; /** - * LogStreamingOption enum. - * @name google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption - * @enum {number} - * @property {number} STREAM_DEFAULT=0 STREAM_DEFAULT value - * @property {number} STREAM_ON=1 STREAM_ON value - * @property {number} STREAM_OFF=2 STREAM_OFF value + * Creates a plain object from a ReceiveTriggerWebhookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} message ReceiveTriggerWebhookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - BuildOptions.LogStreamingOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STREAM_DEFAULT"] = 0; - values[valuesById[1] = "STREAM_ON"] = 1; - values[valuesById[2] = "STREAM_OFF"] = 2; - return values; - })(); + ReceiveTriggerWebhookResponse.toObject = function toObject() { + return {}; + }; /** - * LoggingMode enum. - * @name google.devtools.cloudbuild.v1.BuildOptions.LoggingMode - * @enum {number} - * @property {number} LOGGING_UNSPECIFIED=0 LOGGING_UNSPECIFIED value - * @property {number} LEGACY=1 LEGACY value - * @property {number} GCS_ONLY=2 GCS_ONLY value - * @property {number} STACKDRIVER_ONLY=3 STACKDRIVER_ONLY value - * @property {number} CLOUD_LOGGING_ONLY=5 CLOUD_LOGGING_ONLY value - * @property {number} NONE=4 NONE value + * Converts this ReceiveTriggerWebhookResponse to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @instance + * @returns {Object.} JSON object */ - BuildOptions.LoggingMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOGGING_UNSPECIFIED"] = 0; - values[valuesById[1] = "LEGACY"] = 1; - values[valuesById[2] = "GCS_ONLY"] = 2; - values[valuesById[3] = "STACKDRIVER_ONLY"] = 3; - values[valuesById[5] = "CLOUD_LOGGING_ONLY"] = 5; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); + ReceiveTriggerWebhookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return BuildOptions; + return ReceiveTriggerWebhookResponse; })(); v1.WorkerPool = (function() { @@ -14441,6 +15651,269 @@ return values; })(); + api.HttpBody = (function() { + + /** + * Properties of a HttpBody. + * @memberof google.api + * @interface IHttpBody + * @property {string|null} [contentType] HttpBody contentType + * @property {Uint8Array|null} [data] HttpBody data + * @property {Array.|null} [extensions] HttpBody extensions + */ + + /** + * Constructs a new HttpBody. + * @memberof google.api + * @classdesc Represents a HttpBody. + * @implements IHttpBody + * @constructor + * @param {google.api.IHttpBody=} [properties] Properties to set + */ + function HttpBody(properties) { + this.extensions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpBody contentType. + * @member {string} contentType + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.contentType = ""; + + /** + * HttpBody data. + * @member {Uint8Array} data + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.data = $util.newBuffer([]); + + /** + * HttpBody extensions. + * @member {Array.} extensions + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.extensions = $util.emptyArray; + + /** + * Creates a new HttpBody instance using the specified properties. + * @function create + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody=} [properties] Properties to set + * @returns {google.api.HttpBody} HttpBody instance + */ + HttpBody.create = function create(properties) { + return new HttpBody(properties); + }; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encode + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.extensions != null && message.extensions.length) + for (var i = 0; i < message.extensions.length; ++i) + $root.google.protobuf.Any.encode(message.extensions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contentType = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + if (!(message.extensions && message.extensions.length)) + message.extensions = []; + message.extensions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpBody message. + * @function verify + * @memberof google.api.HttpBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.extensions != null && message.hasOwnProperty("extensions")) { + if (!Array.isArray(message.extensions)) + return "extensions: array expected"; + for (var i = 0; i < message.extensions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.extensions[i]); + if (error) + return "extensions." + error; + } + } + return null; + }; + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpBody + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpBody} HttpBody + */ + HttpBody.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpBody) + return object; + var message = new $root.google.api.HttpBody(); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.extensions) { + if (!Array.isArray(object.extensions)) + throw TypeError(".google.api.HttpBody.extensions: array expected"); + message.extensions = []; + for (var i = 0; i < object.extensions.length; ++i) { + if (typeof object.extensions[i] !== "object") + throw TypeError(".google.api.HttpBody.extensions: object expected"); + message.extensions[i] = $root.google.protobuf.Any.fromObject(object.extensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpBody + * @static + * @param {google.api.HttpBody} message HttpBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extensions = []; + if (options.defaults) { + object.contentType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.extensions && message.extensions.length) { + object.extensions = []; + for (var j = 0; j < message.extensions.length; ++j) + object.extensions[j] = $root.google.protobuf.Any.toObject(message.extensions[j], options); + } + return object; + }; + + /** + * Converts this HttpBody to JSON. + * @function toJSON + * @memberof google.api.HttpBody + * @instance + * @returns {Object.} JSON object + */ + HttpBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpBody; + })(); + api.ResourceDescriptor = (function() { /** diff --git a/packages/google-devtools-cloudbuild/protos/protos.json b/packages/google-devtools-cloudbuild/protos/protos.json index 1c52e36a540..c4e707b6b2c 100644 --- a/packages/google-devtools-cloudbuild/protos/protos.json +++ b/packages/google-devtools-cloudbuild/protos/protos.json @@ -14,8 +14,8 @@ "java_package": "com.google.cloudbuild.v1", "objc_class_prefix": "GCB", "ruby_package": "Google::Cloud::Build::V1", - "(google.api.resource_definition).type": "iam.googleapis.com/ServiceAccount", - "(google.api.resource_definition).pattern": "projects/{project}/serviceAccounts/{service_account}" + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}" }, "nested": { "CloudBuild": { @@ -31,7 +31,7 @@ "(google.api.http).post": "/v1/projects/{project_id}/builds", "(google.api.http).body": "build", "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*}/builds", - "(google.api.http).additional_bindings.body": "*", + "(google.api.http).additional_bindings.body": "build", "(google.api.method_signature)": "project_id,build", "(google.longrunning.operation_info).response_type": "Build", "(google.longrunning.operation_info).metadata_type": "BuildOperationMetadata" @@ -43,7 +43,7 @@ "body": "build", "additional_bindings": { "post": "/v1/{parent=projects/*/locations/*}/builds", - "body": "*" + "body": "build" } } }, @@ -284,6 +284,22 @@ } ] }, + "ReceiveTriggerWebhook": { + "requestType": "ReceiveTriggerWebhookRequest", + "responseType": "ReceiveTriggerWebhookResponse", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/triggers/{trigger}:webhook", + "(google.api.http).body": "body" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/triggers/{trigger}:webhook", + "body": "body" + } + } + ] + }, "CreateWorkerPool": { "requestType": "CreateWorkerPoolRequest", "responseType": "WorkerPool" @@ -349,10 +365,7 @@ }, "source": { "type": "RepoSource", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 3 } } }, @@ -736,6 +749,10 @@ "options": { "(google.api.resource_reference).type": "iam.googleapis.com/ServiceAccount" } + }, + "availableSecrets": { + "type": "Secrets", + "id": 47 } }, "nested": { @@ -859,6 +876,51 @@ } } }, + "Secrets": { + "fields": { + "secretManager": { + "rule": "repeated", + "type": "SecretManagerSecret", + "id": 1 + }, + "inline": { + "rule": "repeated", + "type": "InlineSecret", + "id": 2 + } + } + }, + "InlineSecret": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "envMap": { + "keyType": "string", + "type": "bytes", + "id": 2 + } + } + }, + "SecretManagerSecret": { + "fields": { + "versionName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "env": { + "type": "string", + "id": 2 + } + } + }, "Secret": { "fields": { "kmsKeyName": { @@ -1129,7 +1191,8 @@ "CommentControl": { "values": { "COMMENTS_DISABLED": 0, - "COMMENTS_ENABLED": 1 + "COMMENTS_ENABLED": 1, + "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY": 2 } } } @@ -1335,7 +1398,9 @@ "values": { "UNSPECIFIED": 0, "N1_HIGHCPU_8": 1, - "N1_HIGHCPU_32": 2 + "N1_HIGHCPU_32": 2, + "E2_HIGHCPU_8": 5, + "E2_HIGHCPU_32": 6 } }, "SubstitutionOption": { @@ -1363,6 +1428,29 @@ } } }, + "ReceiveTriggerWebhookRequest": { + "fields": { + "body": { + "type": "google.api.HttpBody", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "trigger": { + "type": "string", + "id": 3 + }, + "secret": { + "type": "string", + "id": 4 + } + } + }, + "ReceiveTriggerWebhookResponse": { + "fields": {} + }, "WorkerPool": { "fields": { "name": { @@ -1657,6 +1745,23 @@ "UNORDERED_LIST": 6 } }, + "HttpBody": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "data": { + "type": "bytes", + "id": 2 + }, + "extensions": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, diff --git a/packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts index 8ae460f6a02..be5d7ce4956 100644 --- a/packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts +++ b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts @@ -178,6 +178,9 @@ export class CloudBuildClient { buildTriggerPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/triggers/{trigger}' ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -187,6 +190,9 @@ export class CloudBuildClient { projectLocationBuildPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/builds/{build}' ), + secretVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/secrets/{secret}/versions/{version}' + ), serviceAccountPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/serviceAccounts/{service_account}' ), @@ -318,6 +324,7 @@ export class CloudBuildClient { 'deleteBuildTrigger', 'updateBuildTrigger', 'runBuildTrigger', + 'receiveTriggerWebhook', 'createWorkerPool', 'getWorkerPool', 'deleteWorkerPool', @@ -539,7 +546,7 @@ export class CloudBuildClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The name of the `Build` to retrieve. + * The name of the `Build` to cancel. * Format: `projects/{project}/locations/{location}/builds/{build}` * @param {string} request.projectId * Required. ID of the project. @@ -1004,6 +1011,111 @@ export class CloudBuildClient { this.initialize(); return this.innerApiCalls.updateBuildTrigger(request, options, callback); } + receiveTriggerWebhook( + request: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + ( + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | undefined + ), + {} | undefined + ] + >; + receiveTriggerWebhook( + request: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + > + ): void; + receiveTriggerWebhook( + request: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * ReceiveTriggerWebhook [Experimental] is called when the API receives a + * webhook request targeted at a specific trigger. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.api.HttpBody} request.body + * HTTP request body. + * @param {string} request.projectId + * Project in which the specified trigger lives + * @param {string} request.trigger + * Name of the trigger to run the payload against + * @param {string} request.secret + * Secret token used for authorization if an OAuth token isn't provided. + * @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 [ReceiveTriggerWebhookResponse]{@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.receiveTriggerWebhook(request); + */ + receiveTriggerWebhook( + request: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + ( + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); + this.initialize(); + return this.innerApiCalls.receiveTriggerWebhook(request, options, callback); + } createWorkerPool( request: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, options?: CallOptions @@ -1819,7 +1931,7 @@ export class CloudBuildClient { * @param {string} request.triggerId * Required. ID of the trigger. * @param {google.devtools.cloudbuild.v1.RepoSource} request.source - * Required. Source to build against this trigger. + * Source to build against this trigger. * @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. @@ -1966,7 +2078,15 @@ export class CloudBuildClient { * @param {number} request.pageSize * Number of results to return in the list. * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. + * The page token for the next page of Builds. + * + * If unspecified, the first page of results is returned. + * + * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + * In this case, the token should be discarded, and pagination should be + * restarted from the first page of results. + * + * See https://google.aip.dev/158 for more. * @param {string} request.filter * The raw filter text to constrain the results. * @param {object} [options] @@ -2040,7 +2160,15 @@ export class CloudBuildClient { * @param {number} request.pageSize * Number of results to return in the list. * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. + * The page token for the next page of Builds. + * + * If unspecified, the first page of results is returned. + * + * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + * In this case, the token should be discarded, and pagination should be + * restarted from the first page of results. + * + * See https://google.aip.dev/158 for more. * @param {string} request.filter * The raw filter text to constrain the results. * @param {object} [options] @@ -2092,7 +2220,15 @@ export class CloudBuildClient { * @param {number} request.pageSize * Number of results to return in the list. * @param {string} request.pageToken - * Token to provide to skip to a particular spot in the list. + * The page token for the next page of Builds. + * + * If unspecified, the first page of results is returned. + * + * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + * In this case, the token should be discarded, and pagination should be + * restarted from the first page of results. + * + * See https://google.aip.dev/158 for more. * @param {string} request.filter * The raw filter text to constrain the results. * @param {object} [options] @@ -2372,6 +2508,76 @@ export class CloudBuildClient { .trigger; } + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} keyring + * @param {string} key + * @returns {string} Resource name string. + */ + cryptoKeyPath( + project: string, + location: string, + keyring: string, + key: string + ) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + keyring: keyring, + key: key, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .location; + } + + /** + * Parse the keyring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the keyring. + */ + matchKeyringFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .keyring; + } + + /** + * Parse the key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key. + */ + matchKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key; + } + /** * Return a fully-qualified project resource name string. * @@ -2488,6 +2694,58 @@ export class CloudBuildClient { ).build; } + /** + * Return a fully-qualified secretVersion resource name string. + * + * @param {string} project + * @param {string} secret + * @param {string} version + * @returns {string} Resource name string. + */ + secretVersionPath(project: string, secret: string, version: string) { + return this.pathTemplates.secretVersionPathTemplate.render({ + project: project, + secret: secret, + version: version, + }); + } + + /** + * Parse the project from SecretVersion resource. + * + * @param {string} secretVersionName + * A fully-qualified path representing SecretVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecretVersionName(secretVersionName: string) { + return this.pathTemplates.secretVersionPathTemplate.match(secretVersionName) + .project; + } + + /** + * Parse the secret from SecretVersion resource. + * + * @param {string} secretVersionName + * A fully-qualified path representing SecretVersion resource. + * @returns {string} A string representing the secret. + */ + matchSecretFromSecretVersionName(secretVersionName: string) { + return this.pathTemplates.secretVersionPathTemplate.match(secretVersionName) + .secret; + } + + /** + * Parse the version from SecretVersion resource. + * + * @param {string} secretVersionName + * A fully-qualified path representing SecretVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSecretVersionName(secretVersionName: string) { + return this.pathTemplates.secretVersionPathTemplate.match(secretVersionName) + .version; + } + /** * Return a fully-qualified serviceAccount resource name string. * diff --git a/packages/google-devtools-cloudbuild/src/v1/cloud_build_client_config.json b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client_config.json index d52bbfa9a07..59a36aa4bb3 100644 --- a/packages/google-devtools-cloudbuild/src/v1/cloud_build_client_config.json +++ b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client_config.json @@ -75,6 +75,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ReceiveTriggerWebhook": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateWorkerPool": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-devtools-cloudbuild/src/v1/gapic_metadata.json b/packages/google-devtools-cloudbuild/src/v1/gapic_metadata.json index 2918f2968ea..13b20579901 100644 --- a/packages/google-devtools-cloudbuild/src/v1/gapic_metadata.json +++ b/packages/google-devtools-cloudbuild/src/v1/gapic_metadata.json @@ -40,6 +40,11 @@ "updateBuildTrigger" ] }, + "ReceiveTriggerWebhook": { + "methods": [ + "receiveTriggerWebhook" + ] + }, "CreateWorkerPool": { "methods": [ "createWorkerPool" @@ -129,6 +134,11 @@ "updateBuildTrigger" ] }, + "ReceiveTriggerWebhook": { + "methods": [ + "receiveTriggerWebhook" + ] + }, "CreateWorkerPool": { "methods": [ "createWorkerPool" diff --git a/packages/google-devtools-cloudbuild/synth.metadata b/packages/google-devtools-cloudbuild/synth.metadata index 68b3f437e87..270186d3d6f 100644 --- a/packages/google-devtools-cloudbuild/synth.metadata +++ b/packages/google-devtools-cloudbuild/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-cloudbuild.git", - "sha": "8f0b1e6220f66d8d2620f9647bf7d9765aab185e" + "sha": "de64555672a0ea24a936c163e457c41270118ab2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" + "sha": "913f5553d5ff5940cddd8245313136449b2a3571", + "internalRef": "363244566" } }, { diff --git a/packages/google-devtools-cloudbuild/test/gapic_cloud_build_v1.ts b/packages/google-devtools-cloudbuild/test/gapic_cloud_build_v1.ts index 08420c3fb9f..fb3f2e92bd9 100644 --- a/packages/google-devtools-cloudbuild/test/gapic_cloud_build_v1.ts +++ b/packages/google-devtools-cloudbuild/test/gapic_cloud_build_v1.ts @@ -907,6 +907,123 @@ describe('v1.CloudBuildClient', () => { }); }); + describe('receiveTriggerWebhook', () => { + it('invokes receiveTriggerWebhook without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse() + ); + client.innerApiCalls.receiveTriggerWebhook = stubSimpleCall( + expectedResponse + ); + const [response] = await client.receiveTriggerWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.receiveTriggerWebhook as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes receiveTriggerWebhook without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse() + ); + client.innerApiCalls.receiveTriggerWebhook = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.receiveTriggerWebhook( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.receiveTriggerWebhook as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes receiveTriggerWebhook with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.receiveTriggerWebhook = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.receiveTriggerWebhook(request), + expectedError + ); + assert( + (client.innerApiCalls.receiveTriggerWebhook as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('createWorkerPool', () => { it('invokes createWorkerPool without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ @@ -2592,6 +2709,82 @@ describe('v1.CloudBuildClient', () => { }); }); + describe('cryptoKey', () => { + const fakePath = '/rendered/path/cryptoKey'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + keyring: 'keyringValue', + key: 'keyValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath( + 'projectValue', + 'locationValue', + 'keyringValue', + 'keyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyringFromCryptoKeyName', () => { + const result = client.matchKeyringFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyringValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyFromCryptoKeyName', () => { + const result = client.matchKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = { @@ -2751,6 +2944,70 @@ describe('v1.CloudBuildClient', () => { }); }); + describe('secretVersion', () => { + const fakePath = '/rendered/path/secretVersion'; + const expectedParameters = { + project: 'projectValue', + secret: 'secretValue', + version: 'versionValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.secretVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.secretVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('secretVersionPath', () => { + const result = client.secretVersionPath( + 'projectValue', + 'secretValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.secretVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecretVersionName', () => { + const result = client.matchProjectFromSecretVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.secretVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretFromSecretVersionName', () => { + const result = client.matchSecretFromSecretVersionName(fakePath); + assert.strictEqual(result, 'secretValue'); + assert( + (client.pathTemplates.secretVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSecretVersionName', () => { + const result = client.matchVersionFromSecretVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.secretVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('serviceAccount', () => { const fakePath = '/rendered/path/serviceAccount'; const expectedParameters = {