Class v1.AccessApprovalClient (3.2.0)

This API allows a customer to manage accesses to cloud resources by Google personnel. It defines the following resource model:

  • The API has a collection of ApprovalRequest resources, named approvalRequests/{approval_request} - The API has top-level settings per Project/Folder/Organization, named accessApprovalSettings

The service also periodically emails a list of recipients, defined at the Project/Folder/Organization level in the accessApprovalSettings, when there is a pending ApprovalRequest for them to act on. The ApprovalRequests can also optionally be published to a Pub/Sub topic owned by the customer (contact support if you would like to enable Pub/Sub notifications).

ApprovalRequests can be approved or dismissed. Google personnel can only access the indicated resource or resources if the request is approved (subject to some exclusions: https://cloud.google.com/access-approval/docs/overview#exclusions).

Note: Using Access Approval functionality will mean that Google may not be able to meet the SLAs for your chosen products, as any support response times may be dramatically increased. As such the SLAs do not apply to any service disruption to the extent impacted by Customer's use of Access Approval. Do not enable Access Approval for projects where you may require high service availability and rapid response by Google Cloud Support.

After a request is approved or dismissed, no further action may be taken on it. Requests with the requested_expiration in the past or with no activity for 14 days are considered dismissed. When an approval expires, the request is considered dismissed.

If a request is not approved or dismissed, we call it pending. v1

Package

@google-cloud/access-approval

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of AccessApprovalClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new AccessApprovalClient({fallback: true}, gax); ```

Properties

accessApprovalStub

accessApprovalStub?: Promise<{
        [name: string]: Function;
    }>;

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

approveApprovalRequest(request, options)

approveApprovalRequest(request?: protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IApprovalRequest,
        (protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage | undefined),
        {} | undefined
    ]>;

Approves a request and returns the updated ApprovalRequest.

Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
request IApproveApprovalRequestMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IApprovalRequest, (protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ApprovalRequest. 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.
   */
  /**
   *  Name of the approval request to approve.
   */
  // const name = 'abc123'
  /**
   *  The expiration time of this approval.
   */
  // const expireTime = {}

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callApproveApprovalRequest() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.approveApprovalRequest(request);
    console.log(response);
  }

  callApproveApprovalRequest();

approveApprovalRequest(request, options, callback)

approveApprovalRequest(request: protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage, options: CallOptions, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IApproveApprovalRequestMessage
options CallOptions
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

approveApprovalRequest(request, callback)

approveApprovalRequest(request: protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IApproveApprovalRequestMessage
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

deleteAccessApprovalSettings(request, options)

deleteAccessApprovalSettings(request?: protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage | undefined),
        {} | undefined
    ]>;

Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

Parameters
NameDescription
request IDeleteAccessApprovalSettingsMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. 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.
   */
  /**
   *  Name of the AccessApprovalSettings to delete.
   */
  // const name = 'abc123'

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callDeleteAccessApprovalSettings() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.deleteAccessApprovalSettings(request);
    console.log(response);
  }

  callDeleteAccessApprovalSettings();

deleteAccessApprovalSettings(request, options, callback)

deleteAccessApprovalSettings(request: protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteAccessApprovalSettingsMessage
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteAccessApprovalSettings(request, callback)

deleteAccessApprovalSettings(request: protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteAccessApprovalSettingsMessage
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

dismissApprovalRequest(request, options)

dismissApprovalRequest(request?: protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IApprovalRequest,
        (protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage | undefined),
        {} | undefined
    ]>;

Dismisses a request. Returns the updated ApprovalRequest.

NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether.

Returns NOT_FOUND if the request does not exist.

Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
request IDismissApprovalRequestMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IApprovalRequest, (protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ApprovalRequest. 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.
   */
  /**
   *  Name of the ApprovalRequest to dismiss.
   */
  // const name = 'abc123'

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callDismissApprovalRequest() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.dismissApprovalRequest(request);
    console.log(response);
  }

  callDismissApprovalRequest();

dismissApprovalRequest(request, options, callback)

dismissApprovalRequest(request: protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage, options: CallOptions, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDismissApprovalRequestMessage
options CallOptions
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

dismissApprovalRequest(request, callback)

dismissApprovalRequest(request: protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDismissApprovalRequestMessage
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

folderAccessApprovalSettingsPath(folder)

folderAccessApprovalSettingsPath(folder: string): string;

Return a fully-qualified folderAccessApprovalSettings resource name string.

Parameter
NameDescription
folder string
Returns
TypeDescription
string

{string} Resource name string.

folderApprovalRequestPath(folder, approvalRequest)

folderApprovalRequestPath(folder: string, approvalRequest: string): string;

Return a fully-qualified folderApprovalRequest resource name string.

Parameters
NameDescription
folder string
approvalRequest string
Returns
TypeDescription
string

{string} Resource name string.

folderServiceAccountPath(folder)

folderServiceAccountPath(folder: string): string;

Return a fully-qualified folderServiceAccount resource name string.

Parameter
NameDescription
folder string
Returns
TypeDescription
string

{string} Resource name string.

getAccessApprovalServiceAccount(request, options)

getAccessApprovalServiceAccount(request?: protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount,
        (protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage | undefined),
        {} | undefined
    ]>;

Retrieves the service account that is used by Access Approval to access KMS keys for signing approved approval requests.

Parameters
NameDescription
request IGetAccessApprovalServiceAccountMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount, (protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AccessApprovalServiceAccount. 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.
   */
  /**
   *  Name of the AccessApprovalServiceAccount to retrieve.
   */
  // const name = 'abc123'

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callGetAccessApprovalServiceAccount() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.getAccessApprovalServiceAccount(request);
    console.log(response);
  }

  callGetAccessApprovalServiceAccount();

getAccessApprovalServiceAccount(request, options, callback)

getAccessApprovalServiceAccount(request: protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage, options: CallOptions, callback: Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount, protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetAccessApprovalServiceAccountMessage
options CallOptions
callback Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount, protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getAccessApprovalServiceAccount(request, callback)

getAccessApprovalServiceAccount(request: protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage, callback: Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount, protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetAccessApprovalServiceAccountMessage
callback Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount, protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getAccessApprovalSettings(request, options)

getAccessApprovalSettings(request?: protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IAccessApprovalSettings,
        (protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage | undefined),
        {} | undefined
    ]>;

Gets the settings associated with a project, folder, or organization.

Parameters
NameDescription
request IGetAccessApprovalSettingsMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, (protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AccessApprovalSettings. 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 name of the AccessApprovalSettings to retrieve.
   *  Format: "{projects|folders|organizations}/{id}/accessApprovalSettings"
   */
  // const name = 'abc123'

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callGetAccessApprovalSettings() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.getAccessApprovalSettings(request);
    console.log(response);
  }

  callGetAccessApprovalSettings();

getAccessApprovalSettings(request, options, callback)

getAccessApprovalSettings(request: protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage, options: CallOptions, callback: Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetAccessApprovalSettingsMessage
options CallOptions
callback Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getAccessApprovalSettings(request, callback)

getAccessApprovalSettings(request: protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage, callback: Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetAccessApprovalSettingsMessage
callback Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getApprovalRequest(request, options)

getApprovalRequest(request?: protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IApprovalRequest,
        (protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage | undefined),
        {} | undefined
    ]>;

Gets an approval request. Returns NOT_FOUND if the request does not exist.

Parameters
NameDescription
request IGetApprovalRequestMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IApprovalRequest, (protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ApprovalRequest. 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 name of the approval request to retrieve.
   *  Format:
   *  "{projects|folders|organizations}/{id}/approvalRequests/{approval_request}"
   */
  // const name = 'abc123'

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callGetApprovalRequest() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.getApprovalRequest(request);
    console.log(response);
  }

  callGetApprovalRequest();

getApprovalRequest(request, options, callback)

getApprovalRequest(request: protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage, options: CallOptions, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetApprovalRequestMessage
options CallOptions
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getApprovalRequest(request, callback)

getApprovalRequest(request: protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetApprovalRequestMessage
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

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
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

invalidateApprovalRequest(request, options)

invalidateApprovalRequest(request?: protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IApprovalRequest,
        (protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage | undefined),
        {} | undefined
    ]>;

Invalidates an existing ApprovalRequest. Returns the updated ApprovalRequest.

NOTE: This does not deny access to the resource if another request has been made and approved. It only invalidates a single approval.

Returns FAILED_PRECONDITION if the request exists but is not in an approved state.

Parameters
NameDescription
request IInvalidateApprovalRequestMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IApprovalRequest, (protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ApprovalRequest. 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.
   */
  /**
   *  Name of the ApprovalRequest to invalidate.
   */
  // const name = 'abc123'

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callInvalidateApprovalRequest() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.invalidateApprovalRequest(request);
    console.log(response);
  }

  callInvalidateApprovalRequest();

invalidateApprovalRequest(request, options, callback)

invalidateApprovalRequest(request: protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage, options: CallOptions, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IInvalidateApprovalRequestMessage
options CallOptions
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

invalidateApprovalRequest(request, callback)

invalidateApprovalRequest(request: protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage, callback: Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IInvalidateApprovalRequestMessage
callback Callback<protos.google.cloud.accessapproval.v1.IApprovalRequest, protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

listApprovalRequests(request, options)

listApprovalRequests(request?: protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IApprovalRequest[],
        protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage | null,
        protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse
    ]>;

Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.

Parameters
NameDescription
request IListApprovalRequestsMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IApprovalRequest[], protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage | null, protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of ApprovalRequest. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listApprovalRequestsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listApprovalRequests(request, options, callback)

listApprovalRequests(request: protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, options: CallOptions, callback: PaginationCallback<protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse | null | undefined, protos.google.cloud.accessapproval.v1.IApprovalRequest>): void;
Parameters
NameDescription
request IListApprovalRequestsMessage
options CallOptions
callback PaginationCallback<protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse | null | undefined, protos.google.cloud.accessapproval.v1.IApprovalRequest>
Returns
TypeDescription
void

listApprovalRequests(request, callback)

listApprovalRequests(request: protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, callback: PaginationCallback<protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse | null | undefined, protos.google.cloud.accessapproval.v1.IApprovalRequest>): void;
Parameters
NameDescription
request IListApprovalRequestsMessage
callback PaginationCallback<protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse | null | undefined, protos.google.cloud.accessapproval.v1.IApprovalRequest>
Returns
TypeDescription
void

listApprovalRequestsAsync(request, options)

listApprovalRequestsAsync(request?: protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, options?: CallOptions): AsyncIterable<protos.google.cloud.accessapproval.v1.IApprovalRequest>;

Equivalent to listApprovalRequests, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListApprovalRequestsMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.accessapproval.v1.IApprovalRequest>

{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, options)

listApprovalRequestsStream(request?: protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListApprovalRequestsMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{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 listApprovalRequestsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

matchApprovalRequestFromFolderApprovalRequestName(folderApprovalRequestName)

matchApprovalRequestFromFolderApprovalRequestName(folderApprovalRequestName: string): string | number;

Parse the approval_request from FolderApprovalRequest resource.

Parameter
NameDescription
folderApprovalRequestName string

A fully-qualified path representing folder_approval_request resource.

Returns
TypeDescription
string | number

{string} A string representing the approval_request.

matchApprovalRequestFromOrganizationApprovalRequestName(organizationApprovalRequestName)

matchApprovalRequestFromOrganizationApprovalRequestName(organizationApprovalRequestName: string): string | number;

Parse the approval_request from OrganizationApprovalRequest resource.

Parameter
NameDescription
organizationApprovalRequestName string

A fully-qualified path representing organization_approval_request resource.

Returns
TypeDescription
string | number

{string} A string representing the approval_request.

matchApprovalRequestFromProjectApprovalRequestName(projectApprovalRequestName)

matchApprovalRequestFromProjectApprovalRequestName(projectApprovalRequestName: string): string | number;

Parse the approval_request from ProjectApprovalRequest resource.

Parameter
NameDescription
projectApprovalRequestName string

A fully-qualified path representing project_approval_request resource.

Returns
TypeDescription
string | number

{string} A string representing the approval_request.

matchFolderFromFolderAccessApprovalSettingsName(folderAccessApprovalSettingsName)

matchFolderFromFolderAccessApprovalSettingsName(folderAccessApprovalSettingsName: string): string | number;

Parse the folder from FolderAccessApprovalSettings resource.

Parameter
NameDescription
folderAccessApprovalSettingsName string

A fully-qualified path representing folder_accessApprovalSettings resource.

Returns
TypeDescription
string | number

{string} A string representing the folder.

matchFolderFromFolderApprovalRequestName(folderApprovalRequestName)

matchFolderFromFolderApprovalRequestName(folderApprovalRequestName: string): string | number;

Parse the folder from FolderApprovalRequest resource.

Parameter
NameDescription
folderApprovalRequestName string

A fully-qualified path representing folder_approval_request resource.

Returns
TypeDescription
string | number

{string} A string representing the folder.

matchFolderFromFolderServiceAccountName(folderServiceAccountName)

matchFolderFromFolderServiceAccountName(folderServiceAccountName: string): string | number;

Parse the folder from FolderServiceAccount resource.

Parameter
NameDescription
folderServiceAccountName string

A fully-qualified path representing folder_serviceAccount resource.

Returns
TypeDescription
string | number

{string} A string representing the folder.

matchOrganizationFromOrganizationAccessApprovalSettingsName(organizationAccessApprovalSettingsName)

matchOrganizationFromOrganizationAccessApprovalSettingsName(organizationAccessApprovalSettingsName: string): string | number;

Parse the organization from OrganizationAccessApprovalSettings resource.

Parameter
NameDescription
organizationAccessApprovalSettingsName string

A fully-qualified path representing organization_accessApprovalSettings resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationApprovalRequestName(organizationApprovalRequestName)

matchOrganizationFromOrganizationApprovalRequestName(organizationApprovalRequestName: string): string | number;

Parse the organization from OrganizationApprovalRequest resource.

Parameter
NameDescription
organizationApprovalRequestName string

A fully-qualified path representing organization_approval_request resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationServiceAccountName(organizationServiceAccountName)

matchOrganizationFromOrganizationServiceAccountName(organizationServiceAccountName: string): string | number;

Parse the organization from OrganizationServiceAccount resource.

Parameter
NameDescription
organizationServiceAccountName string

A fully-qualified path representing organization_serviceAccount resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchProjectFromProjectAccessApprovalSettingsName(projectAccessApprovalSettingsName)

matchProjectFromProjectAccessApprovalSettingsName(projectAccessApprovalSettingsName: string): string | number;

Parse the project from ProjectAccessApprovalSettings resource.

Parameter
NameDescription
projectAccessApprovalSettingsName string

A fully-qualified path representing project_accessApprovalSettings resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectApprovalRequestName(projectApprovalRequestName)

matchProjectFromProjectApprovalRequestName(projectApprovalRequestName: string): string | number;

Parse the project from ProjectApprovalRequest resource.

Parameter
NameDescription
projectApprovalRequestName string

A fully-qualified path representing project_approval_request resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectServiceAccountName(projectServiceAccountName)

matchProjectFromProjectServiceAccountName(projectServiceAccountName: string): string | number;

Parse the project from ProjectServiceAccount resource.

Parameter
NameDescription
projectServiceAccountName string

A fully-qualified path representing project_serviceAccount resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

organizationAccessApprovalSettingsPath(organization)

organizationAccessApprovalSettingsPath(organization: string): string;

Return a fully-qualified organizationAccessApprovalSettings resource name string.

Parameter
NameDescription
organization string
Returns
TypeDescription
string

{string} Resource name string.

organizationApprovalRequestPath(organization, approvalRequest)

organizationApprovalRequestPath(organization: string, approvalRequest: string): string;

Return a fully-qualified organizationApprovalRequest resource name string.

Parameters
NameDescription
organization string
approvalRequest string
Returns
TypeDescription
string

{string} Resource name string.

organizationServiceAccountPath(organization)

organizationServiceAccountPath(organization: string): string;

Return a fully-qualified organizationServiceAccount resource name string.

Parameter
NameDescription
organization string
Returns
TypeDescription
string

{string} Resource name string.

projectAccessApprovalSettingsPath(project)

projectAccessApprovalSettingsPath(project: string): string;

Return a fully-qualified projectAccessApprovalSettings resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

projectApprovalRequestPath(project, approvalRequest)

projectApprovalRequestPath(project: string, approvalRequest: string): string;

Return a fully-qualified projectApprovalRequest resource name string.

Parameters
NameDescription
project string
approvalRequest string
Returns
TypeDescription
string

{string} Resource name string.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

projectServiceAccountPath(project)

projectServiceAccountPath(project: string): string;

Return a fully-qualified projectServiceAccount resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

updateAccessApprovalSettings(request, options)

updateAccessApprovalSettings(request?: protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage, options?: CallOptions): Promise<[
        protos.google.cloud.accessapproval.v1.IAccessApprovalSettings,
        (protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage | undefined),
        {} | undefined
    ]>;

Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask.

Parameters
NameDescription
request IUpdateAccessApprovalSettingsMessage

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, (protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AccessApprovalSettings. 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 new AccessApprovalSettings.
   */
  // const settings = {}
  /**
   *  The update mask applies to the settings. Only the top level fields of
   *  AccessApprovalSettings (notification_emails & enrolled_services) are
   *  supported. For each field, if it is included, the currently stored value
   *  will be entirely overwritten with the value of the field passed in this
   *  request.
   *  For the `FieldMask` definition, see
   *  https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
   *  If this field is left unset, only the notification_emails field will be
   *  updated.
   */
  // const updateMask = {}

  // Imports the Accessapproval library
  const {AccessApprovalClient} = require('@google-cloud/access-approval').v1;

  // Instantiates a client
  const accessapprovalClient = new AccessApprovalClient();

  async function callUpdateAccessApprovalSettings() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await accessapprovalClient.updateAccessApprovalSettings(request);
    console.log(response);
  }

  callUpdateAccessApprovalSettings();

updateAccessApprovalSettings(request, options, callback)

updateAccessApprovalSettings(request: protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage, options: CallOptions, callback: Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateAccessApprovalSettingsMessage
options CallOptions
callback Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateAccessApprovalSettings(request, callback)

updateAccessApprovalSettings(request: protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage, callback: Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateAccessApprovalSettingsMessage
callback Callback<protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage | null | undefined, {} | null | undefined>
Returns
TypeDescription
void