ServiceAccountCredentialsBuilder

ServiceAccountCredentialsBuilder

Builds a ServiceAccountCredentials instance.

Methods

withClientId(clientIdnon-null) → {ServiceAccountCredentialsBuilder}

Set Client ID (API Key)

Parameters:
Name Type Description
clientId String

Client Id (API Key)

Returns:

This Builder instance to add any additional parameters.

Type
ServiceAccountCredentialsBuilder

withClientSecret(clientSecretnon-null) → {ServiceAccountCredentialsBuilder}

Set Client Secret

Parameters:
Name Type Description
clientSecret String

Client Secret

Returns:

This Builder instance to add any additional parameters.

Type
ServiceAccountCredentialsBuilder

withPrivateKey(privateKeynon-null) → {ServiceAccountCredentialsBuilder}

Set private key

Parameters:
Name Type Description
privateKey String

Content of the Private Key (PEM format)

Returns:

This Builder instance to add any additional parameters.

Type
ServiceAccountCredentialsBuilder

withOrganizationId(organizationIdnon-null) → {ServiceAccountCredentialsBuilder}

Set Organization Id (format: org_ident@AdobeOrg) that has been configured for access to DC Services

Parameters:
Name Type Description
organizationId String

Organization ID (format: org_ident@AdobeOrg)

Returns:

This Builder instance to add any additional parameters.

Type
ServiceAccountCredentialsBuilder

withAccountId(accountIdnon-null) → {ServiceAccountCredentialsBuilder}

Set Account Id (format: id@techacct.adobe.com)

Parameters:
Name Type Description
accountId String

Account ID (format: id@techacct.adobe.com)

Returns:

This Builder instance to add any additional parameters.

Type
ServiceAccountCredentialsBuilder

fromFile(credentialsFilePathnon-null) → {ServiceAccountCredentialsBuilder}

Sets Service Account Credentials using the JSON credentials file path. All the keys in the JSON structure are optional.

JSON structure:

{
  "client_credentials": {
    "client_id": "CLIENT_ID",
    "client_secret": "CLIENT_SECRET"
  },
  "service_account_credentials": {
    "organization_id": "org_ident@AdobeOrg",
    "account_id": "id@techacct.adobe.com",
    "private_key_file": "private.key"
  }
}
private_key_file is the path of private key file. It will be looked up in the classpath and the directory of JSON credentials file.
Parameters:
Name Type Description
credentialsFilePath String

JSON credentials file path

Returns:

This Builder instance to add any additional parameters.

Type
ServiceAccountCredentialsBuilder

build() → {ServiceAccountCredentials}

Returns a new ServiceAccountCredentials instance built from the current state of this builder.

Returns:

A ServiceAccountCredentials instance.

Type
ServiceAccountCredentials