Class ApiClientBuilder

java.lang.Object
com.commercetools.api.models.api_client.ApiClientBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<ApiClient>

public class ApiClientBuilder extends Object implements io.vrap.rmf.base.client.Builder<ApiClient>
ApiClientBuilder
Example to create an instance using the builder pattern

     ApiClient apiClient = ApiClient.builder()
             .id("{id}")
             .name("{name}")
             .scope("{scope}")
             .build()
 
  • Constructor Details

  • Method Details

    • id

      public ApiClientBuilder id(String id)

      The OAuth2 client_id that can be used to obtain an access token.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • name

      public ApiClientBuilder name(String name)

      Name of the APIClient.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • scope

      public ApiClientBuilder scope(String scope)

      Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

      Parameters:
      scope - value to be set
      Returns:
      Builder
    • secret

      Only shown once in the response of creating the APIClient. This is the OAuth2 client_secret that can be used to obtain an access token.

      Parameters:
      secret - value to be set
      Returns:
      Builder
    • lastUsedAt

      Date of the last day this APIClient was used to obtain an access token.

      Parameters:
      lastUsedAt - value to be set
      Returns:
      Builder
    • deleteAt

      If set, the Client will be deleted on (or shortly after) this point in time.

      Parameters:
      deleteAt - value to be set
      Returns:
      Builder
    • createdAt

      Date and time (UTC) the APIClient was initially created at.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • accessTokenValiditySeconds

      public ApiClientBuilder accessTokenValiditySeconds(@Nullable Integer accessTokenValiditySeconds)

      Expiration time in seconds for each access token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

      Parameters:
      accessTokenValiditySeconds - value to be set
      Returns:
      Builder
    • refreshTokenValiditySeconds

      public ApiClientBuilder refreshTokenValiditySeconds(@Nullable Integer refreshTokenValiditySeconds)

      Inactivity expiration time in seconds for each refresh token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

      Parameters:
      refreshTokenValiditySeconds - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      The OAuth2 client_id that can be used to obtain an access token.

      Returns:
      id
    • getName

      public String getName()

      Name of the APIClient.

      Returns:
      name
    • getScope

      public String getScope()

      Whitespace-separated list of OAuth scopes that can be used when obtaining an access token.

      Returns:
      scope
    • getSecret

      Only shown once in the response of creating the APIClient. This is the OAuth2 client_secret that can be used to obtain an access token.

      Returns:
      secret
    • getLastUsedAt

      Date of the last day this APIClient was used to obtain an access token.

      Returns:
      lastUsedAt
    • getDeleteAt

      If set, the Client will be deleted on (or shortly after) this point in time.

      Returns:
      deleteAt
    • getCreatedAt

      Date and time (UTC) the APIClient was initially created at.

      Returns:
      createdAt
    • getAccessTokenValiditySeconds

      Expiration time in seconds for each access token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

      Returns:
      accessTokenValiditySeconds
    • getRefreshTokenValiditySeconds

      Inactivity expiration time in seconds for each refresh token obtained by the APIClient. Only present when set with the APIClientDraft. If not present the default value applies.

      Returns:
      refreshTokenValiditySeconds
    • build

      public ApiClient build()
      builds ApiClient with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<ApiClient>
      Returns:
      ApiClient
    • buildUnchecked

      builds ApiClient without checking for non-null required values
      Returns:
      ApiClient
    • of

      public static ApiClientBuilder of()
      factory method for an instance of ApiClientBuilder
      Returns:
      builder
    • of

      public static ApiClientBuilder of(ApiClient template)
      create builder for ApiClient instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder