Skip to content

Commit

Permalink
feat(bigquery): update the API
Browse files Browse the repository at this point in the history
#### bigquery:v2

The following keys were added:
- resources.jobs.methods.delete.description
- resources.jobs.methods.delete.flatPath
- resources.jobs.methods.delete.httpMethod
- resources.jobs.methods.delete.id
- resources.jobs.methods.delete.parameterOrder
- resources.jobs.methods.delete.parameters.jobId.description
- resources.jobs.methods.delete.parameters.jobId.location
- resources.jobs.methods.delete.parameters.jobId.pattern
- resources.jobs.methods.delete.parameters.jobId.required
- resources.jobs.methods.delete.parameters.jobId.type
- resources.jobs.methods.delete.parameters.location.description
- resources.jobs.methods.delete.parameters.location.location
- resources.jobs.methods.delete.parameters.location.type
- resources.jobs.methods.delete.parameters.projectId.description
- resources.jobs.methods.delete.parameters.projectId.location
- resources.jobs.methods.delete.parameters.projectId.pattern
- resources.jobs.methods.delete.parameters.projectId.required
- resources.jobs.methods.delete.parameters.projectId.type
- resources.jobs.methods.delete.path
- resources.jobs.methods.delete.scopes

The following keys were changed:
- schemas.Routine.properties.returnTableType.description
- schemas.TableFieldSchema.properties.type.description
  • Loading branch information
yoshi-automation authored and sofisl committed Apr 5, 2021
1 parent d3807ca commit 6e1defd
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 5 deletions.
42 changes: 39 additions & 3 deletions discovery/bigquery-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,42 @@
"https://www.googleapis.com/auth/cloud-platform"
]
},
"delete": {
"description": "Requests that a job is deleted. This call will return when the job is deleted. This method is available in limited preview.",
"flatPath": "projects/{projectsId}/jobs/{jobsId}/delete",
"httpMethod": "DELETE",
"id": "bigquery.jobs.delete",
"parameterOrder": [
"projectId",
"jobId"
],
"parameters": {
"jobId": {
"description": "Required. Job ID of the job to be deleted. If this is a parent job which has child jobs, all child jobs will be deleted as well. Deletion of child jobs directly is not allowed.",
"location": "path",
"pattern": "^[^/]+$",
"required": true,
"type": "string"
},
"location": {
"description": "The geographic location of the job. Required. See details at: https://cloud.google.com/bigquery/docs/locations#specifying_your_location.",
"location": "query",
"type": "string"
},
"projectId": {
"description": "Required. Project ID of the job to be deleted.",
"location": "path",
"pattern": "^[^/]+$",
"required": true,
"type": "string"
}
},
"path": "projects/{+projectId}/jobs/{+jobId}/delete",
"scopes": [
"https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/cloud-platform"
]
},
"get": {
"description": "Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.",
"httpMethod": "GET",
Expand Down Expand Up @@ -1670,7 +1706,7 @@
}
}
},
"revision": "20210313",
"revision": "20210327",
"rootUrl": "https://bigquery.googleapis.com/",
"schemas": {
"AggregateClassificationMetrics": {
Expand Down Expand Up @@ -5123,7 +5159,7 @@
},
"returnTableType": {
"$ref": "StandardSqlTableType",
"description": "Optional. Set only if Routine is a \"TABLE_VALUED_FUNCTION\". TODO(b/173344646) - Update return_type documentation to say it cannot be set for TABLE_VALUED_FUNCTION before preview launch."
"description": "Optional. Set only if Routine is a \"TABLE_VALUED_FUNCTION\"."
},
"returnType": {
"$ref": "StandardSqlDataType",
Expand Down Expand Up @@ -5770,7 +5806,7 @@
"type": "string"
},
"type": {
"description": "[Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), NUMERIC, BIGNUMERIC, BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).",
"description": "[Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), NUMERIC, BIGNUMERIC, BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, INTERVAL, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).",
"type": "string"
}
},
Expand Down
146 changes: 144 additions & 2 deletions src/apis/bigquery/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2464,7 +2464,7 @@ export namespace bigquery_v2 {
*/
lastModifiedTime?: string | null;
/**
* Optional. Set only if Routine is a "TABLE_VALUED_FUNCTION". TODO(b/173344646) - Update return_type documentation to say it cannot be set for TABLE_VALUED_FUNCTION before preview launch.
* Optional. Set only if Routine is a "TABLE_VALUED_FUNCTION".
*/
returnTableType?: Schema$StandardSqlTableType;
/**
Expand Down Expand Up @@ -2887,7 +2887,7 @@ export namespace bigquery_v2 {
*/
scale?: string | null;
/**
* [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), NUMERIC, BIGNUMERIC, BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
* [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), NUMERIC, BIGNUMERIC, BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, INTERVAL, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
*/
type?: string | null;
}
Expand Down Expand Up @@ -4391,6 +4391,134 @@ export namespace bigquery_v2 {
}
}

/**
* Requests that a job is deleted. This call will return when the job is deleted. This method is available in limited preview.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/bigquery.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 bigquery = google.bigquery('v2');
*
* 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/bigquery',
* '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 bigquery.jobs.delete({
* // Required. Job ID of the job to be deleted. If this is a parent job which has child jobs, all child jobs will be deleted as well. Deletion of child jobs directly is not allowed.
* jobId: '[^/]+',
* // The geographic location of the job. Required. See details at: https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
* location: 'placeholder-value',
* // Required. Project ID of the job to be deleted.
* projectId: '[^/]+',
* });
* console.log(res.data);
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
delete(
params: Params$Resource$Jobs$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Jobs$Delete,
options?: MethodOptions
): GaxiosPromise<void>;
delete(
params: Params$Resource$Jobs$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Jobs$Delete,
options: MethodOptions | BodyResponseCallback<void>,
callback: BodyResponseCallback<void>
): void;
delete(
params: Params$Resource$Jobs$Delete,
callback: BodyResponseCallback<void>
): void;
delete(callback: BodyResponseCallback<void>): void;
delete(
paramsOrCallback?:
| Params$Resource$Jobs$Delete
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<void>
| BodyResponseCallback<Readable>,
callback?: BodyResponseCallback<void> | BodyResponseCallback<Readable>
): void | GaxiosPromise<void> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Jobs$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Jobs$Delete;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl = options.rootUrl || 'https://bigquery.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (
rootUrl +
'/bigquery/v2/projects/{+projectId}/jobs/{+jobId}/delete'
).replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
},
options
),
params,
requiredParams: ['projectId', 'jobId'],
pathParams: ['jobId', 'projectId'],
context: this.context,
};
if (callback) {
createAPIRequest<void>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<void>(parameters);
}
}

/**
* Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
* @example
Expand Down Expand Up @@ -5197,6 +5325,20 @@ export namespace bigquery_v2 {
*/
projectId?: string;
}
export interface Params$Resource$Jobs$Delete extends StandardParameters {
/**
* Required. Job ID of the job to be deleted. If this is a parent job which has child jobs, all child jobs will be deleted as well. Deletion of child jobs directly is not allowed.
*/
jobId?: string;
/**
* The geographic location of the job. Required. See details at: https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
*/
location?: string;
/**
* Required. Project ID of the job to be deleted.
*/
projectId?: string;
}
export interface Params$Resource$Jobs$Get extends StandardParameters {
/**
* [Required] Job ID of the requested job
Expand Down

0 comments on commit 6e1defd

Please sign in to comment.