Constructor
new AccessApprovalClient(optionsopt, gaxInstanceopt)
Construct an instance of AccessApprovalClient.
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
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. |
folderAccessApprovalSettingsPath(folder) → {string}
Return a fully-qualified folderAccessApprovalSettings resource name string.
Parameters:
Name | Type | Description |
---|---|---|
folder |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
folderApprovalRequestPath(folder, approval_request) → {string}
Return a fully-qualified folderApprovalRequest resource name string.
Parameters:
Name | Type | Description |
---|---|---|
folder |
string | |
approval_request |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
folderServiceAccountPath(folder) → {string}
Return a fully-qualified folderServiceAccount resource name string.
Parameters:
Name | Type | Description |
---|---|---|
folder |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
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. |
listApprovalRequestsAsync(request, optionsopt) → {Object}
Equivalent to listApprovalRequests
, 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 ApprovalRequest. 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.
*/
/**
* The parent resource. This may be "projects/{project}",
* "folders/{folder}", or "organizations/{organization}".
*/
// const parent = 'abc123'
/**
* A filter on the type of approval requests to retrieve. Must be one of the
* following values:
* * not set: Requests that are pending or have active approvals.
* * ALL: All requests.
* * PENDING: Only pending requests.
* * ACTIVE: Only active (i.e. currently approved) requests.
* * DISMISSED: Only requests that have been dismissed, or requests that
* are not approved and past expiration.
* * EXPIRED: Only requests that have been approved, and the approval has
* expired.
* * HISTORY: Active, dismissed and expired requests.
*/
// const filter = 'abc123'
/**
* Requested page size.
*/
// const pageSize = 1234
/**
* A token identifying the page of results to return.
*/
// const pageToken = 'abc123'
// Imports the Accessapproval library
const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;
// Instantiates a client
const accessapprovalClient = new AccessApprovalClient();
async function callListApprovalRequests() {
// Construct request
const request = {
};
// Run request
const iterable = accessapprovalClient.listApprovalRequestsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListApprovalRequests();
listApprovalRequestsStream(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 ApprovalRequest 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 |
matchApprovalRequestFromFolderApprovalRequestName(folderApprovalRequestName) → {string}
Parse the approval_request from FolderApprovalRequest resource.
Parameters:
Name | Type | Description |
---|---|---|
folderApprovalRequestName |
string |
A fully-qualified path representing folder_approval_request resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the approval_request. |
matchApprovalRequestFromOrganizationApprovalRequestName(organizationApprovalRequestName) → {string}
Parse the approval_request from OrganizationApprovalRequest resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationApprovalRequestName |
string |
A fully-qualified path representing organization_approval_request resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the approval_request. |
matchApprovalRequestFromProjectApprovalRequestName(projectApprovalRequestName) → {string}
Parse the approval_request from ProjectApprovalRequest resource.
Parameters:
Name | Type | Description |
---|---|---|
projectApprovalRequestName |
string |
A fully-qualified path representing project_approval_request resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the approval_request. |
matchFolderFromFolderAccessApprovalSettingsName(folderAccessApprovalSettingsName) → {string}
Parse the folder from FolderAccessApprovalSettings resource.
Parameters:
Name | Type | Description |
---|---|---|
folderAccessApprovalSettingsName |
string |
A fully-qualified path representing folder_accessApprovalSettings resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the folder. |
matchFolderFromFolderApprovalRequestName(folderApprovalRequestName) → {string}
Parse the folder from FolderApprovalRequest resource.
Parameters:
Name | Type | Description |
---|---|---|
folderApprovalRequestName |
string |
A fully-qualified path representing folder_approval_request resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the folder. |
matchFolderFromFolderServiceAccountName(folderServiceAccountName) → {string}
Parse the folder from FolderServiceAccount resource.
Parameters:
Name | Type | Description |
---|---|---|
folderServiceAccountName |
string |
A fully-qualified path representing folder_serviceAccount resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the folder. |
matchOrganizationFromOrganizationAccessApprovalSettingsName(organizationAccessApprovalSettingsName) → {string}
Parse the organization from OrganizationAccessApprovalSettings resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationAccessApprovalSettingsName |
string |
A fully-qualified path representing organization_accessApprovalSettings resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the organization. |
matchOrganizationFromOrganizationApprovalRequestName(organizationApprovalRequestName) → {string}
Parse the organization from OrganizationApprovalRequest resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationApprovalRequestName |
string |
A fully-qualified path representing organization_approval_request resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the organization. |
matchOrganizationFromOrganizationServiceAccountName(organizationServiceAccountName) → {string}
Parse the organization from OrganizationServiceAccount resource.
Parameters:
Name | Type | Description |
---|---|---|
organizationServiceAccountName |
string |
A fully-qualified path representing organization_serviceAccount resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the organization. |
matchProjectFromProjectAccessApprovalSettingsName(projectAccessApprovalSettingsName) → {string}
Parse the project from ProjectAccessApprovalSettings resource.
Parameters:
Name | Type | Description |
---|---|---|
projectAccessApprovalSettingsName |
string |
A fully-qualified path representing project_accessApprovalSettings resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectApprovalRequestName(projectApprovalRequestName) → {string}
Parse the project from ProjectApprovalRequest resource.
Parameters:
Name | Type | Description |
---|---|---|
projectApprovalRequestName |
string |
A fully-qualified path representing project_approval_request 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. |
matchProjectFromProjectServiceAccountName(projectServiceAccountName) → {string}
Parse the project from ProjectServiceAccount resource.
Parameters:
Name | Type | Description |
---|---|---|
projectServiceAccountName |
string |
A fully-qualified path representing project_serviceAccount resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
organizationAccessApprovalSettingsPath(organization) → {string}
Return a fully-qualified organizationAccessApprovalSettings resource name string.
Parameters:
Name | Type | Description |
---|---|---|
organization |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
organizationApprovalRequestPath(organization, approval_request) → {string}
Return a fully-qualified organizationApprovalRequest resource name string.
Parameters:
Name | Type | Description |
---|---|---|
organization |
string | |
approval_request |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
organizationServiceAccountPath(organization) → {string}
Return a fully-qualified organizationServiceAccount resource name string.
Parameters:
Name | Type | Description |
---|---|---|
organization |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectAccessApprovalSettingsPath(project) → {string}
Return a fully-qualified projectAccessApprovalSettings resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectApprovalRequestPath(project, approval_request) → {string}
Return a fully-qualified projectApprovalRequest resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
approval_request |
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. |
projectServiceAccountPath(project) → {string}
Return a fully-qualified projectServiceAccount resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |