AccessTokenAuthentication Class

public final class AccessTokenAuthentication
extends Authentication

The environment authentication details.

Constructor Summary

Constructor Description
AccessTokenAuthentication()

Creates an instance of AccessTokenAuthentication class.

Method Summary

Modifier and Type Method and Description
String accessToken()

Get the accessToken property: The access token that will be used while authenticating with the onboarded environment.

AuthenticationType authenticationType()

Get the authenticationType property: The authentication type.

static AccessTokenAuthentication fromJson(JsonReader jsonReader)

Reads an instance of AccessTokenAuthentication from the JsonReader.

JsonWriter toJson(JsonWriter jsonWriter)
String username()

Get the username property: The user name that will be used while authenticating with the onboarded environment.

void validate()

Validates the instance.

AccessTokenAuthentication withAccessToken(String accessToken)

Set the accessToken property: The access token that will be used while authenticating with the onboarded environment.

AccessTokenAuthentication withUsername(String username)

Set the username property: The user name that will be used while authenticating with the onboarded environment.

Methods inherited from Authentication

Methods inherited from java.lang.Object

Constructor Details

AccessTokenAuthentication

public AccessTokenAuthentication()

Creates an instance of AccessTokenAuthentication class.

Method Details

accessToken

public String accessToken()

Get the accessToken property: The access token that will be used while authenticating with the onboarded environment.

Returns:

the accessToken value.

authenticationType

public AuthenticationType authenticationType()

Get the authenticationType property: The authentication type.

Overrides:

AccessTokenAuthentication.authenticationType()

Returns:

the authenticationType value.

fromJson

public static AccessTokenAuthentication fromJson(JsonReader jsonReader)

Reads an instance of AccessTokenAuthentication from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AccessTokenAuthentication if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the AccessTokenAuthentication.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

AccessTokenAuthentication.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

username

public String username()

Get the username property: The user name that will be used while authenticating with the onboarded environment.

Returns:

the username value.

validate

public void validate()

Validates the instance.

Overrides:

AccessTokenAuthentication.validate()

withAccessToken

public AccessTokenAuthentication withAccessToken(String accessToken)

Set the accessToken property: The access token that will be used while authenticating with the onboarded environment.

Parameters:

accessToken - the accessToken value to set.

Returns:

the AccessTokenAuthentication object itself.

withUsername

public AccessTokenAuthentication withUsername(String username)

Set the username property: The user name that will be used while authenticating with the onboarded environment.

Parameters:

username - the username value to set.

Returns:

the AccessTokenAuthentication object itself.

Applies to