java.lang.Object
software.amazon.awssdk.services.ssoadmin.model.Grant
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<Grant.Builder,Grant>

@Generated("software.amazon.awssdk:codegen") public final class Grant extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Grant.Builder,Grant>

The Grant union represents the set of possible configuration options for the selected grant type. Exactly one member of the union must be specified, and must match the grant type selected.

See Also:
  • Method Details

    • authorizationCode

      public final AuthorizationCodeGrant authorizationCode()

      Configuration options for the authorization_code grant type.

      Returns:
      Configuration options for the authorization_code grant type.
    • jwtBearer

      public final JwtBearerGrant jwtBearer()

      Configuration options for the urn:ietf:params:oauth:grant-type:jwt-bearer grant type.

      Returns:
      Configuration options for the urn:ietf:params:oauth:grant-type:jwt-bearer grant type.
    • refreshToken

      public final RefreshTokenGrant refreshToken()

      Configuration options for the refresh_token grant type.

      Returns:
      Configuration options for the refresh_token grant type.
    • tokenExchange

      public final TokenExchangeGrant tokenExchange()

      Configuration options for the urn:ietf:params:oauth:grant-type:token-exchange grant type.

      Returns:
      Configuration options for the urn:ietf:params:oauth:grant-type:token-exchange grant type.
    • toBuilder

      public Grant.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<Grant.Builder,Grant>
      Returns:
      a builder for type T
    • builder

      public static Grant.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Grant.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • fromAuthorizationCode

      public static Grant fromAuthorizationCode(AuthorizationCodeGrant authorizationCode)
      Create an instance of this class with authorizationCode() initialized to the given value.

      Configuration options for the authorization_code grant type.

      Parameters:
      authorizationCode - Configuration options for the authorization_code grant type.
    • fromAuthorizationCode

      public static Grant fromAuthorizationCode(Consumer<AuthorizationCodeGrant.Builder> authorizationCode)
      Create an instance of this class with authorizationCode() initialized to the given value.

      Configuration options for the authorization_code grant type.

      Parameters:
      authorizationCode - Configuration options for the authorization_code grant type.
    • fromJwtBearer

      public static Grant fromJwtBearer(JwtBearerGrant jwtBearer)
      Create an instance of this class with jwtBearer() initialized to the given value.

      Configuration options for the urn:ietf:params:oauth:grant-type:jwt-bearer grant type.

      Parameters:
      jwtBearer - Configuration options for the urn:ietf:params:oauth:grant-type:jwt-bearer grant type.
    • fromJwtBearer

      public static Grant fromJwtBearer(Consumer<JwtBearerGrant.Builder> jwtBearer)
      Create an instance of this class with jwtBearer() initialized to the given value.

      Configuration options for the urn:ietf:params:oauth:grant-type:jwt-bearer grant type.

      Parameters:
      jwtBearer - Configuration options for the urn:ietf:params:oauth:grant-type:jwt-bearer grant type.
    • fromRefreshToken

      public static Grant fromRefreshToken(RefreshTokenGrant refreshToken)
      Create an instance of this class with refreshToken() initialized to the given value.

      Configuration options for the refresh_token grant type.

      Parameters:
      refreshToken - Configuration options for the refresh_token grant type.
    • fromRefreshToken

      public static Grant fromRefreshToken(Consumer<RefreshTokenGrant.Builder> refreshToken)
      Create an instance of this class with refreshToken() initialized to the given value.

      Configuration options for the refresh_token grant type.

      Parameters:
      refreshToken - Configuration options for the refresh_token grant type.
    • fromTokenExchange

      public static Grant fromTokenExchange(TokenExchangeGrant tokenExchange)
      Create an instance of this class with tokenExchange() initialized to the given value.

      Configuration options for the urn:ietf:params:oauth:grant-type:token-exchange grant type.

      Parameters:
      tokenExchange - Configuration options for the urn:ietf:params:oauth:grant-type:token-exchange grant type.
    • fromTokenExchange

      public static Grant fromTokenExchange(Consumer<TokenExchangeGrant.Builder> tokenExchange)
      Create an instance of this class with tokenExchange() initialized to the given value.

      Configuration options for the urn:ietf:params:oauth:grant-type:token-exchange grant type.

      Parameters:
      tokenExchange - Configuration options for the urn:ietf:params:oauth:grant-type:token-exchange grant type.
    • type

      public Grant.Type type()
      Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will be Grant.Type.UNKNOWN_TO_SDK_VERSION if the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will be Grant.Type.UNKNOWN_TO_SDK_VERSION if zero members are set, and null if more than one member is set.
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.