diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 0000000..7634225 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,4 @@ +docker: + digest: sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 0000000..4ca4c08 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,36 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/workflows/executions/(.*)/.*-nodejs/protos/(.*) + dest: /owl-bot-staging/$1/protos/$2 + - source: /google/cloud/workflows/executions/(.*)/.*-nodejs/src/(.*) + dest: /owl-bot-staging/$1/src/$2 + - source: /google/cloud/workflows/executions/(.*)/.*-nodejs/test/(.*) + dest: /owl-bot-staging/$1/test/$2 + - source: /google/cloud/workflows/executions/(.*)/.*-nodejs/system-test/(.*) + dest: /owl-bot-staging/$1/system-test/$2 + - source: /google/cloud/workflows/(.*)/.*-nodejs/src/(.*) + dest: /owl-bot-staging/$1/src/$2 + - source: /google/cloud/workflows/(.*)/.*-nodejs/protos/(.*) + dest: /owl-bot-staging/$1/protos/$2 + - source: /google/cloud/workflows/(.*)/.*-nodejs/test/(.*) + dest: /owl-bot-staging/$1/test/$2 + - source: /google/cloud/workflows/(.*)/.*-nodejs/system-test/(.*) + dest: /owl-bot-staging/$1/system-test/$2 diff --git a/.repo-metadata.json b/.repo-metadata.json index f580b1d..cdd6a2a 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -9,5 +9,6 @@ "repo": "googleapis/nodejs-workflows", "distribution_name": "@google-cloud/workflows", "api_id": "workflows.googleapis.com", - "requires_billing": true + "requires_billing": true, + "default_version": "v1" } diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 0000000..cc2287a --- /dev/null +++ b/owlbot.py @@ -0,0 +1,27 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""This script is used to synthesize generated parts of this library.""" + +import os +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.node as node +import json +import logging +from pathlib import Path +import shutil +node.owlbot_main(templates_excludes=["src/index.ts"], staging_excludes=["src/v1/index.ts", "src/v1beta/index.ts", "src/index.ts", "README.md", "package.json"]) +shutil.rmtree('v1', ignore_errors=True) +shutil.rmtree('v1beta', ignore_errors=True) + diff --git a/protos/google/cloud/workflows/executions/v1/executions.proto b/protos/google/cloud/workflows/executions/v1/executions.proto new file mode 100644 index 0000000..583a5d9 --- /dev/null +++ b/protos/google/cloud/workflows/executions/v1/executions.proto @@ -0,0 +1,253 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.workflows.executions.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1;executions"; +option java_multiple_files = true; +option java_outer_classname = "ExecutionsProto"; +option java_package = "com.google.cloud.workflows.executions.v1"; +option (google.api.resource_definition) = { + type: "workflows.googleapis.com/Workflow" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}" +}; + +// Executions is used to start and manage running instances of +// [Workflows][google.cloud.workflows.v1.Workflow] called executions. +service Executions { + option (google.api.default_host) = "workflowexecutions.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a list of executions which belong to the workflow with + // the given name. The method returns executions of all workflow + // revisions. Returned executions are ordered by their start time (newest + // first). + rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/workflows/*}/executions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new execution using the latest revision of the given workflow. + rpc CreateExecution(CreateExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/workflows/*}/executions" + body: "execution" + }; + option (google.api.method_signature) = "parent,execution"; + } + + // Returns an execution of the given name. + rpc GetExecution(GetExecutionRequest) returns (Execution) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workflows/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancels an execution of the given name. + rpc CancelExecution(CancelExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// A running instance of a +// [Workflow](/workflows/docs/reference/rest/v1/projects.locations.workflows). +message Execution { + option (google.api.resource) = { + type: "workflowexecutions.googleapis.com/Execution" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}" + }; + + // Error describes why the execution was abnormally terminated. + message Error { + // Error payload returned by the execution, represented as a JSON string. + string payload = 1; + + // Human readable error context, helpful for debugging purposes. + string context = 2; + } + + // Describes the current state of the execution. More states may be added + // in the future. + enum State { + // Invalid state. + STATE_UNSPECIFIED = 0; + + // The execution is in progress. + ACTIVE = 1; + + // The execution finished successfully. + SUCCEEDED = 2; + + // The execution failed with an error. + FAILED = 3; + + // The execution was stopped intentionally. + CANCELLED = 4; + } + + // Output only. The resource name of the execution. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Marks the beginning of execution. + google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Marks the end of execution, successful or not. + google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the execution. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input parameters of the execution represented as a JSON string. + // The size limit is 32KB. + string argument = 5; + + // Output only. Output of the execution represented as a JSON string. The + // value can only be present if the execution's state is `SUCCEEDED`. + string result = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error which caused the execution to finish prematurely. + // The value is only present if the execution's state is `FAILED` + // or `CANCELLED`. + Error error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Revision of the workflow this execution is using. + string workflow_revision_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for the +// [ListExecutions][] +// method. +message ListExecutionsRequest { + // Required. Name of the workflow for which the executions should be listed. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; + + // Maximum number of executions to return per call. + // Max supported value depends on the selected Execution view: it's 10000 for + // BASIC and 100 for FULL. The default value used if the field is not + // specified is 100, regardless of the selected view. Values greater than + // the max value will be coerced down to it. + int32 page_size = 2; + + // A page token, received from a previous `ListExecutions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListExecutions` must + // match the call that provided the page token. + string page_token = 3; + + // Optional. A view defining which fields should be filled in the returned executions. + // The API will default to the BASIC view. + ExecutionView view = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the +// [ListExecutions][google.cloud.workflows.executions.v1.Executions.ListExecutions] +// method. +message ListExecutionsResponse { + // The executions which match the request. + repeated Execution executions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request for the +// [CreateExecution][google.cloud.workflows.executions.v1.Executions.CreateExecution] +// method. +message CreateExecutionRequest { + // Required. Name of the workflow for which an execution should be created. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + // The latest revision of the workflow will be used. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; + + // Required. Execution to be created. + Execution execution = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the +// [GetExecution][google.cloud.workflows.executions.v1.Executions.GetExecution] +// method. +message GetExecutionRequest { + // Required. Name of the execution to be retrieved. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflowexecutions.googleapis.com/Execution" + } + ]; + + // Optional. A view defining which fields should be filled in the returned execution. + // The API will default to the FULL view. + ExecutionView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the +// [CancelExecution][google.cloud.workflows.executions.v1.Executions.CancelExecution] +// method. +message CancelExecutionRequest { + // Required. Name of the execution to be cancelled. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflowexecutions.googleapis.com/Execution" + } + ]; +} + +// Defines possible views for execution resource. +enum ExecutionView { + // The default / unset value. + EXECUTION_VIEW_UNSPECIFIED = 0; + + // Includes only basic metadata about the execution. + // Following fields are returned: name, start_time, end_time, state + // and workflow_revision_id. + BASIC = 1; + + // Includes all data. + FULL = 2; +} diff --git a/protos/google/cloud/workflows/v1alpha1/workflows.proto b/protos/google/cloud/workflows/v1/workflows.proto similarity index 50% rename from protos/google/cloud/workflows/v1alpha1/workflows.proto rename to protos/google/cloud/workflows/v1/workflows.proto index 3ec6fc4..7e46c2f 100644 --- a/protos/google/cloud/workflows/v1alpha1/workflows.proto +++ b/protos/google/cloud/workflows/v1/workflows.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; -package google.cloud.workflows.v1alpha1; +package google.cloud.workflows.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; @@ -25,36 +24,44 @@ import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/workflows/v1alpha1;workflows"; +option go_package = "google.golang.org/genproto/googleapis/cloud/workflows/v1;workflows"; +option java_multiple_files = true; +option java_outer_classname = "WorkflowsProto"; +option java_package = "com.google.cloud.workflows.v1"; -// Manages workflow programs. +// Workflows is used to deploy and execute workflow programs. +// Workflows makes sure the program executes reliably, despite hardware and +// networking interruptions. service Workflows { option (google.api.default_host) = "workflows.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Lists Workflows in a given project and location. + // The default order is not specified. rpc ListWorkflows(ListWorkflowsRequest) returns (ListWorkflowsResponse) { option (google.api.http) = { - get: "/v1alpha1/{parent=projects/*/locations/*}/workflows" + get: "/v1/{parent=projects/*/locations/*}/workflows" }; + option (google.api.method_signature) = "parent"; } // Gets details of a single Workflow. rpc GetWorkflow(GetWorkflowRequest) returns (Workflow) { option (google.api.http) = { - get: "/v1alpha1/{name=projects/*/locations/*/workflows/*}" + get: "/v1/{name=projects/*/locations/*/workflows/*}" }; option (google.api.method_signature) = "name"; } // Creates a new workflow. If a workflow with the specified name already // exists in the specified project and location, the long running operation - // will return `ALREADY_EXISTS` error. + // will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. rpc CreateWorkflow(CreateWorkflowRequest) returns (google.longrunning.Operation) { option (google.api.http) = { - post: "/v1alpha1/{parent=projects/*/locations/*}/workflows" + post: "/v1/{parent=projects/*/locations/*}/workflows" body: "workflow" }; + option (google.api.method_signature) = "parent,workflow,workflow_id"; option (google.longrunning.operation_info) = { response_type: "Workflow" metadata_type: "OperationMetadata" @@ -62,9 +69,11 @@ service Workflows { } // Deletes a workflow with the specified name. + // This method also cancels and deletes all running executions of the + // workflow. rpc DeleteWorkflow(DeleteWorkflowRequest) returns (google.longrunning.Operation) { option (google.api.http) = { - delete: "/v1alpha1/{name=projects/*/locations/*/workflows/*}" + delete: "/v1/{name=projects/*/locations/*/workflows/*}" }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { @@ -73,14 +82,17 @@ service Workflows { }; } - // Updates existing workflow and increases its - // [version_id][google.cloud.workflows.v1alpha1.Workflow.version_id]. - // Has no impact on any workflow execution. + // Updates an existing workflow. + // Running this method has no impact on already running executions of the + // workflow. A new revision of the workflow may be created as a result of a + // successful update operation. In that case, such revision will be used + // in new workflow executions. rpc UpdateWorkflow(UpdateWorkflowRequest) returns (google.longrunning.Operation) { option (google.api.http) = { - patch: "/v1alpha1/{workflow.name=projects/*/locations/*/workflows/*}" + patch: "/v1/{workflow.name=projects/*/locations/*/workflows/*}" body: "workflow" }; + option (google.api.method_signature) = "workflow,update_mask"; option (google.longrunning.operation_info) = { response_type: "Workflow" metadata_type: "OperationMetadata" @@ -95,71 +107,83 @@ message Workflow { pattern: "projects/{project}/locations/{location}/workflows/{workflow}" }; - // Describes the current state of workflow deployment. + // Describes the current state of workflow deployment. More states may be + // added in the future. enum State { // Invalid state. STATE_UNSPECIFIED = 0; // The workflow has been deployed successfully and is serving. ACTIVE = 1; - - // The workflow failed to deploy successfully and is not serving. - FAILED = 2; - - // The workflow is being deployed. - DEPLOYING = 3; - - // The workflow is being deleted. - DELETING = 4; } - // Name of the workflow resource, for example, - // "projects/project1/locations/us-central1/workflows/workflow1". + // The resource name of the workflow. + // Format: projects/{project}/locations/{location}/workflows/{workflow} string name = 1; // Description of the workflow provided by the user. + // Must be at most 1000 unicode characters long. string description = 2; - // Required. Location of the workflow source code. - oneof source_code { - // Workflow code to be executed. - string source_contents = 3; - } - // Output only. State of the workflow deployment. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The version identifier of the workflow. When the workflow gets - // created, version_id is set to 1. Each deployment attempt increases the - // version by 1. - int64 version_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The revision of the workflow. + // A new revision of a workflow is created as a result of updating the + // following fields of a workflow: + // - `source_code` + // - `service_account` + // The format is "000001-a4d", where the first 6 characters define + // the zero-padded revision ordinal number. They are followed by a hyphen and + // 3 hexadecimal random characters. + string revision_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp of when the workflow was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of the workflow. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the latest revision of the workflow + // was created. + google.protobuf.Timestamp revision_create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Labels associated with this workflow. + // Labels can contain at most 64 entries. Keys and values can be no longer + // than 63 characters and can only contain lowercase letters, numeric + // characters, underscores and dashes. Label keys must start with a letter. + // International characters are allowed. map labels = 8; // Name of the service account associated with the latest workflow version. // This service account represents the identity of the workflow and determines // what permissions the workflow has. - // It should have the following format: - // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from - // the account. The `ACCOUNT` value can be the `email` address or the + // Format: projects/{project}/serviceAccounts/{account} + // + // Using `-` as a wildcard for the `{project}` will infer the project from + // the account. The `{account}` value can be the `email` address or the // `unique_id` of the service account. // // If not provided, workflow will use the project's default service account. + // Modifying this field for an existing workflow results in a new workflow + // revision. string service_account = 9; + + // Required. Location of the workflow source code. + // Modifying this field for an existing workflow results in a new workflow + // revision. + oneof source_code { + // Workflow code to be executed. The size limit is 32KB. + string source_contents = 10; + } } -// Request for the `ListWorkflows` method. +// Request for the +// [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows] +// method. message ListWorkflowsRequest { - // Required. Project and location from which the workflows should be listed, - // for example, "projects/project1/locations/us-central1". + // Required. Project and location from which the workflows should be listed. + // Format: projects/{project}/locations/{location} string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -167,40 +191,49 @@ message ListWorkflowsRequest { } ]; - // Maximum number of workflows to return per call. + // Maximum number of workflows to return per call. The service may return + // fewer than this value. If the value is not specified, a default value of + // 500 will be used. The maximum permitted value is 1000 and values greater + // than 1000 will be coerced down to 1000. int32 page_size = 2; - // The value returned by the last - // `ListWorkflowsResponse` indicates that - // this is a continuation of a prior `ListWorkflows` call, and that the - // system should return the next page of data. + // A page token, received from a previous `ListWorkflows` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListWorkflows` must + // match the call that provided the page token. string page_token = 3; + // Filter to restrict results to specific workflows. string filter = 4; + // Comma-separated list of fields that that specify the order of the results. + // Default sorting order for a field is ascending. To specify descending order + // for a field, append a " desc" suffix. + // If not specified, the results will be returned in an unspecified order. string order_by = 5; } -// Response for the `ListWorkflows` method. +// Response for the +// [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows] +// method. message ListWorkflowsResponse { // The workflows which match the request. repeated Workflow workflows = 1; - // If not empty, indicates that there may be more workflows that match - // the request; this value should be passed in a new - // [google.cloud.workflows.v1alpha1.Workflow][google.cloud.workflows.v1alpha1.Workflow] - // to get more workflows. + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. string next_page_token = 2; - // Locations that could not be reached. + // Unreachable resources. repeated string unreachable = 3; } -// Request for the `GetWorkflow` method. +// Request for the +// [GetWorkflow][google.cloud.workflows.v1.Workflows.GetWorkflow] method. message GetWorkflowRequest { - // Required. Name of the workflow which information should be - // retrieved, for example, - // "projects/project1/locations/us-central1/workflows/workflow1". + // Required. Name of the workflow which information should be retrieved. + // Format: projects/{project}/locations/{location}/workflows/{workflow} string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -209,10 +242,12 @@ message GetWorkflowRequest { ]; } -// Request for the `CreateWorkflow` method. +// Request for the +// [CreateWorkflow][google.cloud.workflows.v1.Workflows.CreateWorkflow] +// method. message CreateWorkflowRequest { - // Required. Project and location in which the workflow should be created, for - // example "projects/project1/locations/us-central1". + // Required. Project and location in which the workflow should be created. + // Format: projects/{project}/locations/{location} string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -223,21 +258,23 @@ message CreateWorkflowRequest { // Required. Workflow to be created. Workflow workflow = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The ID of the workflow to be created. It has to fulfil the + // Required. The ID of the workflow to be created. It has to fulfill the // following requirements: // // * Must contain only letters, numbers, underscores and hyphens. // * Must start with a letter. // * Must be between 1-64 characters. // * Must end with a number or a letter. - // * Must be unique within the customer project / location. + // * Must be unique within the customer project and location. string workflow_id = 3 [(google.api.field_behavior) = REQUIRED]; } -// Request for the `DeleteWorkflow` method. +// Request for the +// [DeleteWorkflow][google.cloud.workflows.v1.Workflows.DeleteWorkflow] +// method. message DeleteWorkflowRequest { - // Required. Name of the workflow which should be deleted, for example, - // "projects/project1/locations/us-central1/workflows/workflow1". + // Required. Name of the workflow to be deleted. + // Format: projects/{project}/locations/{location}/workflows/{workflow} string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -246,39 +283,32 @@ message DeleteWorkflowRequest { ]; } -// Request for the `UpdateWorkflow` method. +// Request for the +// [UpdateWorkflow][google.cloud.workflows.v1.Workflows.UpdateWorkflow] +// method. message UpdateWorkflowRequest { // Required. Workflow to be updated. Workflow workflow = 1 [(google.api.field_behavior) = REQUIRED]; - // List of the only fields to be updated. If not present, the entire workflow + // List of fields to be updated. If not present, the entire workflow // will be updated. google.protobuf.FieldMask update_mask = 2; } // Represents the metadata of the long-running operation. message OperationMetadata { - // Output only. The time the operation was created. + // The time the operation was created. google.protobuf.Timestamp create_time = 1; - // Output only. The time the operation finished running. + // The time the operation finished running. google.protobuf.Timestamp end_time = 2; - // Output only. Server-defined resource path for the target of the operation. + // Server-defined resource path for the target of the operation. string target = 3; - // Output only. Name of the verb executed by the operation. + // Name of the verb executed by the operation. string verb = 4; - // Output only. Human-readable status of the operation, if any. - string status_detail = 5; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - bool cancel_requested = 6; - - // Output only. API version used to start the operation. - string api_version = 7; + // API version used to start the operation. + string api_version = 5; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index d12f440..a31898e 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -26,8 +26,8 @@ export namespace google { /** Namespace executions. */ namespace executions { - /** Namespace v1beta. */ - namespace v1beta { + /** Namespace v1. */ + namespace v1 { /** Represents an Executions */ class Executions extends $protobuf.rpc.Service { @@ -54,87 +54,87 @@ export namespace google { * @param request ListExecutionsRequest message or plain object * @param callback Node-style callback called with the error, if any, and ListExecutionsResponse */ - public listExecutions(request: google.cloud.workflows.executions.v1beta.IListExecutionsRequest, callback: google.cloud.workflows.executions.v1beta.Executions.ListExecutionsCallback): void; + public listExecutions(request: google.cloud.workflows.executions.v1.IListExecutionsRequest, callback: google.cloud.workflows.executions.v1.Executions.ListExecutionsCallback): void; /** * Calls ListExecutions. * @param request ListExecutionsRequest message or plain object * @returns Promise */ - public listExecutions(request: google.cloud.workflows.executions.v1beta.IListExecutionsRequest): Promise; + public listExecutions(request: google.cloud.workflows.executions.v1.IListExecutionsRequest): Promise; /** * Calls CreateExecution. * @param request CreateExecutionRequest message or plain object * @param callback Node-style callback called with the error, if any, and Execution */ - public createExecution(request: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest, callback: google.cloud.workflows.executions.v1beta.Executions.CreateExecutionCallback): void; + public createExecution(request: google.cloud.workflows.executions.v1.ICreateExecutionRequest, callback: google.cloud.workflows.executions.v1.Executions.CreateExecutionCallback): void; /** * Calls CreateExecution. * @param request CreateExecutionRequest message or plain object * @returns Promise */ - public createExecution(request: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest): Promise; + public createExecution(request: google.cloud.workflows.executions.v1.ICreateExecutionRequest): Promise; /** * Calls GetExecution. * @param request GetExecutionRequest message or plain object * @param callback Node-style callback called with the error, if any, and Execution */ - public getExecution(request: google.cloud.workflows.executions.v1beta.IGetExecutionRequest, callback: google.cloud.workflows.executions.v1beta.Executions.GetExecutionCallback): void; + public getExecution(request: google.cloud.workflows.executions.v1.IGetExecutionRequest, callback: google.cloud.workflows.executions.v1.Executions.GetExecutionCallback): void; /** * Calls GetExecution. * @param request GetExecutionRequest message or plain object * @returns Promise */ - public getExecution(request: google.cloud.workflows.executions.v1beta.IGetExecutionRequest): Promise; + public getExecution(request: google.cloud.workflows.executions.v1.IGetExecutionRequest): Promise; /** * Calls CancelExecution. * @param request CancelExecutionRequest message or plain object * @param callback Node-style callback called with the error, if any, and Execution */ - public cancelExecution(request: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest, callback: google.cloud.workflows.executions.v1beta.Executions.CancelExecutionCallback): void; + public cancelExecution(request: google.cloud.workflows.executions.v1.ICancelExecutionRequest, callback: google.cloud.workflows.executions.v1.Executions.CancelExecutionCallback): void; /** * Calls CancelExecution. * @param request CancelExecutionRequest message or plain object * @returns Promise */ - public cancelExecution(request: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest): Promise; + public cancelExecution(request: google.cloud.workflows.executions.v1.ICancelExecutionRequest): Promise; } namespace Executions { /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#listExecutions}. + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#listExecutions}. * @param error Error, if any * @param [response] ListExecutionsResponse */ - type ListExecutionsCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.ListExecutionsResponse) => void; + type ListExecutionsCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1.ListExecutionsResponse) => void; /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#createExecution}. + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#createExecution}. * @param error Error, if any * @param [response] Execution */ - type CreateExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.Execution) => void; + type CreateExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1.Execution) => void; /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#getExecution}. + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#getExecution}. * @param error Error, if any * @param [response] Execution */ - type GetExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.Execution) => void; + type GetExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1.Execution) => void; /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#cancelExecution}. + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#cancelExecution}. * @param error Error, if any * @param [response] Execution */ - type CancelExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.Execution) => void; + type CancelExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1.Execution) => void; } /** Properties of an Execution. */ @@ -150,7 +150,7 @@ export namespace google { endTime?: (google.protobuf.ITimestamp|null); /** Execution state */ - state?: (google.cloud.workflows.executions.v1beta.Execution.State|keyof typeof google.cloud.workflows.executions.v1beta.Execution.State|null); + state?: (google.cloud.workflows.executions.v1.Execution.State|keyof typeof google.cloud.workflows.executions.v1.Execution.State|null); /** Execution argument */ argument?: (string|null); @@ -159,7 +159,7 @@ export namespace google { result?: (string|null); /** Execution error */ - error?: (google.cloud.workflows.executions.v1beta.Execution.IError|null); + error?: (google.cloud.workflows.executions.v1.Execution.IError|null); /** Execution workflowRevisionId */ workflowRevisionId?: (string|null); @@ -172,7 +172,7 @@ export namespace google { * Constructs a new Execution. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.workflows.executions.v1beta.IExecution); + constructor(properties?: google.cloud.workflows.executions.v1.IExecution); /** Execution name. */ public name: string; @@ -184,7 +184,7 @@ export namespace google { public endTime?: (google.protobuf.ITimestamp|null); /** Execution state. */ - public state: (google.cloud.workflows.executions.v1beta.Execution.State|keyof typeof google.cloud.workflows.executions.v1beta.Execution.State); + public state: (google.cloud.workflows.executions.v1.Execution.State|keyof typeof google.cloud.workflows.executions.v1.Execution.State); /** Execution argument. */ public argument: string; @@ -193,7 +193,7 @@ export namespace google { public result: string; /** Execution error. */ - public error?: (google.cloud.workflows.executions.v1beta.Execution.IError|null); + public error?: (google.cloud.workflows.executions.v1.Execution.IError|null); /** Execution workflowRevisionId. */ public workflowRevisionId: string; @@ -203,23 +203,23 @@ export namespace google { * @param [properties] Properties to set * @returns Execution instance */ - public static create(properties?: google.cloud.workflows.executions.v1beta.IExecution): google.cloud.workflows.executions.v1beta.Execution; + public static create(properties?: google.cloud.workflows.executions.v1.IExecution): google.cloud.workflows.executions.v1.Execution; /** - * Encodes the specified Execution message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * Encodes the specified Execution message. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.verify|verify} messages. * @param message Execution message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.workflows.executions.v1beta.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.workflows.executions.v1.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.verify|verify} messages. * @param message Execution message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.workflows.executions.v1.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an Execution message from the specified reader or buffer. @@ -229,7 +229,7 @@ export namespace google { * @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.workflows.executions.v1beta.Execution; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workflows.executions.v1.Execution; /** * Decodes an Execution message from the specified reader or buffer, length delimited. @@ -238,7 +238,7 @@ export namespace google { * @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.workflows.executions.v1beta.Execution; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workflows.executions.v1.Execution; /** * Verifies an Execution message. @@ -252,7 +252,7 @@ export namespace google { * @param object Plain object * @returns Execution */ - public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.Execution; + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1.Execution; /** * Creates a plain object from an Execution message. Also converts values to other types if specified. @@ -260,7 +260,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.workflows.executions.v1beta.Execution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.workflows.executions.v1.Execution, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Execution to JSON. @@ -288,7 +288,7 @@ export namespace google { * Constructs a new Error. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.workflows.executions.v1beta.Execution.IError); + constructor(properties?: google.cloud.workflows.executions.v1.Execution.IError); /** Error payload. */ public payload: string; @@ -301,23 +301,23 @@ export namespace google { * @param [properties] Properties to set * @returns Error instance */ - public static create(properties?: google.cloud.workflows.executions.v1beta.Execution.IError): google.cloud.workflows.executions.v1beta.Execution.Error; + public static create(properties?: google.cloud.workflows.executions.v1.Execution.IError): google.cloud.workflows.executions.v1.Execution.Error; /** - * Encodes the specified Error message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * Encodes the specified Error message. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.Error.verify|verify} messages. * @param message Error message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.workflows.executions.v1beta.Execution.IError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.workflows.executions.v1.Execution.IError, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.Error.verify|verify} messages. * @param message Error message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.Execution.IError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.workflows.executions.v1.Execution.IError, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an Error message from the specified reader or buffer. @@ -327,7 +327,7 @@ export namespace google { * @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.workflows.executions.v1beta.Execution.Error; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workflows.executions.v1.Execution.Error; /** * Decodes an Error message from the specified reader or buffer, length delimited. @@ -336,7 +336,7 @@ export namespace google { * @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.workflows.executions.v1beta.Execution.Error; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workflows.executions.v1.Execution.Error; /** * Verifies an Error message. @@ -350,7 +350,7 @@ export namespace google { * @param object Plain object * @returns Error */ - public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.Execution.Error; + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1.Execution.Error; /** * Creates a plain object from an Error message. Also converts values to other types if specified. @@ -358,7 +358,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.workflows.executions.v1beta.Execution.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.workflows.executions.v1.Execution.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Error to JSON. @@ -390,7 +390,7 @@ export namespace google { pageToken?: (string|null); /** ListExecutionsRequest view */ - view?: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView|null); + view?: (google.cloud.workflows.executions.v1.ExecutionView|keyof typeof google.cloud.workflows.executions.v1.ExecutionView|null); } /** Represents a ListExecutionsRequest. */ @@ -400,7 +400,7 @@ export namespace google { * Constructs a new ListExecutionsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsRequest); + constructor(properties?: google.cloud.workflows.executions.v1.IListExecutionsRequest); /** ListExecutionsRequest parent. */ public parent: string; @@ -412,30 +412,30 @@ export namespace google { public pageToken: string; /** ListExecutionsRequest view. */ - public view: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView); + public view: (google.cloud.workflows.executions.v1.ExecutionView|keyof typeof google.cloud.workflows.executions.v1.ExecutionView); /** * Creates a new ListExecutionsRequest instance using the specified properties. * @param [properties] Properties to set * @returns ListExecutionsRequest instance */ - public static create(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsRequest): google.cloud.workflows.executions.v1beta.ListExecutionsRequest; + public static create(properties?: google.cloud.workflows.executions.v1.IListExecutionsRequest): google.cloud.workflows.executions.v1.ListExecutionsRequest; /** - * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsRequest.verify|verify} messages. * @param message ListExecutionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.workflows.executions.v1beta.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.workflows.executions.v1.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsRequest.verify|verify} messages. * @param message ListExecutionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.workflows.executions.v1.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a ListExecutionsRequest message from the specified reader or buffer. @@ -445,7 +445,7 @@ export namespace google { * @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.workflows.executions.v1beta.ListExecutionsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workflows.executions.v1.ListExecutionsRequest; /** * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. @@ -454,7 +454,7 @@ export namespace google { * @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.workflows.executions.v1beta.ListExecutionsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workflows.executions.v1.ListExecutionsRequest; /** * Verifies a ListExecutionsRequest message. @@ -468,7 +468,7 @@ export namespace google { * @param object Plain object * @returns ListExecutionsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.ListExecutionsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1.ListExecutionsRequest; /** * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. @@ -476,7 +476,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.workflows.executions.v1beta.ListExecutionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.workflows.executions.v1.ListExecutionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this ListExecutionsRequest to JSON. @@ -489,7 +489,7 @@ export namespace google { interface IListExecutionsResponse { /** ListExecutionsResponse executions */ - executions?: (google.cloud.workflows.executions.v1beta.IExecution[]|null); + executions?: (google.cloud.workflows.executions.v1.IExecution[]|null); /** ListExecutionsResponse nextPageToken */ nextPageToken?: (string|null); @@ -502,10 +502,10 @@ export namespace google { * Constructs a new ListExecutionsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsResponse); + constructor(properties?: google.cloud.workflows.executions.v1.IListExecutionsResponse); /** ListExecutionsResponse executions. */ - public executions: google.cloud.workflows.executions.v1beta.IExecution[]; + public executions: google.cloud.workflows.executions.v1.IExecution[]; /** ListExecutionsResponse nextPageToken. */ public nextPageToken: string; @@ -515,23 +515,23 @@ export namespace google { * @param [properties] Properties to set * @returns ListExecutionsResponse instance */ - public static create(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsResponse): google.cloud.workflows.executions.v1beta.ListExecutionsResponse; + public static create(properties?: google.cloud.workflows.executions.v1.IListExecutionsResponse): google.cloud.workflows.executions.v1.ListExecutionsResponse; /** - * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsResponse.verify|verify} messages. * @param message ListExecutionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.workflows.executions.v1beta.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.workflows.executions.v1.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsResponse.verify|verify} messages. * @param message ListExecutionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.workflows.executions.v1.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a ListExecutionsResponse message from the specified reader or buffer. @@ -541,7 +541,7 @@ export namespace google { * @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.workflows.executions.v1beta.ListExecutionsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workflows.executions.v1.ListExecutionsResponse; /** * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. @@ -550,7 +550,7 @@ export namespace google { * @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.workflows.executions.v1beta.ListExecutionsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workflows.executions.v1.ListExecutionsResponse; /** * Verifies a ListExecutionsResponse message. @@ -564,7 +564,7 @@ export namespace google { * @param object Plain object * @returns ListExecutionsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.ListExecutionsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1.ListExecutionsResponse; /** * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. @@ -572,7 +572,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.workflows.executions.v1beta.ListExecutionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.workflows.executions.v1.ListExecutionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this ListExecutionsResponse to JSON. @@ -588,7 +588,7 @@ export namespace google { parent?: (string|null); /** CreateExecutionRequest execution */ - execution?: (google.cloud.workflows.executions.v1beta.IExecution|null); + execution?: (google.cloud.workflows.executions.v1.IExecution|null); } /** Represents a CreateExecutionRequest. */ @@ -598,36 +598,36 @@ export namespace google { * Constructs a new CreateExecutionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest); + constructor(properties?: google.cloud.workflows.executions.v1.ICreateExecutionRequest); /** CreateExecutionRequest parent. */ public parent: string; /** CreateExecutionRequest execution. */ - public execution?: (google.cloud.workflows.executions.v1beta.IExecution|null); + public execution?: (google.cloud.workflows.executions.v1.IExecution|null); /** * Creates a new CreateExecutionRequest instance using the specified properties. * @param [properties] Properties to set * @returns CreateExecutionRequest instance */ - public static create(properties?: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest): google.cloud.workflows.executions.v1beta.CreateExecutionRequest; + public static create(properties?: google.cloud.workflows.executions.v1.ICreateExecutionRequest): google.cloud.workflows.executions.v1.CreateExecutionRequest; /** - * Encodes the specified CreateExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * Encodes the specified CreateExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.CreateExecutionRequest.verify|verify} messages. * @param message CreateExecutionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.workflows.executions.v1.ICreateExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * Encodes the specified CreateExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.CreateExecutionRequest.verify|verify} messages. * @param message CreateExecutionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.workflows.executions.v1.ICreateExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a CreateExecutionRequest message from the specified reader or buffer. @@ -637,7 +637,7 @@ export namespace google { * @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.workflows.executions.v1beta.CreateExecutionRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workflows.executions.v1.CreateExecutionRequest; /** * Decodes a CreateExecutionRequest message from the specified reader or buffer, length delimited. @@ -646,7 +646,7 @@ export namespace google { * @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.workflows.executions.v1beta.CreateExecutionRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workflows.executions.v1.CreateExecutionRequest; /** * Verifies a CreateExecutionRequest message. @@ -660,7 +660,7 @@ export namespace google { * @param object Plain object * @returns CreateExecutionRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.CreateExecutionRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1.CreateExecutionRequest; /** * Creates a plain object from a CreateExecutionRequest message. Also converts values to other types if specified. @@ -668,7 +668,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.workflows.executions.v1beta.CreateExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.workflows.executions.v1.CreateExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this CreateExecutionRequest to JSON. @@ -684,7 +684,7 @@ export namespace google { name?: (string|null); /** GetExecutionRequest view */ - view?: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView|null); + view?: (google.cloud.workflows.executions.v1.ExecutionView|keyof typeof google.cloud.workflows.executions.v1.ExecutionView|null); } /** Represents a GetExecutionRequest. */ @@ -694,36 +694,36 @@ export namespace google { * Constructs a new GetExecutionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.workflows.executions.v1beta.IGetExecutionRequest); + constructor(properties?: google.cloud.workflows.executions.v1.IGetExecutionRequest); /** GetExecutionRequest name. */ public name: string; /** GetExecutionRequest view. */ - public view: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView); + public view: (google.cloud.workflows.executions.v1.ExecutionView|keyof typeof google.cloud.workflows.executions.v1.ExecutionView); /** * Creates a new GetExecutionRequest instance using the specified properties. * @param [properties] Properties to set * @returns GetExecutionRequest instance */ - public static create(properties?: google.cloud.workflows.executions.v1beta.IGetExecutionRequest): google.cloud.workflows.executions.v1beta.GetExecutionRequest; + public static create(properties?: google.cloud.workflows.executions.v1.IGetExecutionRequest): google.cloud.workflows.executions.v1.GetExecutionRequest; /** - * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.GetExecutionRequest.verify|verify} messages. * @param message GetExecutionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.workflows.executions.v1beta.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.workflows.executions.v1.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.GetExecutionRequest.verify|verify} messages. * @param message GetExecutionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.workflows.executions.v1.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a GetExecutionRequest message from the specified reader or buffer. @@ -733,7 +733,7 @@ export namespace google { * @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.workflows.executions.v1beta.GetExecutionRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workflows.executions.v1.GetExecutionRequest; /** * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. @@ -742,7 +742,7 @@ export namespace google { * @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.workflows.executions.v1beta.GetExecutionRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workflows.executions.v1.GetExecutionRequest; /** * Verifies a GetExecutionRequest message. @@ -756,7 +756,7 @@ export namespace google { * @param object Plain object * @returns GetExecutionRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.GetExecutionRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1.GetExecutionRequest; /** * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. @@ -764,7 +764,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.workflows.executions.v1beta.GetExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.workflows.executions.v1.GetExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this GetExecutionRequest to JSON. @@ -787,7 +787,7 @@ export namespace google { * Constructs a new CancelExecutionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest); + constructor(properties?: google.cloud.workflows.executions.v1.ICancelExecutionRequest); /** CancelExecutionRequest name. */ public name: string; @@ -797,23 +797,23 @@ export namespace google { * @param [properties] Properties to set * @returns CancelExecutionRequest instance */ - public static create(properties?: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest): google.cloud.workflows.executions.v1beta.CancelExecutionRequest; + public static create(properties?: google.cloud.workflows.executions.v1.ICancelExecutionRequest): google.cloud.workflows.executions.v1.CancelExecutionRequest; /** - * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CancelExecutionRequest.verify|verify} messages. + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.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.workflows.executions.v1beta.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.workflows.executions.v1.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CancelExecutionRequest.verify|verify} messages. + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.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.workflows.executions.v1beta.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.workflows.executions.v1.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a CancelExecutionRequest message from the specified reader or buffer. @@ -823,7 +823,7 @@ export namespace google { * @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.workflows.executions.v1beta.CancelExecutionRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workflows.executions.v1.CancelExecutionRequest; /** * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. @@ -832,7 +832,7 @@ export namespace google { * @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.workflows.executions.v1beta.CancelExecutionRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workflows.executions.v1.CancelExecutionRequest; /** * Verifies a CancelExecutionRequest message. @@ -846,7 +846,7 @@ export namespace google { * @param object Plain object * @returns CancelExecutionRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.CancelExecutionRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1.CancelExecutionRequest; /** * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. @@ -854,7 +854,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.workflows.executions.v1beta.CancelExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.workflows.executions.v1.CancelExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this CancelExecutionRequest to JSON. @@ -870,6 +870,1848 @@ export namespace google { FULL = 2 } } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Represents an Executions */ + class Executions extends $protobuf.rpc.Service { + + /** + * Constructs a new Executions service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Executions service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Executions; + + /** + * Calls ListExecutions. + * @param request ListExecutionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExecutionsResponse + */ + public listExecutions(request: google.cloud.workflows.executions.v1beta.IListExecutionsRequest, callback: google.cloud.workflows.executions.v1beta.Executions.ListExecutionsCallback): void; + + /** + * Calls ListExecutions. + * @param request ListExecutionsRequest message or plain object + * @returns Promise + */ + public listExecutions(request: google.cloud.workflows.executions.v1beta.IListExecutionsRequest): Promise; + + /** + * Calls CreateExecution. + * @param request CreateExecutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Execution + */ + public createExecution(request: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest, callback: google.cloud.workflows.executions.v1beta.Executions.CreateExecutionCallback): void; + + /** + * Calls CreateExecution. + * @param request CreateExecutionRequest message or plain object + * @returns Promise + */ + public createExecution(request: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest): Promise; + + /** + * Calls GetExecution. + * @param request GetExecutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Execution + */ + public getExecution(request: google.cloud.workflows.executions.v1beta.IGetExecutionRequest, callback: google.cloud.workflows.executions.v1beta.Executions.GetExecutionCallback): void; + + /** + * Calls GetExecution. + * @param request GetExecutionRequest message or plain object + * @returns Promise + */ + public getExecution(request: google.cloud.workflows.executions.v1beta.IGetExecutionRequest): Promise; + + /** + * Calls CancelExecution. + * @param request CancelExecutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Execution + */ + public cancelExecution(request: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest, callback: google.cloud.workflows.executions.v1beta.Executions.CancelExecutionCallback): void; + + /** + * Calls CancelExecution. + * @param request CancelExecutionRequest message or plain object + * @returns Promise + */ + public cancelExecution(request: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest): Promise; + } + + namespace Executions { + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#listExecutions}. + * @param error Error, if any + * @param [response] ListExecutionsResponse + */ + type ListExecutionsCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.ListExecutionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#createExecution}. + * @param error Error, if any + * @param [response] Execution + */ + type CreateExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.Execution) => void; + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#getExecution}. + * @param error Error, if any + * @param [response] Execution + */ + type GetExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.Execution) => void; + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#cancelExecution}. + * @param error Error, if any + * @param [response] Execution + */ + type CancelExecutionCallback = (error: (Error|null), response?: google.cloud.workflows.executions.v1beta.Execution) => void; + } + + /** Properties of an Execution. */ + interface IExecution { + + /** Execution name */ + name?: (string|null); + + /** Execution startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Execution endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Execution state */ + state?: (google.cloud.workflows.executions.v1beta.Execution.State|keyof typeof google.cloud.workflows.executions.v1beta.Execution.State|null); + + /** Execution argument */ + argument?: (string|null); + + /** Execution result */ + result?: (string|null); + + /** Execution error */ + error?: (google.cloud.workflows.executions.v1beta.Execution.IError|null); + + /** Execution workflowRevisionId */ + workflowRevisionId?: (string|null); + } + + /** Represents an Execution. */ + class Execution implements IExecution { + + /** + * Constructs a new Execution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.executions.v1beta.IExecution); + + /** Execution name. */ + public name: string; + + /** Execution startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Execution endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Execution state. */ + public state: (google.cloud.workflows.executions.v1beta.Execution.State|keyof typeof google.cloud.workflows.executions.v1beta.Execution.State); + + /** Execution argument. */ + public argument: string; + + /** Execution result. */ + public result: string; + + /** Execution error. */ + public error?: (google.cloud.workflows.executions.v1beta.Execution.IError|null); + + /** Execution workflowRevisionId. */ + public workflowRevisionId: string; + + /** + * Creates a new Execution instance using the specified properties. + * @param [properties] Properties to set + * @returns Execution instance + */ + public static create(properties?: google.cloud.workflows.executions.v1beta.IExecution): google.cloud.workflows.executions.v1beta.Execution; + + /** + * Encodes the specified Execution message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * @param message Execution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.executions.v1beta.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * @param message Execution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Execution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Execution + * @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.workflows.executions.v1beta.Execution; + + /** + * Decodes an Execution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Execution + * @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.workflows.executions.v1beta.Execution; + + /** + * Verifies an Execution 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 Execution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Execution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.Execution; + + /** + * Creates a plain object from an Execution message. Also converts values to other types if specified. + * @param message Execution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.executions.v1beta.Execution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Execution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Execution { + + /** Properties of an Error. */ + interface IError { + + /** Error payload */ + payload?: (string|null); + + /** Error context */ + context?: (string|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.executions.v1beta.Execution.IError); + + /** Error payload. */ + public payload: string; + + /** Error context. */ + public context: string; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: google.cloud.workflows.executions.v1beta.Execution.IError): google.cloud.workflows.executions.v1beta.Execution.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.executions.v1beta.Execution.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.Execution.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @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.workflows.executions.v1beta.Execution.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @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.workflows.executions.v1beta.Execution.Error; + + /** + * Verifies an Error 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 Error message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Error + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.Execution.Error; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.executions.v1beta.Execution.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + SUCCEEDED = 2, + FAILED = 3, + CANCELLED = 4 + } + } + + /** Properties of a ListExecutionsRequest. */ + interface IListExecutionsRequest { + + /** ListExecutionsRequest parent */ + parent?: (string|null); + + /** ListExecutionsRequest pageSize */ + pageSize?: (number|null); + + /** ListExecutionsRequest pageToken */ + pageToken?: (string|null); + + /** ListExecutionsRequest view */ + view?: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView|null); + } + + /** Represents a ListExecutionsRequest. */ + class ListExecutionsRequest implements IListExecutionsRequest { + + /** + * Constructs a new ListExecutionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsRequest); + + /** ListExecutionsRequest parent. */ + public parent: string; + + /** ListExecutionsRequest pageSize. */ + public pageSize: number; + + /** ListExecutionsRequest pageToken. */ + public pageToken: string; + + /** ListExecutionsRequest view. */ + public view: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView); + + /** + * Creates a new ListExecutionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExecutionsRequest instance + */ + public static create(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsRequest): google.cloud.workflows.executions.v1beta.ListExecutionsRequest; + + /** + * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * @param message ListExecutionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.executions.v1beta.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * @param message ListExecutionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExecutionsRequest + * @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.workflows.executions.v1beta.ListExecutionsRequest; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExecutionsRequest + * @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.workflows.executions.v1beta.ListExecutionsRequest; + + /** + * Verifies a ListExecutionsRequest 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 ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExecutionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.ListExecutionsRequest; + + /** + * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. + * @param message ListExecutionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.executions.v1beta.ListExecutionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExecutionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListExecutionsResponse. */ + interface IListExecutionsResponse { + + /** ListExecutionsResponse executions */ + executions?: (google.cloud.workflows.executions.v1beta.IExecution[]|null); + + /** ListExecutionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExecutionsResponse. */ + class ListExecutionsResponse implements IListExecutionsResponse { + + /** + * Constructs a new ListExecutionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsResponse); + + /** ListExecutionsResponse executions. */ + public executions: google.cloud.workflows.executions.v1beta.IExecution[]; + + /** ListExecutionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExecutionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExecutionsResponse instance + */ + public static create(properties?: google.cloud.workflows.executions.v1beta.IListExecutionsResponse): google.cloud.workflows.executions.v1beta.ListExecutionsResponse; + + /** + * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * @param message ListExecutionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.executions.v1beta.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * @param message ListExecutionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExecutionsResponse + * @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.workflows.executions.v1beta.ListExecutionsResponse; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExecutionsResponse + * @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.workflows.executions.v1beta.ListExecutionsResponse; + + /** + * Verifies a ListExecutionsResponse 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 ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExecutionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.ListExecutionsResponse; + + /** + * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. + * @param message ListExecutionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.executions.v1beta.ListExecutionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExecutionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateExecutionRequest. */ + interface ICreateExecutionRequest { + + /** CreateExecutionRequest parent */ + parent?: (string|null); + + /** CreateExecutionRequest execution */ + execution?: (google.cloud.workflows.executions.v1beta.IExecution|null); + } + + /** Represents a CreateExecutionRequest. */ + class CreateExecutionRequest implements ICreateExecutionRequest { + + /** + * Constructs a new CreateExecutionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest); + + /** CreateExecutionRequest parent. */ + public parent: string; + + /** CreateExecutionRequest execution. */ + public execution?: (google.cloud.workflows.executions.v1beta.IExecution|null); + + /** + * Creates a new CreateExecutionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExecutionRequest instance + */ + public static create(properties?: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest): google.cloud.workflows.executions.v1beta.CreateExecutionRequest; + + /** + * Encodes the specified CreateExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * @param message CreateExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * @param message CreateExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.ICreateExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExecutionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExecutionRequest + * @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.workflows.executions.v1beta.CreateExecutionRequest; + + /** + * Decodes a CreateExecutionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExecutionRequest + * @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.workflows.executions.v1beta.CreateExecutionRequest; + + /** + * Verifies a CreateExecutionRequest 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 CreateExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExecutionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.CreateExecutionRequest; + + /** + * Creates a plain object from a CreateExecutionRequest message. Also converts values to other types if specified. + * @param message CreateExecutionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.executions.v1beta.CreateExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExecutionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetExecutionRequest. */ + interface IGetExecutionRequest { + + /** GetExecutionRequest name */ + name?: (string|null); + + /** GetExecutionRequest view */ + view?: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView|null); + } + + /** Represents a GetExecutionRequest. */ + class GetExecutionRequest implements IGetExecutionRequest { + + /** + * Constructs a new GetExecutionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.executions.v1beta.IGetExecutionRequest); + + /** GetExecutionRequest name. */ + public name: string; + + /** GetExecutionRequest view. */ + public view: (google.cloud.workflows.executions.v1beta.ExecutionView|keyof typeof google.cloud.workflows.executions.v1beta.ExecutionView); + + /** + * Creates a new GetExecutionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExecutionRequest instance + */ + public static create(properties?: google.cloud.workflows.executions.v1beta.IGetExecutionRequest): google.cloud.workflows.executions.v1beta.GetExecutionRequest; + + /** + * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * @param message GetExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.executions.v1beta.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * @param message GetExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.executions.v1beta.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExecutionRequest + * @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.workflows.executions.v1beta.GetExecutionRequest; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExecutionRequest + * @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.workflows.executions.v1beta.GetExecutionRequest; + + /** + * Verifies a GetExecutionRequest 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 GetExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExecutionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.executions.v1beta.GetExecutionRequest; + + /** + * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. + * @param message GetExecutionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.executions.v1beta.GetExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExecutionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CancelExecutionRequest. */ + interface ICancelExecutionRequest { + + /** CancelExecutionRequest name */ + name?: (string|null); + } + + /** Represents a CancelExecutionRequest. */ + class CancelExecutionRequest implements ICancelExecutionRequest { + + /** + * Constructs a new CancelExecutionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest); + + /** CancelExecutionRequest name. */ + public name: string; + + /** + * Creates a new CancelExecutionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelExecutionRequest instance + */ + public static create(properties?: google.cloud.workflows.executions.v1beta.ICancelExecutionRequest): google.cloud.workflows.executions.v1beta.CancelExecutionRequest; + + /** + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.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.workflows.executions.v1beta.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.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.workflows.executions.v1beta.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.workflows.executions.v1beta.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.workflows.executions.v1beta.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.workflows.executions.v1beta.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.workflows.executions.v1beta.CancelExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelExecutionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ExecutionView enum. */ + enum ExecutionView { + EXECUTION_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + } + } + + /** Namespace v1. */ + namespace v1 { + + /** Represents a Workflows */ + class Workflows extends $protobuf.rpc.Service { + + /** + * Constructs a new Workflows service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Workflows service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Workflows; + + /** + * Calls ListWorkflows. + * @param request ListWorkflowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkflowsResponse + */ + public listWorkflows(request: google.cloud.workflows.v1.IListWorkflowsRequest, callback: google.cloud.workflows.v1.Workflows.ListWorkflowsCallback): void; + + /** + * Calls ListWorkflows. + * @param request ListWorkflowsRequest message or plain object + * @returns Promise + */ + public listWorkflows(request: google.cloud.workflows.v1.IListWorkflowsRequest): Promise; + + /** + * Calls GetWorkflow. + * @param request GetWorkflowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workflow + */ + public getWorkflow(request: google.cloud.workflows.v1.IGetWorkflowRequest, callback: google.cloud.workflows.v1.Workflows.GetWorkflowCallback): void; + + /** + * Calls GetWorkflow. + * @param request GetWorkflowRequest message or plain object + * @returns Promise + */ + public getWorkflow(request: google.cloud.workflows.v1.IGetWorkflowRequest): Promise; + + /** + * Calls CreateWorkflow. + * @param request CreateWorkflowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkflow(request: google.cloud.workflows.v1.ICreateWorkflowRequest, callback: google.cloud.workflows.v1.Workflows.CreateWorkflowCallback): void; + + /** + * Calls CreateWorkflow. + * @param request CreateWorkflowRequest message or plain object + * @returns Promise + */ + public createWorkflow(request: google.cloud.workflows.v1.ICreateWorkflowRequest): Promise; + + /** + * Calls DeleteWorkflow. + * @param request DeleteWorkflowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteWorkflow(request: google.cloud.workflows.v1.IDeleteWorkflowRequest, callback: google.cloud.workflows.v1.Workflows.DeleteWorkflowCallback): void; + + /** + * Calls DeleteWorkflow. + * @param request DeleteWorkflowRequest message or plain object + * @returns Promise + */ + public deleteWorkflow(request: google.cloud.workflows.v1.IDeleteWorkflowRequest): Promise; + + /** + * Calls UpdateWorkflow. + * @param request UpdateWorkflowRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateWorkflow(request: google.cloud.workflows.v1.IUpdateWorkflowRequest, callback: google.cloud.workflows.v1.Workflows.UpdateWorkflowCallback): void; + + /** + * Calls UpdateWorkflow. + * @param request UpdateWorkflowRequest message or plain object + * @returns Promise + */ + public updateWorkflow(request: google.cloud.workflows.v1.IUpdateWorkflowRequest): Promise; + } + + namespace Workflows { + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#listWorkflows}. + * @param error Error, if any + * @param [response] ListWorkflowsResponse + */ + type ListWorkflowsCallback = (error: (Error|null), response?: google.cloud.workflows.v1.ListWorkflowsResponse) => void; + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#getWorkflow}. + * @param error Error, if any + * @param [response] Workflow + */ + type GetWorkflowCallback = (error: (Error|null), response?: google.cloud.workflows.v1.Workflow) => void; + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#createWorkflow}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkflowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#deleteWorkflow}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteWorkflowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#updateWorkflow}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateWorkflowCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Workflow. */ + interface IWorkflow { + + /** Workflow name */ + name?: (string|null); + + /** Workflow description */ + description?: (string|null); + + /** Workflow state */ + state?: (google.cloud.workflows.v1.Workflow.State|keyof typeof google.cloud.workflows.v1.Workflow.State|null); + + /** Workflow revisionId */ + revisionId?: (string|null); + + /** Workflow createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Workflow updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Workflow revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** Workflow labels */ + labels?: ({ [k: string]: string }|null); + + /** Workflow serviceAccount */ + serviceAccount?: (string|null); + + /** Workflow sourceContents */ + sourceContents?: (string|null); + } + + /** Represents a Workflow. */ + class Workflow implements IWorkflow { + + /** + * Constructs a new Workflow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.IWorkflow); + + /** Workflow name. */ + public name: string; + + /** Workflow description. */ + public description: string; + + /** Workflow state. */ + public state: (google.cloud.workflows.v1.Workflow.State|keyof typeof google.cloud.workflows.v1.Workflow.State); + + /** Workflow revisionId. */ + public revisionId: string; + + /** Workflow createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Workflow updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Workflow revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** Workflow labels. */ + public labels: { [k: string]: string }; + + /** Workflow serviceAccount. */ + public serviceAccount: string; + + /** Workflow sourceContents. */ + public sourceContents?: (string|null); + + /** Workflow sourceCode. */ + public sourceCode?: "sourceContents"; + + /** + * Creates a new Workflow instance using the specified properties. + * @param [properties] Properties to set + * @returns Workflow instance + */ + public static create(properties?: google.cloud.workflows.v1.IWorkflow): google.cloud.workflows.v1.Workflow; + + /** + * Encodes the specified Workflow message. Does not implicitly {@link google.cloud.workflows.v1.Workflow.verify|verify} messages. + * @param message Workflow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.IWorkflow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Workflow message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.Workflow.verify|verify} messages. + * @param message Workflow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.IWorkflow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Workflow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Workflow + * @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.workflows.v1.Workflow; + + /** + * Decodes a Workflow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Workflow + * @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.workflows.v1.Workflow; + + /** + * Verifies a Workflow 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 Workflow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Workflow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.Workflow; + + /** + * Creates a plain object from a Workflow message. Also converts values to other types if specified. + * @param message Workflow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.Workflow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Workflow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Workflow { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1 + } + } + + /** Properties of a ListWorkflowsRequest. */ + interface IListWorkflowsRequest { + + /** ListWorkflowsRequest parent */ + parent?: (string|null); + + /** ListWorkflowsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkflowsRequest pageToken */ + pageToken?: (string|null); + + /** ListWorkflowsRequest filter */ + filter?: (string|null); + + /** ListWorkflowsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListWorkflowsRequest. */ + class ListWorkflowsRequest implements IListWorkflowsRequest { + + /** + * Constructs a new ListWorkflowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.IListWorkflowsRequest); + + /** ListWorkflowsRequest parent. */ + public parent: string; + + /** ListWorkflowsRequest pageSize. */ + public pageSize: number; + + /** ListWorkflowsRequest pageToken. */ + public pageToken: string; + + /** ListWorkflowsRequest filter. */ + public filter: string; + + /** ListWorkflowsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListWorkflowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkflowsRequest instance + */ + public static create(properties?: google.cloud.workflows.v1.IListWorkflowsRequest): google.cloud.workflows.v1.ListWorkflowsRequest; + + /** + * Encodes the specified ListWorkflowsRequest message. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsRequest.verify|verify} messages. + * @param message ListWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.IListWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkflowsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsRequest.verify|verify} messages. + * @param message ListWorkflowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.IListWorkflowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkflowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkflowsRequest + * @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.workflows.v1.ListWorkflowsRequest; + + /** + * Decodes a ListWorkflowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkflowsRequest + * @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.workflows.v1.ListWorkflowsRequest; + + /** + * Verifies a ListWorkflowsRequest 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 ListWorkflowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkflowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.ListWorkflowsRequest; + + /** + * Creates a plain object from a ListWorkflowsRequest message. Also converts values to other types if specified. + * @param message ListWorkflowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.ListWorkflowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkflowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListWorkflowsResponse. */ + interface IListWorkflowsResponse { + + /** ListWorkflowsResponse workflows */ + workflows?: (google.cloud.workflows.v1.IWorkflow[]|null); + + /** ListWorkflowsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListWorkflowsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListWorkflowsResponse. */ + class ListWorkflowsResponse implements IListWorkflowsResponse { + + /** + * Constructs a new ListWorkflowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.IListWorkflowsResponse); + + /** ListWorkflowsResponse workflows. */ + public workflows: google.cloud.workflows.v1.IWorkflow[]; + + /** ListWorkflowsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListWorkflowsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListWorkflowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkflowsResponse instance + */ + public static create(properties?: google.cloud.workflows.v1.IListWorkflowsResponse): google.cloud.workflows.v1.ListWorkflowsResponse; + + /** + * Encodes the specified ListWorkflowsResponse message. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsResponse.verify|verify} messages. + * @param message ListWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.IListWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkflowsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsResponse.verify|verify} messages. + * @param message ListWorkflowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.IListWorkflowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkflowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkflowsResponse + * @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.workflows.v1.ListWorkflowsResponse; + + /** + * Decodes a ListWorkflowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkflowsResponse + * @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.workflows.v1.ListWorkflowsResponse; + + /** + * Verifies a ListWorkflowsResponse 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 ListWorkflowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkflowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.ListWorkflowsResponse; + + /** + * Creates a plain object from a ListWorkflowsResponse message. Also converts values to other types if specified. + * @param message ListWorkflowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.ListWorkflowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkflowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetWorkflowRequest. */ + interface IGetWorkflowRequest { + + /** GetWorkflowRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkflowRequest. */ + class GetWorkflowRequest implements IGetWorkflowRequest { + + /** + * Constructs a new GetWorkflowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.IGetWorkflowRequest); + + /** GetWorkflowRequest name. */ + public name: string; + + /** + * Creates a new GetWorkflowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkflowRequest instance + */ + public static create(properties?: google.cloud.workflows.v1.IGetWorkflowRequest): google.cloud.workflows.v1.GetWorkflowRequest; + + /** + * Encodes the specified GetWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.GetWorkflowRequest.verify|verify} messages. + * @param message GetWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.IGetWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.GetWorkflowRequest.verify|verify} messages. + * @param message GetWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.IGetWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkflowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkflowRequest + * @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.workflows.v1.GetWorkflowRequest; + + /** + * Decodes a GetWorkflowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkflowRequest + * @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.workflows.v1.GetWorkflowRequest; + + /** + * Verifies a GetWorkflowRequest 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 GetWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkflowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.GetWorkflowRequest; + + /** + * Creates a plain object from a GetWorkflowRequest message. Also converts values to other types if specified. + * @param message GetWorkflowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.GetWorkflowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkflowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateWorkflowRequest. */ + interface ICreateWorkflowRequest { + + /** CreateWorkflowRequest parent */ + parent?: (string|null); + + /** CreateWorkflowRequest workflow */ + workflow?: (google.cloud.workflows.v1.IWorkflow|null); + + /** CreateWorkflowRequest workflowId */ + workflowId?: (string|null); + } + + /** Represents a CreateWorkflowRequest. */ + class CreateWorkflowRequest implements ICreateWorkflowRequest { + + /** + * Constructs a new CreateWorkflowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.ICreateWorkflowRequest); + + /** CreateWorkflowRequest parent. */ + public parent: string; + + /** CreateWorkflowRequest workflow. */ + public workflow?: (google.cloud.workflows.v1.IWorkflow|null); + + /** CreateWorkflowRequest workflowId. */ + public workflowId: string; + + /** + * Creates a new CreateWorkflowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkflowRequest instance + */ + public static create(properties?: google.cloud.workflows.v1.ICreateWorkflowRequest): google.cloud.workflows.v1.CreateWorkflowRequest; + + /** + * Encodes the specified CreateWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.CreateWorkflowRequest.verify|verify} messages. + * @param message CreateWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.ICreateWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.CreateWorkflowRequest.verify|verify} messages. + * @param message CreateWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.ICreateWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkflowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkflowRequest + * @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.workflows.v1.CreateWorkflowRequest; + + /** + * Decodes a CreateWorkflowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkflowRequest + * @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.workflows.v1.CreateWorkflowRequest; + + /** + * Verifies a CreateWorkflowRequest 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 CreateWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkflowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.CreateWorkflowRequest; + + /** + * Creates a plain object from a CreateWorkflowRequest message. Also converts values to other types if specified. + * @param message CreateWorkflowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.CreateWorkflowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkflowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteWorkflowRequest. */ + interface IDeleteWorkflowRequest { + + /** DeleteWorkflowRequest name */ + name?: (string|null); + } + + /** Represents a DeleteWorkflowRequest. */ + class DeleteWorkflowRequest implements IDeleteWorkflowRequest { + + /** + * Constructs a new DeleteWorkflowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.IDeleteWorkflowRequest); + + /** DeleteWorkflowRequest name. */ + public name: string; + + /** + * Creates a new DeleteWorkflowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkflowRequest instance + */ + public static create(properties?: google.cloud.workflows.v1.IDeleteWorkflowRequest): google.cloud.workflows.v1.DeleteWorkflowRequest; + + /** + * Encodes the specified DeleteWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.DeleteWorkflowRequest.verify|verify} messages. + * @param message DeleteWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.IDeleteWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.DeleteWorkflowRequest.verify|verify} messages. + * @param message DeleteWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.IDeleteWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkflowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkflowRequest + * @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.workflows.v1.DeleteWorkflowRequest; + + /** + * Decodes a DeleteWorkflowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkflowRequest + * @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.workflows.v1.DeleteWorkflowRequest; + + /** + * Verifies a DeleteWorkflowRequest 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 DeleteWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkflowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.DeleteWorkflowRequest; + + /** + * Creates a plain object from a DeleteWorkflowRequest message. Also converts values to other types if specified. + * @param message DeleteWorkflowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.DeleteWorkflowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkflowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateWorkflowRequest. */ + interface IUpdateWorkflowRequest { + + /** UpdateWorkflowRequest workflow */ + workflow?: (google.cloud.workflows.v1.IWorkflow|null); + + /** UpdateWorkflowRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateWorkflowRequest. */ + class UpdateWorkflowRequest implements IUpdateWorkflowRequest { + + /** + * Constructs a new UpdateWorkflowRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.IUpdateWorkflowRequest); + + /** UpdateWorkflowRequest workflow. */ + public workflow?: (google.cloud.workflows.v1.IWorkflow|null); + + /** UpdateWorkflowRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateWorkflowRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkflowRequest instance + */ + public static create(properties?: google.cloud.workflows.v1.IUpdateWorkflowRequest): google.cloud.workflows.v1.UpdateWorkflowRequest; + + /** + * Encodes the specified UpdateWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.UpdateWorkflowRequest.verify|verify} messages. + * @param message UpdateWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.IUpdateWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.UpdateWorkflowRequest.verify|verify} messages. + * @param message UpdateWorkflowRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.IUpdateWorkflowRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkflowRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkflowRequest + * @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.workflows.v1.UpdateWorkflowRequest; + + /** + * Decodes an UpdateWorkflowRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkflowRequest + * @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.workflows.v1.UpdateWorkflowRequest; + + /** + * Verifies an UpdateWorkflowRequest 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 UpdateWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkflowRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.UpdateWorkflowRequest; + + /** + * Creates a plain object from an UpdateWorkflowRequest message. Also converts values to other types if specified. + * @param message UpdateWorkflowRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.UpdateWorkflowRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkflowRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workflows.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.workflows.v1.IOperationMetadata): google.cloud.workflows.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.workflows.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workflows.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workflows.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @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.workflows.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @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.workflows.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workflows.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workflows.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace v1beta. */ diff --git a/protos/protos.js b/protos/protos.js index ca187ee..58356cd 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -66,20 +66,20 @@ */ var executions = {}; - executions.v1beta = (function() { + executions.v1 = (function() { /** - * Namespace v1beta. + * Namespace v1. * @memberof google.cloud.workflows.executions * @namespace */ - var v1beta = {}; + var v1 = {}; - v1beta.Executions = (function() { + v1.Executions = (function() { /** * Constructs a new Executions service. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @classdesc Represents an Executions * @extends $protobuf.rpc.Service * @constructor @@ -96,7 +96,7 @@ /** * Creates new Executions service using the specified rpc implementation. * @function create - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited @@ -108,163 +108,163 @@ }; /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#listExecutions}. - * @memberof google.cloud.workflows.executions.v1beta.Executions + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#listExecutions}. + * @memberof google.cloud.workflows.executions.v1.Executions * @typedef ListExecutionsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} [response] ListExecutionsResponse + * @param {google.cloud.workflows.executions.v1.ListExecutionsResponse} [response] ListExecutionsResponse */ /** * Calls ListExecutions. * @function listExecutions - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} request ListExecutionsRequest message or plain object - * @param {google.cloud.workflows.executions.v1beta.Executions.ListExecutionsCallback} callback Node-style callback called with the error, if any, and ListExecutionsResponse + * @param {google.cloud.workflows.executions.v1.IListExecutionsRequest} request ListExecutionsRequest message or plain object + * @param {google.cloud.workflows.executions.v1.Executions.ListExecutionsCallback} callback Node-style callback called with the error, if any, and ListExecutionsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(Executions.prototype.listExecutions = function listExecutions(request, callback) { - return this.rpcCall(listExecutions, $root.google.cloud.workflows.executions.v1beta.ListExecutionsRequest, $root.google.cloud.workflows.executions.v1beta.ListExecutionsResponse, request, callback); + return this.rpcCall(listExecutions, $root.google.cloud.workflows.executions.v1.ListExecutionsRequest, $root.google.cloud.workflows.executions.v1.ListExecutionsResponse, request, callback); }, "name", { value: "ListExecutions" }); /** * Calls ListExecutions. * @function listExecutions - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} request ListExecutionsRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.workflows.executions.v1.IListExecutionsRequest} request ListExecutionsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#createExecution}. - * @memberof google.cloud.workflows.executions.v1beta.Executions + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#createExecution}. + * @memberof google.cloud.workflows.executions.v1.Executions * @typedef CreateExecutionCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.workflows.executions.v1beta.Execution} [response] Execution + * @param {google.cloud.workflows.executions.v1.Execution} [response] Execution */ /** * Calls CreateExecution. * @function createExecution - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} request CreateExecutionRequest message or plain object - * @param {google.cloud.workflows.executions.v1beta.Executions.CreateExecutionCallback} callback Node-style callback called with the error, if any, and Execution + * @param {google.cloud.workflows.executions.v1.ICreateExecutionRequest} request CreateExecutionRequest message or plain object + * @param {google.cloud.workflows.executions.v1.Executions.CreateExecutionCallback} callback Node-style callback called with the error, if any, and Execution * @returns {undefined} * @variation 1 */ Object.defineProperty(Executions.prototype.createExecution = function createExecution(request, callback) { - return this.rpcCall(createExecution, $root.google.cloud.workflows.executions.v1beta.CreateExecutionRequest, $root.google.cloud.workflows.executions.v1beta.Execution, request, callback); + return this.rpcCall(createExecution, $root.google.cloud.workflows.executions.v1.CreateExecutionRequest, $root.google.cloud.workflows.executions.v1.Execution, request, callback); }, "name", { value: "CreateExecution" }); /** * Calls CreateExecution. * @function createExecution - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} request CreateExecutionRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.workflows.executions.v1.ICreateExecutionRequest} request CreateExecutionRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#getExecution}. - * @memberof google.cloud.workflows.executions.v1beta.Executions + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#getExecution}. + * @memberof google.cloud.workflows.executions.v1.Executions * @typedef GetExecutionCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.workflows.executions.v1beta.Execution} [response] Execution + * @param {google.cloud.workflows.executions.v1.Execution} [response] Execution */ /** * Calls GetExecution. * @function getExecution - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} request GetExecutionRequest message or plain object - * @param {google.cloud.workflows.executions.v1beta.Executions.GetExecutionCallback} callback Node-style callback called with the error, if any, and Execution + * @param {google.cloud.workflows.executions.v1.IGetExecutionRequest} request GetExecutionRequest message or plain object + * @param {google.cloud.workflows.executions.v1.Executions.GetExecutionCallback} callback Node-style callback called with the error, if any, and Execution * @returns {undefined} * @variation 1 */ Object.defineProperty(Executions.prototype.getExecution = function getExecution(request, callback) { - return this.rpcCall(getExecution, $root.google.cloud.workflows.executions.v1beta.GetExecutionRequest, $root.google.cloud.workflows.executions.v1beta.Execution, request, callback); + return this.rpcCall(getExecution, $root.google.cloud.workflows.executions.v1.GetExecutionRequest, $root.google.cloud.workflows.executions.v1.Execution, request, callback); }, "name", { value: "GetExecution" }); /** * Calls GetExecution. * @function getExecution - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} request GetExecutionRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.workflows.executions.v1.IGetExecutionRequest} request GetExecutionRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#cancelExecution}. - * @memberof google.cloud.workflows.executions.v1beta.Executions + * Callback as used by {@link google.cloud.workflows.executions.v1.Executions#cancelExecution}. + * @memberof google.cloud.workflows.executions.v1.Executions * @typedef CancelExecutionCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.workflows.executions.v1beta.Execution} [response] Execution + * @param {google.cloud.workflows.executions.v1.Execution} [response] Execution */ /** * Calls CancelExecution. * @function cancelExecution - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest} request CancelExecutionRequest message or plain object - * @param {google.cloud.workflows.executions.v1beta.Executions.CancelExecutionCallback} callback Node-style callback called with the error, if any, and Execution + * @param {google.cloud.workflows.executions.v1.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @param {google.cloud.workflows.executions.v1.Executions.CancelExecutionCallback} callback Node-style callback called with the error, if any, and Execution * @returns {undefined} * @variation 1 */ Object.defineProperty(Executions.prototype.cancelExecution = function cancelExecution(request, callback) { - return this.rpcCall(cancelExecution, $root.google.cloud.workflows.executions.v1beta.CancelExecutionRequest, $root.google.cloud.workflows.executions.v1beta.Execution, request, callback); + return this.rpcCall(cancelExecution, $root.google.cloud.workflows.executions.v1.CancelExecutionRequest, $root.google.cloud.workflows.executions.v1.Execution, request, callback); }, "name", { value: "CancelExecution" }); /** * Calls CancelExecution. * @function cancelExecution - * @memberof google.cloud.workflows.executions.v1beta.Executions + * @memberof google.cloud.workflows.executions.v1.Executions * @instance - * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest} request CancelExecutionRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.workflows.executions.v1.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ return Executions; })(); - v1beta.Execution = (function() { + v1.Execution = (function() { /** * Properties of an Execution. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @interface IExecution * @property {string|null} [name] Execution name * @property {google.protobuf.ITimestamp|null} [startTime] Execution startTime * @property {google.protobuf.ITimestamp|null} [endTime] Execution endTime - * @property {google.cloud.workflows.executions.v1beta.Execution.State|null} [state] Execution state + * @property {google.cloud.workflows.executions.v1.Execution.State|null} [state] Execution state * @property {string|null} [argument] Execution argument * @property {string|null} [result] Execution result - * @property {google.cloud.workflows.executions.v1beta.Execution.IError|null} [error] Execution error + * @property {google.cloud.workflows.executions.v1.Execution.IError|null} [error] Execution error * @property {string|null} [workflowRevisionId] Execution workflowRevisionId */ /** * Constructs a new Execution. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @classdesc Represents an Execution. * @implements IExecution * @constructor - * @param {google.cloud.workflows.executions.v1beta.IExecution=} [properties] Properties to set + * @param {google.cloud.workflows.executions.v1.IExecution=} [properties] Properties to set */ function Execution(properties) { if (properties) @@ -276,7 +276,7 @@ /** * Execution name. * @member {string} name - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.name = ""; @@ -284,7 +284,7 @@ /** * Execution startTime. * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.startTime = null; @@ -292,15 +292,15 @@ /** * Execution endTime. * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.endTime = null; /** * Execution state. - * @member {google.cloud.workflows.executions.v1beta.Execution.State} state - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @member {google.cloud.workflows.executions.v1.Execution.State} state + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.state = 0; @@ -308,7 +308,7 @@ /** * Execution argument. * @member {string} argument - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.argument = ""; @@ -316,15 +316,15 @@ /** * Execution result. * @member {string} result - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.result = ""; /** * Execution error. - * @member {google.cloud.workflows.executions.v1beta.Execution.IError|null|undefined} error - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @member {google.cloud.workflows.executions.v1.Execution.IError|null|undefined} error + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.error = null; @@ -332,7 +332,7 @@ /** * Execution workflowRevisionId. * @member {string} workflowRevisionId - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @instance */ Execution.prototype.workflowRevisionId = ""; @@ -340,21 +340,21 @@ /** * Creates a new Execution instance using the specified properties. * @function create - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static - * @param {google.cloud.workflows.executions.v1beta.IExecution=} [properties] Properties to set - * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution instance + * @param {google.cloud.workflows.executions.v1.IExecution=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1.Execution} Execution instance */ Execution.create = function create(properties) { return new Execution(properties); }; /** - * Encodes the specified Execution message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * Encodes the specified Execution message. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.verify|verify} messages. * @function encode - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static - * @param {google.cloud.workflows.executions.v1beta.IExecution} message Execution message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IExecution} message Execution message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -374,18 +374,18 @@ if (message.result != null && Object.hasOwnProperty.call(message, "result")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.result); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.workflows.executions.v1beta.Execution.Error.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.workflows.executions.v1.Execution.Error.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.workflowRevisionId != null && Object.hasOwnProperty.call(message, "workflowRevisionId")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.workflowRevisionId); return writer; }; /** - * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static - * @param {google.cloud.workflows.executions.v1beta.IExecution} message Execution message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IExecution} message Execution message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -396,18 +396,18 @@ /** * Decodes an Execution message from the specified reader or buffer. * @function decode - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution + * @returns {google.cloud.workflows.executions.v1.Execution} Execution * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Execution.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.workflows.executions.v1beta.Execution(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workflows.executions.v1.Execution(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -430,7 +430,7 @@ message.result = reader.string(); break; case 7: - message.error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.decode(reader, reader.uint32()); + message.error = $root.google.cloud.workflows.executions.v1.Execution.Error.decode(reader, reader.uint32()); break; case 8: message.workflowRevisionId = reader.string(); @@ -446,10 +446,10 @@ /** * Decodes an Execution message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution + * @returns {google.cloud.workflows.executions.v1.Execution} Execution * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -462,7 +462,7 @@ /** * Verifies an Execution message. * @function verify - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -501,7 +501,7 @@ if (!$util.isString(message.result)) return "result: string expected"; if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.verify(message.error); + var error = $root.google.cloud.workflows.executions.v1.Execution.Error.verify(message.error); if (error) return "error." + error; } @@ -514,25 +514,25 @@ /** * Creates an Execution message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static * @param {Object.} object Plain object - * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution + * @returns {google.cloud.workflows.executions.v1.Execution} Execution */ Execution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.workflows.executions.v1beta.Execution) + if (object instanceof $root.google.cloud.workflows.executions.v1.Execution) return object; - var message = new $root.google.cloud.workflows.executions.v1beta.Execution(); + var message = new $root.google.cloud.workflows.executions.v1.Execution(); if (object.name != null) message.name = String(object.name); if (object.startTime != null) { if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.workflows.executions.v1beta.Execution.startTime: object expected"); + throw TypeError(".google.cloud.workflows.executions.v1.Execution.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } if (object.endTime != null) { if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.workflows.executions.v1beta.Execution.endTime: object expected"); + throw TypeError(".google.cloud.workflows.executions.v1.Execution.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } switch (object.state) { @@ -563,8 +563,8 @@ message.result = String(object.result); if (object.error != null) { if (typeof object.error !== "object") - throw TypeError(".google.cloud.workflows.executions.v1beta.Execution.error: object expected"); - message.error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.fromObject(object.error); + throw TypeError(".google.cloud.workflows.executions.v1.Execution.error: object expected"); + message.error = $root.google.cloud.workflows.executions.v1.Execution.Error.fromObject(object.error); } if (object.workflowRevisionId != null) message.workflowRevisionId = String(object.workflowRevisionId); @@ -574,9 +574,9 @@ /** * Creates a plain object from an Execution message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @static - * @param {google.cloud.workflows.executions.v1beta.Execution} message Execution + * @param {google.cloud.workflows.executions.v1.Execution} message Execution * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -601,13 +601,13 @@ if (message.endTime != null && message.hasOwnProperty("endTime")) object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.workflows.executions.v1beta.Execution.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.workflows.executions.v1.Execution.State[message.state] : message.state; if (message.argument != null && message.hasOwnProperty("argument")) object.argument = message.argument; if (message.result != null && message.hasOwnProperty("result")) object.result = message.result; if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.toObject(message.error, options); + object.error = $root.google.cloud.workflows.executions.v1.Execution.Error.toObject(message.error, options); if (message.workflowRevisionId != null && message.hasOwnProperty("workflowRevisionId")) object.workflowRevisionId = message.workflowRevisionId; return object; @@ -616,7 +616,7 @@ /** * Converts this Execution to JSON. * @function toJSON - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @instance * @returns {Object.} JSON object */ @@ -628,7 +628,7 @@ /** * Properties of an Error. - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @interface IError * @property {string|null} [payload] Error payload * @property {string|null} [context] Error context @@ -636,11 +636,11 @@ /** * Constructs a new Error. - * @memberof google.cloud.workflows.executions.v1beta.Execution + * @memberof google.cloud.workflows.executions.v1.Execution * @classdesc Represents an Error. * @implements IError * @constructor - * @param {google.cloud.workflows.executions.v1beta.Execution.IError=} [properties] Properties to set + * @param {google.cloud.workflows.executions.v1.Execution.IError=} [properties] Properties to set */ function Error(properties) { if (properties) @@ -652,7 +652,7 @@ /** * Error payload. * @member {string} payload - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @instance */ Error.prototype.payload = ""; @@ -660,7 +660,7 @@ /** * Error context. * @member {string} context - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @instance */ Error.prototype.context = ""; @@ -668,21 +668,21 @@ /** * Creates a new Error instance using the specified properties. * @function create - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static - * @param {google.cloud.workflows.executions.v1beta.Execution.IError=} [properties] Properties to set - * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error instance + * @param {google.cloud.workflows.executions.v1.Execution.IError=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1.Execution.Error} Error instance */ Error.create = function create(properties) { return new Error(properties); }; /** - * Encodes the specified Error message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * Encodes the specified Error message. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.Error.verify|verify} messages. * @function encode - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static - * @param {google.cloud.workflows.executions.v1beta.Execution.IError} message Error message or plain object to encode + * @param {google.cloud.workflows.executions.v1.Execution.IError} message Error message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -697,11 +697,11 @@ }; /** - * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.Execution.Error.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static - * @param {google.cloud.workflows.executions.v1beta.Execution.IError} message Error message or plain object to encode + * @param {google.cloud.workflows.executions.v1.Execution.IError} message Error message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -712,18 +712,18 @@ /** * Decodes an Error message from the specified reader or buffer. * @function decode - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error + * @returns {google.cloud.workflows.executions.v1.Execution.Error} Error * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Error.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.workflows.executions.v1beta.Execution.Error(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workflows.executions.v1.Execution.Error(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -744,10 +744,10 @@ /** * Decodes an Error message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error + * @returns {google.cloud.workflows.executions.v1.Execution.Error} Error * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -760,7 +760,7 @@ /** * Verifies an Error message. * @function verify - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -780,15 +780,15 @@ /** * Creates an Error message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static * @param {Object.} object Plain object - * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error + * @returns {google.cloud.workflows.executions.v1.Execution.Error} Error */ Error.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.workflows.executions.v1beta.Execution.Error) + if (object instanceof $root.google.cloud.workflows.executions.v1.Execution.Error) return object; - var message = new $root.google.cloud.workflows.executions.v1beta.Execution.Error(); + var message = new $root.google.cloud.workflows.executions.v1.Execution.Error(); if (object.payload != null) message.payload = String(object.payload); if (object.context != null) @@ -799,9 +799,9 @@ /** * Creates a plain object from an Error message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @static - * @param {google.cloud.workflows.executions.v1beta.Execution.Error} message Error + * @param {google.cloud.workflows.executions.v1.Execution.Error} message Error * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -823,7 +823,7 @@ /** * Converts this Error to JSON. * @function toJSON - * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @memberof google.cloud.workflows.executions.v1.Execution.Error * @instance * @returns {Object.} JSON object */ @@ -836,7 +836,7 @@ /** * State enum. - * @name google.cloud.workflows.executions.v1beta.Execution.State + * @name google.cloud.workflows.executions.v1.Execution.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} ACTIVE=1 ACTIVE value @@ -857,25 +857,25 @@ return Execution; })(); - v1beta.ListExecutionsRequest = (function() { + v1.ListExecutionsRequest = (function() { /** * Properties of a ListExecutionsRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @interface IListExecutionsRequest * @property {string|null} [parent] ListExecutionsRequest parent * @property {number|null} [pageSize] ListExecutionsRequest pageSize * @property {string|null} [pageToken] ListExecutionsRequest pageToken - * @property {google.cloud.workflows.executions.v1beta.ExecutionView|null} [view] ListExecutionsRequest view + * @property {google.cloud.workflows.executions.v1.ExecutionView|null} [view] ListExecutionsRequest view */ /** * Constructs a new ListExecutionsRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @classdesc Represents a ListExecutionsRequest. * @implements IListExecutionsRequest * @constructor - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest=} [properties] Properties to set + * @param {google.cloud.workflows.executions.v1.IListExecutionsRequest=} [properties] Properties to set */ function ListExecutionsRequest(properties) { if (properties) @@ -887,7 +887,7 @@ /** * ListExecutionsRequest parent. * @member {string} parent - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @instance */ ListExecutionsRequest.prototype.parent = ""; @@ -895,7 +895,7 @@ /** * ListExecutionsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @instance */ ListExecutionsRequest.prototype.pageSize = 0; @@ -903,15 +903,15 @@ /** * ListExecutionsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @instance */ ListExecutionsRequest.prototype.pageToken = ""; /** * ListExecutionsRequest view. - * @member {google.cloud.workflows.executions.v1beta.ExecutionView} view - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @member {google.cloud.workflows.executions.v1.ExecutionView} view + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @instance */ ListExecutionsRequest.prototype.view = 0; @@ -919,21 +919,21 @@ /** * Creates a new ListExecutionsRequest instance using the specified properties. * @function create - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest=} [properties] Properties to set - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest instance + * @param {google.cloud.workflows.executions.v1.IListExecutionsRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1.ListExecutionsRequest} ListExecutionsRequest instance */ ListExecutionsRequest.create = function create(properties) { return new ListExecutionsRequest(properties); }; /** - * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -952,11 +952,11 @@ }; /** - * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -967,18 +967,18 @@ /** * Decodes a ListExecutionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest + * @returns {google.cloud.workflows.executions.v1.ListExecutionsRequest} ListExecutionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListExecutionsRequest.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.workflows.executions.v1beta.ListExecutionsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workflows.executions.v1.ListExecutionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1005,10 +1005,10 @@ /** * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest + * @returns {google.cloud.workflows.executions.v1.ListExecutionsRequest} ListExecutionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1021,7 +1021,7 @@ /** * Verifies a ListExecutionsRequest message. * @function verify - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1053,15 +1053,15 @@ /** * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest + * @returns {google.cloud.workflows.executions.v1.ListExecutionsRequest} ListExecutionsRequest */ ListExecutionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + if (object instanceof $root.google.cloud.workflows.executions.v1.ListExecutionsRequest) return object; - var message = new $root.google.cloud.workflows.executions.v1beta.ListExecutionsRequest(); + var message = new $root.google.cloud.workflows.executions.v1.ListExecutionsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) @@ -1088,9 +1088,9 @@ /** * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @static - * @param {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} message ListExecutionsRequest + * @param {google.cloud.workflows.executions.v1.ListExecutionsRequest} message ListExecutionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1111,14 +1111,14 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.workflows.executions.v1beta.ExecutionView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.workflows.executions.v1.ExecutionView[message.view] : message.view; return object; }; /** * Converts this ListExecutionsRequest to JSON. * @function toJSON - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @memberof google.cloud.workflows.executions.v1.ListExecutionsRequest * @instance * @returns {Object.} JSON object */ @@ -1129,23 +1129,23 @@ return ListExecutionsRequest; })(); - v1beta.ListExecutionsResponse = (function() { + v1.ListExecutionsResponse = (function() { /** * Properties of a ListExecutionsResponse. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @interface IListExecutionsResponse - * @property {Array.|null} [executions] ListExecutionsResponse executions + * @property {Array.|null} [executions] ListExecutionsResponse executions * @property {string|null} [nextPageToken] ListExecutionsResponse nextPageToken */ /** * Constructs a new ListExecutionsResponse. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @classdesc Represents a ListExecutionsResponse. * @implements IListExecutionsResponse * @constructor - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse=} [properties] Properties to set + * @param {google.cloud.workflows.executions.v1.IListExecutionsResponse=} [properties] Properties to set */ function ListExecutionsResponse(properties) { this.executions = []; @@ -1157,8 +1157,8 @@ /** * ListExecutionsResponse executions. - * @member {Array.} executions - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @member {Array.} executions + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @instance */ ListExecutionsResponse.prototype.executions = $util.emptyArray; @@ -1166,7 +1166,7 @@ /** * ListExecutionsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @instance */ ListExecutionsResponse.prototype.nextPageToken = ""; @@ -1174,21 +1174,21 @@ /** * Creates a new ListExecutionsResponse instance using the specified properties. * @function create - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse=} [properties] Properties to set - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse instance + * @param {google.cloud.workflows.executions.v1.IListExecutionsResponse=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1.ListExecutionsResponse} ListExecutionsResponse instance */ ListExecutionsResponse.create = function create(properties) { return new ListExecutionsResponse(properties); }; /** - * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1197,18 +1197,18 @@ writer = $Writer.create(); if (message.executions != null && message.executions.length) for (var i = 0; i < message.executions.length; ++i) - $root.google.cloud.workflows.executions.v1beta.Execution.encode(message.executions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.workflows.executions.v1.Execution.encode(message.executions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.ListExecutionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static - * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1219,25 +1219,25 @@ /** * Decodes a ListExecutionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse + * @returns {google.cloud.workflows.executions.v1.ListExecutionsResponse} ListExecutionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListExecutionsResponse.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.workflows.executions.v1beta.ListExecutionsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workflows.executions.v1.ListExecutionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.executions && message.executions.length)) message.executions = []; - message.executions.push($root.google.cloud.workflows.executions.v1beta.Execution.decode(reader, reader.uint32())); + message.executions.push($root.google.cloud.workflows.executions.v1.Execution.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); @@ -1253,10 +1253,10 @@ /** * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse + * @returns {google.cloud.workflows.executions.v1.ListExecutionsResponse} ListExecutionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1269,7 +1269,7 @@ /** * Verifies a ListExecutionsResponse message. * @function verify - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1281,7 +1281,7 @@ if (!Array.isArray(message.executions)) return "executions: array expected"; for (var i = 0; i < message.executions.length; ++i) { - var error = $root.google.cloud.workflows.executions.v1beta.Execution.verify(message.executions[i]); + var error = $root.google.cloud.workflows.executions.v1.Execution.verify(message.executions[i]); if (error) return "executions." + error; } @@ -1295,23 +1295,23 @@ /** * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse + * @returns {google.cloud.workflows.executions.v1.ListExecutionsResponse} ListExecutionsResponse */ ListExecutionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + if (object instanceof $root.google.cloud.workflows.executions.v1.ListExecutionsResponse) return object; - var message = new $root.google.cloud.workflows.executions.v1beta.ListExecutionsResponse(); + var message = new $root.google.cloud.workflows.executions.v1.ListExecutionsResponse(); if (object.executions) { if (!Array.isArray(object.executions)) - throw TypeError(".google.cloud.workflows.executions.v1beta.ListExecutionsResponse.executions: array expected"); + throw TypeError(".google.cloud.workflows.executions.v1.ListExecutionsResponse.executions: array expected"); message.executions = []; for (var i = 0; i < object.executions.length; ++i) { if (typeof object.executions[i] !== "object") - throw TypeError(".google.cloud.workflows.executions.v1beta.ListExecutionsResponse.executions: object expected"); - message.executions[i] = $root.google.cloud.workflows.executions.v1beta.Execution.fromObject(object.executions[i]); + throw TypeError(".google.cloud.workflows.executions.v1.ListExecutionsResponse.executions: object expected"); + message.executions[i] = $root.google.cloud.workflows.executions.v1.Execution.fromObject(object.executions[i]); } } if (object.nextPageToken != null) @@ -1322,9 +1322,9 @@ /** * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @static - * @param {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} message ListExecutionsResponse + * @param {google.cloud.workflows.executions.v1.ListExecutionsResponse} message ListExecutionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1339,7 +1339,7 @@ if (message.executions && message.executions.length) { object.executions = []; for (var j = 0; j < message.executions.length; ++j) - object.executions[j] = $root.google.cloud.workflows.executions.v1beta.Execution.toObject(message.executions[j], options); + object.executions[j] = $root.google.cloud.workflows.executions.v1.Execution.toObject(message.executions[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -1349,7 +1349,7 @@ /** * Converts this ListExecutionsResponse to JSON. * @function toJSON - * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @memberof google.cloud.workflows.executions.v1.ListExecutionsResponse * @instance * @returns {Object.} JSON object */ @@ -1360,23 +1360,23 @@ return ListExecutionsResponse; })(); - v1beta.CreateExecutionRequest = (function() { + v1.CreateExecutionRequest = (function() { /** * Properties of a CreateExecutionRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @interface ICreateExecutionRequest * @property {string|null} [parent] CreateExecutionRequest parent - * @property {google.cloud.workflows.executions.v1beta.IExecution|null} [execution] CreateExecutionRequest execution + * @property {google.cloud.workflows.executions.v1.IExecution|null} [execution] CreateExecutionRequest execution */ /** * Constructs a new CreateExecutionRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @classdesc Represents a CreateExecutionRequest. * @implements ICreateExecutionRequest * @constructor - * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest=} [properties] Properties to set + * @param {google.cloud.workflows.executions.v1.ICreateExecutionRequest=} [properties] Properties to set */ function CreateExecutionRequest(properties) { if (properties) @@ -1388,15 +1388,15 @@ /** * CreateExecutionRequest parent. * @member {string} parent - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @instance */ CreateExecutionRequest.prototype.parent = ""; /** * CreateExecutionRequest execution. - * @member {google.cloud.workflows.executions.v1beta.IExecution|null|undefined} execution - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @member {google.cloud.workflows.executions.v1.IExecution|null|undefined} execution + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @instance */ CreateExecutionRequest.prototype.execution = null; @@ -1404,21 +1404,21 @@ /** * Creates a new CreateExecutionRequest instance using the specified properties. * @function create - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest instance + * @param {google.cloud.workflows.executions.v1.ICreateExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1.CreateExecutionRequest} CreateExecutionRequest instance */ CreateExecutionRequest.create = function create(properties) { return new CreateExecutionRequest(properties); }; /** - * Encodes the specified CreateExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * Encodes the specified CreateExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.CreateExecutionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} message CreateExecutionRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.ICreateExecutionRequest} message CreateExecutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1428,16 +1428,16 @@ if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.execution != null && Object.hasOwnProperty.call(message, "execution")) - $root.google.cloud.workflows.executions.v1beta.Execution.encode(message.execution, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.workflows.executions.v1.Execution.encode(message.execution, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * Encodes the specified CreateExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.CreateExecutionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} message CreateExecutionRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.ICreateExecutionRequest} message CreateExecutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1448,18 +1448,18 @@ /** * Decodes a CreateExecutionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest + * @returns {google.cloud.workflows.executions.v1.CreateExecutionRequest} CreateExecutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateExecutionRequest.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.workflows.executions.v1beta.CreateExecutionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workflows.executions.v1.CreateExecutionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1467,7 +1467,7 @@ message.parent = reader.string(); break; case 2: - message.execution = $root.google.cloud.workflows.executions.v1beta.Execution.decode(reader, reader.uint32()); + message.execution = $root.google.cloud.workflows.executions.v1.Execution.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1480,10 +1480,10 @@ /** * Decodes a CreateExecutionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest + * @returns {google.cloud.workflows.executions.v1.CreateExecutionRequest} CreateExecutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1496,7 +1496,7 @@ /** * Verifies a CreateExecutionRequest message. * @function verify - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1508,7 +1508,7 @@ if (!$util.isString(message.parent)) return "parent: string expected"; if (message.execution != null && message.hasOwnProperty("execution")) { - var error = $root.google.cloud.workflows.executions.v1beta.Execution.verify(message.execution); + var error = $root.google.cloud.workflows.executions.v1.Execution.verify(message.execution); if (error) return "execution." + error; } @@ -1518,21 +1518,21 @@ /** * Creates a CreateExecutionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest + * @returns {google.cloud.workflows.executions.v1.CreateExecutionRequest} CreateExecutionRequest */ CreateExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + if (object instanceof $root.google.cloud.workflows.executions.v1.CreateExecutionRequest) return object; - var message = new $root.google.cloud.workflows.executions.v1beta.CreateExecutionRequest(); + var message = new $root.google.cloud.workflows.executions.v1.CreateExecutionRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.execution != null) { if (typeof object.execution !== "object") - throw TypeError(".google.cloud.workflows.executions.v1beta.CreateExecutionRequest.execution: object expected"); - message.execution = $root.google.cloud.workflows.executions.v1beta.Execution.fromObject(object.execution); + throw TypeError(".google.cloud.workflows.executions.v1.CreateExecutionRequest.execution: object expected"); + message.execution = $root.google.cloud.workflows.executions.v1.Execution.fromObject(object.execution); } return message; }; @@ -1540,9 +1540,9 @@ /** * Creates a plain object from a CreateExecutionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} message CreateExecutionRequest + * @param {google.cloud.workflows.executions.v1.CreateExecutionRequest} message CreateExecutionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1557,14 +1557,14 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.execution != null && message.hasOwnProperty("execution")) - object.execution = $root.google.cloud.workflows.executions.v1beta.Execution.toObject(message.execution, options); + object.execution = $root.google.cloud.workflows.executions.v1.Execution.toObject(message.execution, options); return object; }; /** * Converts this CreateExecutionRequest to JSON. * @function toJSON - * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CreateExecutionRequest * @instance * @returns {Object.} JSON object */ @@ -1575,23 +1575,23 @@ return CreateExecutionRequest; })(); - v1beta.GetExecutionRequest = (function() { + v1.GetExecutionRequest = (function() { /** * Properties of a GetExecutionRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @interface IGetExecutionRequest * @property {string|null} [name] GetExecutionRequest name - * @property {google.cloud.workflows.executions.v1beta.ExecutionView|null} [view] GetExecutionRequest view + * @property {google.cloud.workflows.executions.v1.ExecutionView|null} [view] GetExecutionRequest view */ /** * Constructs a new GetExecutionRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @classdesc Represents a GetExecutionRequest. * @implements IGetExecutionRequest * @constructor - * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest=} [properties] Properties to set + * @param {google.cloud.workflows.executions.v1.IGetExecutionRequest=} [properties] Properties to set */ function GetExecutionRequest(properties) { if (properties) @@ -1603,15 +1603,15 @@ /** * GetExecutionRequest name. * @member {string} name - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @instance */ GetExecutionRequest.prototype.name = ""; /** * GetExecutionRequest view. - * @member {google.cloud.workflows.executions.v1beta.ExecutionView} view - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @member {google.cloud.workflows.executions.v1.ExecutionView} view + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @instance */ GetExecutionRequest.prototype.view = 0; @@ -1619,21 +1619,21 @@ /** * Creates a new GetExecutionRequest instance using the specified properties. * @function create - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest instance + * @param {google.cloud.workflows.executions.v1.IGetExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1.GetExecutionRequest} GetExecutionRequest instance */ GetExecutionRequest.create = function create(properties) { return new GetExecutionRequest(properties); }; /** - * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.GetExecutionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1648,11 +1648,11 @@ }; /** - * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.GetExecutionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1663,18 +1663,18 @@ /** * Decodes a GetExecutionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest + * @returns {google.cloud.workflows.executions.v1.GetExecutionRequest} GetExecutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetExecutionRequest.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.workflows.executions.v1beta.GetExecutionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workflows.executions.v1.GetExecutionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1695,10 +1695,10 @@ /** * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest + * @returns {google.cloud.workflows.executions.v1.GetExecutionRequest} GetExecutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1711,7 +1711,7 @@ /** * Verifies a GetExecutionRequest message. * @function verify - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1737,15 +1737,15 @@ /** * Creates a GetExecutionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest + * @returns {google.cloud.workflows.executions.v1.GetExecutionRequest} GetExecutionRequest */ GetExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.workflows.executions.v1beta.GetExecutionRequest) + if (object instanceof $root.google.cloud.workflows.executions.v1.GetExecutionRequest) return object; - var message = new $root.google.cloud.workflows.executions.v1beta.GetExecutionRequest(); + var message = new $root.google.cloud.workflows.executions.v1.GetExecutionRequest(); if (object.name != null) message.name = String(object.name); switch (object.view) { @@ -1768,9 +1768,9 @@ /** * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.GetExecutionRequest} message GetExecutionRequest + * @param {google.cloud.workflows.executions.v1.GetExecutionRequest} message GetExecutionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1785,14 +1785,14 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.workflows.executions.v1beta.ExecutionView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.workflows.executions.v1.ExecutionView[message.view] : message.view; return object; }; /** * Converts this GetExecutionRequest to JSON. * @function toJSON - * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @memberof google.cloud.workflows.executions.v1.GetExecutionRequest * @instance * @returns {Object.} JSON object */ @@ -1803,22 +1803,22 @@ return GetExecutionRequest; })(); - v1beta.CancelExecutionRequest = (function() { + v1.CancelExecutionRequest = (function() { /** * Properties of a CancelExecutionRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @interface ICancelExecutionRequest * @property {string|null} [name] CancelExecutionRequest name */ /** * Constructs a new CancelExecutionRequest. - * @memberof google.cloud.workflows.executions.v1beta + * @memberof google.cloud.workflows.executions.v1 * @classdesc Represents a CancelExecutionRequest. * @implements ICancelExecutionRequest * @constructor - * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest=} [properties] Properties to set + * @param {google.cloud.workflows.executions.v1.ICancelExecutionRequest=} [properties] Properties to set */ function CancelExecutionRequest(properties) { if (properties) @@ -1830,7 +1830,7 @@ /** * CancelExecutionRequest name. * @member {string} name - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @instance */ CancelExecutionRequest.prototype.name = ""; @@ -1838,21 +1838,21 @@ /** * Creates a new CancelExecutionRequest instance using the specified properties. * @function create - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.workflows.executions.v1beta.CancelExecutionRequest} CancelExecutionRequest instance + * @param {google.cloud.workflows.executions.v1.ICancelExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1.CancelExecutionRequest} CancelExecutionRequest instance */ CancelExecutionRequest.create = function create(properties) { return new CancelExecutionRequest(properties); }; /** - * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CancelExecutionRequest.verify|verify} messages. + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1.CancelExecutionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1865,11 +1865,11 @@ }; /** - * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CancelExecutionRequest.verify|verify} messages. + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1.CancelExecutionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode + * @param {google.cloud.workflows.executions.v1.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1880,18 +1880,18 @@ /** * Decodes a CancelExecutionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.workflows.executions.v1beta.CancelExecutionRequest} CancelExecutionRequest + * @returns {google.cloud.workflows.executions.v1.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.workflows.executions.v1beta.CancelExecutionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workflows.executions.v1.CancelExecutionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1909,10 +1909,10 @@ /** * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.workflows.executions.v1beta.CancelExecutionRequest} CancelExecutionRequest + * @returns {google.cloud.workflows.executions.v1.CancelExecutionRequest} CancelExecutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1925,7 +1925,7 @@ /** * Verifies a CancelExecutionRequest message. * @function verify - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1942,15 +1942,15 @@ /** * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.workflows.executions.v1beta.CancelExecutionRequest} CancelExecutionRequest + * @returns {google.cloud.workflows.executions.v1.CancelExecutionRequest} CancelExecutionRequest */ CancelExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + if (object instanceof $root.google.cloud.workflows.executions.v1.CancelExecutionRequest) return object; - var message = new $root.google.cloud.workflows.executions.v1beta.CancelExecutionRequest(); + var message = new $root.google.cloud.workflows.executions.v1.CancelExecutionRequest(); if (object.name != null) message.name = String(object.name); return message; @@ -1959,9 +1959,9 @@ /** * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @static - * @param {google.cloud.workflows.executions.v1beta.CancelExecutionRequest} message CancelExecutionRequest + * @param {google.cloud.workflows.executions.v1.CancelExecutionRequest} message CancelExecutionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1979,7 +1979,7 @@ /** * Converts this CancelExecutionRequest to JSON. * @function toJSON - * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @memberof google.cloud.workflows.executions.v1.CancelExecutionRequest * @instance * @returns {Object.} JSON object */ @@ -1992,13 +1992,13 @@ /** * ExecutionView enum. - * @name google.cloud.workflows.executions.v1beta.ExecutionView + * @name google.cloud.workflows.executions.v1.ExecutionView * @enum {number} * @property {number} EXECUTION_VIEW_UNSPECIFIED=0 EXECUTION_VIEW_UNSPECIFIED value * @property {number} BASIC=1 BASIC value * @property {number} FULL=2 FULL value */ - v1beta.ExecutionView = (function() { + v1.ExecutionView = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "EXECUTION_VIEW_UNSPECIFIED"] = 0; values[valuesById[1] = "BASIC"] = 1; @@ -2006,10 +2006,4311 @@ return values; })(); - return v1beta; + return v1; })(); - return executions; + executions.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.workflows.executions + * @namespace + */ + var v1beta = {}; + + v1beta.Executions = (function() { + + /** + * Constructs a new Executions service. + * @memberof google.cloud.workflows.executions.v1beta + * @classdesc Represents an Executions + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Executions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Executions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Executions; + + /** + * Creates new Executions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Executions} RPC service. Useful where requests and/or responses are streamed. + */ + Executions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#listExecutions}. + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @typedef ListExecutionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} [response] ListExecutionsResponse + */ + + /** + * Calls ListExecutions. + * @function listExecutions + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} request ListExecutionsRequest message or plain object + * @param {google.cloud.workflows.executions.v1beta.Executions.ListExecutionsCallback} callback Node-style callback called with the error, if any, and ListExecutionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.listExecutions = function listExecutions(request, callback) { + return this.rpcCall(listExecutions, $root.google.cloud.workflows.executions.v1beta.ListExecutionsRequest, $root.google.cloud.workflows.executions.v1beta.ListExecutionsResponse, request, callback); + }, "name", { value: "ListExecutions" }); + + /** + * Calls ListExecutions. + * @function listExecutions + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} request ListExecutionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#createExecution}. + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @typedef CreateExecutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workflows.executions.v1beta.Execution} [response] Execution + */ + + /** + * Calls CreateExecution. + * @function createExecution + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} request CreateExecutionRequest message or plain object + * @param {google.cloud.workflows.executions.v1beta.Executions.CreateExecutionCallback} callback Node-style callback called with the error, if any, and Execution + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.createExecution = function createExecution(request, callback) { + return this.rpcCall(createExecution, $root.google.cloud.workflows.executions.v1beta.CreateExecutionRequest, $root.google.cloud.workflows.executions.v1beta.Execution, request, callback); + }, "name", { value: "CreateExecution" }); + + /** + * Calls CreateExecution. + * @function createExecution + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} request CreateExecutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#getExecution}. + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @typedef GetExecutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workflows.executions.v1beta.Execution} [response] Execution + */ + + /** + * Calls GetExecution. + * @function getExecution + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} request GetExecutionRequest message or plain object + * @param {google.cloud.workflows.executions.v1beta.Executions.GetExecutionCallback} callback Node-style callback called with the error, if any, and Execution + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.getExecution = function getExecution(request, callback) { + return this.rpcCall(getExecution, $root.google.cloud.workflows.executions.v1beta.GetExecutionRequest, $root.google.cloud.workflows.executions.v1beta.Execution, request, callback); + }, "name", { value: "GetExecution" }); + + /** + * Calls GetExecution. + * @function getExecution + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} request GetExecutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workflows.executions.v1beta.Executions#cancelExecution}. + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @typedef CancelExecutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workflows.executions.v1beta.Execution} [response] Execution + */ + + /** + * Calls CancelExecution. + * @function cancelExecution + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @param {google.cloud.workflows.executions.v1beta.Executions.CancelExecutionCallback} callback Node-style callback called with the error, if any, and Execution + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.cancelExecution = function cancelExecution(request, callback) { + return this.rpcCall(cancelExecution, $root.google.cloud.workflows.executions.v1beta.CancelExecutionRequest, $root.google.cloud.workflows.executions.v1beta.Execution, request, callback); + }, "name", { value: "CancelExecution" }); + + /** + * Calls CancelExecution. + * @function cancelExecution + * @memberof google.cloud.workflows.executions.v1beta.Executions + * @instance + * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Executions; + })(); + + v1beta.Execution = (function() { + + /** + * Properties of an Execution. + * @memberof google.cloud.workflows.executions.v1beta + * @interface IExecution + * @property {string|null} [name] Execution name + * @property {google.protobuf.ITimestamp|null} [startTime] Execution startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Execution endTime + * @property {google.cloud.workflows.executions.v1beta.Execution.State|null} [state] Execution state + * @property {string|null} [argument] Execution argument + * @property {string|null} [result] Execution result + * @property {google.cloud.workflows.executions.v1beta.Execution.IError|null} [error] Execution error + * @property {string|null} [workflowRevisionId] Execution workflowRevisionId + */ + + /** + * Constructs a new Execution. + * @memberof google.cloud.workflows.executions.v1beta + * @classdesc Represents an Execution. + * @implements IExecution + * @constructor + * @param {google.cloud.workflows.executions.v1beta.IExecution=} [properties] Properties to set + */ + function Execution(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]]; + } + + /** + * Execution name. + * @member {string} name + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.name = ""; + + /** + * Execution startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.startTime = null; + + /** + * Execution endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.endTime = null; + + /** + * Execution state. + * @member {google.cloud.workflows.executions.v1beta.Execution.State} state + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.state = 0; + + /** + * Execution argument. + * @member {string} argument + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.argument = ""; + + /** + * Execution result. + * @member {string} result + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.result = ""; + + /** + * Execution error. + * @member {google.cloud.workflows.executions.v1beta.Execution.IError|null|undefined} error + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.error = null; + + /** + * Execution workflowRevisionId. + * @member {string} workflowRevisionId + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + */ + Execution.prototype.workflowRevisionId = ""; + + /** + * Creates a new Execution instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {google.cloud.workflows.executions.v1beta.IExecution=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution instance + */ + Execution.create = function create(properties) { + return new Execution(properties); + }; + + /** + * Encodes the specified Execution message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {google.cloud.workflows.executions.v1beta.IExecution} message Execution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Execution.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.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.argument != null && Object.hasOwnProperty.call(message, "argument")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.argument); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.result); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.cloud.workflows.executions.v1beta.Execution.Error.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.workflowRevisionId != null && Object.hasOwnProperty.call(message, "workflowRevisionId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.workflowRevisionId); + return writer; + }; + + /** + * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {google.cloud.workflows.executions.v1beta.IExecution} message Execution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Execution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Execution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Execution.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.workflows.executions.v1beta.Execution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.argument = reader.string(); + break; + case 6: + message.result = reader.string(); + break; + case 7: + message.error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.decode(reader, reader.uint32()); + break; + case 8: + message.workflowRevisionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Execution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Execution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Execution message. + * @function verify + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Execution.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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.argument != null && message.hasOwnProperty("argument")) + if (!$util.isString(message.argument)) + return "argument: string expected"; + if (message.result != null && message.hasOwnProperty("result")) + if (!$util.isString(message.result)) + return "result: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.verify(message.error); + if (error) + return "error." + error; + } + if (message.workflowRevisionId != null && message.hasOwnProperty("workflowRevisionId")) + if (!$util.isString(message.workflowRevisionId)) + return "workflowRevisionId: string expected"; + return null; + }; + + /** + * Creates an Execution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.executions.v1beta.Execution} Execution + */ + Execution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.executions.v1beta.Execution) + return object; + var message = new $root.google.cloud.workflows.executions.v1beta.Execution(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.workflows.executions.v1beta.Execution.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.workflows.executions.v1beta.Execution.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.argument != null) + message.argument = String(object.argument); + if (object.result != null) + message.result = String(object.result); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.workflows.executions.v1beta.Execution.error: object expected"); + message.error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.fromObject(object.error); + } + if (object.workflowRevisionId != null) + message.workflowRevisionId = String(object.workflowRevisionId); + return message; + }; + + /** + * Creates a plain object from an Execution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @static + * @param {google.cloud.workflows.executions.v1beta.Execution} message Execution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Execution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.argument = ""; + object.result = ""; + object.error = null; + object.workflowRevisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.workflows.executions.v1beta.Execution.State[message.state] : message.state; + if (message.argument != null && message.hasOwnProperty("argument")) + object.argument = message.argument; + if (message.result != null && message.hasOwnProperty("result")) + object.result = message.result; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.cloud.workflows.executions.v1beta.Execution.Error.toObject(message.error, options); + if (message.workflowRevisionId != null && message.hasOwnProperty("workflowRevisionId")) + object.workflowRevisionId = message.workflowRevisionId; + return object; + }; + + /** + * Converts this Execution to JSON. + * @function toJSON + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @instance + * @returns {Object.} JSON object + */ + Execution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Execution.Error = (function() { + + /** + * Properties of an Error. + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @interface IError + * @property {string|null} [payload] Error payload + * @property {string|null} [context] Error context + */ + + /** + * Constructs a new Error. + * @memberof google.cloud.workflows.executions.v1beta.Execution + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {google.cloud.workflows.executions.v1beta.Execution.IError=} [properties] Properties to set + */ + function Error(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]]; + } + + /** + * Error payload. + * @member {string} payload + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @instance + */ + Error.prototype.payload = ""; + + /** + * Error context. + * @member {string} context + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @instance + */ + Error.prototype.context = ""; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {google.cloud.workflows.executions.v1beta.Execution.IError=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {google.cloud.workflows.executions.v1beta.Execution.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.payload); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.context); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.Execution.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {google.cloud.workflows.executions.v1beta.Execution.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.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.workflows.executions.v1beta.Execution.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payload = reader.string(); + break; + case 2: + message.context = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payload != null && message.hasOwnProperty("payload")) + if (!$util.isString(message.payload)) + return "payload: string expected"; + if (message.context != null && message.hasOwnProperty("context")) + if (!$util.isString(message.context)) + return "context: string expected"; + return null; + }; + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.executions.v1beta.Execution.Error} Error + */ + Error.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.executions.v1beta.Execution.Error) + return object; + var message = new $root.google.cloud.workflows.executions.v1beta.Execution.Error(); + if (object.payload != null) + message.payload = String(object.payload); + if (object.context != null) + message.context = String(object.context); + return message; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @static + * @param {google.cloud.workflows.executions.v1beta.Execution.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.payload = ""; + object.context = ""; + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = message.payload; + if (message.context != null && message.hasOwnProperty("context")) + object.context = message.context; + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof google.cloud.workflows.executions.v1beta.Execution.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Error; + })(); + + /** + * State enum. + * @name google.cloud.workflows.executions.v1beta.Execution.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLED=4 CANCELLED value + */ + Execution.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return Execution; + })(); + + v1beta.ListExecutionsRequest = (function() { + + /** + * Properties of a ListExecutionsRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @interface IListExecutionsRequest + * @property {string|null} [parent] ListExecutionsRequest parent + * @property {number|null} [pageSize] ListExecutionsRequest pageSize + * @property {string|null} [pageToken] ListExecutionsRequest pageToken + * @property {google.cloud.workflows.executions.v1beta.ExecutionView|null} [view] ListExecutionsRequest view + */ + + /** + * Constructs a new ListExecutionsRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @classdesc Represents a ListExecutionsRequest. + * @implements IListExecutionsRequest + * @constructor + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest=} [properties] Properties to set + */ + function ListExecutionsRequest(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]]; + } + + /** + * ListExecutionsRequest parent. + * @member {string} parent + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.parent = ""; + + /** + * ListExecutionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.pageSize = 0; + + /** + * ListExecutionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.pageToken = ""; + + /** + * ListExecutionsRequest view. + * @member {google.cloud.workflows.executions.v1beta.ExecutionView} view + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.view = 0; + + /** + * Creates a new ListExecutionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest instance + */ + ListExecutionsRequest.create = function create(properties) { + return new ListExecutionsRequest(properties); + }; + + /** + * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsRequest.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.workflows.executions.v1beta.ListExecutionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExecutionsRequest message. + * @function verify + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExecutionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} ListExecutionsRequest + */ + ListExecutionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + return object; + var message = new $root.google.cloud.workflows.executions.v1beta.ListExecutionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.view) { + case "EXECUTION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.ListExecutionsRequest} message ListExecutionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExecutionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "EXECUTION_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.workflows.executions.v1beta.ExecutionView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListExecutionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListExecutionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListExecutionsRequest; + })(); + + v1beta.ListExecutionsResponse = (function() { + + /** + * Properties of a ListExecutionsResponse. + * @memberof google.cloud.workflows.executions.v1beta + * @interface IListExecutionsResponse + * @property {Array.|null} [executions] ListExecutionsResponse executions + * @property {string|null} [nextPageToken] ListExecutionsResponse nextPageToken + */ + + /** + * Constructs a new ListExecutionsResponse. + * @memberof google.cloud.workflows.executions.v1beta + * @classdesc Represents a ListExecutionsResponse. + * @implements IListExecutionsResponse + * @constructor + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse=} [properties] Properties to set + */ + function ListExecutionsResponse(properties) { + this.executions = []; + 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]]; + } + + /** + * ListExecutionsResponse executions. + * @member {Array.} executions + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @instance + */ + ListExecutionsResponse.prototype.executions = $util.emptyArray; + + /** + * ListExecutionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @instance + */ + ListExecutionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExecutionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse instance + */ + ListExecutionsResponse.create = function create(properties) { + return new ListExecutionsResponse(properties); + }; + + /** + * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executions != null && message.executions.length) + for (var i = 0; i < message.executions.length; ++i) + $root.google.cloud.workflows.executions.v1beta.Execution.encode(message.executions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.ListExecutionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {google.cloud.workflows.executions.v1beta.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsResponse.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.workflows.executions.v1beta.ListExecutionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.executions && message.executions.length)) + message.executions = []; + message.executions.push($root.google.cloud.workflows.executions.v1beta.Execution.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExecutionsResponse message. + * @function verify + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExecutionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executions != null && message.hasOwnProperty("executions")) { + if (!Array.isArray(message.executions)) + return "executions: array expected"; + for (var i = 0; i < message.executions.length; ++i) { + var error = $root.google.cloud.workflows.executions.v1beta.Execution.verify(message.executions[i]); + if (error) + return "executions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} ListExecutionsResponse + */ + ListExecutionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + return object; + var message = new $root.google.cloud.workflows.executions.v1beta.ListExecutionsResponse(); + if (object.executions) { + if (!Array.isArray(object.executions)) + throw TypeError(".google.cloud.workflows.executions.v1beta.ListExecutionsResponse.executions: array expected"); + message.executions = []; + for (var i = 0; i < object.executions.length; ++i) { + if (typeof object.executions[i] !== "object") + throw TypeError(".google.cloud.workflows.executions.v1beta.ListExecutionsResponse.executions: object expected"); + message.executions[i] = $root.google.cloud.workflows.executions.v1beta.Execution.fromObject(object.executions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @static + * @param {google.cloud.workflows.executions.v1beta.ListExecutionsResponse} message ListExecutionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExecutionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.executions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.executions && message.executions.length) { + object.executions = []; + for (var j = 0; j < message.executions.length; ++j) + object.executions[j] = $root.google.cloud.workflows.executions.v1beta.Execution.toObject(message.executions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExecutionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.workflows.executions.v1beta.ListExecutionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListExecutionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListExecutionsResponse; + })(); + + v1beta.CreateExecutionRequest = (function() { + + /** + * Properties of a CreateExecutionRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @interface ICreateExecutionRequest + * @property {string|null} [parent] CreateExecutionRequest parent + * @property {google.cloud.workflows.executions.v1beta.IExecution|null} [execution] CreateExecutionRequest execution + */ + + /** + * Constructs a new CreateExecutionRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @classdesc Represents a CreateExecutionRequest. + * @implements ICreateExecutionRequest + * @constructor + * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest=} [properties] Properties to set + */ + function CreateExecutionRequest(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]]; + } + + /** + * CreateExecutionRequest parent. + * @member {string} parent + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @instance + */ + CreateExecutionRequest.prototype.parent = ""; + + /** + * CreateExecutionRequest execution. + * @member {google.cloud.workflows.executions.v1beta.IExecution|null|undefined} execution + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @instance + */ + CreateExecutionRequest.prototype.execution = null; + + /** + * Creates a new CreateExecutionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest instance + */ + CreateExecutionRequest.create = function create(properties) { + return new CreateExecutionRequest(properties); + }; + + /** + * Encodes the specified CreateExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} message CreateExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExecutionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.execution != null && Object.hasOwnProperty.call(message, "execution")) + $root.google.cloud.workflows.executions.v1beta.Execution.encode(message.execution, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CreateExecutionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.ICreateExecutionRequest} message CreateExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExecutionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExecutionRequest.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.workflows.executions.v1beta.CreateExecutionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.execution = $root.google.cloud.workflows.executions.v1beta.Execution.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExecutionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExecutionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExecutionRequest message. + * @function verify + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExecutionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.execution != null && message.hasOwnProperty("execution")) { + var error = $root.google.cloud.workflows.executions.v1beta.Execution.verify(message.execution); + if (error) + return "execution." + error; + } + return null; + }; + + /** + * Creates a CreateExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} CreateExecutionRequest + */ + CreateExecutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + return object; + var message = new $root.google.cloud.workflows.executions.v1beta.CreateExecutionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.execution != null) { + if (typeof object.execution !== "object") + throw TypeError(".google.cloud.workflows.executions.v1beta.CreateExecutionRequest.execution: object expected"); + message.execution = $root.google.cloud.workflows.executions.v1beta.Execution.fromObject(object.execution); + } + return message; + }; + + /** + * Creates a plain object from a CreateExecutionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.CreateExecutionRequest} message CreateExecutionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExecutionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.execution = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.execution != null && message.hasOwnProperty("execution")) + object.execution = $root.google.cloud.workflows.executions.v1beta.Execution.toObject(message.execution, options); + return object; + }; + + /** + * Converts this CreateExecutionRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.executions.v1beta.CreateExecutionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExecutionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateExecutionRequest; + })(); + + v1beta.GetExecutionRequest = (function() { + + /** + * Properties of a GetExecutionRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @interface IGetExecutionRequest + * @property {string|null} [name] GetExecutionRequest name + * @property {google.cloud.workflows.executions.v1beta.ExecutionView|null} [view] GetExecutionRequest view + */ + + /** + * Constructs a new GetExecutionRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @classdesc Represents a GetExecutionRequest. + * @implements IGetExecutionRequest + * @constructor + * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest=} [properties] Properties to set + */ + function GetExecutionRequest(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]]; + } + + /** + * GetExecutionRequest name. + * @member {string} name + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @instance + */ + GetExecutionRequest.prototype.name = ""; + + /** + * GetExecutionRequest view. + * @member {google.cloud.workflows.executions.v1beta.ExecutionView} view + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @instance + */ + GetExecutionRequest.prototype.view = 0; + + /** + * Creates a new GetExecutionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest instance + */ + GetExecutionRequest.create = function create(properties) { + return new GetExecutionRequest(properties); + }; + + /** + * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExecutionRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.GetExecutionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExecutionRequest.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.workflows.executions.v1beta.GetExecutionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExecutionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExecutionRequest message. + * @function verify + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExecutionRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.executions.v1beta.GetExecutionRequest} GetExecutionRequest + */ + GetExecutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.executions.v1beta.GetExecutionRequest) + return object; + var message = new $root.google.cloud.workflows.executions.v1beta.GetExecutionRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + case "EXECUTION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.GetExecutionRequest} message GetExecutionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExecutionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "EXECUTION_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.workflows.executions.v1beta.ExecutionView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetExecutionRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.executions.v1beta.GetExecutionRequest + * @instance + * @returns {Object.} JSON object + */ + GetExecutionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetExecutionRequest; + })(); + + v1beta.CancelExecutionRequest = (function() { + + /** + * Properties of a CancelExecutionRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @interface ICancelExecutionRequest + * @property {string|null} [name] CancelExecutionRequest name + */ + + /** + * Constructs a new CancelExecutionRequest. + * @memberof google.cloud.workflows.executions.v1beta + * @classdesc Represents a CancelExecutionRequest. + * @implements ICancelExecutionRequest + * @constructor + * @param {google.cloud.workflows.executions.v1beta.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.workflows.executions.v1beta.CancelExecutionRequest + * @instance + */ + CancelExecutionRequest.prototype.name = ""; + + /** + * Creates a new CancelExecutionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.ICancelExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.executions.v1beta.CancelExecutionRequest} CancelExecutionRequest instance + */ + CancelExecutionRequest.create = function create(properties) { + return new CancelExecutionRequest(properties); + }; + + /** + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CancelExecutionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.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); + return writer; + }; + + /** + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.executions.v1beta.CancelExecutionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.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.workflows.executions.v1beta.CancelExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.executions.v1beta.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.workflows.executions.v1beta.CancelExecutionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = 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.workflows.executions.v1beta.CancelExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.executions.v1beta.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.workflows.executions.v1beta.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"; + return null; + }; + + /** + * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.executions.v1beta.CancelExecutionRequest} CancelExecutionRequest + */ + CancelExecutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + return object; + var message = new $root.google.cloud.workflows.executions.v1beta.CancelExecutionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @static + * @param {google.cloud.workflows.executions.v1beta.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 = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelExecutionRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.executions.v1beta.CancelExecutionRequest + * @instance + * @returns {Object.} JSON object + */ + CancelExecutionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelExecutionRequest; + })(); + + /** + * ExecutionView enum. + * @name google.cloud.workflows.executions.v1beta.ExecutionView + * @enum {number} + * @property {number} EXECUTION_VIEW_UNSPECIFIED=0 EXECUTION_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1beta.ExecutionView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return v1beta; + })(); + + return executions; + })(); + + workflows.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.workflows + * @namespace + */ + var v1 = {}; + + v1.Workflows = (function() { + + /** + * Constructs a new Workflows service. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents a Workflows + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Workflows(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Workflows.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Workflows; + + /** + * Creates new Workflows service using the specified rpc implementation. + * @function create + * @memberof google.cloud.workflows.v1.Workflows + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Workflows} RPC service. Useful where requests and/or responses are streamed. + */ + Workflows.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#listWorkflows}. + * @memberof google.cloud.workflows.v1.Workflows + * @typedef ListWorkflowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workflows.v1.ListWorkflowsResponse} [response] ListWorkflowsResponse + */ + + /** + * Calls ListWorkflows. + * @function listWorkflows + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IListWorkflowsRequest} request ListWorkflowsRequest message or plain object + * @param {google.cloud.workflows.v1.Workflows.ListWorkflowsCallback} callback Node-style callback called with the error, if any, and ListWorkflowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workflows.prototype.listWorkflows = function listWorkflows(request, callback) { + return this.rpcCall(listWorkflows, $root.google.cloud.workflows.v1.ListWorkflowsRequest, $root.google.cloud.workflows.v1.ListWorkflowsResponse, request, callback); + }, "name", { value: "ListWorkflows" }); + + /** + * Calls ListWorkflows. + * @function listWorkflows + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IListWorkflowsRequest} request ListWorkflowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#getWorkflow}. + * @memberof google.cloud.workflows.v1.Workflows + * @typedef GetWorkflowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workflows.v1.Workflow} [response] Workflow + */ + + /** + * Calls GetWorkflow. + * @function getWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IGetWorkflowRequest} request GetWorkflowRequest message or plain object + * @param {google.cloud.workflows.v1.Workflows.GetWorkflowCallback} callback Node-style callback called with the error, if any, and Workflow + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workflows.prototype.getWorkflow = function getWorkflow(request, callback) { + return this.rpcCall(getWorkflow, $root.google.cloud.workflows.v1.GetWorkflowRequest, $root.google.cloud.workflows.v1.Workflow, request, callback); + }, "name", { value: "GetWorkflow" }); + + /** + * Calls GetWorkflow. + * @function getWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IGetWorkflowRequest} request GetWorkflowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#createWorkflow}. + * @memberof google.cloud.workflows.v1.Workflows + * @typedef CreateWorkflowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkflow. + * @function createWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.ICreateWorkflowRequest} request CreateWorkflowRequest message or plain object + * @param {google.cloud.workflows.v1.Workflows.CreateWorkflowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workflows.prototype.createWorkflow = function createWorkflow(request, callback) { + return this.rpcCall(createWorkflow, $root.google.cloud.workflows.v1.CreateWorkflowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkflow" }); + + /** + * Calls CreateWorkflow. + * @function createWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.ICreateWorkflowRequest} request CreateWorkflowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#deleteWorkflow}. + * @memberof google.cloud.workflows.v1.Workflows + * @typedef DeleteWorkflowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteWorkflow. + * @function deleteWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IDeleteWorkflowRequest} request DeleteWorkflowRequest message or plain object + * @param {google.cloud.workflows.v1.Workflows.DeleteWorkflowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workflows.prototype.deleteWorkflow = function deleteWorkflow(request, callback) { + return this.rpcCall(deleteWorkflow, $root.google.cloud.workflows.v1.DeleteWorkflowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteWorkflow" }); + + /** + * Calls DeleteWorkflow. + * @function deleteWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IDeleteWorkflowRequest} request DeleteWorkflowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workflows.v1.Workflows#updateWorkflow}. + * @memberof google.cloud.workflows.v1.Workflows + * @typedef UpdateWorkflowCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateWorkflow. + * @function updateWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IUpdateWorkflowRequest} request UpdateWorkflowRequest message or plain object + * @param {google.cloud.workflows.v1.Workflows.UpdateWorkflowCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workflows.prototype.updateWorkflow = function updateWorkflow(request, callback) { + return this.rpcCall(updateWorkflow, $root.google.cloud.workflows.v1.UpdateWorkflowRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateWorkflow" }); + + /** + * Calls UpdateWorkflow. + * @function updateWorkflow + * @memberof google.cloud.workflows.v1.Workflows + * @instance + * @param {google.cloud.workflows.v1.IUpdateWorkflowRequest} request UpdateWorkflowRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Workflows; + })(); + + v1.Workflow = (function() { + + /** + * Properties of a Workflow. + * @memberof google.cloud.workflows.v1 + * @interface IWorkflow + * @property {string|null} [name] Workflow name + * @property {string|null} [description] Workflow description + * @property {google.cloud.workflows.v1.Workflow.State|null} [state] Workflow state + * @property {string|null} [revisionId] Workflow revisionId + * @property {google.protobuf.ITimestamp|null} [createTime] Workflow createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Workflow updateTime + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] Workflow revisionCreateTime + * @property {Object.|null} [labels] Workflow labels + * @property {string|null} [serviceAccount] Workflow serviceAccount + * @property {string|null} [sourceContents] Workflow sourceContents + */ + + /** + * Constructs a new Workflow. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents a Workflow. + * @implements IWorkflow + * @constructor + * @param {google.cloud.workflows.v1.IWorkflow=} [properties] Properties to set + */ + function Workflow(properties) { + this.labels = {}; + 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]]; + } + + /** + * Workflow name. + * @member {string} name + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.name = ""; + + /** + * Workflow description. + * @member {string} description + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.description = ""; + + /** + * Workflow state. + * @member {google.cloud.workflows.v1.Workflow.State} state + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.state = 0; + + /** + * Workflow revisionId. + * @member {string} revisionId + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.revisionId = ""; + + /** + * Workflow createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.createTime = null; + + /** + * Workflow updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.updateTime = null; + + /** + * Workflow revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.revisionCreateTime = null; + + /** + * Workflow labels. + * @member {Object.} labels + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.labels = $util.emptyObject; + + /** + * Workflow serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.serviceAccount = ""; + + /** + * Workflow sourceContents. + * @member {string|null|undefined} sourceContents + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Workflow.prototype.sourceContents = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Workflow sourceCode. + * @member {"sourceContents"|undefined} sourceCode + * @memberof google.cloud.workflows.v1.Workflow + * @instance + */ + Object.defineProperty(Workflow.prototype, "sourceCode", { + get: $util.oneOfGetter($oneOfFields = ["sourceContents"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Workflow instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {google.cloud.workflows.v1.IWorkflow=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.Workflow} Workflow instance + */ + Workflow.create = function create(properties) { + return new Workflow(properties); + }; + + /** + * Encodes the specified Workflow message. Does not implicitly {@link google.cloud.workflows.v1.Workflow.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {google.cloud.workflows.v1.IWorkflow} message Workflow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workflow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); + if (message.sourceContents != null && Object.hasOwnProperty.call(message, "sourceContents")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceContents); + return writer; + }; + + /** + * Encodes the specified Workflow message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.Workflow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {google.cloud.workflows.v1.IWorkflow} message Workflow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workflow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Workflow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.Workflow} Workflow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workflow.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.workflows.v1.Workflow(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.state = reader.int32(); + break; + case 4: + message.revisionId = reader.string(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 9: + message.serviceAccount = reader.string(); + break; + case 10: + message.sourceContents = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Workflow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.Workflow} Workflow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workflow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Workflow message. + * @function verify + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Workflow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + break; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.sourceContents != null && message.hasOwnProperty("sourceContents")) { + properties.sourceCode = 1; + if (!$util.isString(message.sourceContents)) + return "sourceContents: string expected"; + } + return null; + }; + + /** + * Creates a Workflow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.Workflow} Workflow + */ + Workflow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.Workflow) + return object; + var message = new $root.google.cloud.workflows.v1.Workflow(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + } + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.workflows.v1.Workflow.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.workflows.v1.Workflow.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.cloud.workflows.v1.Workflow.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.workflows.v1.Workflow.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.sourceContents != null) + message.sourceContents = String(object.sourceContents); + return message; + }; + + /** + * Creates a plain object from a Workflow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.Workflow + * @static + * @param {google.cloud.workflows.v1.Workflow} message Workflow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Workflow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.revisionId = ""; + object.createTime = null; + object.updateTime = null; + object.revisionCreateTime = null; + object.serviceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.workflows.v1.Workflow.State[message.state] : message.state; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.sourceContents != null && message.hasOwnProperty("sourceContents")) { + object.sourceContents = message.sourceContents; + if (options.oneofs) + object.sourceCode = "sourceContents"; + } + return object; + }; + + /** + * Converts this Workflow to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.Workflow + * @instance + * @returns {Object.} JSON object + */ + Workflow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.workflows.v1.Workflow.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + */ + Workflow.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + return values; + })(); + + return Workflow; + })(); + + v1.ListWorkflowsRequest = (function() { + + /** + * Properties of a ListWorkflowsRequest. + * @memberof google.cloud.workflows.v1 + * @interface IListWorkflowsRequest + * @property {string|null} [parent] ListWorkflowsRequest parent + * @property {number|null} [pageSize] ListWorkflowsRequest pageSize + * @property {string|null} [pageToken] ListWorkflowsRequest pageToken + * @property {string|null} [filter] ListWorkflowsRequest filter + * @property {string|null} [orderBy] ListWorkflowsRequest orderBy + */ + + /** + * Constructs a new ListWorkflowsRequest. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents a ListWorkflowsRequest. + * @implements IListWorkflowsRequest + * @constructor + * @param {google.cloud.workflows.v1.IListWorkflowsRequest=} [properties] Properties to set + */ + function ListWorkflowsRequest(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]]; + } + + /** + * ListWorkflowsRequest parent. + * @member {string} parent + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @instance + */ + ListWorkflowsRequest.prototype.parent = ""; + + /** + * ListWorkflowsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @instance + */ + ListWorkflowsRequest.prototype.pageSize = 0; + + /** + * ListWorkflowsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @instance + */ + ListWorkflowsRequest.prototype.pageToken = ""; + + /** + * ListWorkflowsRequest filter. + * @member {string} filter + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @instance + */ + ListWorkflowsRequest.prototype.filter = ""; + + /** + * ListWorkflowsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @instance + */ + ListWorkflowsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListWorkflowsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {google.cloud.workflows.v1.IListWorkflowsRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.ListWorkflowsRequest} ListWorkflowsRequest instance + */ + ListWorkflowsRequest.create = function create(properties) { + return new ListWorkflowsRequest(properties); + }; + + /** + * Encodes the specified ListWorkflowsRequest message. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {google.cloud.workflows.v1.IListWorkflowsRequest} message ListWorkflowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListWorkflowsRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {google.cloud.workflows.v1.IListWorkflowsRequest} message ListWorkflowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkflowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.ListWorkflowsRequest} ListWorkflowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowsRequest.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.workflows.v1.ListWorkflowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkflowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.ListWorkflowsRequest} ListWorkflowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkflowsRequest message. + * @function verify + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkflowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListWorkflowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.ListWorkflowsRequest} ListWorkflowsRequest + */ + ListWorkflowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.ListWorkflowsRequest) + return object; + var message = new $root.google.cloud.workflows.v1.ListWorkflowsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListWorkflowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @static + * @param {google.cloud.workflows.v1.ListWorkflowsRequest} message ListWorkflowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkflowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListWorkflowsRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.ListWorkflowsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkflowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListWorkflowsRequest; + })(); + + v1.ListWorkflowsResponse = (function() { + + /** + * Properties of a ListWorkflowsResponse. + * @memberof google.cloud.workflows.v1 + * @interface IListWorkflowsResponse + * @property {Array.|null} [workflows] ListWorkflowsResponse workflows + * @property {string|null} [nextPageToken] ListWorkflowsResponse nextPageToken + * @property {Array.|null} [unreachable] ListWorkflowsResponse unreachable + */ + + /** + * Constructs a new ListWorkflowsResponse. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents a ListWorkflowsResponse. + * @implements IListWorkflowsResponse + * @constructor + * @param {google.cloud.workflows.v1.IListWorkflowsResponse=} [properties] Properties to set + */ + function ListWorkflowsResponse(properties) { + this.workflows = []; + this.unreachable = []; + 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]]; + } + + /** + * ListWorkflowsResponse workflows. + * @member {Array.} workflows + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @instance + */ + ListWorkflowsResponse.prototype.workflows = $util.emptyArray; + + /** + * ListWorkflowsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @instance + */ + ListWorkflowsResponse.prototype.nextPageToken = ""; + + /** + * ListWorkflowsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @instance + */ + ListWorkflowsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListWorkflowsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {google.cloud.workflows.v1.IListWorkflowsResponse=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.ListWorkflowsResponse} ListWorkflowsResponse instance + */ + ListWorkflowsResponse.create = function create(properties) { + return new ListWorkflowsResponse(properties); + }; + + /** + * Encodes the specified ListWorkflowsResponse message. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {google.cloud.workflows.v1.IListWorkflowsResponse} message ListWorkflowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workflows != null && message.workflows.length) + for (var i = 0; i < message.workflows.length; ++i) + $root.google.cloud.workflows.v1.Workflow.encode(message.workflows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListWorkflowsResponse message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.ListWorkflowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {google.cloud.workflows.v1.IListWorkflowsResponse} message ListWorkflowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkflowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.ListWorkflowsResponse} ListWorkflowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowsResponse.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.workflows.v1.ListWorkflowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.workflows && message.workflows.length)) + message.workflows = []; + message.workflows.push($root.google.cloud.workflows.v1.Workflow.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + case 3: + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkflowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.ListWorkflowsResponse} ListWorkflowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkflowsResponse message. + * @function verify + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkflowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workflows != null && message.hasOwnProperty("workflows")) { + if (!Array.isArray(message.workflows)) + return "workflows: array expected"; + for (var i = 0; i < message.workflows.length; ++i) { + var error = $root.google.cloud.workflows.v1.Workflow.verify(message.workflows[i]); + if (error) + return "workflows." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListWorkflowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.ListWorkflowsResponse} ListWorkflowsResponse + */ + ListWorkflowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.ListWorkflowsResponse) + return object; + var message = new $root.google.cloud.workflows.v1.ListWorkflowsResponse(); + if (object.workflows) { + if (!Array.isArray(object.workflows)) + throw TypeError(".google.cloud.workflows.v1.ListWorkflowsResponse.workflows: array expected"); + message.workflows = []; + for (var i = 0; i < object.workflows.length; ++i) { + if (typeof object.workflows[i] !== "object") + throw TypeError(".google.cloud.workflows.v1.ListWorkflowsResponse.workflows: object expected"); + message.workflows[i] = $root.google.cloud.workflows.v1.Workflow.fromObject(object.workflows[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.workflows.v1.ListWorkflowsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListWorkflowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @static + * @param {google.cloud.workflows.v1.ListWorkflowsResponse} message ListWorkflowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkflowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.workflows = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.workflows && message.workflows.length) { + object.workflows = []; + for (var j = 0; j < message.workflows.length; ++j) + object.workflows[j] = $root.google.cloud.workflows.v1.Workflow.toObject(message.workflows[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListWorkflowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.ListWorkflowsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkflowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListWorkflowsResponse; + })(); + + v1.GetWorkflowRequest = (function() { + + /** + * Properties of a GetWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @interface IGetWorkflowRequest + * @property {string|null} [name] GetWorkflowRequest name + */ + + /** + * Constructs a new GetWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents a GetWorkflowRequest. + * @implements IGetWorkflowRequest + * @constructor + * @param {google.cloud.workflows.v1.IGetWorkflowRequest=} [properties] Properties to set + */ + function GetWorkflowRequest(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]]; + } + + /** + * GetWorkflowRequest name. + * @member {string} name + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @instance + */ + GetWorkflowRequest.prototype.name = ""; + + /** + * Creates a new GetWorkflowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IGetWorkflowRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.GetWorkflowRequest} GetWorkflowRequest instance + */ + GetWorkflowRequest.create = function create(properties) { + return new GetWorkflowRequest(properties); + }; + + /** + * Encodes the specified GetWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.GetWorkflowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IGetWorkflowRequest} message GetWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkflowRequest.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); + return writer; + }; + + /** + * Encodes the specified GetWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.GetWorkflowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IGetWorkflowRequest} message GetWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkflowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.GetWorkflowRequest} GetWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkflowRequest.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.workflows.v1.GetWorkflowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetWorkflowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.GetWorkflowRequest} GetWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkflowRequest message. + * @function verify + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkflowRequest.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"; + return null; + }; + + /** + * Creates a GetWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.GetWorkflowRequest} GetWorkflowRequest + */ + GetWorkflowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.GetWorkflowRequest) + return object; + var message = new $root.google.cloud.workflows.v1.GetWorkflowRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkflowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.GetWorkflowRequest} message GetWorkflowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkflowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetWorkflowRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.GetWorkflowRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkflowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetWorkflowRequest; + })(); + + v1.CreateWorkflowRequest = (function() { + + /** + * Properties of a CreateWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @interface ICreateWorkflowRequest + * @property {string|null} [parent] CreateWorkflowRequest parent + * @property {google.cloud.workflows.v1.IWorkflow|null} [workflow] CreateWorkflowRequest workflow + * @property {string|null} [workflowId] CreateWorkflowRequest workflowId + */ + + /** + * Constructs a new CreateWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents a CreateWorkflowRequest. + * @implements ICreateWorkflowRequest + * @constructor + * @param {google.cloud.workflows.v1.ICreateWorkflowRequest=} [properties] Properties to set + */ + function CreateWorkflowRequest(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]]; + } + + /** + * CreateWorkflowRequest parent. + * @member {string} parent + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @instance + */ + CreateWorkflowRequest.prototype.parent = ""; + + /** + * CreateWorkflowRequest workflow. + * @member {google.cloud.workflows.v1.IWorkflow|null|undefined} workflow + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @instance + */ + CreateWorkflowRequest.prototype.workflow = null; + + /** + * CreateWorkflowRequest workflowId. + * @member {string} workflowId + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @instance + */ + CreateWorkflowRequest.prototype.workflowId = ""; + + /** + * Creates a new CreateWorkflowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.ICreateWorkflowRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.CreateWorkflowRequest} CreateWorkflowRequest instance + */ + CreateWorkflowRequest.create = function create(properties) { + return new CreateWorkflowRequest(properties); + }; + + /** + * Encodes the specified CreateWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.CreateWorkflowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.ICreateWorkflowRequest} message CreateWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkflowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) + $root.google.cloud.workflows.v1.Workflow.encode(message.workflow, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.workflowId != null && Object.hasOwnProperty.call(message, "workflowId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.workflowId); + return writer; + }; + + /** + * Encodes the specified CreateWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.CreateWorkflowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.ICreateWorkflowRequest} message CreateWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkflowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.CreateWorkflowRequest} CreateWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkflowRequest.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.workflows.v1.CreateWorkflowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.workflow = $root.google.cloud.workflows.v1.Workflow.decode(reader, reader.uint32()); + break; + case 3: + message.workflowId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkflowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.CreateWorkflowRequest} CreateWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkflowRequest message. + * @function verify + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkflowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.workflow != null && message.hasOwnProperty("workflow")) { + var error = $root.google.cloud.workflows.v1.Workflow.verify(message.workflow); + if (error) + return "workflow." + error; + } + if (message.workflowId != null && message.hasOwnProperty("workflowId")) + if (!$util.isString(message.workflowId)) + return "workflowId: string expected"; + return null; + }; + + /** + * Creates a CreateWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.CreateWorkflowRequest} CreateWorkflowRequest + */ + CreateWorkflowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.CreateWorkflowRequest) + return object; + var message = new $root.google.cloud.workflows.v1.CreateWorkflowRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workflow != null) { + if (typeof object.workflow !== "object") + throw TypeError(".google.cloud.workflows.v1.CreateWorkflowRequest.workflow: object expected"); + message.workflow = $root.google.cloud.workflows.v1.Workflow.fromObject(object.workflow); + } + if (object.workflowId != null) + message.workflowId = String(object.workflowId); + return message; + }; + + /** + * Creates a plain object from a CreateWorkflowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.CreateWorkflowRequest} message CreateWorkflowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkflowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workflow = null; + object.workflowId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workflow != null && message.hasOwnProperty("workflow")) + object.workflow = $root.google.cloud.workflows.v1.Workflow.toObject(message.workflow, options); + if (message.workflowId != null && message.hasOwnProperty("workflowId")) + object.workflowId = message.workflowId; + return object; + }; + + /** + * Converts this CreateWorkflowRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.CreateWorkflowRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkflowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateWorkflowRequest; + })(); + + v1.DeleteWorkflowRequest = (function() { + + /** + * Properties of a DeleteWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @interface IDeleteWorkflowRequest + * @property {string|null} [name] DeleteWorkflowRequest name + */ + + /** + * Constructs a new DeleteWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents a DeleteWorkflowRequest. + * @implements IDeleteWorkflowRequest + * @constructor + * @param {google.cloud.workflows.v1.IDeleteWorkflowRequest=} [properties] Properties to set + */ + function DeleteWorkflowRequest(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]]; + } + + /** + * DeleteWorkflowRequest name. + * @member {string} name + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @instance + */ + DeleteWorkflowRequest.prototype.name = ""; + + /** + * Creates a new DeleteWorkflowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IDeleteWorkflowRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.DeleteWorkflowRequest} DeleteWorkflowRequest instance + */ + DeleteWorkflowRequest.create = function create(properties) { + return new DeleteWorkflowRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.DeleteWorkflowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IDeleteWorkflowRequest} message DeleteWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkflowRequest.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); + return writer; + }; + + /** + * Encodes the specified DeleteWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.DeleteWorkflowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IDeleteWorkflowRequest} message DeleteWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkflowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.DeleteWorkflowRequest} DeleteWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkflowRequest.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.workflows.v1.DeleteWorkflowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkflowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.DeleteWorkflowRequest} DeleteWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkflowRequest message. + * @function verify + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkflowRequest.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"; + return null; + }; + + /** + * Creates a DeleteWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.DeleteWorkflowRequest} DeleteWorkflowRequest + */ + DeleteWorkflowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.DeleteWorkflowRequest) + return object; + var message = new $root.google.cloud.workflows.v1.DeleteWorkflowRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkflowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.DeleteWorkflowRequest} message DeleteWorkflowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkflowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteWorkflowRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.DeleteWorkflowRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkflowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteWorkflowRequest; + })(); + + v1.UpdateWorkflowRequest = (function() { + + /** + * Properties of an UpdateWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @interface IUpdateWorkflowRequest + * @property {google.cloud.workflows.v1.IWorkflow|null} [workflow] UpdateWorkflowRequest workflow + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkflowRequest updateMask + */ + + /** + * Constructs a new UpdateWorkflowRequest. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents an UpdateWorkflowRequest. + * @implements IUpdateWorkflowRequest + * @constructor + * @param {google.cloud.workflows.v1.IUpdateWorkflowRequest=} [properties] Properties to set + */ + function UpdateWorkflowRequest(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]]; + } + + /** + * UpdateWorkflowRequest workflow. + * @member {google.cloud.workflows.v1.IWorkflow|null|undefined} workflow + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @instance + */ + UpdateWorkflowRequest.prototype.workflow = null; + + /** + * UpdateWorkflowRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @instance + */ + UpdateWorkflowRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateWorkflowRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IUpdateWorkflowRequest=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.UpdateWorkflowRequest} UpdateWorkflowRequest instance + */ + UpdateWorkflowRequest.create = function create(properties) { + return new UpdateWorkflowRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkflowRequest message. Does not implicitly {@link google.cloud.workflows.v1.UpdateWorkflowRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IUpdateWorkflowRequest} message UpdateWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkflowRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workflow != null && Object.hasOwnProperty.call(message, "workflow")) + $root.google.cloud.workflows.v1.Workflow.encode(message.workflow, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateWorkflowRequest message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.UpdateWorkflowRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.IUpdateWorkflowRequest} message UpdateWorkflowRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkflowRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkflowRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.UpdateWorkflowRequest} UpdateWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkflowRequest.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.workflows.v1.UpdateWorkflowRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflow = $root.google.cloud.workflows.v1.Workflow.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkflowRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.UpdateWorkflowRequest} UpdateWorkflowRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkflowRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkflowRequest message. + * @function verify + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkflowRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workflow != null && message.hasOwnProperty("workflow")) { + var error = $root.google.cloud.workflows.v1.Workflow.verify(message.workflow); + if (error) + return "workflow." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateWorkflowRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.UpdateWorkflowRequest} UpdateWorkflowRequest + */ + UpdateWorkflowRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.UpdateWorkflowRequest) + return object; + var message = new $root.google.cloud.workflows.v1.UpdateWorkflowRequest(); + if (object.workflow != null) { + if (typeof object.workflow !== "object") + throw TypeError(".google.cloud.workflows.v1.UpdateWorkflowRequest.workflow: object expected"); + message.workflow = $root.google.cloud.workflows.v1.Workflow.fromObject(object.workflow); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.workflows.v1.UpdateWorkflowRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateWorkflowRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @static + * @param {google.cloud.workflows.v1.UpdateWorkflowRequest} message UpdateWorkflowRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkflowRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workflow = null; + object.updateMask = null; + } + if (message.workflow != null && message.hasOwnProperty("workflow")) + object.workflow = $root.google.cloud.workflows.v1.Workflow.toObject(message.workflow, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateWorkflowRequest to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.UpdateWorkflowRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkflowRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateWorkflowRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.workflows.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.workflows.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.workflows.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.workflows.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.workflows.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.workflows.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.workflows.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.workflows.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {google.cloud.workflows.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.workflows.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.workflows.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {google.cloud.workflows.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.workflows.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {google.cloud.workflows.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workflows.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.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.workflows.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.target = reader.string(); + break; + case 4: + message.verb = reader.string(); + break; + case 5: + message.apiVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workflows.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workflows.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workflows.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.workflows.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.workflows.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.workflows.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workflows.v1.OperationMetadata + * @static + * @param {google.cloud.workflows.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.workflows.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationMetadata; + })(); + + return v1; })(); workflows.v1beta = (function() { diff --git a/protos/protos.json b/protos/protos.json index f60dcf0..3b196aa 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -8,12 +8,12 @@ "nested": { "executions": { "nested": { - "v1beta": { + "v1": { "options": { - "go_package": "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1beta;executions", + "go_package": "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1;executions", "java_multiple_files": true, "java_outer_classname": "ExecutionsProto", - "java_package": "com.google.cloud.workflows.executions.v1beta", + "java_package": "com.google.cloud.workflows.executions.v1", "(google.api.resource_definition).type": "workflows.googleapis.com/Workflow", "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/workflows/{workflow}" }, @@ -28,13 +28,13 @@ "requestType": "ListExecutionsRequest", "responseType": "ListExecutionsResponse", "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions", + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/workflows/*}/executions", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions" + "get": "/v1/{parent=projects/*/locations/*/workflows/*}/executions" } }, { @@ -46,14 +46,14 @@ "requestType": "CreateExecutionRequest", "responseType": "Execution", "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions", + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/workflows/*}/executions", "(google.api.http).body": "execution", "(google.api.method_signature)": "parent,execution" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions", + "post": "/v1/{parent=projects/*/locations/*/workflows/*}/executions", "body": "execution" } }, @@ -66,13 +66,13 @@ "requestType": "GetExecutionRequest", "responseType": "Execution", "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}", + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workflows/*/executions/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}" + "get": "/v1/{name=projects/*/locations/*/workflows/*/executions/*}" } }, { @@ -84,14 +84,14 @@ "requestType": "CancelExecutionRequest", "responseType": "Execution", "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel", + "(google.api.http).post": "/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel", "(google.api.http).body": "*", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel", + "post": "/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel", "body": "*" } }, @@ -284,6 +284,633 @@ } } } + }, + "v1beta": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1beta;executions", + "java_multiple_files": true, + "java_outer_classname": "ExecutionsProto", + "java_package": "com.google.cloud.workflows.executions.v1beta", + "(google.api.resource_definition).type": "workflows.googleapis.com/Workflow", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/workflows/{workflow}" + }, + "nested": { + "Executions": { + "options": { + "(google.api.default_host)": "workflowexecutions.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListExecutions": { + "requestType": "ListExecutionsRequest", + "responseType": "ListExecutionsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateExecution": { + "requestType": "CreateExecutionRequest", + "responseType": "Execution", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions", + "(google.api.http).body": "execution", + "(google.api.method_signature)": "parent,execution" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions", + "body": "execution" + } + }, + { + "(google.api.method_signature)": "parent,execution" + } + ] + }, + "GetExecution": { + "requestType": "GetExecutionRequest", + "responseType": "Execution", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelExecution": { + "requestType": "CancelExecutionRequest", + "responseType": "Execution", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Execution": { + "options": { + "(google.api.resource).type": "workflowexecutions.googleapis.com/Execution", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "argument": { + "type": "string", + "id": 5 + }, + "result": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "Error", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "workflowRevisionId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Error": { + "fields": { + "payload": { + "type": "string", + "id": 1 + }, + "context": { + "type": "string", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "CANCELLED": 4 + } + } + } + }, + "ListExecutionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workflows.googleapis.com/Workflow" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "view": { + "type": "ExecutionView", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExecutionsResponse": { + "fields": { + "executions": { + "rule": "repeated", + "type": "Execution", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateExecutionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workflows.googleapis.com/Workflow" + } + }, + "execution": { + "type": "Execution", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetExecutionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workflowexecutions.googleapis.com/Execution" + } + }, + "view": { + "type": "ExecutionView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelExecutionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workflowexecutions.googleapis.com/Execution" + } + } + } + }, + "ExecutionView": { + "values": { + "EXECUTION_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + } + } + } + } + }, + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/workflows/v1;workflows", + "java_multiple_files": true, + "java_outer_classname": "WorkflowsProto", + "java_package": "com.google.cloud.workflows.v1" + }, + "nested": { + "Workflows": { + "options": { + "(google.api.default_host)": "workflows.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListWorkflows": { + "requestType": "ListWorkflowsRequest", + "responseType": "ListWorkflowsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/workflows", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/workflows" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetWorkflow": { + "requestType": "GetWorkflowRequest", + "responseType": "Workflow", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workflows/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/workflows/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateWorkflow": { + "requestType": "CreateWorkflowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workflows", + "(google.api.http).body": "workflow", + "(google.api.method_signature)": "parent,workflow,workflow_id", + "(google.longrunning.operation_info).response_type": "Workflow", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/workflows", + "body": "workflow" + } + }, + { + "(google.api.method_signature)": "parent,workflow,workflow_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workflow", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteWorkflow": { + "requestType": "DeleteWorkflowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workflows/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/workflows/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateWorkflow": { + "requestType": "UpdateWorkflowRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{workflow.name=projects/*/locations/*/workflows/*}", + "(google.api.http).body": "workflow", + "(google.api.method_signature)": "workflow,update_mask", + "(google.longrunning.operation_info).response_type": "Workflow", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{workflow.name=projects/*/locations/*/workflows/*}", + "body": "workflow" + } + }, + { + "(google.api.method_signature)": "workflow,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workflow", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "Workflow": { + "options": { + "(google.api.resource).type": "workflows.googleapis.com/Workflow", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workflows/{workflow}" + }, + "oneofs": { + "sourceCode": { + "oneof": [ + "sourceContents" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "serviceAccount": { + "type": "string", + "id": 9 + }, + "sourceContents": { + "type": "string", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1 + } + } + } + }, + "ListWorkflowsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListWorkflowsResponse": { + "fields": { + "workflows": { + "rule": "repeated", + "type": "Workflow", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetWorkflowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workflows.googleapis.com/Workflow" + } + } + } + }, + "CreateWorkflowRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "workflow": { + "type": "Workflow", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workflowId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteWorkflowRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workflows.googleapis.com/Workflow" + } + } + } + }, + "UpdateWorkflowRequest": { + "fields": { + "workflow": { + "type": "Workflow", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "apiVersion": { + "type": "string", + "id": 5 + } + } } } }, diff --git a/src/index.ts b/src/index.ts index 1a91211..197e326 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,12 +16,13 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta from './v1beta'; -const ExecutionsClient = v1beta.ExecutionsClient; -type ExecutionsClient = v1beta.ExecutionsClient; -const WorkflowsClient = v1beta.WorkflowsClient; -type WorkflowsClient = v1beta.WorkflowsClient; -export {v1beta, ExecutionsClient, WorkflowsClient}; -export default {v1beta, ExecutionsClient, WorkflowsClient}; +const ExecutionsClient = v1.ExecutionsClient; +type ExecutionsClient = v1.ExecutionsClient; +const WorkflowsClient = v1.WorkflowsClient; +type WorkflowsClient = v1.WorkflowsClient; +export {v1, v1beta, ExecutionsClient, WorkflowsClient}; +export default {v1, v1beta, ExecutionsClient, WorkflowsClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/src/v1/executions_client.ts b/src/v1/executions_client.ts new file mode 100644 index 0000000..ec24ddf --- /dev/null +++ b/src/v1/executions_client.ts @@ -0,0 +1,979 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/executions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './executions_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Executions is used to start and manage running instances of + * {@link google.cloud.workflows.v1.Workflow|Workflows} called executions. + * @class + * @memberof v1 + */ +export class ExecutionsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + executionsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ExecutionsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ExecutionsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}' + ), + workflowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflows/{workflow}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listExecutions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'executions' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.workflows.executions.v1.Executions', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.executionsStub) { + return this.executionsStub; + } + + // Put together the "service stub" for + // google.cloud.workflows.executions.v1.Executions. + this.executionsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.workflows.executions.v1.Executions' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.workflows.executions.v1.Executions, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const executionsStubMethods = [ + 'listExecutions', + 'createExecution', + 'getExecution', + 'cancelExecution', + ]; + for (const methodName of executionsStubMethods) { + const callPromise = this.executionsStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.executionsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'workflowexecutions.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'workflowexecutions.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createExecution( + request: protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution, + ( + | protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest + | undefined + ), + {} | undefined + ] + >; + createExecution( + request: protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createExecution( + request: protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest, + callback: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new execution using the latest revision of the given workflow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * @param {google.cloud.workflows.executions.v1.Execution} request.execution + * Required. Execution to be created. + * @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 [Execution]{@link google.cloud.workflows.executions.v1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createExecution(request); + */ + createExecution( + request: protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution, + ( + | protos.google.cloud.workflows.executions.v1.ICreateExecutionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createExecution(request, options, callback); + } + getExecution( + request: protos.google.cloud.workflows.executions.v1.IGetExecutionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution, + ( + | protos.google.cloud.workflows.executions.v1.IGetExecutionRequest + | undefined + ), + {} | undefined + ] + >; + getExecution( + request: protos.google.cloud.workflows.executions.v1.IGetExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.IGetExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getExecution( + request: protos.google.cloud.workflows.executions.v1.IGetExecutionRequest, + callback: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.IGetExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns an execution of the given name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @param {google.cloud.workflows.executions.v1.ExecutionView} [request.view] + * Optional. A view defining which fields should be filled in the returned execution. + * The API will default to the FULL view. + * @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 [Execution]{@link google.cloud.workflows.executions.v1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getExecution(request); + */ + getExecution( + request: protos.google.cloud.workflows.executions.v1.IGetExecutionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.IGetExecutionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.IGetExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution, + ( + | protos.google.cloud.workflows.executions.v1.IGetExecutionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getExecution(request, options, callback); + } + cancelExecution( + request: protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution, + ( + | protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest + | undefined + ), + {} | undefined + ] + >; + cancelExecution( + request: protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + cancelExecution( + request: protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest, + callback: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Cancels an execution of the given name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @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 [Execution]{@link google.cloud.workflows.executions.v1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.cancelExecution(request); + */ + cancelExecution( + request: protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workflows.executions.v1.IExecution, + | protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution, + ( + | protos.google.cloud.workflows.executions.v1.ICancelExecutionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelExecution(request, options, callback); + } + + listExecutions( + request: protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution[], + protos.google.cloud.workflows.executions.v1.IListExecutionsRequest | null, + protos.google.cloud.workflows.executions.v1.IListExecutionsResponse + ] + >; + listExecutions( + request: protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + | protos.google.cloud.workflows.executions.v1.IListExecutionsResponse + | null + | undefined, + protos.google.cloud.workflows.executions.v1.IExecution + > + ): void; + listExecutions( + request: protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + callback: PaginationCallback< + protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + | protos.google.cloud.workflows.executions.v1.IListExecutionsResponse + | null + | undefined, + protos.google.cloud.workflows.executions.v1.IExecution + > + ): void; + /** + * Returns a list of executions which belong to the workflow with + * the given name. The method returns executions of all workflow + * revisions. Returned executions are ordered by their start time (newest + * first). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @param {number} request.pageSize + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 10000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * @param {string} request.pageToken + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * @param {google.cloud.workflows.executions.v1.ExecutionView} [request.view] + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Execution]{@link google.cloud.workflows.executions.v1.Execution}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listExecutionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExecutions( + request: protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + | protos.google.cloud.workflows.executions.v1.IListExecutionsResponse + | null + | undefined, + protos.google.cloud.workflows.executions.v1.IExecution + >, + callback?: PaginationCallback< + protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + | protos.google.cloud.workflows.executions.v1.IListExecutionsResponse + | null + | undefined, + protos.google.cloud.workflows.executions.v1.IExecution + > + ): Promise< + [ + protos.google.cloud.workflows.executions.v1.IExecution[], + protos.google.cloud.workflows.executions.v1.IListExecutionsRequest | null, + protos.google.cloud.workflows.executions.v1.IListExecutionsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listExecutions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @param {number} request.pageSize + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 10000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * @param {string} request.pageToken + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * @param {google.cloud.workflows.executions.v1.ExecutionView} [request.view] + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Execution]{@link google.cloud.workflows.executions.v1.Execution} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listExecutionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExecutionsStream( + request?: protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listExecutions.createStream( + this.innerApiCalls.listExecutions as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listExecutions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @param {number} request.pageSize + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 10000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * @param {string} request.pageToken + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * @param {google.cloud.workflows.executions.v1.ExecutionView} [request.view] + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Execution]{@link google.cloud.workflows.executions.v1.Execution}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listExecutionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listExecutionsAsync( + request?: protos.google.cloud.workflows.executions.v1.IListExecutionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listExecutions.asyncIterate( + this.innerApiCalls['listExecutions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + workflow: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + workflow: workflow, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the workflow from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the workflow. + */ + matchWorkflowFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .workflow; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified workflow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow + * @returns {string} Resource name string. + */ + workflowPath(project: string, location: string, workflow: string) { + return this.pathTemplates.workflowPathTemplate.render({ + project: project, + location: location, + workflow: workflow, + }); + } + + /** + * Parse the project from Workflow resource. + * + * @param {string} workflowName + * A fully-qualified path representing Workflow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkflowName(workflowName: string) { + return this.pathTemplates.workflowPathTemplate.match(workflowName).project; + } + + /** + * Parse the location from Workflow resource. + * + * @param {string} workflowName + * A fully-qualified path representing Workflow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkflowName(workflowName: string) { + return this.pathTemplates.workflowPathTemplate.match(workflowName).location; + } + + /** + * Parse the workflow from Workflow resource. + * + * @param {string} workflowName + * A fully-qualified path representing Workflow resource. + * @returns {string} A string representing the workflow. + */ + matchWorkflowFromWorkflowName(workflowName: string) { + return this.pathTemplates.workflowPathTemplate.match(workflowName).workflow; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.executionsStub!.then((stub) => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/executions_client_config.json b/src/v1/executions_client_config.json new file mode 100644 index 0000000..ea2d78f --- /dev/null +++ b/src/v1/executions_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.workflows.executions.v1.Executions": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListExecutions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/executions_proto_list.json b/src/v1/executions_proto_list.json new file mode 100644 index 0000000..3cffd5d --- /dev/null +++ b/src/v1/executions_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/workflows/executions/v1/executions.proto" +] diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json new file mode 100644 index 0000000..4beac11 --- /dev/null +++ b/src/v1/gapic_metadata.json @@ -0,0 +1,77 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.workflows.v1", + "libraryPackage": "@google-cloud/workflows", + "services": { + "Workflows": { + "clients": { + "grpc": { + "libraryClient": "WorkflowsClient", + "rpcs": { + "GetWorkflow": { + "methods": [ + "getWorkflow" + ] + }, + "CreateWorkflow": { + "methods": [ + "createWorkflow" + ] + }, + "DeleteWorkflow": { + "methods": [ + "deleteWorkflow" + ] + }, + "UpdateWorkflow": { + "methods": [ + "updateWorkflow" + ] + }, + "ListWorkflows": { + "methods": [ + "listWorkflows", + "listWorkflowsStream", + "listWorkflowsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WorkflowsClient", + "rpcs": { + "GetWorkflow": { + "methods": [ + "getWorkflow" + ] + }, + "CreateWorkflow": { + "methods": [ + "createWorkflow" + ] + }, + "DeleteWorkflow": { + "methods": [ + "deleteWorkflow" + ] + }, + "UpdateWorkflow": { + "methods": [ + "updateWorkflow" + ] + }, + "ListWorkflows": { + "methods": [ + "listWorkflows", + "listWorkflowsStream", + "listWorkflowsAsync" + ] + } + } + } + } + } + } +} diff --git a/src/v1/index.ts b/src/v1/index.ts new file mode 100644 index 0000000..4af11e9 --- /dev/null +++ b/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ExecutionsClient} from './executions_client'; +export {WorkflowsClient} from './workflows_client'; diff --git a/src/v1/workflows_client.ts b/src/v1/workflows_client.ts new file mode 100644 index 0000000..c4676f8 --- /dev/null +++ b/src/v1/workflows_client.ts @@ -0,0 +1,1238 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/workflows_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './workflows_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Workflows is used to deploy and execute workflow programs. + * Workflows makes sure the program executes reliably, despite hardware and + * networking interruptions. + * @class + * @memberof v1 + */ +export class WorkflowsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + workflowsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WorkflowsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WorkflowsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + workflowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflows/{workflow}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listWorkflows: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workflows' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const createWorkflowResponse = protoFilesRoot.lookup( + '.google.cloud.workflows.v1.Workflow' + ) as gax.protobuf.Type; + const createWorkflowMetadata = protoFilesRoot.lookup( + '.google.cloud.workflows.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteWorkflowResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteWorkflowMetadata = protoFilesRoot.lookup( + '.google.cloud.workflows.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateWorkflowResponse = protoFilesRoot.lookup( + '.google.cloud.workflows.v1.Workflow' + ) as gax.protobuf.Type; + const updateWorkflowMetadata = protoFilesRoot.lookup( + '.google.cloud.workflows.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createWorkflow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkflowResponse.decode.bind(createWorkflowResponse), + createWorkflowMetadata.decode.bind(createWorkflowMetadata) + ), + deleteWorkflow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteWorkflowResponse.decode.bind(deleteWorkflowResponse), + deleteWorkflowMetadata.decode.bind(deleteWorkflowMetadata) + ), + updateWorkflow: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateWorkflowResponse.decode.bind(updateWorkflowResponse), + updateWorkflowMetadata.decode.bind(updateWorkflowMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.workflows.v1.Workflows', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.workflowsStub) { + return this.workflowsStub; + } + + // Put together the "service stub" for + // google.cloud.workflows.v1.Workflows. + this.workflowsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.workflows.v1.Workflows' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.workflows.v1.Workflows, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const workflowsStubMethods = [ + 'listWorkflows', + 'getWorkflow', + 'createWorkflow', + 'deleteWorkflow', + 'updateWorkflow', + ]; + for (const methodName of workflowsStubMethods) { + const callPromise = this.workflowsStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.workflowsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'workflows.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'workflows.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getWorkflow( + request: protos.google.cloud.workflows.v1.IGetWorkflowRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IGetWorkflowRequest | undefined, + {} | undefined + ] + >; + getWorkflow( + request: protos.google.cloud.workflows.v1.IGetWorkflowRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IGetWorkflowRequest | null | undefined, + {} | null | undefined + > + ): void; + getWorkflow( + request: protos.google.cloud.workflows.v1.IGetWorkflowRequest, + callback: Callback< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IGetWorkflowRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets details of a single Workflow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the workflow which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @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 [Workflow]{@link google.cloud.workflows.v1.Workflow}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getWorkflow(request); + */ + getWorkflow( + request: protos.google.cloud.workflows.v1.IGetWorkflowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workflows.v1.IWorkflow, + | protos.google.cloud.workflows.v1.IGetWorkflowRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IGetWorkflowRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IGetWorkflowRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWorkflow(request, options, callback); + } + + createWorkflow( + request: protos.google.cloud.workflows.v1.ICreateWorkflowRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createWorkflow( + request: protos.google.cloud.workflows.v1.ICreateWorkflowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkflow( + request: protos.google.cloud.workflows.v1.ICreateWorkflowRequest, + callback: Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new workflow. If a workflow with the specified name already + * exists in the specified project and location, the long running operation + * will return {@link google.rpc.Code.ALREADY_EXISTS|ALREADY_EXISTS} error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * @param {google.cloud.workflows.v1.Workflow} request.workflow + * Required. Workflow to be created. + * @param {string} request.workflowId + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createWorkflow(request); + * const [response] = await operation.promise(); + */ + createWorkflow( + request: protos.google.cloud.workflows.v1.ICreateWorkflowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWorkflow(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createWorkflow()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateWorkflowProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateWorkflowProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workflows.v1.Workflow, + protos.google.cloud.workflows.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createWorkflow, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workflows.v1.Workflow, + protos.google.cloud.workflows.v1.OperationMetadata + >; + } + deleteWorkflow( + request: protos.google.cloud.workflows.v1.IDeleteWorkflowRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteWorkflow( + request: protos.google.cloud.workflows.v1.IDeleteWorkflowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkflow( + request: protos.google.cloud.workflows.v1.IDeleteWorkflowRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a workflow with the specified name. + * This method also cancels and deletes all running executions of the + * workflow. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteWorkflow(request); + * const [response] = await operation.promise(); + */ + deleteWorkflow( + request: protos.google.cloud.workflows.v1.IDeleteWorkflowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkflow(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteWorkflow()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteWorkflowProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteWorkflowProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.workflows.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteWorkflow, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.workflows.v1.OperationMetadata + >; + } + updateWorkflow( + request: protos.google.cloud.workflows.v1.IUpdateWorkflowRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateWorkflow( + request: protos.google.cloud.workflows.v1.IUpdateWorkflowRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkflow( + request: protos.google.cloud.workflows.v1.IUpdateWorkflowRequest, + callback: Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing workflow. + * Running this method has no impact on already running executions of the + * workflow. A new revision of the workflow may be created as a result of a + * successful update operation. In that case, such revision will be used + * in new workflow executions. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.workflows.v1.Workflow} request.workflow + * Required. Workflow to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * List of fields to be updated. If not present, the entire workflow + * will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.updateWorkflow(request); + * const [response] = await operation.promise(); + */ + updateWorkflow( + request: protos.google.cloud.workflows.v1.IUpdateWorkflowRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'workflow.name': request.workflow!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateWorkflow(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateWorkflow()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateWorkflowProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateWorkflowProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workflows.v1.Workflow, + protos.google.cloud.workflows.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateWorkflow, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workflows.v1.Workflow, + protos.google.cloud.workflows.v1.OperationMetadata + >; + } + listWorkflows( + request: protos.google.cloud.workflows.v1.IListWorkflowsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workflows.v1.IWorkflow[], + protos.google.cloud.workflows.v1.IListWorkflowsRequest | null, + protos.google.cloud.workflows.v1.IListWorkflowsResponse + ] + >; + listWorkflows( + request: protos.google.cloud.workflows.v1.IListWorkflowsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.workflows.v1.IListWorkflowsRequest, + | protos.google.cloud.workflows.v1.IListWorkflowsResponse + | null + | undefined, + protos.google.cloud.workflows.v1.IWorkflow + > + ): void; + listWorkflows( + request: protos.google.cloud.workflows.v1.IListWorkflowsRequest, + callback: PaginationCallback< + protos.google.cloud.workflows.v1.IListWorkflowsRequest, + | protos.google.cloud.workflows.v1.IListWorkflowsResponse + | null + | undefined, + protos.google.cloud.workflows.v1.IWorkflow + > + ): void; + /** + * Lists Workflows in a given project and location. + * The default order is not specified. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * @param {number} request.pageSize + * Maximum number of workflows to return per call. The service may return + * fewer than this value. If the value is not specified, a default value of + * 500 will be used. The maximum permitted value is 1000 and values greater + * than 1000 will be coerced down to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * @param {string} request.filter + * Filter to restrict results to specific workflows. + * @param {string} request.orderBy + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Workflow]{@link google.cloud.workflows.v1.Workflow}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkflowsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkflows( + request: protos.google.cloud.workflows.v1.IListWorkflowsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.workflows.v1.IListWorkflowsRequest, + | protos.google.cloud.workflows.v1.IListWorkflowsResponse + | null + | undefined, + protos.google.cloud.workflows.v1.IWorkflow + >, + callback?: PaginationCallback< + protos.google.cloud.workflows.v1.IListWorkflowsRequest, + | protos.google.cloud.workflows.v1.IListWorkflowsResponse + | null + | undefined, + protos.google.cloud.workflows.v1.IWorkflow + > + ): Promise< + [ + protos.google.cloud.workflows.v1.IWorkflow[], + protos.google.cloud.workflows.v1.IListWorkflowsRequest | null, + protos.google.cloud.workflows.v1.IListWorkflowsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkflows(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * @param {number} request.pageSize + * Maximum number of workflows to return per call. The service may return + * fewer than this value. If the value is not specified, a default value of + * 500 will be used. The maximum permitted value is 1000 and values greater + * than 1000 will be coerced down to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * @param {string} request.filter + * Filter to restrict results to specific workflows. + * @param {string} request.orderBy + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Workflow]{@link google.cloud.workflows.v1.Workflow} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listWorkflowsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkflowsStream( + request?: protos.google.cloud.workflows.v1.IListWorkflowsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkflows.createStream( + this.innerApiCalls.listWorkflows as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listWorkflows`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * @param {number} request.pageSize + * Maximum number of workflows to return per call. The service may return + * fewer than this value. If the value is not specified, a default value of + * 500 will be used. The maximum permitted value is 1000 and values greater + * than 1000 will be coerced down to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * @param {string} request.filter + * Filter to restrict results to specific workflows. + * @param {string} request.orderBy + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Workflow]{@link google.cloud.workflows.v1.Workflow}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listWorkflowsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listWorkflowsAsync( + request?: protos.google.cloud.workflows.v1.IListWorkflowsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkflows.asyncIterate( + this.innerApiCalls['listWorkflows'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified workflow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow + * @returns {string} Resource name string. + */ + workflowPath(project: string, location: string, workflow: string) { + return this.pathTemplates.workflowPathTemplate.render({ + project: project, + location: location, + workflow: workflow, + }); + } + + /** + * Parse the project from Workflow resource. + * + * @param {string} workflowName + * A fully-qualified path representing Workflow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkflowName(workflowName: string) { + return this.pathTemplates.workflowPathTemplate.match(workflowName).project; + } + + /** + * Parse the location from Workflow resource. + * + * @param {string} workflowName + * A fully-qualified path representing Workflow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkflowName(workflowName: string) { + return this.pathTemplates.workflowPathTemplate.match(workflowName).location; + } + + /** + * Parse the workflow from Workflow resource. + * + * @param {string} workflowName + * A fully-qualified path representing Workflow resource. + * @returns {string} A string representing the workflow. + */ + matchWorkflowFromWorkflowName(workflowName: string) { + return this.pathTemplates.workflowPathTemplate.match(workflowName).workflow; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.workflowsStub!.then((stub) => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/workflows_client_config.json b/src/v1/workflows_client_config.json new file mode 100644 index 0000000..02f67fc --- /dev/null +++ b/src/v1/workflows_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.workflows.v1.Workflows": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListWorkflows": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkflow": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateWorkflow": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkflow": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkflow": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/workflows_proto_list.json b/src/v1/workflows_proto_list.json new file mode 100644 index 0000000..46c65a9 --- /dev/null +++ b/src/v1/workflows_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/workflows/v1/workflows.proto" +] diff --git a/src/v1beta/executions_client.ts b/src/v1beta/executions_client.ts index 9b38026..78e13b6 100644 --- a/src/v1beta/executions_client.ts +++ b/src/v1beta/executions_client.ts @@ -26,11 +26,11 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1beta/executions_client_config.json`. @@ -146,22 +146,7 @@ export class ExecutionsClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -240,13 +225,14 @@ export class ExecutionsClient { ]; for (const methodName of executionsStubMethods) { const callPromise = this.executionsStub.then( - (stub) => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -412,11 +398,10 @@ export class ExecutionsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createExecution(request, options, callback); } @@ -515,11 +500,10 @@ export class ExecutionsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getExecution(request, options, callback); } @@ -615,11 +599,10 @@ export class ExecutionsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.cancelExecution(request, options, callback); } @@ -730,11 +713,10 @@ export class ExecutionsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listExecutions(request, options, callback); } @@ -781,11 +763,10 @@ export class ExecutionsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listExecutions.createStream( @@ -843,17 +824,16 @@ export class ExecutionsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listExecutions.asyncIterate( this.innerApiCalls['listExecutions'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/src/v1beta/index.ts b/src/v1beta/index.ts index a5d0951..4af11e9 100644 --- a/src/v1beta/index.ts +++ b/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/v1beta/workflows_client.ts b/src/v1beta/workflows_client.ts index ff67fe6..991dcf8 100644 --- a/src/v1beta/workflows_client.ts +++ b/src/v1beta/workflows_client.ts @@ -27,11 +27,11 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1beta/workflows_client_config.json`. @@ -149,22 +149,7 @@ export class WorkflowsClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -189,15 +174,11 @@ export class WorkflowsClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ @@ -296,13 +277,14 @@ export class WorkflowsClient { ]; for (const methodName of workflowsStubMethods) { const callPromise = this.workflowsStub.then( - (stub) => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -462,11 +444,10 @@ export class WorkflowsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getWorkflow(request, options, callback); } @@ -582,11 +563,10 @@ export class WorkflowsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createWorkflow(request, options, callback); } @@ -727,11 +707,10 @@ export class WorkflowsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteWorkflow(request, options, callback); } @@ -876,11 +855,10 @@ export class WorkflowsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workflow.name': request.workflow!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'workflow.name': request.workflow!.name || '', + }); this.initialize(); return this.innerApiCalls.updateWorkflow(request, options, callback); } @@ -1028,11 +1006,10 @@ export class WorkflowsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listWorkflows(request, options, callback); } @@ -1082,11 +1059,10 @@ export class WorkflowsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listWorkflows.createStream( @@ -1147,17 +1123,16 @@ export class WorkflowsClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listWorkflows.asyncIterate( this.innerApiCalls['listWorkflows'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/test/gapic_executions_v1.ts b/test/gapic_executions_v1.ts new file mode 100644 index 0000000..767d652 --- /dev/null +++ b/test/gapic_executions_v1.ts @@ -0,0 +1,981 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as executionsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ExecutionsClient', () => { + it('has servicePath', () => { + const servicePath = executionsModule.v1.ExecutionsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = executionsModule.v1.ExecutionsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = executionsModule.v1.ExecutionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new executionsModule.v1.ExecutionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new executionsModule.v1.ExecutionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.executionsStub, undefined); + await client.initialize(); + assert(client.executionsStub); + }); + + it('has close method', () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createExecution', () => { + it('invokes createExecution without error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.CreateExecutionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ); + client.innerApiCalls.createExecution = stubSimpleCall(expectedResponse); + const [response] = await client.createExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createExecution without error using callback', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.CreateExecutionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ); + client.innerApiCalls.createExecution = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExecution( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workflows.executions.v1.IExecution | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createExecution with error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.CreateExecutionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createExecution = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createExecution(request), expectedError); + assert( + (client.innerApiCalls.createExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getExecution', () => { + it('invokes getExecution without error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.GetExecutionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ); + client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); + const [response] = await client.getExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getExecution without error using callback', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.GetExecutionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ); + client.innerApiCalls.getExecution = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExecution( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workflows.executions.v1.IExecution | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getExecution with error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.GetExecutionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getExecution = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getExecution(request), expectedError); + assert( + (client.innerApiCalls.getExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('cancelExecution', () => { + it('invokes cancelExecution without error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.CancelExecutionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ); + client.innerApiCalls.cancelExecution = stubSimpleCall(expectedResponse); + const [response] = await client.cancelExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes cancelExecution without error using callback', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.CancelExecutionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ); + client.innerApiCalls.cancelExecution = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelExecution( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workflows.executions.v1.IExecution | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes cancelExecution with error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.CancelExecutionRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelExecution = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelExecution(request), expectedError); + assert( + (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listExecutions', () => { + it('invokes listExecutions without error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.ListExecutionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + ]; + client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); + const [response] = await client.listExecutions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listExecutions without error using callback', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.ListExecutionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + ]; + client.innerApiCalls.listExecutions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExecutions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.workflows.executions.v1.IExecution[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listExecutions with error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.ListExecutionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listExecutions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listExecutions(request), expectedError); + assert( + (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listExecutionsStream without error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.ListExecutionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + ]; + client.descriptors.page.listExecutions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workflows.executions.v1.Execution[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.workflows.executions.v1.Execution) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExecutions, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listExecutions.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listExecutionsStream with error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.ListExecutionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workflows.executions.v1.Execution[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.workflows.executions.v1.Execution) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExecutions, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listExecutions.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listExecutions without error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.ListExecutionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.Execution() + ), + ]; + client.descriptors.page.listExecutions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workflows.executions.v1.IExecution[] = + []; + const iterable = client.listExecutionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listExecutions with error', async () => { + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.executions.v1.ListExecutionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExecutionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.workflows.executions.v1.IExecution[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + workflow: 'workflowValue', + execution: 'executionValue', + }; + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'workflowValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkflowFromExecutionName', () => { + const result = client.matchWorkflowFromExecutionName(fakePath); + assert.strictEqual(result, 'workflowValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workflow', () => { + const fakePath = '/rendered/path/workflow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + workflow: 'workflowValue', + }; + const client = new executionsModule.v1.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workflowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workflowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workflowPath', () => { + const result = client.workflowPath( + 'projectValue', + 'locationValue', + 'workflowValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workflowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkflowName', () => { + const result = client.matchProjectFromWorkflowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.workflowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkflowName', () => { + const result = client.matchLocationFromWorkflowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workflowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkflowFromWorkflowName', () => { + const result = client.matchWorkflowFromWorkflowName(fakePath); + assert.strictEqual(result, 'workflowValue'); + assert( + (client.pathTemplates.workflowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/test/gapic_executions_v1beta.ts b/test/gapic_executions_v1beta.ts index de191db..f08347e 100644 --- a/test/gapic_executions_v1beta.ts +++ b/test/gapic_executions_v1beta.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -247,9 +246,8 @@ describe('v1beta.ExecutionsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.workflows.executions.v1beta.Execution() ); - client.innerApiCalls.createExecution = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createExecution = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createExecution( request, @@ -359,9 +357,8 @@ describe('v1beta.ExecutionsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.workflows.executions.v1beta.Execution() ); - client.innerApiCalls.getExecution = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getExecution = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getExecution( request, @@ -471,9 +468,8 @@ describe('v1beta.ExecutionsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.workflows.executions.v1beta.Execution() ); - client.innerApiCalls.cancelExecution = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.cancelExecution = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.cancelExecution( request, @@ -599,9 +595,8 @@ describe('v1beta.ExecutionsClient', () => { new protos.google.cloud.workflows.executions.v1beta.Execution() ), ]; - client.innerApiCalls.listExecutions = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listExecutions = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listExecutions( request, @@ -681,12 +676,12 @@ describe('v1beta.ExecutionsClient', () => { new protos.google.cloud.workflows.executions.v1beta.Execution() ), ]; - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listExecutions.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listExecutionsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.workflows.executions.v1beta.Execution[] = []; + const responses: protos.google.cloud.workflows.executions.v1beta.Execution[] = + []; stream.on( 'data', ( @@ -710,10 +705,9 @@ describe('v1beta.ExecutionsClient', () => { .calledWith(client.innerApiCalls.listExecutions, request) ); assert.strictEqual( - (client.descriptors.page.listExecutions - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listExecutions.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -730,13 +724,12 @@ describe('v1beta.ExecutionsClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listExecutions.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listExecutionsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.workflows.executions.v1beta.Execution[] = []; + const responses: protos.google.cloud.workflows.executions.v1beta.Execution[] = + []; stream.on( 'data', ( @@ -759,10 +752,9 @@ describe('v1beta.ExecutionsClient', () => { .calledWith(client.innerApiCalls.listExecutions, request) ); assert.strictEqual( - (client.descriptors.page.listExecutions - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listExecutions.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -789,25 +781,25 @@ describe('v1beta.ExecutionsClient', () => { new protos.google.cloud.workflows.executions.v1beta.Execution() ), ]; - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.workflows.executions.v1beta.IExecution[] = []; + client.descriptors.page.listExecutions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workflows.executions.v1beta.IExecution[] = + []; const iterable = client.listExecutionsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listExecutions - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listExecutions - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -824,27 +816,26 @@ describe('v1beta.ExecutionsClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listExecutions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listExecutionsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.workflows.executions.v1beta.IExecution[] = []; + const responses: protos.google.cloud.workflows.executions.v1beta.IExecution[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listExecutions - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listExecutions - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listExecutions.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/test/gapic_workflows_v1.ts b/test/gapic_workflows_v1.ts new file mode 100644 index 0000000..2a20f71 --- /dev/null +++ b/test/gapic_workflows_v1.ts @@ -0,0 +1,1320 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as workflowsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.WorkflowsClient', () => { + it('has servicePath', () => { + const servicePath = workflowsModule.v1.WorkflowsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = workflowsModule.v1.WorkflowsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = workflowsModule.v1.WorkflowsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new workflowsModule.v1.WorkflowsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new workflowsModule.v1.WorkflowsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.workflowsStub, undefined); + await client.initialize(); + assert(client.workflowsStub); + }); + + it('has close method', () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getWorkflow', () => { + it('invokes getWorkflow without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.GetWorkflowRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.v1.Workflow() + ); + client.innerApiCalls.getWorkflow = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkflow(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getWorkflow without error using callback', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.GetWorkflowRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workflows.v1.Workflow() + ); + client.innerApiCalls.getWorkflow = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkflow( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workflows.v1.IWorkflow | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getWorkflow with error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.GetWorkflowRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkflow = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getWorkflow(request), expectedError); + assert( + (client.innerApiCalls.getWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createWorkflow', () => { + it('invokes createWorkflow without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.CreateWorkflowRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkflow = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkflow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkflow without error using callback', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.CreateWorkflowRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkflow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkflow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createWorkflow with call error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.CreateWorkflowRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkflow = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createWorkflow(request), expectedError); + assert( + (client.innerApiCalls.createWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkflow with LRO error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.CreateWorkflowRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkflow = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkflow(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkCreateWorkflowProgress without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + 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.checkCreateWorkflowProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkflowProgress with error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + 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.checkCreateWorkflowProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteWorkflow', () => { + it('invokes deleteWorkflow without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.DeleteWorkflowRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkflow = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteWorkflow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteWorkflow without error using callback', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.DeleteWorkflowRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkflow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkflow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.workflows.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteWorkflow with call error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.DeleteWorkflowRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkflow = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteWorkflow(request), expectedError); + assert( + (client.innerApiCalls.deleteWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteWorkflow with LRO error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.DeleteWorkflowRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkflow = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteWorkflow(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkDeleteWorkflowProgress without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + 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.checkDeleteWorkflowProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteWorkflowProgress with error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + 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.checkDeleteWorkflowProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateWorkflow', () => { + it('invokes updateWorkflow without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.UpdateWorkflowRequest() + ); + request.workflow = {}; + request.workflow.name = ''; + const expectedHeaderRequestParams = 'workflow.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkflow = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateWorkflow(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateWorkflow without error using callback', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.UpdateWorkflowRequest() + ); + request.workflow = {}; + request.workflow.name = ''; + const expectedHeaderRequestParams = 'workflow.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkflow = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkflow( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workflows.v1.IWorkflow, + protos.google.cloud.workflows.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateWorkflow with call error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.UpdateWorkflowRequest() + ); + request.workflow = {}; + request.workflow.name = ''; + const expectedHeaderRequestParams = 'workflow.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkflow = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateWorkflow(request), expectedError); + assert( + (client.innerApiCalls.updateWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateWorkflow with LRO error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.UpdateWorkflowRequest() + ); + request.workflow = {}; + request.workflow.name = ''; + const expectedHeaderRequestParams = 'workflow.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkflow = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateWorkflow(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateWorkflow as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkUpdateWorkflowProgress without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + 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.checkUpdateWorkflowProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateWorkflowProgress with error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + 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.checkUpdateWorkflowProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listWorkflows', () => { + it('invokes listWorkflows without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.ListWorkflowsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + ]; + client.innerApiCalls.listWorkflows = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkflows(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkflows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkflows without error using callback', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.ListWorkflowsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + ]; + client.innerApiCalls.listWorkflows = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkflows( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workflows.v1.IWorkflow[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkflows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listWorkflows with error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.ListWorkflowsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkflows = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listWorkflows(request), expectedError); + assert( + (client.innerApiCalls.listWorkflows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkflowsStream without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.ListWorkflowsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + ]; + client.descriptors.page.listWorkflows.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWorkflowsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workflows.v1.Workflow[] = []; + stream.on( + 'data', + (response: protos.google.cloud.workflows.v1.Workflow) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listWorkflows.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkflows, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkflows.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listWorkflowsStream with error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.ListWorkflowsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkflows.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkflowsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workflows.v1.Workflow[] = []; + stream.on( + 'data', + (response: protos.google.cloud.workflows.v1.Workflow) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWorkflows.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkflows, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkflows.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkflows without error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.ListWorkflowsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + generateSampleMessage(new protos.google.cloud.workflows.v1.Workflow()), + ]; + client.descriptors.page.listWorkflows.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workflows.v1.IWorkflow[] = []; + const iterable = client.listWorkflowsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkflows with error', async () => { + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workflows.v1.ListWorkflowsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkflows.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkflowsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.workflows.v1.IWorkflow[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workflow', () => { + const fakePath = '/rendered/path/workflow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + workflow: 'workflowValue', + }; + const client = new workflowsModule.v1.WorkflowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workflowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workflowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workflowPath', () => { + const result = client.workflowPath( + 'projectValue', + 'locationValue', + 'workflowValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workflowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkflowName', () => { + const result = client.matchProjectFromWorkflowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.workflowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkflowName', () => { + const result = client.matchLocationFromWorkflowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workflowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkflowFromWorkflowName', () => { + const result = client.matchWorkflowFromWorkflowName(fakePath); + assert.strictEqual(result, 'workflowValue'); + assert( + (client.pathTemplates.workflowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/test/gapic_workflows_v1beta.ts b/test/gapic_workflows_v1beta.ts index 69a4800..05be3e4 100644 --- a/test/gapic_workflows_v1beta.ts +++ b/test/gapic_workflows_v1beta.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -279,9 +278,8 @@ describe('v1beta.WorkflowsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.workflows.v1beta.Workflow() ); - client.innerApiCalls.getWorkflow = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getWorkflow = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getWorkflow( request, @@ -360,9 +358,8 @@ describe('v1beta.WorkflowsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createWorkflow = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createWorkflow = + stubLongRunningCall(expectedResponse); const [operation] = await client.createWorkflow(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -394,9 +391,8 @@ describe('v1beta.WorkflowsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createWorkflow = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createWorkflow = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createWorkflow( request, @@ -556,9 +552,8 @@ describe('v1beta.WorkflowsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteWorkflow = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteWorkflow = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteWorkflow(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -590,9 +585,8 @@ describe('v1beta.WorkflowsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteWorkflow = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteWorkflow = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteWorkflow( request, @@ -753,9 +747,8 @@ describe('v1beta.WorkflowsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateWorkflow = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateWorkflow = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateWorkflow(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -788,9 +781,8 @@ describe('v1beta.WorkflowsClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateWorkflow = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateWorkflow = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateWorkflow( request, @@ -999,9 +991,8 @@ describe('v1beta.WorkflowsClient', () => { new protos.google.cloud.workflows.v1beta.Workflow() ), ]; - client.innerApiCalls.listWorkflows = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listWorkflows = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listWorkflows( request, @@ -1079,9 +1070,8 @@ describe('v1beta.WorkflowsClient', () => { new protos.google.cloud.workflows.v1beta.Workflow() ), ]; - client.descriptors.page.listWorkflows.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listWorkflows.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listWorkflowsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.workflows.v1beta.Workflow[] = []; @@ -1106,10 +1096,9 @@ describe('v1beta.WorkflowsClient', () => { .calledWith(client.innerApiCalls.listWorkflows, request) ); assert.strictEqual( - (client.descriptors.page.listWorkflows - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkflows.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1126,10 +1115,8 @@ describe('v1beta.WorkflowsClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listWorkflows.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listWorkflows.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listWorkflowsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.workflows.v1beta.Workflow[] = []; @@ -1153,10 +1140,9 @@ describe('v1beta.WorkflowsClient', () => { .calledWith(client.innerApiCalls.listWorkflows, request) ); assert.strictEqual( - (client.descriptors.page.listWorkflows - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkflows.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1183,9 +1169,8 @@ describe('v1beta.WorkflowsClient', () => { new protos.google.cloud.workflows.v1beta.Workflow() ), ]; - client.descriptors.page.listWorkflows.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listWorkflows.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.workflows.v1beta.IWorkflow[] = []; const iterable = client.listWorkflowsAsync(request); for await (const resource of iterable) { @@ -1193,15 +1178,15 @@ describe('v1beta.WorkflowsClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listWorkflows - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listWorkflows - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1218,10 +1203,8 @@ describe('v1beta.WorkflowsClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listWorkflows.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listWorkflows.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listWorkflowsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.workflows.v1beta.IWorkflow[] = []; @@ -1230,15 +1213,15 @@ describe('v1beta.WorkflowsClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listWorkflows - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listWorkflows - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkflows.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); });