Constructor
new ApiGatewayServiceClient(optionsopt)
Construct an instance of ApiGatewayServiceClient.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. The options accepted by the constructor are described in detail in this document. The common options are: Properties
|
Members
apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
The DNS address for this API service.
Methods
apiConfigPath(project, api, api_config) → {string}
Return a fully-qualified apiConfig resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
api |
string | |
api_config |
string |
Returns:
| Type | Description |
|---|---|
| string |
Resource name string. |
apiPath(project, api) → {string}
Return a fully-qualified api resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
api |
string |
Returns:
| Type | Description |
|---|---|
| string |
Resource name string. |
(async) checkCreateApiConfigProgress(name) → {Promise}
Check the status of the long running operation returned by createApiConfig().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkCreateApiConfigProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkCreateApiProgress(name) → {Promise}
Check the status of the long running operation returned by createApi().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkCreateApiProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkCreateGatewayProgress(name) → {Promise}
Check the status of the long running operation returned by createGateway().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkCreateGatewayProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkDeleteApiConfigProgress(name) → {Promise}
Check the status of the long running operation returned by deleteApiConfig().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkDeleteApiConfigProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkDeleteApiProgress(name) → {Promise}
Check the status of the long running operation returned by deleteApi().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkDeleteApiProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkDeleteGatewayProgress(name) → {Promise}
Check the status of the long running operation returned by deleteGateway().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkDeleteGatewayProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkUpdateApiConfigProgress(name) → {Promise}
Check the status of the long running operation returned by updateApiConfig().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkUpdateApiConfigProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkUpdateApiProgress(name) → {Promise}
Check the status of the long running operation returned by updateApi().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkUpdateApiProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
(async) checkUpdateGatewayProgress(name) → {Promise}
Check the status of the long running operation returned by updateGateway().
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const decodedOperation = await checkUpdateGatewayProgress(name);
console.log(decodedOperation.result);
console.log(decodedOperation.done);
console.log(decodedOperation.metadata);
close() → {Promise}
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns:
| Type | Description |
|---|---|
| Promise |
A promise that resolves when the client is closed. |
createApi(request, optionsopt) → {Promise}
Creates a new Api in a given project and location.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.createApi(request);
const [response] = await operation.promise();
createApiConfig(request, optionsopt) → {Promise}
Creates a new ApiConfig in a given project and location.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.createApiConfig(request);
const [response] = await operation.promise();
createGateway(request, optionsopt) → {Promise}
Creates a new Gateway in a given project and location.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.createGateway(request);
const [response] = await operation.promise();
deleteApi(request, optionsopt) → {Promise}
Deletes a single Api.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.deleteApi(request);
const [response] = await operation.promise();
deleteApiConfig(request, optionsopt) → {Promise}
Deletes a single ApiConfig.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.deleteApiConfig(request);
const [response] = await operation.promise();
deleteGateway(request, optionsopt) → {Promise}
Deletes a single Gateway.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.deleteGateway(request);
const [response] = await operation.promise();
gatewayPath(project, location, gateway) → {string}
Return a fully-qualified gateway resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
string | |
location |
string | |
gateway |
string |
Returns:
| Type | Description |
|---|---|
| string |
Resource name string. |
getApi(request, optionsopt) → {Promise}
Gets details of a single Api.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
getApiConfig(request, optionsopt) → {Promise}
Gets details of a single ApiConfig.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
getGateway(request, optionsopt) → {Promise}
Gets details of a single Gateway.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
getProjectId() → {Promise}
Return the project ID used by this class.
Returns:
| Type | Description |
|---|---|
| Promise |
A promise that resolves to string containing the project ID. |
initialize() → {Promise}
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns:
| Type | Description |
|---|---|
| Promise |
A promise that resolves to an authenticated service stub. |
listApiConfigs(request, optionsopt) → {Promise}
Lists ApiConfigs in a given project and location.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listApiConfigsAsync(request, optionsopt) → {Object}
Equivalent to listApiConfigs, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ApiConfig. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
const iterable = client.listApiConfigsAsync(request);
for await (const response of iterable) {
// process response
}
listApiConfigsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing ApiConfig on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listApis(request, optionsopt) → {Promise}
Lists Apis in a given project and location.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listApisAsync(request, optionsopt) → {Object}
Equivalent to listApis, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Api. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
const iterable = client.listApisAsync(request);
for await (const response of iterable) {
// process response
}
listApisStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing Api on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listGateways(request, optionsopt) → {Promise}
Lists Gateways in a given project and location.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
listGatewaysAsync(request, optionsopt) → {Object}
Equivalent to listGateways, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Gateway. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
const iterable = client.listGatewaysAsync(request);
for await (const response of iterable) {
// process response
}
listGatewaysStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Stream |
An object stream which emits an object representing Gateway on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
matchApiConfigFromApiConfigName(apiConfigName) → {string}
Parse the api_config from ApiConfig resource.
Parameters:
| Name | Type | Description |
|---|---|---|
apiConfigName |
string |
A fully-qualified path representing ApiConfig resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the api_config. |
matchApiFromApiConfigName(apiConfigName) → {string}
Parse the api from ApiConfig resource.
Parameters:
| Name | Type | Description |
|---|---|---|
apiConfigName |
string |
A fully-qualified path representing ApiConfig resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the api. |
matchApiFromApiName(apiName) → {string}
Parse the api from Api resource.
Parameters:
| Name | Type | Description |
|---|---|---|
apiName |
string |
A fully-qualified path representing Api resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the api. |
matchGatewayFromGatewayName(gatewayName) → {string}
Parse the gateway from Gateway resource.
Parameters:
| Name | Type | Description |
|---|---|---|
gatewayName |
string |
A fully-qualified path representing Gateway resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the gateway. |
matchLocationFromGatewayName(gatewayName) → {string}
Parse the location from Gateway resource.
Parameters:
| Name | Type | Description |
|---|---|---|
gatewayName |
string |
A fully-qualified path representing Gateway resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the location. |
matchProjectFromApiConfigName(apiConfigName) → {string}
Parse the project from ApiConfig resource.
Parameters:
| Name | Type | Description |
|---|---|---|
apiConfigName |
string |
A fully-qualified path representing ApiConfig resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the project. |
matchProjectFromApiName(apiName) → {string}
Parse the project from Api resource.
Parameters:
| Name | Type | Description |
|---|---|---|
apiName |
string |
A fully-qualified path representing Api resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the project. |
matchProjectFromGatewayName(gatewayName) → {string}
Parse the project from Gateway resource.
Parameters:
| Name | Type | Description |
|---|---|---|
gatewayName |
string |
A fully-qualified path representing Gateway resource. |
Returns:
| Type | Description |
|---|---|
| string |
A string representing the project. |
updateApi(request, optionsopt) → {Promise}
Updates the parameters of a single Api.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.updateApi(request);
const [response] = await operation.promise();
updateApiConfig(request, optionsopt) → {Promise}
Updates the parameters of a single ApiConfig.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|
Example
const [operation] = await client.updateApiConfig(request);
const [response] = await operation.promise();
updateGateway(request, optionsopt) → {Promise}
Updates the parameters of a single Gateway.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
| Type | Description |
|---|---|
| Promise |
|