diff --git a/packages/google-cloud-run/README.md b/packages/google-cloud-run/README.md index dda374cdac9..2a5a56e09a0 100644 --- a/packages/google-cloud-run/README.md +++ b/packages/google-cloud-run/README.md @@ -111,6 +111,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Executions.cancel_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js,packages/google-cloud-run/samples/README.md) | | Executions.delete_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js,packages/google-cloud-run/samples/README.md) | | Executions.get_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.get_execution.js,packages/google-cloud-run/samples/README.md) | | Executions.list_executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.list_executions.js,packages/google-cloud-run/samples/README.md) | diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/condition.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/condition.proto index cb6680a61b5..458fc934cee 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/condition.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/condition.proto @@ -172,6 +172,9 @@ message Condition { // The execution is in the process of being cancelled. CANCELLING = 4; + + // The execution was deleted. + DELETED = 5; } // type is used to communicate the status of the reconciliation process. diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/execution.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/execution.proto index 29b73a232fa..5b9b19f1ebc 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/execution.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/execution.proto @@ -65,14 +65,28 @@ service Executions { metadata_type: "Execution" }; } + + // Cancels an Execution. + rpc CancelExecution(CancelExecutionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Execution" + metadata_type: "Execution" + }; + } } // Request message for obtaining a Execution by its full name. message GetExecutionRequest { // Required. The full name of the Execution. // Format: - // projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, - // where {project} can be project id or number. + // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + // where `{project}` can be project id or number. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } @@ -83,8 +97,8 @@ message GetExecutionRequest { message ListExecutionsRequest { // Required. The Execution from which the Executions should be listed. // To list all Executions across Jobs, use "-" instead of Job name. - // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - // can be project id or number. + // Format: `projects/{project}/locations/{location}/jobs/{job}`, where + // `{project}` can be project id or number. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -117,8 +131,8 @@ message ListExecutionsResponse { message DeleteExecutionRequest { // Required. The name of the Execution to delete. // Format: - // projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, - // where {project} can be project id or number. + // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + // where `{project}` can be project id or number. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } @@ -133,6 +147,26 @@ message DeleteExecutionRequest { string etag = 3; } +// Request message for deleting an Execution. +message CancelExecutionRequest { + // Required. The name of the Execution to cancel. + // Format: + // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + // where `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } + ]; + + // Indicates that the request should be validated without actually + // cancelling any resources. + bool validate_only = 2; + + // A system-generated fingerprint for this version of the resource. + // This may be used to detect modification conflict during updates. + string etag = 3; +} + // Execution represents the configuration of a single execution. A execution an // immutable resource that references a container image which is run to // completion. diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/job.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/job.proto index b180eb50610..8d6559ad4f3 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/job.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/job.proto @@ -21,13 +21,16 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/launch_stage.proto"; import "google/api/resource.proto"; +import "google/api/routing.proto"; import "google/cloud/run/v2/condition.proto"; import "google/cloud/run/v2/execution.proto"; import "google/cloud/run/v2/execution_template.proto"; +import "google/cloud/run/v2/k8s.min.proto"; import "google/cloud/run/v2/vendor_settings.proto"; import "google/iam/v1/iam_policy.proto"; import "google/iam/v1/policy.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; @@ -47,6 +50,12 @@ service Jobs { post: "/v2/{parent=projects/*/locations/*}/jobs" body: "job" }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; option (google.api.method_signature) = "parent,job,job_id"; option (google.longrunning.operation_info) = { response_type: "Job" @@ -59,6 +68,12 @@ service Jobs { option (google.api.http) = { get: "/v2/{name=projects/*/locations/*/jobs/*}" }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; option (google.api.method_signature) = "name"; } @@ -67,6 +82,12 @@ service Jobs { option (google.api.http) = { get: "/v2/{parent=projects/*/locations/*}/jobs" }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; option (google.api.method_signature) = "parent"; } @@ -76,6 +97,12 @@ service Jobs { patch: "/v2/{job.name=projects/*/locations/*/jobs/*}" body: "job" }; + option (google.api.routing) = { + routing_parameters { + field: "job.name" + path_template: "projects/*/locations/{location=*}/**" + } + }; option (google.api.method_signature) = "job"; option (google.longrunning.operation_info) = { response_type: "Job" @@ -88,6 +115,12 @@ service Jobs { option (google.api.http) = { delete: "/v2/{name=projects/*/locations/*/jobs/*}" }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { response_type: "Job" @@ -101,6 +134,12 @@ service Jobs { post: "/v2/{name=projects/*/locations/*/jobs/*}:run" body: "*" }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { response_type: "Execution" @@ -239,6 +278,38 @@ message DeleteJobRequest { // Request message to create a new Execution of a Job. message RunJobRequest { + // RunJob Overrides that contains Execution fields to be overridden. + message Overrides { + // Per-container override specification. + message ContainerOverride { + // The name of the container specified as a DNS_LABEL. + string name = 1; + + // Optional. Arguments to the entrypoint. Will replace existing args for + // override. + repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; + + // List of environment variables to set in the container. Will be merged + // with existing env for override. + repeated EnvVar env = 3; + + // Optional. True if the intention is to clear out existing args list. + bool clear_args = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Per container override specification. + repeated ContainerOverride container_overrides = 1; + + // Optional. The desired number of tasks the execution should run. Will + // replace existing task_count value. + int32 task_count = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Duration in seconds the task may be active before the system will + // actively try to mark it failed and kill associated containers. Will + // replace existing timeout_seconds value. + google.protobuf.Duration timeout = 4; + } + // Required. The full name of the Job. // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} // can be project id or number. @@ -254,6 +325,10 @@ message RunJobRequest { // A system-generated fingerprint for this version of the // resource. May be used to detect modification conflict during updates. string etag = 3; + + // Overrides specification for a given execution of a job. If provided, + // overrides will be applied to update the execution or task spec. + Overrides overrides = 4; } // Job represents the configuration of a single job, which references a diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto index 1d66551ac39..378462e0e11 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto @@ -43,7 +43,7 @@ option (google.api.resource_definition) = { // A single application container. // This specifies both the container to run, the command to run in the container // and the arguments to supply to it. -// Note that additional arguments may be supplied by the system to the container +// Note that additional arguments can be supplied by the system to the container // at runtime. message Container { // Name of the container specified as a DNS_LABEL (RFC 1123). @@ -93,6 +93,9 @@ message Container { // succeeds. Container will not be added to service endpoints if the probe // fails. Probe startup_probe = 11; + + // Names of the containers that must start before this container. + repeated string depends_on = 12; } // ResourceRequirements describes the compute resource requirements. @@ -118,8 +121,8 @@ message ResourceRequirements { // EnvVar represents an environment variable present in a Container. message EnvVar { - // Required. Name of the environment variable. Must be a C_IDENTIFIER, and - // mnay not exceed 32768 characters. + // Required. Name of the environment variable. Must not exceed 32768 + // characters. string name = 1 [(google.api.field_behavior) = REQUIRED]; oneof values { @@ -202,6 +205,9 @@ message Volume { // mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for // more information on how to connect Cloud SQL and Cloud Run. CloudSqlInstance cloud_sql_instance = 3; + + // Ephemeral storage used as a shared volume. + EmptyDirVolumeSource empty_dir = 4; } } @@ -285,6 +291,37 @@ message CloudSqlInstance { repeated string instances = 1; } +// In memory (tmpfs) ephemeral storage. +// It is ephemeral in the sense that when the sandbox is taken down, the data is +// destroyed with it (it does not persist across sandbox runs). +message EmptyDirVolumeSource { + // The different types of medium supported for EmptyDir. + enum Medium { + // When not specified, falls back to the default implementation which + // is currently in memory (this may change over time). + MEDIUM_UNSPECIFIED = 0; + + // Explicitly set the EmptyDir to be in memory. Uses tmpfs. + MEMORY = 1; + } + + // The medium on which the data is stored. Acceptable values today is only + // MEMORY or none. When none, the default will currently be backed by memory + // but could change over time. +optional + Medium medium = 1; + + // Limit on the storage usable by this EmptyDir volume. + // The size limit is also applicable for memory medium. + // The maximum usage on memory medium EmptyDir would be the minimum value + // between the SizeLimit specified here and the sum of memory limits of all + // containers. The default is nil which means that the limit is undefined. + // More info: + // https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + // Info in Kubernetes: + // https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + string size_limit = 2; +} + // Probe describes a health check to be performed against a container to // determine whether it is alive or ready to receive traffic. message Probe { @@ -363,7 +400,7 @@ message GRPCAction { int32 port = 1; // Service is the name of the service to place in the gRPC HealthCheckRequest - // (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If + // (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If // this is not specified, the default behavior is defined by gRPC. string service = 2; } diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/task.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/task.proto index 7741c301617..e24acc0e034 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/task.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/task.proto @@ -133,12 +133,18 @@ message Task { map annotations = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Represents time when the task was created by the job - // controller. It is not guaranteed to be set in happens-before order across - // separate operations. + // Output only. Represents time when the task was created by the system. + // It is not guaranteed to be set in happens-before order across separate + // operations. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Represents time when the task was scheduled to run by the + // system. It is not guaranteed to be set in happens-before order across + // separate operations. + google.protobuf.Timestamp scheduled_time = 34 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Represents time when the task started to run. // It is not guaranteed to be set in happens-before order across separate // operations. diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto index 389b6153229..9a24d3db517 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.cloud.run.v2; +import "google/api/field_behavior.proto"; import "google/api/resource.proto"; option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; @@ -23,10 +24,8 @@ option java_multiple_files = true; option java_outer_classname = "VendorSettingsProto"; option java_package = "com.google.cloud.run.v2"; -// VPC Access settings. For more information on creating a VPC Connector, visit -// https://cloud.google.com/vpc/docs/configure-serverless-vpc-access For -// information on how to configure Cloud Run with an existing VPC Connector, -// visit https://cloud.google.com/run/docs/configuring/connecting-vpc +// VPC Access settings. For more information on sending traffic to a VPC +// network, visit https://cloud.google.com/run/docs/configuring/connecting-vpc. message VpcAccess { // Egress options for VPC access. enum VpcEgress { @@ -40,15 +39,42 @@ message VpcAccess { PRIVATE_RANGES_ONLY = 2; } + // Direct VPC egress settings. + message NetworkInterface { + // The VPC network that the Cloud Run resource will be able to send traffic + // to. At least one of network or subnetwork must be specified. If both + // network and subnetwork are specified, the given VPC subnetwork must + // belong to the given VPC network. If network is not specified, it will be + // looked up from the subnetwork. + string network = 1; + + // The VPC subnetwork that the Cloud Run resource will get IPs from. At + // least one of network or subnetwork must be specified. If both + // network and subnetwork are specified, the given VPC subnetwork must + // belong to the given VPC network. If subnetwork is not specified, the + // subnetwork with the same name with the network will be used. + string subnetwork = 2; + + // Network tags applied to this Cloud Run resource. + repeated string tags = 3; + } + // VPC Access connector name. // Format: projects/{project}/locations/{location}/connectors/{connector}, // where {project} can be project id or number. + // For more information on sending traffic to a VPC network via a connector, + // visit https://cloud.google.com/run/docs/configuring/vpc-connectors. string connector = 1 [(google.api.resource_reference) = { type: "vpcaccess.googleapis.com/Connector" }]; - // Traffic VPC egress settings. + // Traffic VPC egress settings. If not provided, it defaults to + // PRIVATE_RANGES_ONLY. VpcEgress egress = 2; + + // Direct VPC egress settings. Currently only single network interface is + // supported. + repeated NetworkInterface network_interfaces = 3; } // Settings for Binary Authorization feature. diff --git a/packages/google-cloud-run/protos/protos.d.ts b/packages/google-cloud-run/protos/protos.d.ts index 35d3779b975..d67465c48cf 100644 --- a/packages/google-cloud-run/protos/protos.d.ts +++ b/packages/google-cloud-run/protos/protos.d.ts @@ -2719,11 +2719,11 @@ export namespace google { /** MethodOptions .google.api.methodSignature */ ".google.api.methodSignature"?: (string[]|null); - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - /** MethodOptions .google.api.routing */ ".google.api.routing"?: (google.api.IRoutingRule|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); } /** Represents a MethodOptions. */ @@ -4130,7 +4130,8 @@ export namespace google { JOB_STATUS_SERVICE_POLLING_ERROR = 1, NON_ZERO_EXIT_CODE = 2, CANCELLED = 3, - CANCELLING = 4 + CANCELLING = 4, + DELETED = 5 } } @@ -4195,6 +4196,20 @@ export namespace google { * @returns Promise */ public deleteExecution(request: google.cloud.run.v2.IDeleteExecutionRequest): Promise; + + /** + * Calls CancelExecution. + * @param request CancelExecutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest, callback: google.cloud.run.v2.Executions.CancelExecutionCallback): void; + + /** + * Calls CancelExecution. + * @param request CancelExecutionRequest message or plain object + * @returns Promise + */ + public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest): Promise; } namespace Executions { @@ -4219,6 +4234,13 @@ export namespace google { * @param [response] Operation */ type DeleteExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a GetExecutionRequest. */ @@ -4645,6 +4667,115 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CancelExecutionRequest. */ + interface ICancelExecutionRequest { + + /** CancelExecutionRequest name */ + name?: (string|null); + + /** CancelExecutionRequest validateOnly */ + validateOnly?: (boolean|null); + + /** CancelExecutionRequest etag */ + etag?: (string|null); + } + + /** Represents a CancelExecutionRequest. */ + class CancelExecutionRequest implements ICancelExecutionRequest { + + /** + * Constructs a new CancelExecutionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICancelExecutionRequest); + + /** CancelExecutionRequest name. */ + public name: string; + + /** CancelExecutionRequest validateOnly. */ + public validateOnly: boolean; + + /** CancelExecutionRequest etag. */ + public etag: string; + + /** + * Creates a new CancelExecutionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelExecutionRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICancelExecutionRequest): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @param message CancelExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @param message CancelExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Verifies a CancelExecutionRequest 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 CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelExecutionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. + * @param message CancelExecutionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CancelExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelExecutionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelExecutionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Execution. */ interface IExecution { @@ -5075,6 +5206,9 @@ export namespace google { /** Container startupProbe */ startupProbe?: (google.cloud.run.v2.IProbe|null); + + /** Container dependsOn */ + dependsOn?: (string[]|null); } /** Represents a Container. */ @@ -5119,6 +5253,9 @@ export namespace google { /** Container startupProbe. */ public startupProbe?: (google.cloud.run.v2.IProbe|null); + /** Container dependsOn. */ + public dependsOn: string[]; + /** * Creates a new Container instance using the specified properties. * @param [properties] Properties to set @@ -5835,6 +5972,9 @@ export namespace google { /** Volume cloudSqlInstance */ cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); + + /** Volume emptyDir */ + emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); } /** Represents a Volume. */ @@ -5855,8 +5995,11 @@ export namespace google { /** Volume cloudSqlInstance. */ public cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); + /** Volume emptyDir. */ + public emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); + /** Volume volumeType. */ - public volumeType?: ("secret"|"cloudSqlInstance"); + public volumeType?: ("secret"|"cloudSqlInstance"|"emptyDir"); /** * Creates a new Volume instance using the specified properties. @@ -6251,6 +6394,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an EmptyDirVolumeSource. */ + interface IEmptyDirVolumeSource { + + /** EmptyDirVolumeSource medium */ + medium?: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium|null); + + /** EmptyDirVolumeSource sizeLimit */ + sizeLimit?: (string|null); + } + + /** Represents an EmptyDirVolumeSource. */ + class EmptyDirVolumeSource implements IEmptyDirVolumeSource { + + /** + * Constructs a new EmptyDirVolumeSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IEmptyDirVolumeSource); + + /** EmptyDirVolumeSource medium. */ + public medium: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium); + + /** EmptyDirVolumeSource sizeLimit. */ + public sizeLimit: string; + + /** + * Creates a new EmptyDirVolumeSource instance using the specified properties. + * @param [properties] Properties to set + * @returns EmptyDirVolumeSource instance + */ + public static create(properties?: google.cloud.run.v2.IEmptyDirVolumeSource): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @param message EmptyDirVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @param message EmptyDirVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Verifies an EmptyDirVolumeSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmptyDirVolumeSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. + * @param message EmptyDirVolumeSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.EmptyDirVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmptyDirVolumeSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmptyDirVolumeSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EmptyDirVolumeSource { + + /** Medium enum. */ + enum Medium { + MEDIUM_UNSPECIFIED = 0, + MEMORY = 1 + } + } + /** Properties of a Probe. */ interface IProbe { @@ -6807,6 +7062,9 @@ export namespace google { /** VpcAccess egress */ egress?: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress|null); + + /** VpcAccess networkInterfaces */ + networkInterfaces?: (google.cloud.run.v2.VpcAccess.INetworkInterface[]|null); } /** Represents a VpcAccess. */ @@ -6824,6 +7082,9 @@ export namespace google { /** VpcAccess egress. */ public egress: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress); + /** VpcAccess networkInterfaces. */ + public networkInterfaces: google.cloud.run.v2.VpcAccess.INetworkInterface[]; + /** * Creates a new VpcAccess instance using the specified properties. * @param [properties] Properties to set @@ -6910,6 +7171,115 @@ export namespace google { ALL_TRAFFIC = 1, PRIVATE_RANGES_ONLY = 2 } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface tags */ + tags?: (string[]|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface); + + /** NetworkInterface network. */ + public network: string; + + /** NetworkInterface subnetwork. */ + public subnetwork: string; + + /** NetworkInterface tags. */ + public tags: string[]; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface): google.cloud.run.v2.VpcAccess.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.VpcAccess.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.VpcAccess.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VpcAccess.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VpcAccess.NetworkInterface; + + /** + * Verifies a NetworkInterface 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 NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VpcAccess.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.VpcAccess.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a BinaryAuthorization. */ @@ -8136,6 +8506,9 @@ export namespace google { /** RunJobRequest etag */ etag?: (string|null); + + /** RunJobRequest overrides */ + overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); } /** Represents a RunJobRequest. */ @@ -8156,6 +8529,9 @@ export namespace google { /** RunJobRequest etag. */ public etag: string; + /** RunJobRequest overrides. */ + public overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); + /** * Creates a new RunJobRequest instance using the specified properties. * @param [properties] Properties to set @@ -8234,6 +8610,236 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace RunJobRequest { + + /** Properties of an Overrides. */ + interface IOverrides { + + /** Overrides containerOverrides */ + containerOverrides?: (google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]|null); + + /** Overrides taskCount */ + taskCount?: (number|null); + + /** Overrides timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents an Overrides. */ + class Overrides implements IOverrides { + + /** + * Constructs a new Overrides. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.RunJobRequest.IOverrides); + + /** Overrides containerOverrides. */ + public containerOverrides: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]; + + /** Overrides taskCount. */ + public taskCount: number; + + /** Overrides timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new Overrides instance using the specified properties. + * @param [properties] Properties to set + * @returns Overrides instance + */ + public static create(properties?: google.cloud.run.v2.RunJobRequest.IOverrides): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @param message Overrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @param message Overrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Overrides message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Decodes an Overrides message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Verifies an Overrides message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Overrides message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Overrides + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Creates a plain object from an Overrides message. Also converts values to other types if specified. + * @param message Overrides + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Overrides to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Overrides + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Overrides { + + /** Properties of a ContainerOverride. */ + interface IContainerOverride { + + /** ContainerOverride name */ + name?: (string|null); + + /** ContainerOverride args */ + args?: (string[]|null); + + /** ContainerOverride env */ + env?: (google.cloud.run.v2.IEnvVar[]|null); + + /** ContainerOverride clearArgs */ + clearArgs?: (boolean|null); + } + + /** Represents a ContainerOverride. */ + class ContainerOverride implements IContainerOverride { + + /** + * Constructs a new ContainerOverride. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride); + + /** ContainerOverride name. */ + public name: string; + + /** ContainerOverride args. */ + public args: string[]; + + /** ContainerOverride env. */ + public env: google.cloud.run.v2.IEnvVar[]; + + /** ContainerOverride clearArgs. */ + public clearArgs: boolean; + + /** + * Creates a new ContainerOverride instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerOverride instance + */ + public static create(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @param message ContainerOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @param message ContainerOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Verifies a ContainerOverride 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 ContainerOverride message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerOverride + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. + * @param message ContainerOverride + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerOverride to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerOverride + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + /** Properties of a Job. */ interface IJob { @@ -11279,6 +11885,9 @@ export namespace google { /** Task createTime */ createTime?: (google.protobuf.ITimestamp|null); + /** Task scheduledTime */ + scheduledTime?: (google.protobuf.ITimestamp|null); + /** Task startTime */ startTime?: (google.protobuf.ITimestamp|null); @@ -11379,6 +11988,9 @@ export namespace google { /** Task createTime. */ public createTime?: (google.protobuf.ITimestamp|null); + /** Task scheduledTime. */ + public scheduledTime?: (google.protobuf.ITimestamp|null); + /** Task startTime. */ public startTime?: (google.protobuf.ITimestamp|null); diff --git a/packages/google-cloud-run/protos/protos.js b/packages/google-cloud-run/protos/protos.js index e58c15bcef9..3c9820ecd64 100644 --- a/packages/google-cloud-run/protos/protos.js +++ b/packages/google-cloud-run/protos/protos.js @@ -7737,8 +7737,8 @@ * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo */ /** @@ -7799,20 +7799,20 @@ MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * MethodOptions .google.api.routing. + * @member {google.api.IRoutingRule|null|undefined} .google.api.routing * @memberof google.protobuf.MethodOptions * @instance */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + MethodOptions.prototype[".google.api.routing"] = null; /** - * MethodOptions .google.api.routing. - * @member {google.api.IRoutingRule|null|undefined} .google.api.routing + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo * @memberof google.protobuf.MethodOptions * @instance */ - MethodOptions.prototype[".google.api.routing"] = null; + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; /** * Creates a new MethodOptions instance using the specified properties. @@ -7912,14 +7912,14 @@ message[".google.api.methodSignature"].push(reader.string()); break; } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } case 72295729: { message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32()); break; } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7988,16 +7988,16 @@ if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); if (error) return ".google.api.routing." + error; } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } return null; }; @@ -8057,16 +8057,16 @@ for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } if (object[".google.api.routing"] != null) { if (typeof object[".google.api.routing"] !== "object") throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } return message; }; @@ -11203,6 +11203,7 @@ case 2: case 3: case 4: + case 5: break; } } @@ -11437,6 +11438,10 @@ case 4: message.executionReason = 4; break; + case "DELETED": + case 5: + message.executionReason = 5; + break; } return message; }; @@ -11638,6 +11643,7 @@ * @property {number} NON_ZERO_EXIT_CODE=2 NON_ZERO_EXIT_CODE value * @property {number} CANCELLED=3 CANCELLED value * @property {number} CANCELLING=4 CANCELLING value + * @property {number} DELETED=5 DELETED value */ Condition.ExecutionReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -11646,6 +11652,7 @@ values[valuesById[2] = "NON_ZERO_EXIT_CODE"] = 2; values[valuesById[3] = "CANCELLED"] = 3; values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "DELETED"] = 5; return values; })(); @@ -11783,6 +11790,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. + * @memberof google.cloud.run.v2.Executions + * @typedef CancelExecutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelExecution. + * @function cancelExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @param {google.cloud.run.v2.Executions.CancelExecutionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.cancelExecution = function cancelExecution(request, callback) { + return this.rpcCall(cancelExecution, $root.google.cloud.run.v2.CancelExecutionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelExecution" }); + + /** + * Calls CancelExecution. + * @function cancelExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Executions; })(); @@ -12760,6 +12800,256 @@ return DeleteExecutionRequest; })(); + v2.CancelExecutionRequest = (function() { + + /** + * Properties of a CancelExecutionRequest. + * @memberof google.cloud.run.v2 + * @interface ICancelExecutionRequest + * @property {string|null} [name] CancelExecutionRequest name + * @property {boolean|null} [validateOnly] CancelExecutionRequest validateOnly + * @property {string|null} [etag] CancelExecutionRequest etag + */ + + /** + * Constructs a new CancelExecutionRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CancelExecutionRequest. + * @implements ICancelExecutionRequest + * @constructor + * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set + */ + function CancelExecutionRequest(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]]; + } + + /** + * CancelExecutionRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + */ + CancelExecutionRequest.prototype.name = ""; + + /** + * CancelExecutionRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + */ + CancelExecutionRequest.prototype.validateOnly = false; + + /** + * CancelExecutionRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + */ + CancelExecutionRequest.prototype.etag = ""; + + /** + * Creates a new CancelExecutionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest instance + */ + CancelExecutionRequest.create = function create(properties) { + return new CancelExecutionRequest(properties); + }; + + /** + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelExecutionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelExecutionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CancelExecutionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelExecutionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelExecutionRequest message. + * @function verify + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelExecutionRequest.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.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest + */ + CancelExecutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CancelExecutionRequest) + return object; + var message = new $root.google.cloud.run.v2.CancelExecutionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.CancelExecutionRequest} message CancelExecutionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelExecutionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this CancelExecutionRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + * @returns {Object.} JSON object + */ + CancelExecutionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelExecutionRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CancelExecutionRequest"; + }; + + return CancelExecutionRequest; + })(); + v2.Execution = (function() { /** @@ -14246,6 +14536,7 @@ * @property {string|null} [workingDir] Container workingDir * @property {google.cloud.run.v2.IProbe|null} [livenessProbe] Container livenessProbe * @property {google.cloud.run.v2.IProbe|null} [startupProbe] Container startupProbe + * @property {Array.|null} [dependsOn] Container dependsOn */ /** @@ -14262,6 +14553,7 @@ this.env = []; this.ports = []; this.volumeMounts = []; + this.dependsOn = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14356,6 +14648,14 @@ */ Container.prototype.startupProbe = null; + /** + * Container dependsOn. + * @member {Array.} dependsOn + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.dependsOn = $util.emptyArray; + /** * Creates a new Container instance using the specified properties. * @function create @@ -14407,6 +14707,9 @@ $root.google.cloud.run.v2.Probe.encode(message.livenessProbe, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.startupProbe != null && Object.hasOwnProperty.call(message, "startupProbe")) $root.google.cloud.run.v2.Probe.encode(message.startupProbe, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.dependsOn != null && message.dependsOn.length) + for (var i = 0; i < message.dependsOn.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.dependsOn[i]); return writer; }; @@ -14495,6 +14798,12 @@ message.startupProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); break; } + case 12: { + if (!(message.dependsOn && message.dependsOn.length)) + message.dependsOn = []; + message.dependsOn.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -14595,6 +14904,13 @@ if (error) return "startupProbe." + error; } + if (message.dependsOn != null && message.hasOwnProperty("dependsOn")) { + if (!Array.isArray(message.dependsOn)) + return "dependsOn: array expected"; + for (var i = 0; i < message.dependsOn.length; ++i) + if (!$util.isString(message.dependsOn[i])) + return "dependsOn: string[] expected"; + } return null; }; @@ -14675,6 +14991,13 @@ throw TypeError(".google.cloud.run.v2.Container.startupProbe: object expected"); message.startupProbe = $root.google.cloud.run.v2.Probe.fromObject(object.startupProbe); } + if (object.dependsOn) { + if (!Array.isArray(object.dependsOn)) + throw TypeError(".google.cloud.run.v2.Container.dependsOn: array expected"); + message.dependsOn = []; + for (var i = 0; i < object.dependsOn.length; ++i) + message.dependsOn[i] = String(object.dependsOn[i]); + } return message; }; @@ -14697,6 +15020,7 @@ object.env = []; object.ports = []; object.volumeMounts = []; + object.dependsOn = []; } if (options.defaults) { object.name = ""; @@ -14743,6 +15067,11 @@ object.livenessProbe = $root.google.cloud.run.v2.Probe.toObject(message.livenessProbe, options); if (message.startupProbe != null && message.hasOwnProperty("startupProbe")) object.startupProbe = $root.google.cloud.run.v2.Probe.toObject(message.startupProbe, options); + if (message.dependsOn && message.dependsOn.length) { + object.dependsOn = []; + for (var j = 0; j < message.dependsOn.length; ++j) + object.dependsOn[j] = message.dependsOn[j]; + } return object; }; @@ -16239,6 +16568,7 @@ * @property {string|null} [name] Volume name * @property {google.cloud.run.v2.ISecretVolumeSource|null} [secret] Volume secret * @property {google.cloud.run.v2.ICloudSqlInstance|null} [cloudSqlInstance] Volume cloudSqlInstance + * @property {google.cloud.run.v2.IEmptyDirVolumeSource|null} [emptyDir] Volume emptyDir */ /** @@ -16280,17 +16610,25 @@ */ Volume.prototype.cloudSqlInstance = null; + /** + * Volume emptyDir. + * @member {google.cloud.run.v2.IEmptyDirVolumeSource|null|undefined} emptyDir + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Volume.prototype.emptyDir = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Volume volumeType. - * @member {"secret"|"cloudSqlInstance"|undefined} volumeType + * @member {"secret"|"cloudSqlInstance"|"emptyDir"|undefined} volumeType * @memberof google.cloud.run.v2.Volume * @instance */ Object.defineProperty(Volume.prototype, "volumeType", { - get: $util.oneOfGetter($oneOfFields = ["secret", "cloudSqlInstance"]), + get: $util.oneOfGetter($oneOfFields = ["secret", "cloudSqlInstance", "emptyDir"]), set: $util.oneOfSetter($oneOfFields) }); @@ -16324,6 +16662,8 @@ $root.google.cloud.run.v2.SecretVolumeSource.encode(message.secret, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.cloudSqlInstance != null && Object.hasOwnProperty.call(message, "cloudSqlInstance")) $root.google.cloud.run.v2.CloudSqlInstance.encode(message.cloudSqlInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.emptyDir != null && Object.hasOwnProperty.call(message, "emptyDir")) + $root.google.cloud.run.v2.EmptyDirVolumeSource.encode(message.emptyDir, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -16370,6 +16710,10 @@ message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.decode(reader, reader.uint32()); break; } + case 4: { + message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -16427,6 +16771,16 @@ return "cloudSqlInstance." + error; } } + if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { + if (properties.volumeType === 1) + return "volumeType: multiple values"; + properties.volumeType = 1; + { + var error = $root.google.cloud.run.v2.EmptyDirVolumeSource.verify(message.emptyDir); + if (error) + return "emptyDir." + error; + } + } return null; }; @@ -16454,6 +16808,11 @@ throw TypeError(".google.cloud.run.v2.Volume.cloudSqlInstance: object expected"); message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.fromObject(object.cloudSqlInstance); } + if (object.emptyDir != null) { + if (typeof object.emptyDir !== "object") + throw TypeError(".google.cloud.run.v2.Volume.emptyDir: object expected"); + message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.fromObject(object.emptyDir); + } return message; }; @@ -16484,6 +16843,11 @@ if (options.oneofs) object.volumeType = "cloudSqlInstance"; } + if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { + object.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.toObject(message.emptyDir, options); + if (options.oneofs) + object.volumeType = "emptyDir"; + } return object; }; @@ -17257,6 +17621,266 @@ return CloudSqlInstance; })(); + v2.EmptyDirVolumeSource = (function() { + + /** + * Properties of an EmptyDirVolumeSource. + * @memberof google.cloud.run.v2 + * @interface IEmptyDirVolumeSource + * @property {google.cloud.run.v2.EmptyDirVolumeSource.Medium|null} [medium] EmptyDirVolumeSource medium + * @property {string|null} [sizeLimit] EmptyDirVolumeSource sizeLimit + */ + + /** + * Constructs a new EmptyDirVolumeSource. + * @memberof google.cloud.run.v2 + * @classdesc Represents an EmptyDirVolumeSource. + * @implements IEmptyDirVolumeSource + * @constructor + * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set + */ + function EmptyDirVolumeSource(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]]; + } + + /** + * EmptyDirVolumeSource medium. + * @member {google.cloud.run.v2.EmptyDirVolumeSource.Medium} medium + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @instance + */ + EmptyDirVolumeSource.prototype.medium = 0; + + /** + * EmptyDirVolumeSource sizeLimit. + * @member {string} sizeLimit + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @instance + */ + EmptyDirVolumeSource.prototype.sizeLimit = ""; + + /** + * Creates a new EmptyDirVolumeSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource instance + */ + EmptyDirVolumeSource.create = function create(properties) { + return new EmptyDirVolumeSource(properties); + }; + + /** + * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmptyDirVolumeSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.medium != null && Object.hasOwnProperty.call(message, "medium")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.medium); + if (message.sizeLimit != null && Object.hasOwnProperty.call(message, "sizeLimit")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sizeLimit); + return writer; + }; + + /** + * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmptyDirVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmptyDirVolumeSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.medium = reader.int32(); + break; + } + case 2: { + message.sizeLimit = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmptyDirVolumeSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmptyDirVolumeSource message. + * @function verify + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmptyDirVolumeSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.medium != null && message.hasOwnProperty("medium")) + switch (message.medium) { + default: + return "medium: enum value expected"; + case 0: + case 1: + break; + } + if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) + if (!$util.isString(message.sizeLimit)) + return "sizeLimit: string expected"; + return null; + }; + + /** + * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource + */ + EmptyDirVolumeSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.EmptyDirVolumeSource) + return object; + var message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); + switch (object.medium) { + default: + if (typeof object.medium === "number") { + message.medium = object.medium; + break; + } + break; + case "MEDIUM_UNSPECIFIED": + case 0: + message.medium = 0; + break; + case "MEMORY": + case 1: + message.medium = 1; + break; + } + if (object.sizeLimit != null) + message.sizeLimit = String(object.sizeLimit); + return message; + }; + + /** + * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.EmptyDirVolumeSource} message EmptyDirVolumeSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmptyDirVolumeSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.medium = options.enums === String ? "MEDIUM_UNSPECIFIED" : 0; + object.sizeLimit = ""; + } + if (message.medium != null && message.hasOwnProperty("medium")) + object.medium = options.enums === String ? $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] === undefined ? message.medium : $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] : message.medium; + if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) + object.sizeLimit = message.sizeLimit; + return object; + }; + + /** + * Converts this EmptyDirVolumeSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @instance + * @returns {Object.} JSON object + */ + EmptyDirVolumeSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmptyDirVolumeSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmptyDirVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.EmptyDirVolumeSource"; + }; + + /** + * Medium enum. + * @name google.cloud.run.v2.EmptyDirVolumeSource.Medium + * @enum {number} + * @property {number} MEDIUM_UNSPECIFIED=0 MEDIUM_UNSPECIFIED value + * @property {number} MEMORY=1 MEMORY value + */ + EmptyDirVolumeSource.Medium = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEDIUM_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMORY"] = 1; + return values; + })(); + + return EmptyDirVolumeSource; + })(); + v2.Probe = (function() { /** @@ -18585,6 +19209,7 @@ * @interface IVpcAccess * @property {string|null} [connector] VpcAccess connector * @property {google.cloud.run.v2.VpcAccess.VpcEgress|null} [egress] VpcAccess egress + * @property {Array.|null} [networkInterfaces] VpcAccess networkInterfaces */ /** @@ -18596,6 +19221,7 @@ * @param {google.cloud.run.v2.IVpcAccess=} [properties] Properties to set */ function VpcAccess(properties) { + this.networkInterfaces = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18618,6 +19244,14 @@ */ VpcAccess.prototype.egress = 0; + /** + * VpcAccess networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.run.v2.VpcAccess + * @instance + */ + VpcAccess.prototype.networkInterfaces = $util.emptyArray; + /** * Creates a new VpcAccess instance using the specified properties. * @function create @@ -18646,6 +19280,9 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.connector); if (message.egress != null && Object.hasOwnProperty.call(message, "egress")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.egress); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.run.v2.VpcAccess.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -18688,6 +19325,12 @@ message.egress = reader.int32(); break; } + case 3: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.run.v2.VpcAccess.NetworkInterface.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -18735,6 +19378,15 @@ case 2: break; } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } return null; }; @@ -18772,6 +19424,16 @@ message.egress = 2; break; } + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } return message; }; @@ -18788,6 +19450,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.networkInterfaces = []; if (options.defaults) { object.connector = ""; object.egress = options.enums === String ? "VPC_EGRESS_UNSPECIFIED" : 0; @@ -18796,6 +19460,11 @@ object.connector = message.connector; if (message.egress != null && message.hasOwnProperty("egress")) object.egress = options.enums === String ? $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] === undefined ? message.egress : $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] : message.egress; + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.toObject(message.networkInterfaces[j], options); + } return object; }; @@ -18841,6 +19510,273 @@ return values; })(); + VpcAccess.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.run.v2.VpcAccess + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {Array.|null} [tags] NetworkInterface tags + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.run.v2.VpcAccess + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + this.tags = []; + 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]]; + } + + /** + * NetworkInterface network. + * @member {string} network + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = ""; + + /** + * NetworkInterface subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = ""; + + /** + * NetworkInterface tags. + * @member {Array.} tags + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @instance + */ + NetworkInterface.prototype.tags = $util.emptyArray; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.VpcAccess.NetworkInterface) + return object; + var message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.run.v2.VpcAccess.NetworkInterface.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tags = []; + if (options.defaults) { + object.network = ""; + object.subnetwork = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.VpcAccess.NetworkInterface"; + }; + + return NetworkInterface; + })(); + return VpcAccess; })(); @@ -21586,6 +22522,7 @@ * @property {string|null} [name] RunJobRequest name * @property {boolean|null} [validateOnly] RunJobRequest validateOnly * @property {string|null} [etag] RunJobRequest etag + * @property {google.cloud.run.v2.RunJobRequest.IOverrides|null} [overrides] RunJobRequest overrides */ /** @@ -21627,6 +22564,14 @@ */ RunJobRequest.prototype.etag = ""; + /** + * RunJobRequest overrides. + * @member {google.cloud.run.v2.RunJobRequest.IOverrides|null|undefined} overrides + * @memberof google.cloud.run.v2.RunJobRequest + * @instance + */ + RunJobRequest.prototype.overrides = null; + /** * Creates a new RunJobRequest instance using the specified properties. * @function create @@ -21657,6 +22602,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) + $root.google.cloud.run.v2.RunJobRequest.Overrides.encode(message.overrides, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -21703,6 +22650,10 @@ message.etag = reader.string(); break; } + case 4: { + message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -21747,6 +22698,11 @@ if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; + if (message.overrides != null && message.hasOwnProperty("overrides")) { + var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.verify(message.overrides); + if (error) + return "overrides." + error; + } return null; }; @@ -21768,6 +22724,11 @@ message.validateOnly = Boolean(object.validateOnly); if (object.etag != null) message.etag = String(object.etag); + if (object.overrides != null) { + if (typeof object.overrides !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.overrides: object expected"); + message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.fromObject(object.overrides); + } return message; }; @@ -21788,6 +22749,7 @@ object.name = ""; object.validateOnly = false; object.etag = ""; + object.overrides = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -21795,6 +22757,8 @@ object.validateOnly = message.validateOnly; if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; + if (message.overrides != null && message.hasOwnProperty("overrides")) + object.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.toObject(message.overrides, options); return object; }; @@ -21824,6 +22788,595 @@ return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest"; }; + RunJobRequest.Overrides = (function() { + + /** + * Properties of an Overrides. + * @memberof google.cloud.run.v2.RunJobRequest + * @interface IOverrides + * @property {Array.|null} [containerOverrides] Overrides containerOverrides + * @property {number|null} [taskCount] Overrides taskCount + * @property {google.protobuf.IDuration|null} [timeout] Overrides timeout + */ + + /** + * Constructs a new Overrides. + * @memberof google.cloud.run.v2.RunJobRequest + * @classdesc Represents an Overrides. + * @implements IOverrides + * @constructor + * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set + */ + function Overrides(properties) { + this.containerOverrides = []; + 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]]; + } + + /** + * Overrides containerOverrides. + * @member {Array.} containerOverrides + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + */ + Overrides.prototype.containerOverrides = $util.emptyArray; + + /** + * Overrides taskCount. + * @member {number} taskCount + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + */ + Overrides.prototype.taskCount = 0; + + /** + * Overrides timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + */ + Overrides.prototype.timeout = null; + + /** + * Creates a new Overrides instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides instance + */ + Overrides.create = function create(properties) { + return new Overrides(properties); + }; + + /** + * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Overrides.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.containerOverrides != null && message.containerOverrides.length) + for (var i = 0; i < message.containerOverrides.length; ++i) + $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.encode(message.containerOverrides[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.taskCount); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Overrides.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Overrides message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Overrides.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.containerOverrides && message.containerOverrides.length)) + message.containerOverrides = []; + message.containerOverrides.push($root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.decode(reader, reader.uint32())); + break; + } + case 2: { + message.taskCount = reader.int32(); + break; + } + case 4: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Overrides message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Overrides.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Overrides message. + * @function verify + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Overrides.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.containerOverrides != null && message.hasOwnProperty("containerOverrides")) { + if (!Array.isArray(message.containerOverrides)) + return "containerOverrides: array expected"; + for (var i = 0; i < message.containerOverrides.length; ++i) { + var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify(message.containerOverrides[i]); + if (error) + return "containerOverrides." + error; + } + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount)) + return "taskCount: integer expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates an Overrides message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides + */ + Overrides.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides) + return object; + var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); + if (object.containerOverrides) { + if (!Array.isArray(object.containerOverrides)) + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: array expected"); + message.containerOverrides = []; + for (var i = 0; i < object.containerOverrides.length; ++i) { + if (typeof object.containerOverrides[i] !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: object expected"); + message.containerOverrides[i] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.fromObject(object.containerOverrides[i]); + } + } + if (object.taskCount != null) + message.taskCount = object.taskCount | 0; + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from an Overrides message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides} message Overrides + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Overrides.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.containerOverrides = []; + if (options.defaults) { + object.taskCount = 0; + object.timeout = null; + } + if (message.containerOverrides && message.containerOverrides.length) { + object.containerOverrides = []; + for (var j = 0; j < message.containerOverrides.length; ++j) + object.containerOverrides[j] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.toObject(message.containerOverrides[j], options); + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + object.taskCount = message.taskCount; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this Overrides to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + * @returns {Object.} JSON object + */ + Overrides.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Overrides + * @function getTypeUrl + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Overrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides"; + }; + + Overrides.ContainerOverride = (function() { + + /** + * Properties of a ContainerOverride. + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @interface IContainerOverride + * @property {string|null} [name] ContainerOverride name + * @property {Array.|null} [args] ContainerOverride args + * @property {Array.|null} [env] ContainerOverride env + * @property {boolean|null} [clearArgs] ContainerOverride clearArgs + */ + + /** + * Constructs a new ContainerOverride. + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @classdesc Represents a ContainerOverride. + * @implements IContainerOverride + * @constructor + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set + */ + function ContainerOverride(properties) { + this.args = []; + this.env = []; + 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]]; + } + + /** + * ContainerOverride name. + * @member {string} name + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.name = ""; + + /** + * ContainerOverride args. + * @member {Array.} args + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.args = $util.emptyArray; + + /** + * ContainerOverride env. + * @member {Array.} env + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.env = $util.emptyArray; + + /** + * ContainerOverride clearArgs. + * @member {boolean} clearArgs + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.clearArgs = false; + + /** + * Creates a new ContainerOverride instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride instance + */ + ContainerOverride.create = function create(properties) { + return new ContainerOverride(properties); + }; + + /** + * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.args[i]); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + $root.google.cloud.run.v2.EnvVar.encode(message.env[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clearArgs != null && Object.hasOwnProperty.call(message, "clearArgs")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.clearArgs); + return writer; + }; + + /** + * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerOverride.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 3: { + if (!(message.env && message.env.length)) + message.env = []; + message.env.push($root.google.cloud.run.v2.EnvVar.decode(reader, reader.uint32())); + break; + } + case 4: { + message.clearArgs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerOverride message. + * @function verify + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerOverride.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.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) { + var error = $root.google.cloud.run.v2.EnvVar.verify(message.env[i]); + if (error) + return "env." + error; + } + } + if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) + if (typeof message.clearArgs !== "boolean") + return "clearArgs: boolean expected"; + return null; + }; + + /** + * Creates a ContainerOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride + */ + ContainerOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride) + return object; + var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); + if (object.name != null) + message.name = String(object.name); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) { + if (typeof object.env[i] !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: object expected"); + message.env[i] = $root.google.cloud.run.v2.EnvVar.fromObject(object.env[i]); + } + } + if (object.clearArgs != null) + message.clearArgs = Boolean(object.clearArgs); + return message; + }; + + /** + * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} message ContainerOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.env = []; + } + if (options.defaults) { + object.name = ""; + object.clearArgs = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = $root.google.cloud.run.v2.EnvVar.toObject(message.env[j], options); + } + if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) + object.clearArgs = message.clearArgs; + return object; + }; + + /** + * Converts this ContainerOverride to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + * @returns {Object.} JSON object + */ + ContainerOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerOverride + * @function getTypeUrl + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride"; + }; + + return ContainerOverride; + })(); + + return Overrides; + })(); + return RunJobRequest; })(); @@ -30361,6 +31914,7 @@ * @property {Object.|null} [labels] Task labels * @property {Object.|null} [annotations] Task annotations * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime + * @property {google.protobuf.ITimestamp|null} [scheduledTime] Task scheduledTime * @property {google.protobuf.ITimestamp|null} [startTime] Task startTime * @property {google.protobuf.ITimestamp|null} [completionTime] Task completionTime * @property {google.protobuf.ITimestamp|null} [updateTime] Task updateTime @@ -30455,6 +32009,14 @@ */ Task.prototype.createTime = null; + /** + * Task scheduledTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduledTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.scheduledTime = null; + /** * Task startTime. * @member {google.protobuf.ITimestamp|null|undefined} startTime @@ -30734,6 +32296,8 @@ writer.uint32(/* id 32, wireType 2 =*/258).string(message.logUri); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzs); + if (message.scheduledTime != null && Object.hasOwnProperty.call(message, "scheduledTime")) + $root.google.protobuf.Timestamp.encode(message.scheduledTime, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); return writer; @@ -30832,6 +32396,10 @@ message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 34: { + message.scheduledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } case 27: { message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; @@ -30999,6 +32567,11 @@ if (error) return "createTime." + error; } + if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduledTime); + if (error) + return "scheduledTime." + error; + } if (message.startTime != null && message.hasOwnProperty("startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime); if (error) @@ -31158,6 +32731,11 @@ throw TypeError(".google.cloud.run.v2.Task.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } + if (object.scheduledTime != null) { + if (typeof object.scheduledTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.scheduledTime: object expected"); + message.scheduledTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledTime); + } if (object.startTime != null) { if (typeof object.startTime !== "object") throw TypeError(".google.cloud.run.v2.Task.startTime: object expected"); @@ -31337,6 +32915,7 @@ object.vpcAccess = null; object.logUri = ""; object.satisfiesPzs = false; + object.scheduledTime = null; object.etag = ""; } if (message.name != null && message.hasOwnProperty("name")) @@ -31419,6 +32998,8 @@ object.logUri = message.logUri; if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) object.satisfiesPzs = message.satisfiesPzs; + if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) + object.scheduledTime = $root.google.protobuf.Timestamp.toObject(message.scheduledTime, options); if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; return object; diff --git a/packages/google-cloud-run/protos/protos.json b/packages/google-cloud-run/protos/protos.json index 9c137007f3e..81c85a773c7 100644 --- a/packages/google-cloud-run/protos/protos.json +++ b/packages/google-cloud-run/protos/protos.json @@ -1151,7 +1151,8 @@ "JOB_STATUS_SERVICE_POLLING_ERROR": 1, "NON_ZERO_EXIT_CODE": 2, "CANCELLED": 3, - "CANCELLING": 4 + "CANCELLING": 4, + "DELETED": 5 } } } @@ -1223,6 +1224,34 @@ } } ] + }, + "CancelExecution": { + "requestType": "CancelExecutionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Execution", + "(google.longrunning.operation_info).metadata_type": "Execution" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Execution", + "metadata_type": "Execution" + } + } + ] } } }, @@ -1295,6 +1324,26 @@ } } }, + "CancelExecutionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Execution" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, "Execution": { "options": { "(google.api.resource).type": "run.googleapis.com/Execution", @@ -1595,6 +1644,11 @@ "startupProbe": { "type": "Probe", "id": 11 + }, + "dependsOn": { + "rule": "repeated", + "type": "string", + "id": 12 } } }, @@ -1704,7 +1758,8 @@ "volumeType": { "oneof": [ "secret", - "cloudSqlInstance" + "cloudSqlInstance", + "emptyDir" ] } }, @@ -1723,6 +1778,10 @@ "cloudSqlInstance": { "type": "CloudSqlInstance", "id": 3 + }, + "emptyDir": { + "type": "EmptyDirVolumeSource", + "id": 4 } } }, @@ -1774,6 +1833,26 @@ } } }, + "EmptyDirVolumeSource": { + "fields": { + "medium": { + "type": "Medium", + "id": 1 + }, + "sizeLimit": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Medium": { + "values": { + "MEDIUM_UNSPECIFIED": 0, + "MEMORY": 1 + } + } + } + }, "Probe": { "oneofs": { "probeType": { @@ -1879,6 +1958,11 @@ "egress": { "type": "VpcEgress", "id": 2 + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 3 } }, "nested": { @@ -1888,6 +1972,23 @@ "ALL_TRAFFIC": 1, "PRIVATE_RANGES_ONLY": 2 } + }, + "NetworkInterface": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "subnetwork": { + "type": "string", + "id": 2 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } } } }, @@ -1985,6 +2086,8 @@ "options": { "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/jobs", "(google.api.http).body": "job", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", "(google.api.method_signature)": "parent,job,job_id", "(google.longrunning.operation_info).response_type": "Job", "(google.longrunning.operation_info).metadata_type": "Job" @@ -1996,6 +2099,14 @@ "body": "job" } }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, { "(google.api.method_signature)": "parent,job,job_id" }, @@ -2012,6 +2123,8 @@ "responseType": "Job", "options": { "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", "(google.api.method_signature)": "name" }, "parsedOptions": [ @@ -2020,6 +2133,14 @@ "get": "/v2/{name=projects/*/locations/*/jobs/*}" } }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, { "(google.api.method_signature)": "name" } @@ -2030,6 +2151,8 @@ "responseType": "ListJobsResponse", "options": { "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/jobs", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", "(google.api.method_signature)": "parent" }, "parsedOptions": [ @@ -2038,6 +2161,14 @@ "get": "/v2/{parent=projects/*/locations/*}/jobs" } }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, { "(google.api.method_signature)": "parent" } @@ -2049,6 +2180,8 @@ "options": { "(google.api.http).patch": "/v2/{job.name=projects/*/locations/*/jobs/*}", "(google.api.http).body": "job", + "(google.api.routing).routing_parameters.field": "job.name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", "(google.api.method_signature)": "job", "(google.longrunning.operation_info).response_type": "Job", "(google.longrunning.operation_info).metadata_type": "Job" @@ -2060,6 +2193,14 @@ "body": "job" } }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "job.name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, { "(google.api.method_signature)": "job" }, @@ -2076,6 +2217,8 @@ "responseType": "google.longrunning.Operation", "options": { "(google.api.http).delete": "/v2/{name=projects/*/locations/*/jobs/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "Job", "(google.longrunning.operation_info).metadata_type": "Job" @@ -2086,6 +2229,14 @@ "delete": "/v2/{name=projects/*/locations/*/jobs/*}" } }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, { "(google.api.method_signature)": "name" }, @@ -2103,6 +2254,8 @@ "options": { "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*}:run", "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "Execution", "(google.longrunning.operation_info).metadata_type": "Execution" @@ -2114,6 +2267,14 @@ "body": "*" } }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, { "(google.api.method_signature)": "name" }, @@ -2308,6 +2469,62 @@ "etag": { "type": "string", "id": 3 + }, + "overrides": { + "type": "Overrides", + "id": 4 + } + }, + "nested": { + "Overrides": { + "fields": { + "containerOverrides": { + "rule": "repeated", + "type": "ContainerOverride", + "id": 1 + }, + "taskCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + }, + "nested": { + "ContainerOverride": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "env": { + "rule": "repeated", + "type": "EnvVar", + "id": 3 + }, + "clearArgs": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } } } }, @@ -3641,6 +3858,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "scheduledTime": { + "type": "google.protobuf.Timestamp", + "id": 34, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "startTime": { "type": "google.protobuf.Timestamp", "id": 27, diff --git a/packages/google-cloud-run/samples/README.md b/packages/google-cloud-run/samples/README.md index 7f43d2e3c76..26e9e48c503 100644 --- a/packages/google-cloud-run/samples/README.md +++ b/packages/google-cloud-run/samples/README.md @@ -12,6 +12,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Executions.cancel_execution](#executions.cancel_execution) * [Executions.delete_execution](#executions.delete_execution) * [Executions.get_execution](#executions.get_execution) * [Executions.list_executions](#executions.list_executions) @@ -54,6 +55,23 @@ Before running the samples, make sure you've followed the steps outlined in +### Executions.cancel_execution + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js` + + +----- + + + + ### Executions.delete_execution View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js). diff --git a/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js b/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js new file mode 100644 index 00000000000..7891dd31cd2 --- /dev/null +++ b/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Executions_CancelExecution_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + */ + // const name = 'abc123' + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {ExecutionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ExecutionsClient(); + + async function callCancelExecution() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.cancelExecution(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelExecution(); + // [END run_v2_generated_Executions_CancelExecution_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js b/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js index bec84488fcb..d8786bdc59a 100644 --- a/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js +++ b/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js @@ -31,8 +31,8 @@ function main(name) { /** * Required. The name of the Execution to delete. * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, - * where {project} can be project id or number. + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. */ // const name = 'abc123' /** diff --git a/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js b/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js index 8233f4e8a19..0c2aa25cc2e 100644 --- a/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js +++ b/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js @@ -31,8 +31,8 @@ function main(name) { /** * Required. The full name of the Execution. * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, - * where {project} can be project id or number. + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. */ // const name = 'abc123' diff --git a/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js b/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js index ebcc951cd10..c3cd751c6a8 100644 --- a/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js +++ b/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js @@ -31,8 +31,8 @@ function main(parent) { /** * Required. The Execution from which the Executions should be listed. * To list all Executions across Jobs, use "-" instead of Job name. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-run/samples/generated/v2/jobs.run_job.js b/packages/google-cloud-run/samples/generated/v2/jobs.run_job.js index 6bf942f7fe2..5eb1e279a09 100644 --- a/packages/google-cloud-run/samples/generated/v2/jobs.run_job.js +++ b/packages/google-cloud-run/samples/generated/v2/jobs.run_job.js @@ -44,6 +44,11 @@ function main(name) { * resource. May be used to detect modification conflict during updates. */ // const etag = 'abc123' + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + */ + // const overrides = {} // Imports the Run library const {JobsClient} = require('@google-cloud/run').v2; diff --git a/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json b/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json index 25a91a3f003..28858fb5549 100644 --- a/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json +++ b/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json @@ -151,6 +151,54 @@ } } }, + { + "regionTag": "run_v2_generated_Executions_CancelExecution_async", + "title": "Executions cancelExecution Sample", + "origin": "API_DEFINITION", + "description": " Cancels an Execution.", + "canonical": true, + "file": "executions.cancel_execution.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelExecution", + "fullName": "google.cloud.run.v2.Executions.CancelExecution", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "CancelExecution", + "fullName": "google.cloud.run.v2.Executions.CancelExecution", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + } + }, { "regionTag": "run_v2_generated_Jobs_CreateJob_async", "title": "Executions createJob Sample", @@ -402,7 +450,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 71, "type": "FULL" } ], @@ -422,6 +470,10 @@ { "name": "etag", "type": "TYPE_STRING" + }, + { + "name": "overrides", + "type": ".google.cloud.run.v2.RunJobRequest.Overrides" } ], "resultType": ".google.longrunning.Operation", diff --git a/packages/google-cloud-run/src/v2/executions_client.ts b/packages/google-cloud-run/src/v2/executions_client.ts index d28a99d42e7..828bf02ee8b 100644 --- a/packages/google-cloud-run/src/v2/executions_client.ts +++ b/packages/google-cloud-run/src/v2/executions_client.ts @@ -260,6 +260,12 @@ export class ExecutionsClient { const deleteExecutionMetadata = protoFilesRoot.lookup( '.google.cloud.run.v2.Execution' ) as gax.protobuf.Type; + const cancelExecutionResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution' + ) as gax.protobuf.Type; + const cancelExecutionMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution' + ) as gax.protobuf.Type; this.descriptors.longrunning = { deleteExecution: new this._gaxModule.LongrunningDescriptor( @@ -267,6 +273,11 @@ export class ExecutionsClient { deleteExecutionResponse.decode.bind(deleteExecutionResponse), deleteExecutionMetadata.decode.bind(deleteExecutionMetadata) ), + cancelExecution: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelExecutionResponse.decode.bind(cancelExecutionResponse), + cancelExecutionMetadata.decode.bind(cancelExecutionMetadata) + ), }; // Put together the default options sent with requests. @@ -322,6 +333,7 @@ export class ExecutionsClient { 'getExecution', 'listExecutions', 'deleteExecution', + 'cancelExecution', ]; for (const methodName of executionsStubMethods) { const callPromise = this.executionsStub.then( @@ -416,8 +428,8 @@ export class ExecutionsClient { * @param {string} request.name * Required. The full name of the Execution. * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, - * where {project} can be project id or number. + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -502,8 +514,8 @@ export class ExecutionsClient { * @param {string} request.name * Required. The name of the Execution to delete. * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, - * where {project} can be project id or number. + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. * @param {boolean} request.validateOnly * Indicates that the request should be validated without actually * deleting any resources. @@ -639,6 +651,151 @@ export class ExecutionsClient { protos.google.cloud.run.v2.Execution >; } + /** + * Cancels an Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated without actually + * cancelling any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/executions.cancel_execution.js + * region_tag:run_v2_generated_Executions_CancelExecution_async + */ + cancelExecution( + request?: protos.google.cloud.run.v2.ICancelExecutionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + cancelExecution( + request: protos.google.cloud.run.v2.ICancelExecutionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelExecution( + request: protos.google.cloud.run.v2.ICancelExecutionRequest, + callback: Callback< + LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelExecution( + request?: protos.google.cloud.run.v2.ICancelExecutionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelExecution(request, options, callback); + } + /** + * Check the status of the long running operation returned by `cancelExecution()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/executions.cancel_execution.js + * region_tag:run_v2_generated_Executions_CancelExecution_async + */ + async checkCancelExecutionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.run.v2.Execution, + protos.google.cloud.run.v2.Execution + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.cancelExecution, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.run.v2.Execution, + protos.google.cloud.run.v2.Execution + >; + } /** * Lists Executions from a Job. * @@ -647,8 +804,8 @@ export class ExecutionsClient { * @param {string} request.parent * Required. The Execution from which the Executions should be listed. * To list all Executions across Jobs, use "-" instead of Job name. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. * @param {number} request.pageSize * Maximum number of Executions to return in this call. * @param {string} request.pageToken @@ -742,8 +899,8 @@ export class ExecutionsClient { * @param {string} request.parent * Required. The Execution from which the Executions should be listed. * To list all Executions across Jobs, use "-" instead of Job name. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. * @param {number} request.pageSize * Maximum number of Executions to return in this call. * @param {string} request.pageToken @@ -793,8 +950,8 @@ export class ExecutionsClient { * @param {string} request.parent * Required. The Execution from which the Executions should be listed. * To list all Executions across Jobs, use "-" instead of Job name. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. * @param {number} request.pageSize * Maximum number of Executions to return in this call. * @param {string} request.pageToken diff --git a/packages/google-cloud-run/src/v2/executions_client_config.json b/packages/google-cloud-run/src/v2/executions_client_config.json index fadded8ee9a..20bcbf69f35 100644 --- a/packages/google-cloud-run/src/v2/executions_client_config.json +++ b/packages/google-cloud-run/src/v2/executions_client_config.json @@ -31,6 +31,10 @@ "DeleteExecution": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CancelExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-run/src/v2/gapic_metadata.json b/packages/google-cloud-run/src/v2/gapic_metadata.json index cfa5d3b6414..03c89b4f289 100644 --- a/packages/google-cloud-run/src/v2/gapic_metadata.json +++ b/packages/google-cloud-run/src/v2/gapic_metadata.json @@ -20,6 +20,11 @@ "deleteExecution" ] }, + "CancelExecution": { + "methods": [ + "cancelExecution" + ] + }, "ListExecutions": { "methods": [ "listExecutions", @@ -42,6 +47,11 @@ "deleteExecution" ] }, + "CancelExecution": { + "methods": [ + "cancelExecution" + ] + }, "ListExecutions": { "methods": [ "listExecutions", diff --git a/packages/google-cloud-run/src/v2/jobs_client.ts b/packages/google-cloud-run/src/v2/jobs_client.ts index 9b665b00499..26074615331 100644 --- a/packages/google-cloud-run/src/v2/jobs_client.ts +++ b/packages/google-cloud-run/src/v2/jobs_client.ts @@ -524,10 +524,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); this.initialize(); return this.innerApiCalls.getJob(request, options, callback); } @@ -909,10 +920,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); this.initialize(); return this.innerApiCalls.createJob(request, options, callback); } @@ -1049,10 +1071,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.job?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - 'job.name': request.job!.name ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); this.initialize(); return this.innerApiCalls.updateJob(request, options, callback); } @@ -1190,10 +1223,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); this.initialize(); return this.innerApiCalls.deleteJob(request, options, callback); } @@ -1243,6 +1287,9 @@ export class JobsClient { * @param {string} request.etag * A system-generated fingerprint for this version of the * resource. May be used to detect modification conflict during updates. + * @param {google.cloud.run.v2.RunJobRequest.Overrides} request.overrides + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1331,10 +1378,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); this.initialize(); return this.innerApiCalls.runJob(request, options, callback); } @@ -1459,10 +1517,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); this.initialize(); return this.innerApiCalls.listJobs(request, options, callback); } @@ -1501,10 +1570,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1552,10 +1632,21 @@ export class JobsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; + const routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue + .toString() + .match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, {location: parameterValue}); + } + } + } options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', - }); + this._gaxModule.routingHeader.fromParams(routingParameter); const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-run/test/gapic_executions_v2.ts b/packages/google-cloud-run/test/gapic_executions_v2.ts index b1020d1fe82..ab5c481de52 100644 --- a/packages/google-cloud-run/test/gapic_executions_v2.ts +++ b/packages/google-cloud-run/test/gapic_executions_v2.ts @@ -586,6 +586,200 @@ describe('v2.ExecutionsClient', () => { }); }); + describe('cancelExecution', () => { + it('invokes cancelExecution without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.run.v2.CancelExecutionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelExecution = + stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelExecution(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelExecution without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.run.v2.CancelExecutionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelExecution = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelExecution( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IExecution + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelExecution with call error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.run.v2.CancelExecutionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelExecution = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelExecution(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelExecution with LRO error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.run.v2.CancelExecutionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelExecution = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.cancelExecution(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelExecutionProgress without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCancelExecutionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelExecutionProgress with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCancelExecutionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listExecutions', () => { it('invokes listExecutions without error', async () => { const client = new executionsModule.v2.ExecutionsClient({ diff --git a/packages/google-cloud-run/test/gapic_jobs_v2.ts b/packages/google-cloud-run/test/gapic_jobs_v2.ts index 38f90bddd2f..99100c9221a 100644 --- a/packages/google-cloud-run/test/gapic_jobs_v2.ts +++ b/packages/google-cloud-run/test/gapic_jobs_v2.ts @@ -272,12 +272,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.GetJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.cloud.run.v2.Job() ); @@ -303,12 +300,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.GetJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.cloud.run.v2.Job() ); @@ -350,12 +344,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.GetJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getJob(request), expectedError); @@ -378,11 +369,8 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.GetJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.GetJobRequest', - ['name'] - ); - request.name = defaultValue1; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getJob(request), expectedError); @@ -790,12 +778,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.CreateJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.CreateJobRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -822,12 +807,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.CreateJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.CreateJobRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -876,12 +858,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.CreateJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.CreateJobRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.createJob = stubLongRunningCall( undefined, @@ -907,12 +886,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.CreateJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.CreateJobRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.createJob = stubLongRunningCall( undefined, @@ -980,13 +956,10 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.UpdateJobRequest() ); - request.job ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.UpdateJobRequest', - ['job', 'name'] - ); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1013,13 +986,10 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.UpdateJobRequest() ); - request.job ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.UpdateJobRequest', - ['job', 'name'] - ); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1068,13 +1038,10 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.UpdateJobRequest() ); - request.job ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.UpdateJobRequest', - ['job', 'name'] - ); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.updateJob = stubLongRunningCall( undefined, @@ -1100,13 +1067,10 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.UpdateJobRequest() ); - request.job ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.UpdateJobRequest', - ['job', 'name'] - ); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.updateJob = stubLongRunningCall( undefined, @@ -1174,12 +1138,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.DeleteJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1206,12 +1167,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.DeleteJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1260,12 +1218,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.DeleteJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.deleteJob = stubLongRunningCall( undefined, @@ -1291,12 +1246,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.DeleteJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.DeleteJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.deleteJob = stubLongRunningCall( undefined, @@ -1364,12 +1316,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.RunJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.RunJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1396,12 +1345,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.RunJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.RunJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1450,12 +1396,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.RunJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.RunJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.runJob = stubLongRunningCall( undefined, @@ -1481,12 +1424,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.RunJobRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.RunJobRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.runJob = stubLongRunningCall( undefined, @@ -1554,12 +1494,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.ListJobsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.run.v2.Job()), generateSampleMessage(new protos.google.cloud.run.v2.Job()), @@ -1587,12 +1524,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.ListJobsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.run.v2.Job()), generateSampleMessage(new protos.google.cloud.run.v2.Job()), @@ -1636,12 +1570,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.ListJobsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listJobs(request), expectedError); @@ -1664,12 +1595,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.ListJobsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.run.v2.Job()), generateSampleMessage(new protos.google.cloud.run.v2.Job()), @@ -1715,12 +1643,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.ListJobsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.descriptors.page.listJobs.createStream = stubPageStreamingCall( undefined, @@ -1763,12 +1688,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.ListJobsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.run.v2.Job()), generateSampleMessage(new protos.google.cloud.run.v2.Job()), @@ -1805,12 +1727,9 @@ describe('v2.JobsClient', () => { const request = generateSampleMessage( new protos.google.cloud.run.v2.ListJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.run.v2.ListJobsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; const expectedError = new Error('expected'); client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( undefined,