googleapis
Version:
Google APIs Client Library for Node.js
1,013 lines (1,012 loc) • 46.6 kB
TypeScript
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace vpcaccess_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | 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;
}
/**
* Serverless VPC Access API
*
* API for managing VPC access connectors.
*
* @example
* ```js
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
* ```
*/
export class Vpcaccess {
context: APIRequestContext;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* Definition of a Serverless VPC Access connector.
*/
export interface Schema$Connector {
/**
* Output only. List of projects using the connector.
*/
connectedProjects?: string[] | null;
/**
* Optional. The range of internal addresses that follows RFC 4632 notation. Example: `10.132.0.0/28`.
*/
ipCidrRange?: string | null;
/**
* Machine type of VM Instance underlying connector. Default is e2-micro
*/
machineType?: string | null;
/**
* Maximum value of instances in autoscaling group underlying the connector.
*/
maxInstances?: number | null;
/**
* Maximum throughput of the connector in Mbps. Refers to the expected throughput when using an `e2-micro` machine type. Value must be a multiple of 100 from 300 through 1000. Must be higher than the value specified by --min-throughput. If both max-throughput and max-instances are provided, max-instances takes precedence over max-throughput. The use of `max-throughput` is discouraged in favor of `max-instances`.
*/
maxThroughput?: number | null;
/**
* Minimum value of instances in autoscaling group underlying the connector.
*/
minInstances?: number | null;
/**
* Minimum throughput of the connector in Mbps. Refers to the expected throughput when using an `e2-micro` machine type. Value must be a multiple of 100 from 200 through 900. Must be lower than the value specified by --max-throughput. If both min-throughput and min-instances are provided, min-instances takes precedence over min-throughput. The use of `min-throughput` is discouraged in favor of `min-instances`.
*/
minThroughput?: number | null;
/**
* The resource name in the format `projects/x/locations/x/connectors/x`.
*/
name?: string | null;
/**
* Optional. Name of a VPC network.
*/
network?: string | null;
/**
* Output only. State of the VPC access connector.
*/
state?: string | null;
/**
* Optional. The subnet in which to house the VPC Access Connector.
*/
subnet?: Schema$Subnet;
}
/**
* Response for listing Serverless VPC Access connectors.
*/
export interface Schema$ListConnectorsResponse {
/**
* List of Serverless VPC Access connectors.
*/
connectors?: Schema$Connector[];
/**
* Continuation token.
*/
nextPageToken?: string | null;
}
/**
* The response message for Locations.ListLocations.
*/
export interface Schema$ListLocationsResponse {
/**
* A list of locations that matches the specified filter in the request.
*/
locations?: Schema$Location[];
/**
* The standard List next-page token.
*/
nextPageToken?: string | null;
}
/**
* The response message for Operations.ListOperations.
*/
export interface Schema$ListOperationsResponse {
/**
* The standard List next-page token.
*/
nextPageToken?: string | null;
/**
* A list of operations that matches the specified filter in the request.
*/
operations?: Schema$Operation[];
/**
* Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations.
*/
unreachable?: string[] | null;
}
/**
* A resource that represents a Google Cloud location.
*/
export interface Schema$Location {
/**
* The friendly name for this location, typically a nearby city name. For example, "Tokyo".
*/
displayName?: string | null;
/**
* Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"\}
*/
labels?: {
[key: string]: string;
} | null;
/**
* The canonical id for this location. For example: `"us-east1"`.
*/
locationId?: string | null;
/**
* Service-specific metadata. For example the available capacity at the given location.
*/
metadata?: {
[key: string]: any;
} | null;
/**
* Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"`
*/
name?: string | null;
}
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
export interface Schema$Operation {
/**
* If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
*/
done?: boolean | null;
/**
* The error result of the operation in case of failure or cancellation.
*/
error?: Schema$Status;
/**
* Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
*/
metadata?: {
[key: string]: any;
} | null;
/**
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id\}`.
*/
name?: string | null;
/**
* The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
*/
response?: {
[key: string]: any;
} | null;
}
/**
* Metadata for google.longrunning.Operation.
*/
export interface Schema$OperationMetadata {
/**
* Output only. Time when the operation was created.
*/
createTime?: string | null;
/**
* Output only. Time when the operation completed.
*/
endTime?: string | null;
/**
* Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1.Connectors.CreateConnector.
*/
method?: string | null;
/**
* Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1.
*/
target?: string | null;
}
/**
* Metadata for google.longrunning.Operation.
*/
export interface Schema$OperationMetadataV1Alpha1 {
/**
* Output only. Time when the operation completed.
*/
endTime?: string | null;
/**
* Output only. Time when the operation was created.
*/
insertTime?: string | null;
/**
* Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1alpha1.Connectors.CreateConnector.
*/
method?: string | null;
/**
* Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1.
*/
target?: string | null;
}
/**
* Metadata for google.longrunning.Operation.
*/
export interface Schema$OperationMetadataV1Beta1 {
/**
* Output only. Time when the operation was created.
*/
createTime?: string | null;
/**
* Output only. Time when the operation completed.
*/
endTime?: string | null;
/**
* Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1beta1.Connectors.CreateConnector.
*/
method?: string | null;
/**
* Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1.
*/
target?: string | null;
}
/**
* The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
*/
export interface Schema$Status {
/**
* The status code, which should be an enum value of google.rpc.Code.
*/
code?: number | null;
/**
* A list of messages that carry the error details. There is a common set of message types for APIs to use.
*/
details?: Array<{
[key: string]: any;
}> | null;
/**
* A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
*/
message?: string | null;
}
/**
* The subnet in which to house the connector
*/
export interface Schema$Subnet {
/**
* Optional. Subnet name (relative, not fully qualified). E.g. if the full subnet selfLink is https://compute.googleapis.com/compute/v1/projects/{project\}/regions/{region\}/subnetworks/{subnetName\} the correct input for this field would be {subnetName\}
*/
name?: string | null;
/**
* Optional. Project in which the subnet exists. If not set, this project is assumed to be the project for which the connector create request was issued.
*/
projectId?: string | null;
}
export class Resource$Projects {
context: APIRequestContext;
locations: Resource$Projects$Locations;
constructor(context: APIRequestContext);
}
export class Resource$Projects$Locations {
context: APIRequestContext;
connectors: Resource$Projects$Locations$Connectors;
operations: Resource$Projects$Locations$Operations;
constructor(context: APIRequestContext);
/**
* Lists information about the supported locations for this service.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.list({
* // Optional. Do not use this field. It is unsupported and is ignored unless explicitly documented otherwise. This is primarily for internal usage.
* extraLocationTypes: 'placeholder-value',
* // A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
* filter: 'placeholder-value',
* // The resource that owns the locations collection, if applicable.
* name: 'projects/my-project',
* // The maximum number of results to return. If not set, the service selects a default.
* pageSize: 'placeholder-value',
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
* pageToken: 'placeholder-value',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "locations": [],
* // "nextPageToken": "my_nextPageToken"
* // }
* }
*
* 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.
*/
list(params: Params$Resource$Projects$Locations$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
list(params?: Params$Resource$Projects$Locations$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>;
list(params: Params$Resource$Projects$Locations$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
list(params: Params$Resource$Projects$Locations$List, options: MethodOptions | BodyResponseCallback<Schema$ListLocationsResponse>, callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
list(params: Params$Resource$Projects$Locations$List, callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
list(callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
}
export interface Params$Resource$Projects$Locations$List extends StandardParameters {
/**
* Optional. Do not use this field. It is unsupported and is ignored unless explicitly documented otherwise. This is primarily for internal usage.
*/
extraLocationTypes?: string[];
/**
* A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
*/
filter?: string;
/**
* The resource that owns the locations collection, if applicable.
*/
name?: string;
/**
* The maximum number of results to return. If not set, the service selects a default.
*/
pageSize?: number;
/**
* A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
*/
pageToken?: string;
}
export class Resource$Projects$Locations$Connectors {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Creates a Serverless VPC Access connector, returns an operation.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.connectors.create({
* // Required. The ID to use for this connector.
* connectorId: 'placeholder-value',
* // Required. The project ID and location in which the configuration should be created, specified in the format `projects/x/locations/x`.
* parent: 'projects/my-project/locations/my-location',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "connectedProjects": [],
* // "ipCidrRange": "my_ipCidrRange",
* // "machineType": "my_machineType",
* // "maxInstances": 0,
* // "maxThroughput": 0,
* // "minInstances": 0,
* // "minThroughput": 0,
* // "name": "my_name",
* // "network": "my_network",
* // "state": "my_state",
* // "subnet": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
create(params: Params$Resource$Projects$Locations$Connectors$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
create(params?: Params$Resource$Projects$Locations$Connectors$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
create(params: Params$Resource$Projects$Locations$Connectors$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Projects$Locations$Connectors$Create, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
create(params: Params$Resource$Projects$Locations$Connectors$Create, callback: BodyResponseCallback<Schema$Operation>): void;
create(callback: BodyResponseCallback<Schema$Operation>): void;
/**
* Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.connectors.delete({
* // Required. Name of a Serverless VPC Access connector to delete.
* name: 'projects/my-project/locations/my-location/connectors/my-connector',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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$Projects$Locations$Connectors$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
delete(params?: Params$Resource$Projects$Locations$Connectors$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
delete(params: Params$Resource$Projects$Locations$Connectors$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
delete(params: Params$Resource$Projects$Locations$Connectors$Delete, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
delete(params: Params$Resource$Projects$Locations$Connectors$Delete, callback: BodyResponseCallback<Schema$Operation>): void;
delete(callback: BodyResponseCallback<Schema$Operation>): void;
/**
* Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.connectors.get({
* // Required. Name of a Serverless VPC Access connector to get.
* name: 'projects/my-project/locations/my-location/connectors/my-connector',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "connectedProjects": [],
* // "ipCidrRange": "my_ipCidrRange",
* // "machineType": "my_machineType",
* // "maxInstances": 0,
* // "maxThroughput": 0,
* // "minInstances": 0,
* // "minThroughput": 0,
* // "name": "my_name",
* // "network": "my_network",
* // "state": "my_state",
* // "subnet": {}
* // }
* }
*
* 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.
*/
get(params: Params$Resource$Projects$Locations$Connectors$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
get(params?: Params$Resource$Projects$Locations$Connectors$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Connector>>;
get(params: Params$Resource$Projects$Locations$Connectors$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
get(params: Params$Resource$Projects$Locations$Connectors$Get, options: MethodOptions | BodyResponseCallback<Schema$Connector>, callback: BodyResponseCallback<Schema$Connector>): void;
get(params: Params$Resource$Projects$Locations$Connectors$Get, callback: BodyResponseCallback<Schema$Connector>): void;
get(callback: BodyResponseCallback<Schema$Connector>): void;
/**
* Lists Serverless VPC Access connectors.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.connectors.list({
* // Maximum number of functions to return per call.
* pageSize: 'placeholder-value',
* // Continuation token.
* pageToken: 'placeholder-value',
* // Required. The project and location from which the routes should be listed.
* parent: 'projects/my-project/locations/my-location',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "connectors": [],
* // "nextPageToken": "my_nextPageToken"
* // }
* }
*
* 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.
*/
list(params: Params$Resource$Projects$Locations$Connectors$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
list(params?: Params$Resource$Projects$Locations$Connectors$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListConnectorsResponse>>;
list(params: Params$Resource$Projects$Locations$Connectors$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
list(params: Params$Resource$Projects$Locations$Connectors$List, options: MethodOptions | BodyResponseCallback<Schema$ListConnectorsResponse>, callback: BodyResponseCallback<Schema$ListConnectorsResponse>): void;
list(params: Params$Resource$Projects$Locations$Connectors$List, callback: BodyResponseCallback<Schema$ListConnectorsResponse>): void;
list(callback: BodyResponseCallback<Schema$ListConnectorsResponse>): void;
/**
* Updates a Serverless VPC Access connector, returns an operation.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.connectors.patch({
* // The resource name in the format `projects/x/locations/x/connectors/x`.
* name: 'projects/my-project/locations/my-location/connectors/my-connector',
* // The fields to update on the entry group. If absent or empty, all modifiable fields are updated.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "connectedProjects": [],
* // "ipCidrRange": "my_ipCidrRange",
* // "machineType": "my_machineType",
* // "maxInstances": 0,
* // "maxThroughput": 0,
* // "minInstances": 0,
* // "minThroughput": 0,
* // "name": "my_name",
* // "network": "my_network",
* // "state": "my_state",
* // "subnet": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
patch(params: Params$Resource$Projects$Locations$Connectors$Patch, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
patch(params?: Params$Resource$Projects$Locations$Connectors$Patch, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
patch(params: Params$Resource$Projects$Locations$Connectors$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
patch(params: Params$Resource$Projects$Locations$Connectors$Patch, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
patch(params: Params$Resource$Projects$Locations$Connectors$Patch, callback: BodyResponseCallback<Schema$Operation>): void;
patch(callback: BodyResponseCallback<Schema$Operation>): void;
}
export interface Params$Resource$Projects$Locations$Connectors$Create extends StandardParameters {
/**
* Required. The ID to use for this connector.
*/
connectorId?: string;
/**
* Required. The project ID and location in which the configuration should be created, specified in the format `projects/x/locations/x`.
*/
parent?: string;
/**
* Request body metadata
*/
requestBody?: Schema$Connector;
}
export interface Params$Resource$Projects$Locations$Connectors$Delete extends StandardParameters {
/**
* Required. Name of a Serverless VPC Access connector to delete.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Connectors$Get extends StandardParameters {
/**
* Required. Name of a Serverless VPC Access connector to get.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Connectors$List extends StandardParameters {
/**
* Maximum number of functions to return per call.
*/
pageSize?: number;
/**
* Continuation token.
*/
pageToken?: string;
/**
* Required. The project and location from which the routes should be listed.
*/
parent?: string;
}
export interface Params$Resource$Projects$Locations$Connectors$Patch extends StandardParameters {
/**
* The resource name in the format `projects/x/locations/x/connectors/x`.
*/
name?: string;
/**
* The fields to update on the entry group. If absent or empty, all modifiable fields are updated.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$Connector;
}
export class Resource$Projects$Locations$Operations {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.operations.get({
* // The name of the operation resource.
* name: 'projects/my-project/locations/my-location/operations/my-operation',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
get(params?: Params$Resource$Projects$Locations$Operations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
get(params: Params$Resource$Projects$Locations$Operations$Get, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
get(params: Params$Resource$Projects$Locations$Operations$Get, callback: BodyResponseCallback<Schema$Operation>): void;
get(callback: BodyResponseCallback<Schema$Operation>): void;
/**
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/vpcaccess.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const vpcaccess = google.vpcaccess('v1');
*
* 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 vpcaccess.projects.locations.operations.list({
* // The standard list filter.
* filter: 'placeholder-value',
* // The name of the operation's parent resource.
* name: 'projects/my-project/locations/my-location',
* // The standard list page size.
* pageSize: 'placeholder-value',
* // The standard list page token.
* pageToken: 'placeholder-value',
* // When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
* returnPartialSuccess: 'placeholder-value',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "nextPageToken": "my_nextPageToken",
* // "operations": [],
* // "unreachable": []
* // }
* }
*
* 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.
*/
list(params: Params$Resource$Projects$Locations$Operations$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
list(params?: Params$Resource$Projects$Locations$Operations$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
list(params: Params$Resource$Projects$Locations$Operations$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
list(params: Params$Resource$Projects$Locations$Operations$List, options: MethodOptions | BodyResponseCallback<Schema$ListOperationsResponse>, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
list(params: Params$Resource$Projects$Locations$Operations$List, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
list(callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
}
export interface Params$Resource$Projects$Locations$Operations$Get extends StandardParameters {
/**
* The name of the operation resource.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Operations$List extends StandardParameters {
/**
* The standard list filter.
*/
filter?: string;
/**
* The name of the operation's parent resource.
*/
name?: string;
/**
* The standard list page size.
*/
pageSize?: number;
/**
* The standard list page token.
*/
pageToken?: string;
/**
* When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation.
*/
returnPartialSuccess?: boolean;
}
export {};
}