software.amazon.awssdk.services.healthlake.model.IdentityProviderConfiguration Maven / Gradle / Ivy
Show all versions of healthlake Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.healthlake.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The identity provider configuration that you gave when the Data Store was created.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class IdentityProviderConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField AUTHORIZATION_STRATEGY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AuthorizationStrategy").getter(getter(IdentityProviderConfiguration::authorizationStrategyAsString))
.setter(setter(Builder::authorizationStrategy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthorizationStrategy").build())
.build();
private static final SdkField FINE_GRAINED_AUTHORIZATION_ENABLED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("FineGrainedAuthorizationEnabled")
.getter(getter(IdentityProviderConfiguration::fineGrainedAuthorizationEnabled))
.setter(setter(Builder::fineGrainedAuthorizationEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FineGrainedAuthorizationEnabled")
.build()).build();
private static final SdkField METADATA_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Metadata").getter(getter(IdentityProviderConfiguration::metadata)).setter(setter(Builder::metadata))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Metadata").build()).build();
private static final SdkField IDP_LAMBDA_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IdpLambdaArn").getter(getter(IdentityProviderConfiguration::idpLambdaArn))
.setter(setter(Builder::idpLambdaArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdpLambdaArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AUTHORIZATION_STRATEGY_FIELD,
FINE_GRAINED_AUTHORIZATION_ENABLED_FIELD, METADATA_FIELD, IDP_LAMBDA_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String authorizationStrategy;
private final Boolean fineGrainedAuthorizationEnabled;
private final String metadata;
private final String idpLambdaArn;
private IdentityProviderConfiguration(BuilderImpl builder) {
this.authorizationStrategy = builder.authorizationStrategy;
this.fineGrainedAuthorizationEnabled = builder.fineGrainedAuthorizationEnabled;
this.metadata = builder.metadata;
this.idpLambdaArn = builder.idpLambdaArn;
}
/**
*
* The authorization strategy that you selected when you created the Data Store.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authorizationStrategy} will return {@link AuthorizationStrategy#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #authorizationStrategyAsString}.
*
*
* @return The authorization strategy that you selected when you created the Data Store.
* @see AuthorizationStrategy
*/
public final AuthorizationStrategy authorizationStrategy() {
return AuthorizationStrategy.fromValue(authorizationStrategy);
}
/**
*
* The authorization strategy that you selected when you created the Data Store.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authorizationStrategy} will return {@link AuthorizationStrategy#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #authorizationStrategyAsString}.
*
*
* @return The authorization strategy that you selected when you created the Data Store.
* @see AuthorizationStrategy
*/
public final String authorizationStrategyAsString() {
return authorizationStrategy;
}
/**
*
* If you enabled fine-grained authorization when you created the Data Store.
*
*
* @return If you enabled fine-grained authorization when you created the Data Store.
*/
public final Boolean fineGrainedAuthorizationEnabled() {
return fineGrainedAuthorizationEnabled;
}
/**
*
* The JSON metadata elements that you want to use in your identity provider configuration. Required elements are
* listed based on the launch specification of the SMART application. For more information on all possible elements,
* see Metadata in SMART's
* App Launch specification.
*
*
* authorization_endpoint
: The URL to the OAuth2 authorization endpoint.
*
*
* grant_types_supported
: An array of grant types that are supported at the token endpoint. You must
* provide at least one grant type option. Valid options are authorization_code
and
* client_credentials
.
*
*
* token_endpoint
: The URL to the OAuth2 token endpoint.
*
*
* capabilities
: An array of strings of the SMART capabilities that the authorization server supports.
*
*
* code_challenge_methods_supported
: An array of strings of supported PKCE code challenge methods. You
* must include the S256
method in the array of PKCE code challenge methods.
*
*
* @return The JSON metadata elements that you want to use in your identity provider configuration. Required
* elements are listed based on the launch specification of the SMART application. For more information on
* all possible elements, see Metadata in SMART's
* App Launch specification.
*
* authorization_endpoint
: The URL to the OAuth2 authorization endpoint.
*
*
* grant_types_supported
: An array of grant types that are supported at the token endpoint. You
* must provide at least one grant type option. Valid options are authorization_code
and
* client_credentials
.
*
*
* token_endpoint
: The URL to the OAuth2 token endpoint.
*
*
* capabilities
: An array of strings of the SMART capabilities that the authorization server
* supports.
*
*
* code_challenge_methods_supported
: An array of strings of supported PKCE code challenge
* methods. You must include the S256
method in the array of PKCE code challenge methods.
*/
public final String metadata() {
return metadata;
}
/**
*
* The Amazon Resource Name (ARN) of the Lambda function that you want to use to decode the access token created by
* the authorization server.
*
*
* @return The Amazon Resource Name (ARN) of the Lambda function that you want to use to decode the access token
* created by the authorization server.
*/
public final String idpLambdaArn() {
return idpLambdaArn;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(authorizationStrategyAsString());
hashCode = 31 * hashCode + Objects.hashCode(fineGrainedAuthorizationEnabled());
hashCode = 31 * hashCode + Objects.hashCode(metadata());
hashCode = 31 * hashCode + Objects.hashCode(idpLambdaArn());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof IdentityProviderConfiguration)) {
return false;
}
IdentityProviderConfiguration other = (IdentityProviderConfiguration) obj;
return Objects.equals(authorizationStrategyAsString(), other.authorizationStrategyAsString())
&& Objects.equals(fineGrainedAuthorizationEnabled(), other.fineGrainedAuthorizationEnabled())
&& Objects.equals(metadata(), other.metadata()) && Objects.equals(idpLambdaArn(), other.idpLambdaArn());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("IdentityProviderConfiguration").add("AuthorizationStrategy", authorizationStrategyAsString())
.add("FineGrainedAuthorizationEnabled", fineGrainedAuthorizationEnabled()).add("Metadata", metadata())
.add("IdpLambdaArn", idpLambdaArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AuthorizationStrategy":
return Optional.ofNullable(clazz.cast(authorizationStrategyAsString()));
case "FineGrainedAuthorizationEnabled":
return Optional.ofNullable(clazz.cast(fineGrainedAuthorizationEnabled()));
case "Metadata":
return Optional.ofNullable(clazz.cast(metadata()));
case "IdpLambdaArn":
return Optional.ofNullable(clazz.cast(idpLambdaArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function