diff --git a/protos/google/devtools/cloudbuild/v1/cloudbuild.proto b/protos/google/devtools/cloudbuild/v1/cloudbuild.proto index 4e3a018..de8a1de 100644 --- a/protos/google/devtools/cloudbuild/v1/cloudbuild.proto +++ b/protos/google/devtools/cloudbuild/v1/cloudbuild.proto @@ -19,9 +19,11 @@ package google.devtools.cloudbuild.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild"; @@ -29,6 +31,14 @@ option java_multiple_files = true; option java_package = "com.google.cloudbuild.v1"; option objc_class_prefix = "GCB"; option ruby_package = "Google::Cloud::Build::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/ServiceAccount" + pattern: "projects/{project}/serviceAccounts/{service_account}" +}; // Creates and manages builds on Google Cloud Platform. // @@ -52,6 +62,10 @@ service CloudBuild { option (google.api.http) = { post: "/v1/projects/{project_id}/builds" body: "build" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*}/builds" + body: "*" + } }; option (google.api.method_signature) = "project_id,build"; option (google.longrunning.operation_info) = { @@ -67,6 +81,7 @@ service CloudBuild { rpc GetBuild(GetBuildRequest) returns (Build) { option (google.api.http) = { get: "/v1/projects/{project_id}/builds/{id}" + additional_bindings { get: "/v1/{name=projects/*/locations/*/builds/*}" } }; option (google.api.method_signature) = "project_id,id"; } @@ -78,6 +93,7 @@ service CloudBuild { rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) { option (google.api.http) = { get: "/v1/projects/{project_id}/builds" + additional_bindings { get: "/v1/{parent=projects/*/locations/*}/builds" } }; option (google.api.method_signature) = "project_id,filter"; } @@ -87,6 +103,10 @@ service CloudBuild { option (google.api.http) = { post: "/v1/projects/{project_id}/builds/{id}:cancel" body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/builds/*}:cancel" + body: "*" + } }; option (google.api.method_signature) = "project_id,id"; } @@ -122,6 +142,10 @@ service CloudBuild { option (google.api.http) = { post: "/v1/projects/{project_id}/builds/{id}:retry" body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/builds/*}:retry" + body: "*" + } }; option (google.api.method_signature) = "project_id,id"; option (google.longrunning.operation_info) = { @@ -228,6 +252,12 @@ service CloudBuild { // Specifies a build to retry. message RetryBuildRequest { + // The name of the `Build` to retry. + // Format: `projects/{project}/locations/{location}/builds/{build}` + string name = 3 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + }]; + // Required. ID of the project. string project_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -416,7 +446,7 @@ message BuildStep { // Output only. Stores timing information for pulling this build step's // builder image only. - TimeSpan pull_timing = 13; + TimeSpan pull_timing = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; // Time limit for executing this build step. If not defined, the step has no // time limit and will be allowed to continue to run until either it completes @@ -426,7 +456,7 @@ message BuildStep { // Output only. Status of the build step. At this time, build step status is // only updated on build completion; step status is not updated in real-time // as the build progresses. - Build.Status status = 12; + Build.Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Volume describes a Docker container volume which is mounted into build steps @@ -502,6 +532,12 @@ message ArtifactResult { // resolved from the specified branch or tag. // - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. message Build { + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/builds/{build}" + pattern: "projects/{project}/locations/{location}/builds/{build}" + }; + // Possible status of a build or build step. enum Status { // Status of the build is unknown. @@ -532,6 +568,11 @@ message Build { EXPIRED = 9; } + // Output only. The 'Build' name with format: + // `projects/{project}/locations/{location}/builds/{build}`, where {build} + // is a unique identifier generated by the service. + string name = 45 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Unique identifier of the build. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -539,10 +580,10 @@ message Build { string project_id = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Status of the build. - Status status = 2; + Status status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Customer-readable message about the current status. - string status_detail = 24; + string status_detail = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; // The location of the source files to build. Source source = 3; @@ -572,6 +613,8 @@ message Build { // granularity. If this amount of time elapses, work on the build will cease // and the build status will be `TIMEOUT`. // + // `timeout` starts ticking from `startTime`. + // // Default time is ten minutes. google.protobuf.Duration timeout = 12; @@ -605,11 +648,12 @@ message Build { string logs_bucket = 19; // Output only. A permanent fixed identifier for source. - SourceProvenance source_provenance = 21; + SourceProvenance source_provenance = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The ID of the `BuildTrigger` that triggered this build, if it // was triggered automatically. - string build_trigger_id = 22; + string build_trigger_id = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; // Special options for this build. BuildOptions options = 23; @@ -636,6 +680,15 @@ message Build { // If the build does not specify source or images, // these keys will not be included. map timing = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // IAM service account whose credentials will be used at build runtime. + // 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. + string service_account = 42 [(google.api.resource_reference) = { + type: "iam.googleapis.com/ServiceAccount" + }]; } // Artifacts produced by a build that should be uploaded upon @@ -656,7 +709,7 @@ message Artifacts { repeated string paths = 2; // Output only. Stores timing information for pushing all artifact objects. - TimeSpan timing = 3; + TimeSpan timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A list of images to be pushed upon the successful completion of all build @@ -769,6 +822,12 @@ message Secret { // Request to create a new build. message CreateBuildRequest { + // The parent resource where this build will be created. + // Format: `projects/{project}/locations/{location}` + string parent = 4 [(google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/Build" + }]; + // Required. ID of the project. string project_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -778,6 +837,12 @@ message CreateBuildRequest { // Request to get a build. message GetBuildRequest { + // The name of the `Build` to retrieve. + // Format: `projects/{project}/locations/{location}/builds/{build}` + string name = 4 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + }]; + // Required. ID of the project. string project_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -787,6 +852,12 @@ message GetBuildRequest { // Request to list builds. message ListBuildsRequest { + // The parent of the collection of `Builds`. + // Format: `projects/{project}/locations/location` + string parent = 9 [(google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/Build" + }]; + // Required. ID of the project. string project_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -811,6 +882,12 @@ message ListBuildsResponse { // Request to cancel an ongoing build. message CancelBuildRequest { + // The name of the `Build` to retrieve. + // Format: `projects/{project}/locations/{location}/builds/{build}` + string name = 4 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + }]; + // Required. ID of the project. string project_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -821,6 +898,11 @@ message CancelBuildRequest { // Configuration for an automated build in response to source repository // changes. message BuildTrigger { + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/BuildTrigger" + pattern: "projects/{project}/triggers/{trigger}" + }; + // Output only. Unique identifier of the trigger. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -867,12 +949,11 @@ message BuildTrigger { google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // If true, the trigger will never result in a build. + // If true, the trigger will never automatically execute a build. bool disabled = 9; // Substitutions for Build resource. The keys must match the following - // regular expression: `^_[A-Z0-9_]+$`.The keys cannot conflict with the - // keys in bindings. + // regular expression: `^_[A-Z0-9_]+$`. map substitutions = 11; // ignored_files and included_files are file glob matches using @@ -948,8 +1029,8 @@ message PullRequestFilter { string branch = 2; } - // Whether to block builds on a "/gcbrun" comment from a repository admin or - // collaborator. + // Configure builds to run whether a repository owner or collaborator need to + // comment `/gcbrun`. CommentControl comment_control = 5; // If true, branches that do NOT match the git_ref will trigger a build. @@ -1050,7 +1131,9 @@ message BuildOptions { VERIFIED = 1; } - // Supported VM sizes. + // Supported Compute Engine machine types. + // For more information, see [Machine + // types](https://cloud.google.com/compute/docs/machine-types). enum MachineType { // Standard machine type. UNSPECIFIED = 0; @@ -1091,11 +1174,23 @@ message BuildOptions { // rely on the default logging behavior as it may change in the future. LOGGING_UNSPECIFIED = 0; - // Stackdriver logging and Cloud Storage logging are enabled. + // Cloud Logging and Cloud Storage logging are enabled. LEGACY = 1; // Only Cloud Storage logging is enabled. GCS_ONLY = 2; + + // This option is the same as CLOUD_LOGGING_ONLY. + STACKDRIVER_ONLY = 3 [deprecated = true]; + + // Only Cloud Logging is enabled. Note that logs for both the Cloud Console + // UI and Cloud SDK are based on Cloud Storage logs, so neither will provide + // logs if this option is chosen. + CLOUD_LOGGING_ONLY = 5; + + // Turn off all logging. No build logs will be captured. + // Next ID: 6 + NONE = 4; } // Requested hash for SourceProvenance. @@ -1117,8 +1212,18 @@ message BuildOptions { // Option to specify behavior when there is an error in the substitution // checks. + // + // NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot + // be overridden in the build configuration file. SubstitutionOption substitution_option = 4; + // Option to specify whether or not to apply bash style string + // operations to the substitutions. + // + // NOTE: this is always enabled for triggered builds and cannot be + // overridden in the build configuration file. + bool dynamic_substitutions = 17; + // Option to define build log streaming behavior to Google Cloud // Storage. LogStreamingOption log_streaming_option = 5; @@ -1129,8 +1234,8 @@ message BuildOptions { // This field is experimental. string worker_pool = 7; - // Option to specify the logging mode, which determines where the logs are - // stored. + // Option to specify the logging mode, which determines if and where build + // logs are stored. LoggingMode logging = 11; // A list of global environment variable definitions that will exist for all diff --git a/protos/protos.d.ts b/protos/protos.d.ts index d1471e6..8ac99b7 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -389,6 +389,9 @@ export namespace google { /** Properties of a RetryBuildRequest. */ interface IRetryBuildRequest { + /** RetryBuildRequest name */ + name?: (string|null); + /** RetryBuildRequest projectId */ projectId?: (string|null); @@ -405,6 +408,9 @@ export namespace google { */ constructor(properties?: google.devtools.cloudbuild.v1.IRetryBuildRequest); + /** RetryBuildRequest name. */ + public name: string; + /** RetryBuildRequest projectId. */ public projectId: string; @@ -1499,6 +1505,9 @@ export namespace google { /** Properties of a Build. */ interface IBuild { + /** Build name */ + name?: (string|null); + /** Build id */ id?: (string|null); @@ -1567,6 +1576,9 @@ export namespace google { /** Build timing */ timing?: ({ [k: string]: google.devtools.cloudbuild.v1.ITimeSpan }|null); + + /** Build serviceAccount */ + serviceAccount?: (string|null); } /** Represents a Build. */ @@ -1578,6 +1590,9 @@ export namespace google { */ constructor(properties?: google.devtools.cloudbuild.v1.IBuild); + /** Build name. */ + public name: string; + /** Build id. */ public id: string; @@ -1647,6 +1662,9 @@ export namespace google { /** Build timing. */ public timing: { [k: string]: google.devtools.cloudbuild.v1.ITimeSpan }; + /** Build serviceAccount. */ + public serviceAccount: string; + /** * Creates a new Build instance using the specified properties. * @param [properties] Properties to set @@ -2518,6 +2536,9 @@ export namespace google { /** Properties of a CreateBuildRequest. */ interface ICreateBuildRequest { + /** CreateBuildRequest parent */ + parent?: (string|null); + /** CreateBuildRequest projectId */ projectId?: (string|null); @@ -2534,6 +2555,9 @@ export namespace google { */ constructor(properties?: google.devtools.cloudbuild.v1.ICreateBuildRequest); + /** CreateBuildRequest parent. */ + public parent: string; + /** CreateBuildRequest projectId. */ public projectId: string; @@ -2614,6 +2638,9 @@ export namespace google { /** Properties of a GetBuildRequest. */ interface IGetBuildRequest { + /** GetBuildRequest name */ + name?: (string|null); + /** GetBuildRequest projectId */ projectId?: (string|null); @@ -2630,6 +2657,9 @@ export namespace google { */ constructor(properties?: google.devtools.cloudbuild.v1.IGetBuildRequest); + /** GetBuildRequest name. */ + public name: string; + /** GetBuildRequest projectId. */ public projectId: string; @@ -2710,6 +2740,9 @@ export namespace google { /** Properties of a ListBuildsRequest. */ interface IListBuildsRequest { + /** ListBuildsRequest parent */ + parent?: (string|null); + /** ListBuildsRequest projectId */ projectId?: (string|null); @@ -2732,6 +2765,9 @@ export namespace google { */ constructor(properties?: google.devtools.cloudbuild.v1.IListBuildsRequest); + /** ListBuildsRequest parent. */ + public parent: string; + /** ListBuildsRequest projectId. */ public projectId: string; @@ -2914,6 +2950,9 @@ export namespace google { /** Properties of a CancelBuildRequest. */ interface ICancelBuildRequest { + /** CancelBuildRequest name */ + name?: (string|null); + /** CancelBuildRequest projectId */ projectId?: (string|null); @@ -2930,6 +2969,9 @@ export namespace google { */ constructor(properties?: google.devtools.cloudbuild.v1.ICancelBuildRequest); + /** CancelBuildRequest name. */ + public name: string; + /** CancelBuildRequest projectId. */ public projectId: string; @@ -4114,6 +4156,9 @@ export namespace google { /** BuildOptions substitutionOption */ substitutionOption?: (google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|null); + /** BuildOptions dynamicSubstitutions */ + dynamicSubstitutions?: (boolean|null); + /** BuildOptions logStreamingOption */ logStreamingOption?: (google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|null); @@ -4157,6 +4202,9 @@ export namespace google { /** BuildOptions substitutionOption. */ public substitutionOption: (google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption); + /** BuildOptions dynamicSubstitutions. */ + public dynamicSubstitutions: boolean; + /** BuildOptions logStreamingOption. */ public logStreamingOption: (google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption); @@ -4278,7 +4326,10 @@ export namespace google { enum LoggingMode { LOGGING_UNSPECIFIED = 0, LEGACY = 1, - GCS_ONLY = 2 + GCS_ONLY = 2, + STACKDRIVER_ONLY = 3, + CLOUD_LOGGING_ONLY = 5, + NONE = 4 } } @@ -5563,6 +5614,232 @@ export namespace google { INPUT_ONLY = 4, IMMUTABLE = 5 } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace protobuf. */ @@ -7129,6 +7406,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ @@ -7301,6 +7581,9 @@ export namespace google { /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -7424,6 +7707,9 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); } /** Represents a FieldOptions. */ @@ -8964,6 +9250,96 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Verifies a FieldMask 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Timestamp. */ interface ITimestamp { diff --git a/protos/protos.js b/protos/protos.js index d8ef457..85e74bb 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -635,6 +635,7 @@ * Properties of a RetryBuildRequest. * @memberof google.devtools.cloudbuild.v1 * @interface IRetryBuildRequest + * @property {string|null} [name] RetryBuildRequest name * @property {string|null} [projectId] RetryBuildRequest projectId * @property {string|null} [id] RetryBuildRequest id */ @@ -654,6 +655,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * RetryBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @instance + */ + RetryBuildRequest.prototype.name = ""; + /** * RetryBuildRequest projectId. * @member {string} projectId @@ -698,6 +707,8 @@ 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 3, wireType 2 =*/26).string(message.name); return writer; }; @@ -732,6 +743,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: + message.name = reader.string(); + break; case 1: message.projectId = reader.string(); break; @@ -773,6 +787,9 @@ RetryBuildRequest.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"; @@ -794,6 +811,8 @@ if (object instanceof $root.google.devtools.cloudbuild.v1.RetryBuildRequest) return object; var message = new $root.google.devtools.cloudbuild.v1.RetryBuildRequest(); + if (object.name != null) + message.name = String(object.name); if (object.projectId != null) message.projectId = String(object.projectId); if (object.id != null) @@ -817,11 +836,14 @@ if (options.defaults) { object.projectId = ""; object.id = ""; + object.name = ""; } 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; }; @@ -3637,6 +3659,7 @@ * Properties of a Build. * @memberof google.devtools.cloudbuild.v1 * @interface IBuild + * @property {string|null} [name] Build name * @property {string|null} [id] Build id * @property {string|null} [projectId] Build projectId * @property {google.devtools.cloudbuild.v1.Build.Status|null} [status] Build status @@ -3660,6 +3683,7 @@ * @property {Array.|null} [tags] Build tags * @property {Array.|null} [secrets] Build secrets * @property {Object.|null} [timing] Build timing + * @property {string|null} [serviceAccount] Build serviceAccount */ /** @@ -3683,6 +3707,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * Build name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.name = ""; + /** * Build id. * @member {string} id @@ -3867,6 +3899,14 @@ */ Build.prototype.timing = $util.emptyObject; + /** + * Build serviceAccount. + * @member {string} serviceAccount + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.serviceAccount = ""; + /** * Creates a new Build instance using the specified properties. * @function create @@ -3945,6 +3985,10 @@ $root.google.devtools.cloudbuild.v1.Artifacts.encode(message.artifacts, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); if (message.queueTtl != null && Object.hasOwnProperty.call(message, "queueTtl")) $root.google.protobuf.Duration.encode(message.queueTtl, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + 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); return writer; }; @@ -3979,6 +4023,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 45: + message.name = reader.string(); + break; case 1: message.id = reader.string(); break; @@ -4094,6 +4141,9 @@ } message.timing[key] = value; break; + case 42: + message.serviceAccount = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -4129,6 +4179,9 @@ Build.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.id != null && message.hasOwnProperty("id")) if (!$util.isString(message.id)) return "id: string expected"; @@ -4262,6 +4315,9 @@ return "timing." + error; } } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; return null; }; @@ -4277,6 +4333,8 @@ if (object instanceof $root.google.devtools.cloudbuild.v1.Build) return object; var message = new $root.google.devtools.cloudbuild.v1.Build(); + if (object.name != null) + message.name = String(object.name); if (object.id != null) message.id = String(object.id); if (object.projectId != null) @@ -4428,6 +4486,8 @@ message.timing[keys[i]] = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.timing[keys[i]]); } } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); return message; }; @@ -4472,6 +4532,8 @@ object.logUrl = ""; object.artifacts = null; object.queueTtl = null; + object.serviceAccount = ""; + object.name = ""; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -4538,6 +4600,10 @@ object.artifacts = $root.google.devtools.cloudbuild.v1.Artifacts.toObject(message.artifacts, options); if (message.queueTtl != null && message.hasOwnProperty("queueTtl")) object.queueTtl = $root.google.protobuf.Duration.toObject(message.queueTtl, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; @@ -6480,6 +6546,7 @@ * Properties of a CreateBuildRequest. * @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 */ @@ -6499,6 +6566,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * CreateBuildRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @instance + */ + CreateBuildRequest.prototype.parent = ""; + /** * CreateBuildRequest projectId. * @member {string} projectId @@ -6543,6 +6618,8 @@ 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; }; @@ -6577,6 +6654,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.parent = reader.string(); + break; case 1: message.projectId = reader.string(); break; @@ -6618,6 +6698,9 @@ CreateBuildRequest.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"; @@ -6641,6 +6724,8 @@ if (object instanceof $root.google.devtools.cloudbuild.v1.CreateBuildRequest) 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) { @@ -6667,11 +6752,14 @@ if (options.defaults) { object.projectId = ""; object.build = null; + object.parent = ""; } 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; }; @@ -6695,6 +6783,7 @@ * Properties of a GetBuildRequest. * @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 */ @@ -6714,6 +6803,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * GetBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @instance + */ + GetBuildRequest.prototype.name = ""; + /** * GetBuildRequest projectId. * @member {string} projectId @@ -6758,6 +6855,8 @@ 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; }; @@ -6792,6 +6891,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; case 1: message.projectId = reader.string(); break; @@ -6833,6 +6935,9 @@ GetBuildRequest.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"; @@ -6854,6 +6959,8 @@ if (object instanceof $root.google.devtools.cloudbuild.v1.GetBuildRequest) 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) @@ -6877,11 +6984,14 @@ if (options.defaults) { object.projectId = ""; object.id = ""; + object.name = ""; } 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; }; @@ -6905,6 +7015,7 @@ * Properties of a ListBuildsRequest. * @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 @@ -6926,6 +7037,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * ListBuildsRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @instance + */ + ListBuildsRequest.prototype.parent = ""; + /** * ListBuildsRequest projectId. * @member {string} projectId @@ -6990,6 +7109,8 @@ 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; }; @@ -7024,6 +7145,9 @@ 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; @@ -7071,6 +7195,9 @@ ListBuildsRequest.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"; @@ -7098,6 +7225,8 @@ if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildsRequest) 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) @@ -7127,6 +7256,7 @@ object.pageSize = 0; object.pageToken = ""; object.filter = ""; + object.parent = ""; } if (message.projectId != null && message.hasOwnProperty("projectId")) object.projectId = message.projectId; @@ -7136,6 +7266,8 @@ 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; }; @@ -7390,6 +7522,7 @@ * Properties of a CancelBuildRequest. * @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 */ @@ -7409,6 +7542,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * CancelBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @instance + */ + CancelBuildRequest.prototype.name = ""; + /** * CancelBuildRequest projectId. * @member {string} projectId @@ -7453,6 +7594,8 @@ 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; }; @@ -7487,6 +7630,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; case 1: message.projectId = reader.string(); break; @@ -7528,6 +7674,9 @@ CancelBuildRequest.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"; @@ -7549,6 +7698,8 @@ if (object instanceof $root.google.devtools.cloudbuild.v1.CancelBuildRequest) return object; 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) @@ -7572,11 +7723,14 @@ if (options.defaults) { object.projectId = ""; object.id = ""; + object.name = ""; } 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; }; @@ -10385,6 +10539,7 @@ * @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 @@ -10452,6 +10607,14 @@ */ 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 @@ -10553,6 +10716,8 @@ 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; }; @@ -10609,6 +10774,9 @@ case 4: message.substitutionOption = reader.int32(); break; + case 17: + message.dynamicSubstitutions = reader.bool(); + break; case 5: message.logStreamingOption = reader.int32(); break; @@ -10709,6 +10877,9 @@ 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: @@ -10728,6 +10899,9 @@ case 0: case 1: case 2: + case 3: + case 5: + case 4: break; } if (message.env != null && message.hasOwnProperty("env")) { @@ -10832,6 +11006,8 @@ message.substitutionOption = 1; break; } + if (object.dynamicSubstitutions != null) + message.dynamicSubstitutions = Boolean(object.dynamicSubstitutions); switch (object.logStreamingOption) { case "STREAM_DEFAULT": case 0: @@ -10861,6 +11037,18 @@ 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)) @@ -10920,6 +11108,7 @@ 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 = []; @@ -10958,6 +11147,8 @@ 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; }; @@ -11039,12 +11230,18 @@ * @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; })(); @@ -14242,37 +14439,30 @@ return values; })(); - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular */ /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14280,78 +14470,143 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorSet.decode = function decode(reader, length) { + ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); break; default: reader.skipType(tag & 7); @@ -14362,69 +14617,570 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorSet message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileDescriptorSet.verify = function verify(message) { + ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; return null; }; /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); } - return message; - }; - + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(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]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + /** * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. * @function toObject @@ -18435,6 +19191,7 @@ * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition */ /** @@ -18447,6 +19204,7 @@ */ function FileOptions(properties) { this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18621,6 +19379,14 @@ */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** * Creates a new FileOptions instance using the specified properties. * @function create @@ -18688,6 +19454,9 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -18787,6 +19556,11 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -18897,6 +19671,15 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } return null; }; @@ -18974,6 +19757,16 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } return message; }; @@ -18990,8 +19783,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; @@ -19059,6 +19854,11 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } return object; }; @@ -19103,6 +19903,7 @@ * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** @@ -19161,6 +19962,14 @@ */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + /** * Creates a new MessageOptions instance using the specified properties. * @function create @@ -19196,6 +20005,8 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -19247,6 +20058,9 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -19303,6 +20117,11 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } return null; }; @@ -19336,6 +20155,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } return message; }; @@ -19359,6 +20183,7 @@ object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; + object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; @@ -19373,6 +20198,8 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; @@ -19404,6 +20231,7 @@ * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** @@ -19487,6 +20315,14 @@ */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + /** * Creates a new FieldOptions instance using the specified properties. * @function create @@ -19532,6 +20368,8 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -19599,6 +20437,9 @@ } else message[".google.api.fieldBehavior"].push(reader.int32()); break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -19689,6 +20530,11 @@ break; } } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } return null; }; @@ -19783,6 +20629,11 @@ break; } } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } return message; }; @@ -19810,6 +20661,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; + object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -19833,6 +20685,8 @@ for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); return object; }; @@ -23461,6 +24315,209 @@ return Empty; })(); + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + protobuf.Timestamp = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index e992dfa..f400c18 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -12,7 +12,9 @@ "java_multiple_files": true, "java_package": "com.google.cloudbuild.v1", "objc_class_prefix": "GCB", - "ruby_package": "Google::Cloud::Build::V1" + "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}" }, "nested": { "CloudBuild": { @@ -27,6 +29,8 @@ "options": { "(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.method_signature)": "project_id,build", "(google.longrunning.operation_info).response_type": "Build", "(google.longrunning.operation_info).metadata_type": "BuildOperationMetadata" @@ -37,6 +41,7 @@ "responseType": "Build", "options": { "(google.api.http).get": "/v1/projects/{project_id}/builds/{id}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/builds/*}", "(google.api.method_signature)": "project_id,id" } }, @@ -45,6 +50,7 @@ "responseType": "ListBuildsResponse", "options": { "(google.api.http).get": "/v1/projects/{project_id}/builds", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*}/builds", "(google.api.method_signature)": "project_id,filter" } }, @@ -54,6 +60,8 @@ "options": { "(google.api.http).post": "/v1/projects/{project_id}/builds/{id}:cancel", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/builds/*}:cancel", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "project_id,id" } }, @@ -63,6 +71,8 @@ "options": { "(google.api.http).post": "/v1/projects/{project_id}/builds/{id}:retry", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/builds/*}:retry", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "project_id,id", "(google.longrunning.operation_info).response_type": "Build", "(google.longrunning.operation_info).metadata_type": "BuildOperationMetadata" @@ -145,6 +155,13 @@ }, "RetryBuildRequest": { "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, "projectId": { "type": "string", "id": 1, @@ -339,7 +356,10 @@ }, "pullTiming": { "type": "TimeSpan", - "id": 13 + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "timeout": { "type": "google.protobuf.Duration", @@ -347,7 +367,10 @@ }, "status": { "type": "Build.Status", - "id": 12 + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -408,7 +431,18 @@ } }, "Build": { + "options": { + "(google.api.resource).type": "cloudbuild.googleapis.com/Build", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/builds/{build}" + }, "fields": { + "name": { + "type": "string", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "id": { "type": "string", "id": 1, @@ -425,11 +459,17 @@ }, "status": { "type": "Status", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "statusDetail": { "type": "string", - "id": 24 + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "source": { "type": "Source", @@ -491,11 +531,17 @@ }, "sourceProvenance": { "type": "SourceProvenance", - "id": 21 + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "buildTriggerId": { "type": "string", - "id": 22 + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "options": { "type": "BuildOptions", @@ -530,6 +576,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "serviceAccount": { + "type": "string", + "id": 42, + "options": { + "(google.api.resource_reference).type": "iam.googleapis.com/ServiceAccount" + } } }, "nested": { @@ -574,7 +627,10 @@ }, "timing": { "type": "TimeSpan", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } } @@ -665,6 +721,13 @@ }, "CreateBuildRequest": { "fields": { + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).child_type": "cloudbuild.googleapis.com/Build" + } + }, "projectId": { "type": "string", "id": 1, @@ -683,6 +746,13 @@ }, "GetBuildRequest": { "fields": { + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, "projectId": { "type": "string", "id": 1, @@ -701,6 +771,13 @@ }, "ListBuildsRequest": { "fields": { + "parent": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).child_type": "cloudbuild.googleapis.com/Build" + } + }, "projectId": { "type": "string", "id": 1, @@ -737,6 +814,13 @@ }, "CancelBuildRequest": { "fields": { + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, "projectId": { "type": "string", "id": 1, @@ -754,6 +838,10 @@ } }, "BuildTrigger": { + "options": { + "(google.api.resource).type": "cloudbuild.googleapis.com/BuildTrigger", + "(google.api.resource).pattern": "projects/{project}/triggers/{trigger}" + }, "oneofs": { "buildTemplate": { "oneof": [ @@ -1051,6 +1139,10 @@ "type": "SubstitutionOption", "id": 4 }, + "dynamicSubstitutions": { + "type": "bool", + "id": 17 + }, "logStreamingOption": { "type": "LogStreamingOption", "id": 5 @@ -1110,7 +1202,10 @@ "values": { "LOGGING_UNSPECIFIED": 0, "LEGACY": 1, - "GCS_ONLY": 2 + "GCS_ONLY": 2, + "STACKDRIVER_ONLY": 3, + "CLOUD_LOGGING_ONLY": 5, + "NONE": 4 } } } @@ -1283,7 +1378,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "FieldBehaviorProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -1407,6 +1502,72 @@ "INPUT_ONLY": 4, "IMMUTABLE": 5 } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } } } }, @@ -2332,6 +2493,15 @@ "Empty": { "fields": {} }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "Timestamp": { "fields": { "seconds": { diff --git a/src/v1/cloud_build_client.ts b/src/v1/cloud_build_client.ts index e0f85a5..4aaf8a0 100644 --- a/src/v1/cloud_build_client.ts +++ b/src/v1/cloud_build_client.ts @@ -62,6 +62,7 @@ export class CloudBuildClient { batching: {}, }; innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; cloudBuildStub?: Promise<{[name: string]: Function}>; @@ -164,6 +165,27 @@ export class CloudBuildClient { : nodejsProtoPath ); + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + buildTriggerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/triggers/{trigger}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectBuildPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/builds/{build}' + ), + projectLocationBuildPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/builds/{build}' + ), + serviceAccountPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/serviceAccounts/{service_account}' + ), + }; + // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. @@ -411,6 +433,9 @@ export class CloudBuildClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.name + * The name of the `Build` to retrieve. + * Format: `projects/{project}/locations/{location}/builds/{build}` * @param {string} request.projectId * Required. ID of the project. * @param {string} request.id @@ -459,6 +484,7 @@ export class CloudBuildClient { 'x-goog-request-params' ] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.getBuild(request, options, callback); @@ -499,6 +525,9 @@ export class CloudBuildClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.name + * The name of the `Build` to retrieve. + * Format: `projects/{project}/locations/{location}/builds/{build}` * @param {string} request.projectId * Required. ID of the project. * @param {string} request.id @@ -549,6 +578,7 @@ export class CloudBuildClient { 'x-goog-request-params' ] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.cancelBuild(request, options, callback); @@ -1409,6 +1439,9 @@ export class CloudBuildClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.parent + * The parent resource where this build will be created. + * Format: `projects/{project}/locations/{location}` * @param {string} request.projectId * Required. ID of the project. * @param {google.devtools.cloudbuild.v1.Build} request.build @@ -1464,6 +1497,7 @@ export class CloudBuildClient { 'x-goog-request-params' ] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createBuild(request, options, callback); @@ -1571,6 +1605,9 @@ export class CloudBuildClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.name + * The name of the `Build` to retry. + * Format: `projects/{project}/locations/{location}/builds/{build}` * @param {string} request.projectId * Required. ID of the project. * @param {string} request.id @@ -1626,6 +1663,7 @@ export class CloudBuildClient { 'x-goog-request-params' ] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.retryBuild(request, options, callback); @@ -1843,6 +1881,9 @@ export class CloudBuildClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.parent + * The parent of the collection of `Builds`. + * Format: `projects/{project}/locations/location` * @param {string} request.projectId * Required. ID of the project. * @param {number} request.pageSize @@ -1909,6 +1950,7 @@ export class CloudBuildClient { 'x-goog-request-params' ] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listBuilds(request, options, callback); @@ -1929,6 +1971,9 @@ export class CloudBuildClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.parent + * The parent of the collection of `Builds`. + * Format: `projects/{project}/locations/location` * @param {string} request.projectId * Required. ID of the project. * @param {number} request.pageSize @@ -1954,6 +1999,7 @@ export class CloudBuildClient { 'x-goog-request-params' ] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -1971,6 +2017,9 @@ export class CloudBuildClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.parent + * The parent of the collection of `Builds`. + * Format: `projects/{project}/locations/location` * @param {string} request.projectId * Required. ID of the project. * @param {number} request.pageSize @@ -1996,6 +2045,7 @@ export class CloudBuildClient { 'x-goog-request-params' ] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + parent: request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); @@ -2201,6 +2251,203 @@ export class CloudBuildClient { callSettings ) as AsyncIterable; } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified buildTrigger resource name string. + * + * @param {string} project + * @param {string} trigger + * @returns {string} Resource name string. + */ + buildTriggerPath(project: string, trigger: string) { + return this.pathTemplates.buildTriggerPathTemplate.render({ + project: project, + trigger: trigger, + }); + } + + /** + * Parse the project from BuildTrigger resource. + * + * @param {string} buildTriggerName + * A fully-qualified path representing BuildTrigger resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBuildTriggerName(buildTriggerName: string) { + return this.pathTemplates.buildTriggerPathTemplate.match(buildTriggerName) + .project; + } + + /** + * Parse the trigger from BuildTrigger resource. + * + * @param {string} buildTriggerName + * A fully-qualified path representing BuildTrigger resource. + * @returns {string} A string representing the trigger. + */ + matchTriggerFromBuildTriggerName(buildTriggerName: string) { + return this.pathTemplates.buildTriggerPathTemplate.match(buildTriggerName) + .trigger; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectBuild resource name string. + * + * @param {string} project + * @param {string} build + * @returns {string} Resource name string. + */ + projectBuildPath(project: string, build: string) { + return this.pathTemplates.projectBuildPathTemplate.render({ + project: project, + build: build, + }); + } + + /** + * Parse the project from ProjectBuild resource. + * + * @param {string} projectBuildName + * A fully-qualified path representing project_build resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectBuildName(projectBuildName: string) { + return this.pathTemplates.projectBuildPathTemplate.match(projectBuildName) + .project; + } + + /** + * Parse the build from ProjectBuild resource. + * + * @param {string} projectBuildName + * A fully-qualified path representing project_build resource. + * @returns {string} A string representing the build. + */ + matchBuildFromProjectBuildName(projectBuildName: string) { + return this.pathTemplates.projectBuildPathTemplate.match(projectBuildName) + .build; + } + + /** + * Return a fully-qualified projectLocationBuild resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} build + * @returns {string} Resource name string. + */ + projectLocationBuildPath(project: string, location: string, build: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.render({ + project: project, + location: location, + build: build, + }); + } + + /** + * Parse the project from ProjectLocationBuild resource. + * + * @param {string} projectLocationBuildName + * A fully-qualified path representing project_location_build resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBuildName(projectLocationBuildName: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.match( + projectLocationBuildName + ).project; + } + + /** + * Parse the location from ProjectLocationBuild resource. + * + * @param {string} projectLocationBuildName + * A fully-qualified path representing project_location_build resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBuildName(projectLocationBuildName: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.match( + projectLocationBuildName + ).location; + } + + /** + * Parse the build from ProjectLocationBuild resource. + * + * @param {string} projectLocationBuildName + * A fully-qualified path representing project_location_build resource. + * @returns {string} A string representing the build. + */ + matchBuildFromProjectLocationBuildName(projectLocationBuildName: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.match( + projectLocationBuildName + ).build; + } + + /** + * Return a fully-qualified serviceAccount resource name string. + * + * @param {string} project + * @param {string} service_account + * @returns {string} Resource name string. + */ + serviceAccountPath(project: string, serviceAccount: string) { + return this.pathTemplates.serviceAccountPathTemplate.render({ + project: project, + service_account: serviceAccount, + }); + } + + /** + * Parse the project from ServiceAccount resource. + * + * @param {string} serviceAccountName + * A fully-qualified path representing ServiceAccount resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceAccountName(serviceAccountName: string) { + return this.pathTemplates.serviceAccountPathTemplate.match( + serviceAccountName + ).project; + } + + /** + * Parse the service_account from ServiceAccount resource. + * + * @param {string} serviceAccountName + * A fully-qualified path representing ServiceAccount resource. + * @returns {string} A string representing the service_account. + */ + matchServiceAccountFromServiceAccountName(serviceAccountName: string) { + return this.pathTemplates.serviceAccountPathTemplate.match( + serviceAccountName + ).service_account; + } /** * Terminate the GRPC channel and close the client. diff --git a/synth.metadata b/synth.metadata index babbb66..6e05fc6 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-cloudbuild.git", - "sha": "956c248fa658604429f67b50a32d54727a8edfc6" + "sha": "81332f008c25cdf869a40fe43865500e3ab0594e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "sha": "bc18612d35891d88bcac57c85d79db93f4f29028", + "internalRef": "331027363" } }, { diff --git a/test/gapic_cloud_build_v1.ts b/test/gapic_cloud_build_v1.ts index 231add2..f0e33f3 100644 --- a/test/gapic_cloud_build_v1.ts +++ b/test/gapic_cloud_build_v1.ts @@ -237,7 +237,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.GetBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -268,7 +269,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.GetBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -316,7 +318,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.GetBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -346,7 +349,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.CancelBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -377,7 +381,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.CancelBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -425,7 +430,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.CancelBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1352,7 +1358,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedOptions = { otherArgs: { headers: { @@ -1384,7 +1391,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedOptions = { otherArgs: { headers: { @@ -1439,7 +1447,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedOptions = { otherArgs: { headers: { @@ -1470,7 +1479,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedOptions = { otherArgs: { headers: { @@ -1543,7 +1553,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1575,7 +1586,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1630,7 +1642,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1661,7 +1674,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1930,7 +1944,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedOptions = { otherArgs: { headers: { @@ -1963,7 +1978,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedOptions = { otherArgs: { headers: { @@ -2013,7 +2029,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedOptions = { otherArgs: { headers: { @@ -2044,7 +2061,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedResponse = [ generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), @@ -2094,7 +2112,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedError = new Error('expected'); client.descriptors.page.listBuilds.createStream = stubPageStreamingCall( undefined, @@ -2140,7 +2159,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedResponse = [ generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), @@ -2179,7 +2199,8 @@ describe('v1.CloudBuildClient', () => { new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; const expectedError = new Error('expected'); client.descriptors.page.listBuilds.asyncIterate = stubAsyncIterationCall( undefined, @@ -2520,4 +2541,268 @@ describe('v1.CloudBuildClient', () => { ); }); }); + + describe('Path templates', () => { + describe('buildTrigger', () => { + const fakePath = '/rendered/path/buildTrigger'; + const expectedParameters = { + project: 'projectValue', + trigger: 'triggerValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.buildTriggerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.buildTriggerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('buildTriggerPath', () => { + const result = client.buildTriggerPath('projectValue', 'triggerValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.buildTriggerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBuildTriggerName', () => { + const result = client.matchProjectFromBuildTriggerName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.buildTriggerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTriggerFromBuildTriggerName', () => { + const result = client.matchTriggerFromBuildTriggerName(fakePath); + assert.strictEqual(result, 'triggerValue'); + assert( + (client.pathTemplates.buildTriggerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectBuild', () => { + const fakePath = '/rendered/path/projectBuild'; + const expectedParameters = { + project: 'projectValue', + build: 'buildValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectBuildPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectBuildPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectBuildPath', () => { + const result = client.projectBuildPath('projectValue', 'buildValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectBuildPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectBuildName', () => { + const result = client.matchProjectFromProjectBuildName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectBuildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBuildFromProjectBuildName', () => { + const result = client.matchBuildFromProjectBuildName(fakePath); + assert.strictEqual(result, 'buildValue'); + assert( + (client.pathTemplates.projectBuildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationBuild', () => { + const fakePath = '/rendered/path/projectLocationBuild'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + build: 'buildValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationBuildPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBuildPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBuildPath', () => { + const result = client.projectLocationBuildPath( + 'projectValue', + 'locationValue', + 'buildValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationBuildPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationBuildName', () => { + const result = client.matchProjectFromProjectLocationBuildName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationBuildPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationBuildName', () => { + const result = client.matchLocationFromProjectLocationBuildName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationBuildPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBuildFromProjectLocationBuildName', () => { + const result = client.matchBuildFromProjectLocationBuildName(fakePath); + assert.strictEqual(result, 'buildValue'); + assert( + (client.pathTemplates.projectLocationBuildPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('serviceAccount', () => { + const fakePath = '/rendered/path/serviceAccount'; + const expectedParameters = { + project: 'projectValue', + service_account: 'serviceAccountValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.serviceAccountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.serviceAccountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('serviceAccountPath', () => { + const result = client.serviceAccountPath( + 'projectValue', + 'serviceAccountValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.serviceAccountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServiceAccountName', () => { + const result = client.matchProjectFromServiceAccountName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.serviceAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceAccountFromServiceAccountName', () => { + const result = client.matchServiceAccountFromServiceAccountName( + fakePath + ); + assert.strictEqual(result, 'serviceAccountValue'); + assert( + (client.pathTemplates.serviceAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); });