Class v1.IdentityAwareProxyAdminServiceClient (1.1.1)

APIs for Identity-Aware Proxy Admin configurations. v1

Package

@google-cloud/iap

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of IdentityAwareProxyAdminServiceClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

identityAwareProxyAdminServiceStub

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

innerApiCalls

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

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.

warn

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

Methods

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.

getIamPolicy(request, options)

getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.IGetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Gets the access control policy for an Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api

Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  OPTIONAL: A `GetPolicyOptions` object for specifying options to
   *  `GetIamPolicy`. This field is only used by Cloud IAM.
   */
  // const options = {}

  // Imports the Iap library
  const {IdentityAwareProxyAdminServiceClient} =
    require('@google-cloud/iap').v1;

  // Instantiates a client
  const iapClient = new IdentityAwareProxyAdminServiceClient();

  async function callGetIamPolicy() {
    // Construct request
    const request = {
      resource,
    };

    // Run request
    const response = await iapClient.getIamPolicy(request);
    console.log(response);
  }

  callGetIamPolicy();

getIamPolicy(request, options, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIapSettings(request, options)

getIapSettings(request?: protos.google.cloud.iap.v1.IGetIapSettingsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.iap.v1.IIapSettings,
        protos.google.cloud.iap.v1.IGetIapSettingsRequest | undefined,
        {} | undefined
    ]>;

Gets the IAP settings on a particular IAP protected resource.

Parameters
NameDescription
request protos.google.cloud.iap.v1.IGetIapSettingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IGetIapSettingsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [IapSettings]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name for which to retrieve the settings.
   *  Authorization: Requires the `getSettings` permission for the associated
   *  resource.
   */
  // const name = 'abc123'

  // Imports the Iap library
  const {IdentityAwareProxyAdminServiceClient} =
    require('@google-cloud/iap').v1;

  // Instantiates a client
  const iapClient = new IdentityAwareProxyAdminServiceClient();

  async function callGetIapSettings() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await iapClient.getIapSettings(request);
    console.log(response);
  }

  callGetIapSettings();

getIapSettings(request, options, callback)

getIapSettings(request: protos.google.cloud.iap.v1.IGetIapSettingsRequest, options: CallOptions, callback: Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IGetIapSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.iap.v1.IGetIapSettingsRequest
options CallOptions
callback Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IGetIapSettingsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIapSettings(request, callback)

getIapSettings(request: protos.google.cloud.iap.v1.IGetIapSettingsRequest, callback: Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IGetIapSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.iap.v1.IGetIapSettingsRequest
callback Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IGetIapSettingsRequest | 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.

setIamPolicy(request, options)

setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.ISetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Sets the access control policy for an Identity-Aware Proxy protected resource. Replaces any existing policy. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api

Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being specified.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  REQUIRED: The complete policy to be applied to the `resource`. The size of
   *  the policy is limited to a few 10s of KB. An empty policy is a
   *  valid policy but certain Cloud Platform services (such as Projects)
   *  might reject them.
   */
  // const policy = {}

  // Imports the Iap library
  const {IdentityAwareProxyAdminServiceClient} =
    require('@google-cloud/iap').v1;

  // Instantiates a client
  const iapClient = new IdentityAwareProxyAdminServiceClient();

  async function callSetIamPolicy() {
    // Construct request
    const request = {
      resource,
      policy,
    };

    // Run request
    const response = await iapClient.setIamPolicy(request);
    console.log(response);
  }

  callSetIamPolicy();

setIamPolicy(request, options, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, options)

testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.ITestIamPermissionsResponse,
        protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
        {} | undefined
    ]>;

Returns permissions that a caller has on the Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api

Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [TestIamPermissionsResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy detail is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  The set of permissions to check for the `resource`. Permissions with
   *  wildcards (such as '*' or 'storage.*') are not allowed. For more
   *  information see
   *  IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
   */
  // const permissions = 'abc123'

  // Imports the Iap library
  const {IdentityAwareProxyAdminServiceClient} =
    require('@google-cloud/iap').v1;

  // Instantiates a client
  const iapClient = new IdentityAwareProxyAdminServiceClient();

  async function callTestIamPermissions() {
    // Construct request
    const request = {
      resource,
      permissions,
    };

    // Run request
    const response = await iapClient.testIamPermissions(request);
    console.log(response);
  }

  callTestIamPermissions();

testIamPermissions(request, options, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
options CallOptions
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateIapSettings(request, options)

updateIapSettings(request?: protos.google.cloud.iap.v1.IUpdateIapSettingsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.iap.v1.IIapSettings,
        protos.google.cloud.iap.v1.IUpdateIapSettingsRequest | undefined,
        {} | undefined
    ]>;

Updates the IAP settings on a particular IAP protected resource. It replaces all fields unless the update_mask is set.

Parameters
NameDescription
request protos.google.cloud.iap.v1.IUpdateIapSettingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IUpdateIapSettingsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [IapSettings]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The new values for the IAP settings to be updated.
   *  Authorization: Requires the `updateSettings` permission for the associated
   *  resource.
   */
  // const iapSettings = {}
  /**
   *  The field mask specifying which IAP settings should be updated.
   *  If omitted, the all of the settings are updated. See
   *  https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
   */
  // const updateMask = {}

  // Imports the Iap library
  const {IdentityAwareProxyAdminServiceClient} =
    require('@google-cloud/iap').v1;

  // Instantiates a client
  const iapClient = new IdentityAwareProxyAdminServiceClient();

  async function callUpdateIapSettings() {
    // Construct request
    const request = {
      iapSettings,
    };

    // Run request
    const response = await iapClient.updateIapSettings(request);
    console.log(response);
  }

  callUpdateIapSettings();

updateIapSettings(request, options, callback)

updateIapSettings(request: protos.google.cloud.iap.v1.IUpdateIapSettingsRequest, options: CallOptions, callback: Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IUpdateIapSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.iap.v1.IUpdateIapSettingsRequest
options CallOptions
callback Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IUpdateIapSettingsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateIapSettings(request, callback)

updateIapSettings(request: protos.google.cloud.iap.v1.IUpdateIapSettingsRequest, callback: Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IUpdateIapSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.iap.v1.IUpdateIapSettingsRequest
callback Callback<protos.google.cloud.iap.v1.IIapSettings, protos.google.cloud.iap.v1.IUpdateIapSettingsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void