All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.healthlake.model.IdentityProviderConfiguration Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Health Lake module holds the client classes that are used for communicating with Health Lake.

There is a newer version: 2.28.4
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((IdentityProviderConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The authorization strategy that you selected when you created the Data Store. *

* * @param authorizationStrategy * The authorization strategy that you selected when you created the Data Store. * @see AuthorizationStrategy * @return Returns a reference to this object so that method calls can be chained together. * @see AuthorizationStrategy */ Builder authorizationStrategy(String authorizationStrategy); /** *

* The authorization strategy that you selected when you created the Data Store. *

* * @param authorizationStrategy * The authorization strategy that you selected when you created the Data Store. * @see AuthorizationStrategy * @return Returns a reference to this object so that method calls can be chained together. * @see AuthorizationStrategy */ Builder authorizationStrategy(AuthorizationStrategy authorizationStrategy); /** *

* If you enabled fine-grained authorization when you created the Data Store. *

* * @param fineGrainedAuthorizationEnabled * If you enabled fine-grained authorization when you created the Data Store. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fineGrainedAuthorizationEnabled(Boolean 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. *

* * @param metadata * 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 Returns a reference to this object so that method calls can be chained together. */ Builder metadata(String 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. *

* * @param idpLambdaArn * 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 Returns a reference to this object so that method calls can be chained together. */ Builder idpLambdaArn(String idpLambdaArn); } static final class BuilderImpl implements Builder { private String authorizationStrategy; private Boolean fineGrainedAuthorizationEnabled; private String metadata; private String idpLambdaArn; private BuilderImpl() { } private BuilderImpl(IdentityProviderConfiguration model) { authorizationStrategy(model.authorizationStrategy); fineGrainedAuthorizationEnabled(model.fineGrainedAuthorizationEnabled); metadata(model.metadata); idpLambdaArn(model.idpLambdaArn); } public final String getAuthorizationStrategy() { return authorizationStrategy; } public final void setAuthorizationStrategy(String authorizationStrategy) { this.authorizationStrategy = authorizationStrategy; } @Override public final Builder authorizationStrategy(String authorizationStrategy) { this.authorizationStrategy = authorizationStrategy; return this; } @Override public final Builder authorizationStrategy(AuthorizationStrategy authorizationStrategy) { this.authorizationStrategy(authorizationStrategy == null ? null : authorizationStrategy.toString()); return this; } public final Boolean getFineGrainedAuthorizationEnabled() { return fineGrainedAuthorizationEnabled; } public final void setFineGrainedAuthorizationEnabled(Boolean fineGrainedAuthorizationEnabled) { this.fineGrainedAuthorizationEnabled = fineGrainedAuthorizationEnabled; } @Override public final Builder fineGrainedAuthorizationEnabled(Boolean fineGrainedAuthorizationEnabled) { this.fineGrainedAuthorizationEnabled = fineGrainedAuthorizationEnabled; return this; } public final String getMetadata() { return metadata; } public final void setMetadata(String metadata) { this.metadata = metadata; } @Override public final Builder metadata(String metadata) { this.metadata = metadata; return this; } public final String getIdpLambdaArn() { return idpLambdaArn; } public final void setIdpLambdaArn(String idpLambdaArn) { this.idpLambdaArn = idpLambdaArn; } @Override public final Builder idpLambdaArn(String idpLambdaArn) { this.idpLambdaArn = idpLambdaArn; return this; } @Override public IdentityProviderConfiguration build() { return new IdentityProviderConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy