Constructor
new ApiHubClient(optionsopt, gaxInstanceopt)
Construct an instance of ApiHubClient.
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
|
||||||||||||||||||||||||||||||||||||||||||||||||
gaxInstance |
gax |
<optional> |
loaded instance of |
Members
apiEndpoint
The DNS address for this API service.
apiEndpoint
The DNS address for this API service - same as servicePath.
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
apiHubInstancePath(project, location, api_hub_instance) → {string}
Return a fully-qualified apiHubInstance resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
api_hub_instance |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
apiOperationPath(project, location, api, version, operation) → {string}
Return a fully-qualified apiOperation resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
api |
string | |
version |
string | |
operation |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
apiPath(project, location, api) → {string}
Return a fully-qualified api resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
api |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
attributePath(project, location, attribute) → {string}
Return a fully-qualified attribute resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
attribute |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
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. |
definitionPath(project, location, api, version, definition) → {string}
Return a fully-qualified definition resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
api |
string | |
version |
string | |
definition |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
dependencyPath(project, location, dependency) → {string}
Return a fully-qualified dependency resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
dependency |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
deploymentPath(project, location, deployment) → {string}
Return a fully-qualified deployment resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
deployment |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
externalApiPath(project, location, external_api) → {string}
Return a fully-qualified externalApi resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
external_api |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
getLocation(request, optionsopt) → {Promise}
Gets information about a 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 |
|
getProjectId() → {Promise}
Return the project ID used by this class.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves to string containing the project ID. |
hostProjectRegistrationPath(project, location, host_project_registration) → {string}
Return a fully-qualified hostProjectRegistration resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
host_project_registration |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
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. |
listApiOperationsAsync(request, optionsopt) → {Object}
Equivalent to listApiOperations
, 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 ApiOperation. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent which owns this collection of operations i.e., the API
* version. Format:
* `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
*/
// const parent = 'abc123'
/**
* Optional. An expression that filters the list of ApiOperations.
* A filter expression consists of a field name, a comparison
* operator, and a value for filtering. The value must be a string or a
* boolean. The comparison operator must be one of: `<`, `>` or
* `=`. Filters are not case sensitive.
* The following fields in the `ApiOperation` are eligible for filtering:
* * `name` - The ApiOperation resource name. Allowed comparison
* operators:
* `=`.
* * `details.http_operation.path.path` - The http operation's complete path
* relative to server endpoint. Allowed comparison operators: `=`.
* * `details.http_operation.method` - The http operation method type.
* Allowed comparison operators: `=`.
* * `details.deprecated` - Indicates if the ApiOperation is deprecated.
* Allowed values are True / False indicating the deprycation status of the
* ApiOperation. Allowed comparison operators: `=`.
* * `create_time` - The time at which the ApiOperation was created. The
* value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339
* format. Allowed comparison operators: `>` and `<`.
* Expressions are combined with either `AND` logic operator or `OR` logical
* operator but not both of them together i.e. only one of the `AND` or `OR`
* operator can be used throughout the filter string and both the operators
* cannot be used together. No other logical operators are supported. At most
* three filter fields are allowed in the filter string and if provided
* more than that then `INVALID_ARGUMENT` error is returned by the API.
* Here are a few examples:
* * `details.deprecated = True` - The ApiOperation is deprecated.
* * `details.http_operation.method = GET AND create_time <
* \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
* The method of the http operation of the ApiOperation is _GET_ and the
* spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
* 12:00:00 UTC_.
* * `details.http_operation.method = GET OR details.http_operation.method =
* POST`. - The http operation of the method of ApiOperation is _GET_ or
* _POST_.
*/
// const filter = 'abc123'
/**
* Optional. The maximum number of operations to return. The service may
* return fewer than this value. If unspecified, at most 50 operations will be
* returned. The maximum value is 1000; values above 1000 will be coerced to
* 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListApiOperations` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters (except page_size) provided to
* `ListApiOperations` must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callListApiOperations() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apihubClient.listApiOperationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListApiOperations();
listApiOperationsStream(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 ApiOperation 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 |
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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent, which owns this collection of API resources.
* Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Optional. An expression that filters the list of ApiResources.
* A filter expression consists of a field name, a comparison
* operator, and a value for filtering. The value must be a string. The
* comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
* case sensitive.
* The following fields in the `ApiResource` are eligible for filtering:
* * `owner.email` - The email of the team which owns the ApiResource.
* Allowed comparison operators: `=`.
* * `create_time` - The time at which the ApiResource was created. The
* value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339
* format. Allowed comparison operators: `>` and `<`.
* * `display_name` - The display name of the ApiResource. Allowed
* comparison operators: `=`.
* * `target_user.enum_values.values.id` - The allowed value id of the
* target users attribute associated with the ApiResource. Allowed
* comparison operator is `:`.
* * `target_user.enum_values.values.display_name` - The allowed value
* display name of the target users attribute associated with the
* ApiResource. Allowed comparison operator is `:`.
* * `team.enum_values.values.id` - The allowed value id of the team
* attribute associated with the ApiResource. Allowed comparison operator is
* `:`.
* * `team.enum_values.values.display_name` - The allowed value display name
* of the team attribute associated with the ApiResource. Allowed comparison
* operator is `:`.
* * `business_unit.enum_values.values.id` - The allowed value id of the
* business unit attribute associated with the ApiResource. Allowed
* comparison operator is `:`.
* * `business_unit.enum_values.values.display_name` - The allowed value
* display name of the business unit attribute associated with the
* ApiResource. Allowed comparison operator is `:`.
* * `maturity_level.enum_values.values.id` - The allowed value id of the
* maturity level attribute associated with the ApiResource. Allowed
* comparison operator is `:`.
* * `maturity_level.enum_values.values.display_name` - The allowed value
* display name of the maturity level attribute associated with the
* ApiResource. Allowed comparison operator is `:`.
* * `api_style.enum_values.values.id` - The allowed value id of the
* api style attribute associated with the ApiResource. Allowed
* comparison operator is `:`.
* * `api_style.enum_values.values.display_name` - The allowed value display
* name of the api style attribute associated with the ApiResource. Allowed
* comparison operator is `:`.
* Expressions are combined with either `AND` logic operator or `OR` logical
* operator but not both of them together i.e. only one of the `AND` or `OR`
* operator can be used throughout the filter string and both the operators
* cannot be used together. No other logical operators are supported. At most
* three filter fields are allowed in the filter string and if provided
* more than that then `INVALID_ARGUMENT` error is returned by the API.
* Here are a few examples:
* * `owner.email = \"apihub@google.com\"` - - The owner team email is
* _apihub@google.com_.
* * `owner.email = \"apihub@google.com\" AND create_time <
* \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
* The owner team email is _apihub@google.com_ and the api was created
* before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
* * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
* apihub-team-id` - The filter string specifies the APIs where the owner
* team email is _apihub@google.com_ or the id of the allowed value
* associated with the team attribute is _apihub-team-id_.
* * `owner.email = \"apihub@google.com\" OR
* team.enum_values.values.display_name: ApiHub Team` - The filter string
* specifies the APIs where the owner team email is _apihub@google.com_ or
* the display name of the allowed value associated with the team attribute
* is `ApiHub Team`.
*/
// const filter = 'abc123'
/**
* Optional. The maximum number of API resources to return. The service may
* return fewer than this value. If unspecified, at most 50 Apis will be
* returned. The maximum value is 1000; values above 1000 will be coerced to
* 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListApis` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters (except page_size) provided to
* `ListApis` must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callListApis() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apihubClient.listApisAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListApis();
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 |
listAttributesAsync(request, optionsopt) → {Object}
Equivalent to listAttributes
, 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 Attribute. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource for Attribute.
* Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Optional. An expression that filters the list of Attributes.
* A filter expression consists of a field name, a comparison
* operator, and a value for filtering. The value must be a string or a
* boolean. The comparison operator must be one of: `<`, `>` or
* `=`. Filters are not case sensitive.
* The following fields in the `Attribute` are eligible for filtering:
* * `display_name` - The display name of the Attribute. Allowed
* comparison operators: `=`.
* * `definition_type` - The definition type of the attribute. Allowed
* comparison operators: `=`.
* * `scope` - The scope of the attribute. Allowed comparison operators:
* `=`.
* * `data_type` - The type of the data of the attribute. Allowed
* comparison operators: `=`.
* * `mandatory` - Denotes whether the attribute is mandatory or not.
* Allowed comparison operators: `=`.
* * `create_time` - The time at which the Attribute was created. The
* value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339
* format. Allowed comparison operators: `>` and `<`.
* Expressions are combined with either `AND` logic operator or `OR` logical
* operator but not both of them together i.e. only one of the `AND` or `OR`
* operator can be used throughout the filter string and both the operators
* cannot be used together. No other logical operators are
* supported. At most three filter fields are allowed in the filter
* string and if provided more than that then `INVALID_ARGUMENT` error is
* returned by the API.
* Here are a few examples:
* * `display_name = production` - - The display name of the attribute is
* _production_.
* * `(display_name = production) AND (create_time <
* \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
* The display name of the attribute is _production_ and the attribute was
* created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
* UTC_.
* * `display_name = production OR scope = api` -
* The attribute where the display name is _production_ or the scope is
* _api_.
*/
// const filter = 'abc123'
/**
* Optional. The maximum number of attribute resources to return. The service
* may return fewer than this value. If unspecified, at most 50 attributes
* will be returned. The maximum value is 1000; values above 1000 will be
* coerced to 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListAttributes` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListAttributes` must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callListAttributes() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apihubClient.listAttributesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAttributes();
listAttributesStream(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 Attribute 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 |
listDeploymentsAsync(request, optionsopt) → {Object}
Equivalent to listDeployments
, 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 Deployment. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent, which owns this collection of deployment resources.
* Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Optional. An expression that filters the list of Deployments.
* A filter expression consists of a field name, a comparison
* operator, and a value for filtering. The value must be a string. The
* comparison operator must be one of: `<`, `>` or
* `=`. Filters are not case sensitive.
* The following fields in the `Deployments` are eligible for filtering:
* * `display_name` - The display name of the Deployment. Allowed
* comparison operators: `=`.
* * `create_time` - The time at which the Deployment was created. The
* value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339
* format. Allowed comparison operators: `>` and `<`.
* * `resource_uri` - A URI to the deployment resource. Allowed
* comparison operators: `=`.
* * `api_versions` - The API versions linked to this deployment. Allowed
* comparison operators: `:`.
* * `deployment_type.enum_values.values.id` - The allowed value id of the
* deployment_type attribute associated with the Deployment. Allowed
* comparison operators: `:`.
* * `deployment_type.enum_values.values.display_name` - The allowed value
* display name of the deployment_type attribute associated with the
* Deployment. Allowed comparison operators: `:`.
* * `slo.string_values.values` -The allowed string value of the slo
* attribute associated with the deployment. Allowed comparison
* operators: `:`.
* * `environment.enum_values.values.id` - The allowed value id of the
* environment attribute associated with the deployment. Allowed
* comparison operators: `:`.
* * `environment.enum_values.values.display_name` - The allowed value
* display name of the environment attribute associated with the deployment.
* Allowed comparison operators: `:`.
* Expressions are combined with either `AND` logic operator or `OR` logical
* operator but not both of them together i.e. only one of the `AND` or `OR`
* operator can be used throughout the filter string and both the operators
* cannot be used together. No other logical operators are supported. At most
* three filter fields are allowed in the filter string and if provided
* more than that then `INVALID_ARGUMENT` error is returned by the API.
* Here are a few examples:
* * `environment.enum_values.values.id: staging-id` - The allowed value id
* of the environment attribute associated with the Deployment is
* _staging-id_.
* * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
* The allowed value display name of the environment attribute associated
* with the Deployment is `Staging Deployment`.
* * `environment.enum_values.values.id: production-id AND create_time <
* \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
* The allowed value id of the environment attribute associated with the
* Deployment is _production-id_ and Deployment was created before
* _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
* * `environment.enum_values.values.id: production-id OR
* slo.string_values.values: \"99.99%\"`
* - The allowed value id of the environment attribute Deployment is
* _production-id_ or string value of the slo attribute is _99.99%_.
*/
// const filter = 'abc123'
/**
* Optional. The maximum number of deployment resources to return. The service
* may return fewer than this value. If unspecified, at most 50 deployments
* will be returned. The maximum value is 1000; values above 1000 will be
* coerced to 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListDeployments` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters (except page_size) provided to
* `ListDeployments` must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callListDeployments() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apihubClient.listDeploymentsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListDeployments();
listDeploymentsStream(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 Deployment 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 |
listExternalApisAsync(request, optionsopt) → {Object}
Equivalent to listExternalApis
, 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 ExternalApi. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent, which owns this collection of External API resources.
* Format: `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of External API resources to return. The
* service may return fewer than this value. If unspecified, at most 50
* ExternalApis will be returned. The maximum value is 1000; values above 1000
* will be coerced to 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListExternalApis` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters (except page_size) provided to
* `ListExternalApis` must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callListExternalApis() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apihubClient.listExternalApisAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListExternalApis();
listExternalApisStream(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 ExternalApi 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 |
listLocationsAsync(request, optionsopt) → {Object}
Lists information about the supported locations for this service. 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 Location. 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.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
```
listSpecsAsync(request, optionsopt) → {Object}
Equivalent to listSpecs
, 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 Spec. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent, which owns this collection of specs.
* Format:
* `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
*/
// const parent = 'abc123'
/**
* Optional. An expression that filters the list of Specs.
* A filter expression consists of a field name, a comparison
* operator, and a value for filtering. The value must be a string. The
* comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
* case sensitive.
* The following fields in the `Spec` are eligible for filtering:
* * `display_name` - The display name of the Spec. Allowed comparison
* operators: `=`.
* * `create_time` - The time at which the Spec was created. The
* value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339
* format. Allowed comparison operators: `>` and `<`.
* * `spec_type.enum_values.values.id` - The allowed value id of the
* spec_type attribute associated with the Spec. Allowed comparison
* operators: `:`.
* * `spec_type.enum_values.values.display_name` - The allowed value display
* name of the spec_type attribute associated with the Spec. Allowed
* comparison operators: `:`.
* * `lint_response.json_values.values` - The json value of the
* lint_response attribute associated with the Spec. Allowed comparison
* operators: `:`.
* * `mime_type` - The MIME type of the Spec. Allowed comparison
* operators: `=`.
* Expressions are combined with either `AND` logic operator or `OR` logical
* operator but not both of them together i.e. only one of the `AND` or `OR`
* operator can be used throughout the filter string and both the operators
* cannot be used together. No other logical operators are
* supported. At most three filter fields are allowed in the filter
* string and if provided more than that then `INVALID_ARGUMENT` error is
* returned by the API.
* Here are a few examples:
* * `spec_type.enum_values.values.id: rest-id` - The filter
* string specifies that the id of the allowed value associated with the
* spec_type attribute is _rest-id_.
* * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
* The filter string specifies that the display name of the allowed value
* associated with the spec_type attribute is `Rest Display Name`.
* * `spec_type.enum_values.values.id: grpc-id AND create_time <
* \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
* The id of the allowed value associated with the spec_type attribute is
* _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
* after _2021-08-10 12:00:00 UTC_.
* * `spec_type.enum_values.values.id: rest-id OR
* spec_type.enum_values.values.id: grpc-id`
* - The id of the allowed value associated with the spec_type attribute is
* _rest-id_ or _grpc-id_.
*/
// const filter = 'abc123'
/**
* Optional. The maximum number of specs to return. The service may return
* fewer than this value. If unspecified, at most 50 specs will be
* returned. The maximum value is 1000; values above 1000 will be coerced to
* 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListSpecs` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListSpecs` must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callListSpecs() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apihubClient.listSpecsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListSpecs();
listSpecsStream(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 Spec 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 |
listVersionsAsync(request, optionsopt) → {Object}
Equivalent to listVersions
, 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 Version. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent which owns this collection of API versions i.e., the
* API resource Format: `projects/{project}/locations/{location}/apis/{api}`
*/
// const parent = 'abc123'
/**
* Optional. An expression that filters the list of Versions.
* A filter expression consists of a field name, a comparison
* operator, and a value for filtering. The value must be a string, a
* number, or a boolean. The comparison operator must be one of: `<`, `>` or
* `=`. Filters are not case sensitive.
* The following fields in the `Version` are eligible for filtering:
* * `display_name` - The display name of the Version. Allowed
* comparison operators: `=`.
* * `create_time` - The time at which the Version was created. The
* value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339
* format. Allowed comparison operators: `>` and `<`.
* * `lifecycle.enum_values.values.id` - The allowed value id of the
* lifecycle attribute associated with the Version. Allowed comparison
* operators: `:`.
* * `lifecycle.enum_values.values.display_name` - The allowed value display
* name of the lifecycle attribute associated with the Version. Allowed
* comparison operators: `:`.
* * `compliance.enum_values.values.id` - The allowed value id of the
* compliances attribute associated with the Version. Allowed comparison
* operators: `:`.
* * `compliance.enum_values.values.display_name` - The allowed value
* display name of the compliances attribute associated with the Version.
* Allowed comparison operators: `:`.
* * `accreditation.enum_values.values.id` - The allowed value id of the
* accreditations attribute associated with the Version. Allowed
* comparison operators: `:`.
* * `accreditation.enum_values.values.display_name` - The allowed value
* display name of the accreditations attribute associated with the Version.
* Allowed comparison operators: `:`.
* Expressions are combined with either `AND` logic operator or `OR` logical
* operator but not both of them together i.e. only one of the `AND` or `OR`
* operator can be used throughout the filter string and both the operators
* cannot be used together. No other logical operators are
* supported. At most three filter fields are allowed in the filter
* string and if provided more than that then `INVALID_ARGUMENT` error is
* returned by the API.
* Here are a few examples:
* * `lifecycle.enum_values.values.id: preview-id` - The filter string
* specifies that the id of the allowed value associated with the lifecycle
* attribute of the Version is _preview-id_.
* * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
* The filter string specifies that the display name of the allowed value
* associated with the lifecycle attribute of the Version is `Preview
* Display Name`.
* * `lifecycle.enum_values.values.id: preview-id AND create_time <
* \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
* The id of the allowed value associated with the lifecycle attribute of
* the Version is _preview-id_ and it was created before _2021-08-15
* 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
* * `compliance.enum_values.values.id: gdpr-id OR
* compliance.enum_values.values.id: pci-dss-id`
* - The id of the allowed value associated with the compliance attribute is
* _gdpr-id_ or _pci-dss-id_.
*/
// const filter = 'abc123'
/**
* Optional. The maximum number of versions to return. The service may return
* fewer than this value. If unspecified, at most 50 versions will be
* returned. The maximum value is 1000; values above 1000 will be coerced to
* 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListVersions` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters (except page_size) provided to
* `ListVersions` must match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callListVersions() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = apihubClient.listVersionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListVersions();
listVersionsStream(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 Version 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 |
locationPath(project, location) → {string}
Return a fully-qualified location resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
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. |
matchApiFromApiOperationName(apiOperationName) → {string}
Parse the api from ApiOperation resource.
Parameters:
Name | Type | Description |
---|---|---|
apiOperationName |
string |
A fully-qualified path representing ApiOperation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the api. |
matchApiFromDefinitionName(definitionName) → {string}
Parse the api from Definition resource.
Parameters:
Name | Type | Description |
---|---|---|
definitionName |
string |
A fully-qualified path representing Definition resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the api. |
matchApiFromSpecName(specName) → {string}
Parse the api from Spec resource.
Parameters:
Name | Type | Description |
---|---|---|
specName |
string |
A fully-qualified path representing Spec resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the api. |
matchApiFromVersionName(versionName) → {string}
Parse the api from Version resource.
Parameters:
Name | Type | Description |
---|---|---|
versionName |
string |
A fully-qualified path representing Version resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the api. |
matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName) → {string}
Parse the api_hub_instance from ApiHubInstance resource.
Parameters:
Name | Type | Description |
---|---|---|
apiHubInstanceName |
string |
A fully-qualified path representing ApiHubInstance resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the api_hub_instance. |
matchAttributeFromAttributeName(attributeName) → {string}
Parse the attribute from Attribute resource.
Parameters:
Name | Type | Description |
---|---|---|
attributeName |
string |
A fully-qualified path representing Attribute resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the attribute. |
matchDefinitionFromDefinitionName(definitionName) → {string}
Parse the definition from Definition resource.
Parameters:
Name | Type | Description |
---|---|---|
definitionName |
string |
A fully-qualified path representing Definition resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the definition. |
matchDependencyFromDependencyName(dependencyName) → {string}
Parse the dependency from Dependency resource.
Parameters:
Name | Type | Description |
---|---|---|
dependencyName |
string |
A fully-qualified path representing Dependency resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the dependency. |
matchDeploymentFromDeploymentName(deploymentName) → {string}
Parse the deployment from Deployment resource.
Parameters:
Name | Type | Description |
---|---|---|
deploymentName |
string |
A fully-qualified path representing Deployment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the deployment. |
matchExternalApiFromExternalApiName(externalApiName) → {string}
Parse the external_api from ExternalApi resource.
Parameters:
Name | Type | Description |
---|---|---|
externalApiName |
string |
A fully-qualified path representing ExternalApi resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the external_api. |
matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName) → {string}
Parse the host_project_registration from HostProjectRegistration resource.
Parameters:
Name | Type | Description |
---|---|---|
hostProjectRegistrationName |
string |
A fully-qualified path representing HostProjectRegistration resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the host_project_registration. |
matchLocationFromApiHubInstanceName(apiHubInstanceName) → {string}
Parse the location from ApiHubInstance resource.
Parameters:
Name | Type | Description |
---|---|---|
apiHubInstanceName |
string |
A fully-qualified path representing ApiHubInstance resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromApiName(apiName) → {string}
Parse the location from Api resource.
Parameters:
Name | Type | Description |
---|---|---|
apiName |
string |
A fully-qualified path representing Api resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromApiOperationName(apiOperationName) → {string}
Parse the location from ApiOperation resource.
Parameters:
Name | Type | Description |
---|---|---|
apiOperationName |
string |
A fully-qualified path representing ApiOperation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromAttributeName(attributeName) → {string}
Parse the location from Attribute resource.
Parameters:
Name | Type | Description |
---|---|---|
attributeName |
string |
A fully-qualified path representing Attribute resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromDefinitionName(definitionName) → {string}
Parse the location from Definition resource.
Parameters:
Name | Type | Description |
---|---|---|
definitionName |
string |
A fully-qualified path representing Definition resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromDependencyName(dependencyName) → {string}
Parse the location from Dependency resource.
Parameters:
Name | Type | Description |
---|---|---|
dependencyName |
string |
A fully-qualified path representing Dependency resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromDeploymentName(deploymentName) → {string}
Parse the location from Deployment resource.
Parameters:
Name | Type | Description |
---|---|---|
deploymentName |
string |
A fully-qualified path representing Deployment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromExternalApiName(externalApiName) → {string}
Parse the location from ExternalApi resource.
Parameters:
Name | Type | Description |
---|---|---|
externalApiName |
string |
A fully-qualified path representing ExternalApi resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName) → {string}
Parse the location from HostProjectRegistration resource.
Parameters:
Name | Type | Description |
---|---|---|
hostProjectRegistrationName |
string |
A fully-qualified path representing HostProjectRegistration resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromLocationName(locationName) → {string}
Parse the location from Location resource.
Parameters:
Name | Type | Description |
---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromPluginName(pluginName) → {string}
Parse the location from Plugin resource.
Parameters:
Name | Type | Description |
---|---|---|
pluginName |
string |
A fully-qualified path representing Plugin resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName) → {string}
Parse the location from RuntimeProjectAttachment resource.
Parameters:
Name | Type | Description |
---|---|---|
runtimeProjectAttachmentName |
string |
A fully-qualified path representing RuntimeProjectAttachment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromSpecName(specName) → {string}
Parse the location from Spec resource.
Parameters:
Name | Type | Description |
---|---|---|
specName |
string |
A fully-qualified path representing Spec resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromStyleGuideName(styleGuideName) → {string}
Parse the location from StyleGuide resource.
Parameters:
Name | Type | Description |
---|---|---|
styleGuideName |
string |
A fully-qualified path representing StyleGuide resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromVersionName(versionName) → {string}
Parse the location from Version resource.
Parameters:
Name | Type | Description |
---|---|---|
versionName |
string |
A fully-qualified path representing Version resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchOperationFromApiOperationName(apiOperationName) → {string}
Parse the operation from ApiOperation resource.
Parameters:
Name | Type | Description |
---|---|---|
apiOperationName |
string |
A fully-qualified path representing ApiOperation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the operation. |
matchPluginFromPluginName(pluginName) → {string}
Parse the plugin from Plugin resource.
Parameters:
Name | Type | Description |
---|---|---|
pluginName |
string |
A fully-qualified path representing Plugin resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the plugin. |
matchPluginFromStyleGuideName(styleGuideName) → {string}
Parse the plugin from StyleGuide resource.
Parameters:
Name | Type | Description |
---|---|---|
styleGuideName |
string |
A fully-qualified path representing StyleGuide resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the plugin. |
matchProjectFromApiHubInstanceName(apiHubInstanceName) → {string}
Parse the project from ApiHubInstance resource.
Parameters:
Name | Type | Description |
---|---|---|
apiHubInstanceName |
string |
A fully-qualified path representing ApiHubInstance 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. |
matchProjectFromApiOperationName(apiOperationName) → {string}
Parse the project from ApiOperation resource.
Parameters:
Name | Type | Description |
---|---|---|
apiOperationName |
string |
A fully-qualified path representing ApiOperation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromAttributeName(attributeName) → {string}
Parse the project from Attribute resource.
Parameters:
Name | Type | Description |
---|---|---|
attributeName |
string |
A fully-qualified path representing Attribute resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromDefinitionName(definitionName) → {string}
Parse the project from Definition resource.
Parameters:
Name | Type | Description |
---|---|---|
definitionName |
string |
A fully-qualified path representing Definition resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromDependencyName(dependencyName) → {string}
Parse the project from Dependency resource.
Parameters:
Name | Type | Description |
---|---|---|
dependencyName |
string |
A fully-qualified path representing Dependency resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromDeploymentName(deploymentName) → {string}
Parse the project from Deployment resource.
Parameters:
Name | Type | Description |
---|---|---|
deploymentName |
string |
A fully-qualified path representing Deployment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromExternalApiName(externalApiName) → {string}
Parse the project from ExternalApi resource.
Parameters:
Name | Type | Description |
---|---|---|
externalApiName |
string |
A fully-qualified path representing ExternalApi resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName) → {string}
Parse the project from HostProjectRegistration resource.
Parameters:
Name | Type | Description |
---|---|---|
hostProjectRegistrationName |
string |
A fully-qualified path representing HostProjectRegistration resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromLocationName(locationName) → {string}
Parse the project from Location resource.
Parameters:
Name | Type | Description |
---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromPluginName(pluginName) → {string}
Parse the project from Plugin resource.
Parameters:
Name | Type | Description |
---|---|---|
pluginName |
string |
A fully-qualified path representing Plugin resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectName(projectName) → {string}
Parse the project from Project resource.
Parameters:
Name | Type | Description |
---|---|---|
projectName |
string |
A fully-qualified path representing Project resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName) → {string}
Parse the project from RuntimeProjectAttachment resource.
Parameters:
Name | Type | Description |
---|---|---|
runtimeProjectAttachmentName |
string |
A fully-qualified path representing RuntimeProjectAttachment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromSpecName(specName) → {string}
Parse the project from Spec resource.
Parameters:
Name | Type | Description |
---|---|---|
specName |
string |
A fully-qualified path representing Spec resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromStyleGuideName(styleGuideName) → {string}
Parse the project from StyleGuide resource.
Parameters:
Name | Type | Description |
---|---|---|
styleGuideName |
string |
A fully-qualified path representing StyleGuide resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromVersionName(versionName) → {string}
Parse the project from Version resource.
Parameters:
Name | Type | Description |
---|---|---|
versionName |
string |
A fully-qualified path representing Version resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName) → {string}
Parse the runtime_project_attachment from RuntimeProjectAttachment resource.
Parameters:
Name | Type | Description |
---|---|---|
runtimeProjectAttachmentName |
string |
A fully-qualified path representing RuntimeProjectAttachment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the runtime_project_attachment. |
matchSpecFromSpecName(specName) → {string}
Parse the spec from Spec resource.
Parameters:
Name | Type | Description |
---|---|---|
specName |
string |
A fully-qualified path representing Spec resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the spec. |
matchVersionFromApiOperationName(apiOperationName) → {string}
Parse the version from ApiOperation resource.
Parameters:
Name | Type | Description |
---|---|---|
apiOperationName |
string |
A fully-qualified path representing ApiOperation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the version. |
matchVersionFromDefinitionName(definitionName) → {string}
Parse the version from Definition resource.
Parameters:
Name | Type | Description |
---|---|---|
definitionName |
string |
A fully-qualified path representing Definition resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the version. |
matchVersionFromSpecName(specName) → {string}
Parse the version from Spec resource.
Parameters:
Name | Type | Description |
---|---|---|
specName |
string |
A fully-qualified path representing Spec resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the version. |
matchVersionFromVersionName(versionName) → {string}
Parse the version from Version resource.
Parameters:
Name | Type | Description |
---|---|---|
versionName |
string |
A fully-qualified path representing Version resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the version. |
pluginPath(project, location, plugin) → {string}
Return a fully-qualified plugin resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
plugin |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectPath(project) → {string}
Return a fully-qualified project resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
runtimeProjectAttachmentPath(project, location, runtime_project_attachment) → {string}
Return a fully-qualified runtimeProjectAttachment resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
runtime_project_attachment |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
searchResourcesAsync(request, optionsopt) → {Object}
Equivalent to searchResources
, 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 SearchResult. 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
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the location which will be of the type
* `projects/{project_id}/locations/{location_id}`. This field is used to
* identify the instance of API-Hub in which resources should be searched.
*/
// const location = 'abc123'
/**
* Required. The free text search query. This query can contain keywords which
* could be related to any detail of the API-Hub resources such display names,
* descriptions, attributes etc.
*/
// const query = 'abc123'
/**
* Optional. An expression that filters the list of search results.
* A filter expression consists of a field name, a comparison operator,
* and a value for filtering. The value must be a string, a number, or a
* boolean. The comparison operator must be `=`. Filters are not case
* sensitive.
* The following field names are eligible for filtering:
* * `resource_type` - The type of resource in the search results.
* Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
* `Definition`, `Spec` or `Version`. This field can only be specified once
* in the filter.
* Here are is an example:
* * `resource_type = Api` - The resource_type is _Api_.
*/
// const filter = 'abc123'
/**
* Optional. The maximum number of search results to return. The service may
* return fewer than this value. If unspecified at most 10 search results will
* be returned. If value is negative then `INVALID_ARGUMENT` error is
* returned. The maximum value is 25; values above 25 will be coerced to 25.
* While paginating, you can specify a new page size parameter for each page
* of search results to be listed.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous
* SearchResources SearchResources
* call. Specify this parameter to retrieve the next page of transactions.
* When paginating, you must specify the `page_token` parameter and all the
* other parameters except
* page_size google.cloud.apihub.v1.SearchResourcesRequest.page_size
* should be specified with the same value which was used in the previous
* call. If the other fields are set with a different value than the previous
* call then `INVALID_ARGUMENT` error is returned.
*/
// const pageToken = 'abc123'
// Imports the Apihub library
const {ApiHubClient} = require('@google-cloud/apihub').v1;
// Instantiates a client
const apihubClient = new ApiHubClient();
async function callSearchResources() {
// Construct request
const request = {
location,
query,
};
// Run request
const iterable = apihubClient.searchResourcesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callSearchResources();
searchResourcesStream(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 SearchResult 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 |
specPath(project, location, api, version, spec) → {string}
Return a fully-qualified spec resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
api |
string | |
version |
string | |
spec |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
styleGuidePath(project, location, plugin) → {string}
Return a fully-qualified styleGuide resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
plugin |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
versionPath(project, location, api, version) → {string}
Return a fully-qualified version resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
api |
string | |
version |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |