Class v1.IAMCredentialsClient

A service account is a special type of Google account that belongs to your application or a virtual machine (VM), instead of to an individual end user. Your application assumes the identity of the service account to call Google APIs, so that the users aren't directly involved.

Service account credentials are used to temporarily assume the identity of the service account. Supported credential types include OAuth 2.0 access tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and more. v1

Package

@google-cloud/iam-credentials!

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of IAMCredentialsClient.

Parameter
TypeNameDescription
ClientOptionsopts

Properties

apiEndpoint

static get apiEndpoint(): string;

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

Property Value
TypeDescription
string

auth

auth: gax.GoogleAuth;
Property Value
TypeDescription
gax.GoogleAuth

descriptors

descriptors: Descriptors;
Property Value
TypeDescription
Descriptors

iAMCredentialsStub

iAMCredentialsStub?: Promise<{
        [name: string]: Function;
    }>;
Property Value
TypeDescription
Promise<{ [name: string]: Function; }>

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };
Property Value
TypeDescription
{ [name: string]: Function; }

port

static get port(): number;

The port for this API service.

Property Value
TypeDescription
number

scopes

static get scopes(): string[];

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

Property Value
TypeDescription
string[]

servicePath

static get servicePath(): string;

The DNS address for this API service.

Property Value
TypeDescription
string

warn

warn: (code: string, message: string, warnType?: string) => void;
Property Value
TypeDescription
(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.

generateAccessToken(request, options)

generateAccessToken(request?: protos.google.iam.credentials.v1.IGenerateAccessTokenRequest, options?: CallOptions): Promise<[
        protos.google.iam.credentials.v1.IGenerateAccessTokenResponse,
        protos.google.iam.credentials.v1.IGenerateAccessTokenRequest | undefined,
        {} | undefined
    ]>;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.IGenerateAccessTokenRequestrequest
CallOptionsoptions
Returns
TypeDescription
Promise<[ protos.google.iam.credentials.v1.IGenerateAccessTokenResponse, protos.google.iam.credentials.v1.IGenerateAccessTokenRequest | undefined, {} | undefined ]>

generateAccessToken(request, options, callback)

generateAccessToken(request: protos.google.iam.credentials.v1.IGenerateAccessTokenRequest, options: CallOptions, callback: Callback<protos.google.iam.credentials.v1.IGenerateAccessTokenResponse, protos.google.iam.credentials.v1.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.IGenerateAccessTokenRequestrequest
CallOptionsoptions
Callback<protos.google.iam.credentials.v1.IGenerateAccessTokenResponse, protos.google.iam.credentials.v1.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void

generateAccessToken(request, callback)

generateAccessToken(request: protos.google.iam.credentials.v1.IGenerateAccessTokenRequest, callback: Callback<protos.google.iam.credentials.v1.IGenerateAccessTokenResponse, protos.google.iam.credentials.v1.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.IGenerateAccessTokenRequestrequest
Callback<protos.google.iam.credentials.v1.IGenerateAccessTokenResponse, protos.google.iam.credentials.v1.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void

generateIdToken(request, options)

generateIdToken(request?: protos.google.iam.credentials.v1.IGenerateIdTokenRequest, options?: CallOptions): Promise<[
        protos.google.iam.credentials.v1.IGenerateIdTokenResponse,
        protos.google.iam.credentials.v1.IGenerateIdTokenRequest | undefined,
        {} | undefined
    ]>;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.IGenerateIdTokenRequestrequest
CallOptionsoptions
Returns
TypeDescription
Promise<[ protos.google.iam.credentials.v1.IGenerateIdTokenResponse, protos.google.iam.credentials.v1.IGenerateIdTokenRequest | undefined, {} | undefined ]>

generateIdToken(request, options, callback)

generateIdToken(request: protos.google.iam.credentials.v1.IGenerateIdTokenRequest, options: CallOptions, callback: Callback<protos.google.iam.credentials.v1.IGenerateIdTokenResponse, protos.google.iam.credentials.v1.IGenerateIdTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.IGenerateIdTokenRequestrequest
CallOptionsoptions
Callback<protos.google.iam.credentials.v1.IGenerateIdTokenResponse, protos.google.iam.credentials.v1.IGenerateIdTokenRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void

generateIdToken(request, callback)

generateIdToken(request: protos.google.iam.credentials.v1.IGenerateIdTokenRequest, callback: Callback<protos.google.iam.credentials.v1.IGenerateIdTokenResponse, protos.google.iam.credentials.v1.IGenerateIdTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.IGenerateIdTokenRequestrequest
Callback<protos.google.iam.credentials.v1.IGenerateIdTokenResponse, protos.google.iam.credentials.v1.IGenerateIdTokenRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void

getProjectId()

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

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
TypeNameDescription
Callback<string, undefined, undefined>callback
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.

signBlob(request, options)

signBlob(request?: protos.google.iam.credentials.v1.ISignBlobRequest, options?: CallOptions): Promise<[
        protos.google.iam.credentials.v1.ISignBlobResponse,
        protos.google.iam.credentials.v1.ISignBlobRequest | undefined,
        {} | undefined
    ]>;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.ISignBlobRequestrequest
CallOptionsoptions
Returns
TypeDescription
Promise<[ protos.google.iam.credentials.v1.ISignBlobResponse, protos.google.iam.credentials.v1.ISignBlobRequest | undefined, {} | undefined ]>

signBlob(request, options, callback)

signBlob(request: protos.google.iam.credentials.v1.ISignBlobRequest, options: CallOptions, callback: Callback<protos.google.iam.credentials.v1.ISignBlobResponse, protos.google.iam.credentials.v1.ISignBlobRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.ISignBlobRequestrequest
CallOptionsoptions
Callback<protos.google.iam.credentials.v1.ISignBlobResponse, protos.google.iam.credentials.v1.ISignBlobRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void

signBlob(request, callback)

signBlob(request: protos.google.iam.credentials.v1.ISignBlobRequest, callback: Callback<protos.google.iam.credentials.v1.ISignBlobResponse, protos.google.iam.credentials.v1.ISignBlobRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.ISignBlobRequestrequest
Callback<protos.google.iam.credentials.v1.ISignBlobResponse, protos.google.iam.credentials.v1.ISignBlobRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void

signJwt(request, options)

signJwt(request?: protos.google.iam.credentials.v1.ISignJwtRequest, options?: CallOptions): Promise<[
        protos.google.iam.credentials.v1.ISignJwtResponse,
        protos.google.iam.credentials.v1.ISignJwtRequest | undefined,
        {} | undefined
    ]>;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.ISignJwtRequestrequest
CallOptionsoptions
Returns
TypeDescription
Promise<[ protos.google.iam.credentials.v1.ISignJwtResponse, protos.google.iam.credentials.v1.ISignJwtRequest | undefined, {} | undefined ]>

signJwt(request, options, callback)

signJwt(request: protos.google.iam.credentials.v1.ISignJwtRequest, options: CallOptions, callback: Callback<protos.google.iam.credentials.v1.ISignJwtResponse, protos.google.iam.credentials.v1.ISignJwtRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.ISignJwtRequestrequest
CallOptionsoptions
Callback<protos.google.iam.credentials.v1.ISignJwtResponse, protos.google.iam.credentials.v1.ISignJwtRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void

signJwt(request, callback)

signJwt(request: protos.google.iam.credentials.v1.ISignJwtRequest, callback: Callback<protos.google.iam.credentials.v1.ISignJwtResponse, protos.google.iam.credentials.v1.ISignJwtRequest | null | undefined, {} | null | undefined>): void;
Parameters
TypeNameDescription
protos.google.iam.credentials.v1.ISignJwtRequestrequest
Callback<protos.google.iam.credentials.v1.ISignJwtResponse, protos.google.iam.credentials.v1.ISignJwtRequest | null | undefined, {} | null | undefined>callback
Returns
TypeDescription
void