diff --git a/discovery/workflowexecutions-v1beta.json b/discovery/workflowexecutions-v1beta.json new file mode 100644 index 00000000000..4333703db27 --- /dev/null +++ b/discovery/workflowexecutions-v1beta.json @@ -0,0 +1,381 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "basePath": "", + "baseUrl": "https://workflowexecutions.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Workflow Executions", + "description": "Execute workflows created with Workflows API.", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/workflows", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "workflowexecutions:v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://workflowexecutions.mtls.googleapis.com/", + "name": "workflowexecutions", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "projects": { + "resources": { + "locations": { + "resources": { + "workflows": { + "resources": { + "executions": { + "methods": { + "cancel": { + "description": "Cancels an execution of the given name.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/workflows/{workflowsId}/executions/{executionsId}:cancel", + "httpMethod": "POST", + "id": "workflowexecutions.projects.locations.workflows.executions.cancel", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the execution to be cancelled. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/workflows/[^/]+/executions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}:cancel", + "request": { + "$ref": "CancelExecutionRequest" + }, + "response": { + "$ref": "Execution" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "description": "Creates a new execution using the latest revision of the given workflow.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/workflows/{workflowsId}/executions", + "httpMethod": "POST", + "id": "workflowexecutions.projects.locations.workflows.executions.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "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.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/workflows/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/executions", + "request": { + "$ref": "Execution" + }, + "response": { + "$ref": "Execution" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Returns an execution of the given name.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/workflows/{workflowsId}/executions/{executionsId}", + "httpMethod": "GET", + "id": "workflowexecutions.projects.locations.workflows.executions.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the execution to be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/workflows/[^/]+/executions/[^/]+$", + "required": true, + "type": "string" + }, + "view": { + "description": "Optional. A view defining which fields should be filled in the returned execution. The API will default to the FULL view.", + "enum": [ + "EXECUTION_VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "The default / unset value.", + "Includes only basic metadata about the execution. Following fields are returned: name, start_time, end_time, state and workflow_revision_id.", + "Includes all data." + ], + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "Execution" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "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).", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/workflows/{workflowsId}/executions", + "httpMethod": "GET", + "id": "workflowexecutions.projects.locations.workflows.executions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "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.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "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.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the workflow for which the executions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow}", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/workflows/[^/]+$", + "required": true, + "type": "string" + }, + "view": { + "description": "Optional. A view defining which fields should be filled in the returned executions. The API will default to the BASIC view.", + "enum": [ + "EXECUTION_VIEW_UNSPECIFIED", + "BASIC", + "FULL" + ], + "enumDescriptions": [ + "The default / unset value.", + "Includes only basic metadata about the execution. Following fields are returned: name, start_time, end_time, state and workflow_revision_id.", + "Includes all data." + ], + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+parent}/executions", + "response": { + "$ref": "ListExecutionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + } + } + }, + "revision": "20200922", + "rootUrl": "https://workflowexecutions.googleapis.com/", + "schemas": { + "CancelExecutionRequest": { + "description": "Request for the CancelExecution method.", + "id": "CancelExecutionRequest", + "properties": {}, + "type": "object" + }, + "Error": { + "description": "Error describes why the execution was abnormally terminated.", + "id": "Error", + "properties": { + "context": { + "description": "Human readable error context, helpful for debugging purposes.", + "type": "string" + }, + "payload": { + "description": "Error payload returned by the execution, represented as a JSON string.", + "type": "string" + } + }, + "type": "object" + }, + "Execution": { + "description": "A running instance of a [Workflow](/workflows/docs/reference/rest/v1beta/projects.locations.workflows).", + "id": "Execution", + "properties": { + "argument": { + "description": "Input parameters of the execution represented as a JSON string. The size limit is 32KB.", + "type": "string" + }, + "endTime": { + "description": "Output only. Marks the end of execution, successful or not.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "error": { + "$ref": "Error", + "description": "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`.", + "readOnly": true + }, + "name": { + "description": "Output only. The resource name of the execution. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}", + "readOnly": true, + "type": "string" + }, + "result": { + "description": "Output only. Output of the execution represented as a JSON string. The value can only be present if the execution's state is `SUCCEEDED`.", + "readOnly": true, + "type": "string" + }, + "startTime": { + "description": "Output only. Marks the beginning of execution.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "state": { + "description": "Output only. Current state of the execution.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "SUCCEEDED", + "FAILED", + "CANCELLED" + ], + "enumDescriptions": [ + "Invalid state.", + "The execution is in progress.", + "The execution finished successfully.", + "The execution failed with an error.", + "The execution was stopped intentionally." + ], + "readOnly": true, + "type": "string" + }, + "workflowRevisionId": { + "description": "Output only. Revision of the workflow this execution is using.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ListExecutionsResponse": { + "description": "Response for the ListExecutions method.", + "id": "ListExecutionsResponse", + "properties": { + "executions": { + "description": "The executions which match the request.", + "items": { + "$ref": "Execution" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Workflow Executions API", + "version": "v1beta", + "version_module": true +} \ No newline at end of file diff --git a/src/apis/workflowexecutions/README.md b/src/apis/workflowexecutions/README.md new file mode 100644 index 00000000000..7a127aea888 --- /dev/null +++ b/src/apis/workflowexecutions/README.md @@ -0,0 +1,47 @@ +Google Inc. logo + +# workflowexecutions + +> Execute workflows created with Workflows API. + +## Installation + +```sh +$ npm install googleapis +``` + +## Usage +All documentation and usage information can be found on [GitHub](https://github.com/googleapis/google-api-nodejs-client). + +## Building a browser bundle + +This library can be used in a browser. To prepare a single file bundle, clone the +[repository](https://github.com/googleapis/google-api-nodejs-client) and run + +```sh +$ cd src/apis/workflowexecutions +$ npm install +$ npm run webpack +``` + +The generated bundle will be written to `dist/workflowexecutions.min.js`. Use it from your HTML file: + +```html + + +``` + +## License +This library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/googleapis/google-api-nodejs-client/blob/master/LICENSE). + +## Contributing +We love contributions! Before submitting a Pull Request, it's always good to start with a new issue first. To learn more, see [CONTRIBUTING](https://github.com/google/google-api-nodejs-client/blob/master/.github/CONTRIBUTING.md). + +## Questions/problems? +* Ask your development related questions on [StackOverflow](http://stackoverflow.com/questions/tagged/google-api-nodejs-client). +* If you've found an bug/issue, please [file it on GitHub](https://github.com/googleapis/google-api-nodejs-client/issues). + + +*Crafted with ❤️ by the Google Node.js team* diff --git a/src/apis/workflowexecutions/index.ts b/src/apis/workflowexecutions/index.ts new file mode 100644 index 00000000000..85e902c83ba --- /dev/null +++ b/src/apis/workflowexecutions/index.ts @@ -0,0 +1,39 @@ +// 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. + +/*! THIS FILE IS AUTO-GENERATED */ + +import {AuthPlus, getAPI, GoogleConfigurable} from 'googleapis-common'; +import {workflowexecutions_v1beta} from './v1beta'; + +export const VERSIONS = { + v1beta: workflowexecutions_v1beta.Workflowexecutions, +}; + +export function workflowexecutions( + version: 'v1beta' +): workflowexecutions_v1beta.Workflowexecutions; +export function workflowexecutions( + options: workflowexecutions_v1beta.Options +): workflowexecutions_v1beta.Workflowexecutions; +export function workflowexecutions< + T = workflowexecutions_v1beta.Workflowexecutions +>( + this: GoogleConfigurable, + versionOrOptions: 'v1beta' | workflowexecutions_v1beta.Options +) { + return getAPI('workflowexecutions', versionOrOptions, VERSIONS, this); +} + +const auth = new AuthPlus(); +export {auth}; diff --git a/src/apis/workflowexecutions/package.json b/src/apis/workflowexecutions/package.json new file mode 100644 index 00000000000..4792b5ec545 --- /dev/null +++ b/src/apis/workflowexecutions/package.json @@ -0,0 +1,43 @@ +{ + "name": "@google/workflowexecutions", + "version": "0.1.0", + "description": "workflowexecutions", + "main": "build/index.js", + "types": "build/index.d.ts", + "keywords": [ + "google" + ], + "author": "Google LLC", + "license": "Apache-2.0", + "homepage": "https://github.com/googleapis/google-api-nodejs-client", + "bugs": { + "url": "https://github.com/googleapis/google-api-nodejs-client/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-api-nodejs-client.git" + }, + "engines": { + "node": ">=10.0.0" + }, + "scripts": { + "fix": "gts fix", + "lint": "gts check", + "compile": "tsc -p .", + "prepare": "npm run compile", + "docs": "typedoc --out docs/", + "webpack": "webpack" + }, + "dependencies": { + "googleapis-common": "^4.4.0" + }, + "devDependencies": { + "gts": "^2.0.0", + "null-loader": "^4.0.0", + "ts-loader": "^8.0.0", + "typedoc": "^0.19.0", + "typescript": "~3.7.0", + "webpack": "^4.35.3", + "webpack-cli": "^3.3.5" + } +} diff --git a/src/apis/workflowexecutions/tsconfig.json b/src/apis/workflowexecutions/tsconfig.json new file mode 100644 index 00000000000..e0810904968 --- /dev/null +++ b/src/apis/workflowexecutions/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "*.ts", + ] +} diff --git a/src/apis/workflowexecutions/v1beta.ts b/src/apis/workflowexecutions/v1beta.ts new file mode 100644 index 00000000000..50721973a5f --- /dev/null +++ b/src/apis/workflowexecutions/v1beta.ts @@ -0,0 +1,885 @@ +// 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. + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/class-name-casing */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable no-irregular-whitespace */ + +import { + OAuth2Client, + JWT, + Compute, + UserRefreshClient, + GaxiosPromise, + GoogleConfigurable, + createAPIRequest, + MethodOptions, + StreamMethodOptions, + GlobalOptions, + GoogleAuth, + BodyResponseCallback, + APIRequestContext, +} from 'googleapis-common'; +import {Readable} from 'stream'; + +export namespace workflowexecutions_v1beta { + export interface Options extends GlobalOptions { + version: 'v1beta'; + } + + interface StandardParameters { + /** + * Auth client or API Key for the request + */ + auth?: + | string + | OAuth2Client + | JWT + | Compute + | UserRefreshClient + | GoogleAuth; + + /** + * V1 error format. + */ + '$.xgafv'?: string; + /** + * OAuth access token. + */ + access_token?: string; + /** + * Data format for response. + */ + alt?: string; + /** + * JSONP + */ + callback?: string; + /** + * Selector specifying which fields to include in a partial response. + */ + fields?: string; + /** + * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + */ + key?: string; + /** + * OAuth 2.0 token for the current user. + */ + oauth_token?: string; + /** + * Returns response with indentations and line breaks. + */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + */ + quotaUser?: string; + /** + * Legacy upload protocol for media (e.g. "media", "multipart"). + */ + uploadType?: string; + /** + * Upload protocol for media (e.g. "raw", "multipart"). + */ + upload_protocol?: string; + } + + /** + * Workflow Executions API + * + * Execute workflows created with Workflows API. + * + * @example + * const {google} = require('googleapis'); + * const workflowexecutions = google.workflowexecutions('v1beta'); + * + * @namespace workflowexecutions + * @type {Function} + * @version v1beta + * @variation v1beta + * @param {object=} options Options for Workflowexecutions + */ + export class Workflowexecutions { + context: APIRequestContext; + projects: Resource$Projects; + + constructor(options: GlobalOptions, google?: GoogleConfigurable) { + this.context = { + _options: options || {}, + google, + }; + + this.projects = new Resource$Projects(this.context); + } + } + + /** + * Request for the CancelExecution method. + */ + export interface Schema$CancelExecutionRequest {} + /** + * Error describes why the execution was abnormally terminated. + */ + export interface Schema$Error { + /** + * Human readable error context, helpful for debugging purposes. + */ + context?: string | null; + /** + * Error payload returned by the execution, represented as a JSON string. + */ + payload?: string | null; + } + /** + * A running instance of a [Workflow](/workflows/docs/reference/rest/v1beta/projects.locations.workflows). + */ + export interface Schema$Execution { + /** + * Input parameters of the execution represented as a JSON string. The size limit is 32KB. + */ + argument?: string | null; + /** + * Output only. Marks the end of execution, successful or not. + */ + endTime?: string | null; + /** + * 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?: Schema$Error; + /** + * Output only. The resource name of the execution. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + */ + name?: string | null; + /** + * Output only. Output of the execution represented as a JSON string. The value can only be present if the execution's state is `SUCCEEDED`. + */ + result?: string | null; + /** + * Output only. Marks the beginning of execution. + */ + startTime?: string | null; + /** + * Output only. Current state of the execution. + */ + state?: string | null; + /** + * Output only. Revision of the workflow this execution is using. + */ + workflowRevisionId?: string | null; + } + /** + * Response for the ListExecutions method. + */ + export interface Schema$ListExecutionsResponse { + /** + * The executions which match the request. + */ + executions?: Schema$Execution[]; + /** + * A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. + */ + nextPageToken?: string | null; + } + + export class Resource$Projects { + context: APIRequestContext; + locations: Resource$Projects$Locations; + constructor(context: APIRequestContext) { + this.context = context; + this.locations = new Resource$Projects$Locations(this.context); + } + } + + export class Resource$Projects$Locations { + context: APIRequestContext; + workflows: Resource$Projects$Locations$Workflows; + constructor(context: APIRequestContext) { + this.context = context; + this.workflows = new Resource$Projects$Locations$Workflows(this.context); + } + } + + export class Resource$Projects$Locations$Workflows { + context: APIRequestContext; + executions: Resource$Projects$Locations$Workflows$Executions; + constructor(context: APIRequestContext) { + this.context = context; + this.executions = new Resource$Projects$Locations$Workflows$Executions( + this.context + ); + } + } + + export class Resource$Projects$Locations$Workflows$Executions { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * workflowexecutions.projects.locations.workflows.executions.cancel + * @desc Cancels an execution of the given name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/workflowexecutions.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const workflowexecutions = google.workflowexecutions('v1beta'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await workflowexecutions.projects.locations.workflows.executions.cancel( + * { + * // Required. Name of the execution to be cancelled. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * name: + * 'projects/my-project/locations/my-location/workflows/my-workflow/executions/my-execution', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "argument": "my_argument", + * // "endTime": "my_endTime", + * // "error": {}, + * // "name": "my_name", + * // "result": "my_result", + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "workflowRevisionId": "my_workflowRevisionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias workflowexecutions.projects.locations.workflows.executions.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. Name of the execution to be cancelled. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @param {().CancelExecutionRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel( + params: Params$Resource$Projects$Locations$Workflows$Executions$Cancel, + options: StreamMethodOptions + ): GaxiosPromise; + cancel( + params?: Params$Resource$Projects$Locations$Workflows$Executions$Cancel, + options?: MethodOptions + ): GaxiosPromise; + cancel( + params: Params$Resource$Projects$Locations$Workflows$Executions$Cancel, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + cancel( + params: Params$Resource$Projects$Locations$Workflows$Executions$Cancel, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + cancel( + params: Params$Resource$Projects$Locations$Workflows$Executions$Cancel, + callback: BodyResponseCallback + ): void; + cancel(callback: BodyResponseCallback): void; + cancel( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Workflows$Executions$Cancel + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Workflows$Executions$Cancel; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Locations$Workflows$Executions$Cancel; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://workflowexecutions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+name}:cancel').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * workflowexecutions.projects.locations.workflows.executions.create + * @desc Creates a new execution using the latest revision of the given workflow. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/workflowexecutions.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const workflowexecutions = google.workflowexecutions('v1beta'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await workflowexecutions.projects.locations.workflows.executions.create( + * { + * // 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. + * parent: 'projects/my-project/locations/my-location/workflows/my-workflow', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "argument": "my_argument", + * // "endTime": "my_endTime", + * // "error": {}, + * // "name": "my_name", + * // "result": "my_result", + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "workflowRevisionId": "my_workflowRevisionId" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "argument": "my_argument", + * // "endTime": "my_endTime", + * // "error": {}, + * // "name": "my_name", + * // "result": "my_result", + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "workflowRevisionId": "my_workflowRevisionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias workflowexecutions.projects.locations.workflows.executions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.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 {().Execution} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create( + params: Params$Resource$Projects$Locations$Workflows$Executions$Create, + options: StreamMethodOptions + ): GaxiosPromise; + create( + params?: Params$Resource$Projects$Locations$Workflows$Executions$Create, + options?: MethodOptions + ): GaxiosPromise; + create( + params: Params$Resource$Projects$Locations$Workflows$Executions$Create, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Projects$Locations$Workflows$Executions$Create, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Projects$Locations$Workflows$Executions$Create, + callback: BodyResponseCallback + ): void; + create(callback: BodyResponseCallback): void; + create( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Workflows$Executions$Create + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Workflows$Executions$Create; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Locations$Workflows$Executions$Create; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://workflowexecutions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+parent}/executions').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * workflowexecutions.projects.locations.workflows.executions.get + * @desc Returns an execution of the given name. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/workflowexecutions.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const workflowexecutions = google.workflowexecutions('v1beta'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await workflowexecutions.projects.locations.workflows.executions.get( + * { + * // Required. Name of the execution to be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * name: + * 'projects/my-project/locations/my-location/workflows/my-workflow/executions/my-execution', + * // Optional. A view defining which fields should be filled in the returned execution. The API will default to the FULL view. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "argument": "my_argument", + * // "endTime": "my_endTime", + * // "error": {}, + * // "name": "my_name", + * // "result": "my_result", + * // "startTime": "my_startTime", + * // "state": "my_state", + * // "workflowRevisionId": "my_workflowRevisionId" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias workflowexecutions.projects.locations.workflows.executions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. Name of the execution to be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @param {string=} params.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] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get( + params: Params$Resource$Projects$Locations$Workflows$Executions$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Projects$Locations$Workflows$Executions$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Projects$Locations$Workflows$Executions$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Projects$Locations$Workflows$Executions$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Projects$Locations$Workflows$Executions$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Workflows$Executions$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Workflows$Executions$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Locations$Workflows$Executions$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://workflowexecutions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * workflowexecutions.projects.locations.workflows.executions.list + * @desc 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). + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/workflowexecutions.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const workflowexecutions = google.workflowexecutions('v1beta'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await workflowexecutions.projects.locations.workflows.executions.list( + * { + * // 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. + * pageSize: 'placeholder-value', + * // 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. + * pageToken: 'placeholder-value', + * // Required. Name of the workflow for which the executions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow} + * parent: 'projects/my-project/locations/my-location/workflows/my-workflow', + * // Optional. A view defining which fields should be filled in the returned executions. The API will default to the BASIC view. + * view: 'placeholder-value', + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "executions": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias workflowexecutions.projects.locations.workflows.executions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.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=} params.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 {string} params.parent Required. Name of the workflow for which the executions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow} + * @param {string=} params.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] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Projects$Locations$Workflows$Executions$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Projects$Locations$Workflows$Executions$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Projects$Locations$Workflows$Executions$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Projects$Locations$Workflows$Executions$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Projects$Locations$Workflows$Executions$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Workflows$Executions$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Workflows$Executions$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Locations$Workflows$Executions$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://workflowexecutions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+parent}/executions').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Projects$Locations$Workflows$Executions$Cancel + extends StandardParameters { + /** + * Required. Name of the execution to be cancelled. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + */ + name?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$CancelExecutionRequest; + } + export interface Params$Resource$Projects$Locations$Workflows$Executions$Create + extends StandardParameters { + /** + * 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. + */ + parent?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$Execution; + } + export interface Params$Resource$Projects$Locations$Workflows$Executions$Get + extends StandardParameters { + /** + * Required. Name of the execution to be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + */ + name?: string; + /** + * Optional. A view defining which fields should be filled in the returned execution. The API will default to the FULL view. + */ + view?: string; + } + export interface Params$Resource$Projects$Locations$Workflows$Executions$List + extends StandardParameters { + /** + * 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. + */ + pageSize?: number; + /** + * 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. + */ + pageToken?: string; + /** + * Required. Name of the workflow for which the executions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow} + */ + parent?: string; + /** + * Optional. A view defining which fields should be filled in the returned executions. The API will default to the BASIC view. + */ + view?: string; + } +} diff --git a/src/apis/workflowexecutions/webpack.config.js b/src/apis/workflowexecutions/webpack.config.js new file mode 100644 index 00000000000..ad8bd68405f --- /dev/null +++ b/src/apis/workflowexecutions/webpack.config.js @@ -0,0 +1,70 @@ +// Copyright 2019 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. + +// Use `npm run webpack` to produce Webpack bundle for this library. + +const path = require('path'); + +module.exports = { + entry: './index.ts', + resolve: { + extensions: ['.ts', '.js', '.json'], + }, + output: { + library: 'Workflowexecutions', + filename: 'workflowexecutions.min.js', + path: path.resolve(__dirname, 'dist'), + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + http2: 'empty', + }, + module: { + rules: [ + { + test: /node_modules[\\/]google-auth-library[\\/]src[\\/]crypto[\\/]node[\\/]crypto/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https-proxy-agent[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gcp-metadata[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]pkginfo[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]semver[\\/]/, + use: 'null-loader', + }, + { + test: /\.ts$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + ], + }, + mode: 'production', + plugins: [], +};