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

software.amazon.awssdk.services.sagemaker.model.OidcConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating with Amazon SageMaker Service

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.sagemaker.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Use this parameter to configure your OIDC Identity Provider (IdP). *

*/ @Generated("software.amazon.awssdk:codegen") public final class OidcConfig implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CLIENT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ClientId").getter(getter(OidcConfig::clientId)).setter(setter(Builder::clientId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClientId").build()).build(); private static final SdkField CLIENT_SECRET_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ClientSecret").getter(getter(OidcConfig::clientSecret)).setter(setter(Builder::clientSecret)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClientSecret").build()).build(); private static final SdkField ISSUER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Issuer") .getter(getter(OidcConfig::issuer)).setter(setter(Builder::issuer)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Issuer").build()).build(); private static final SdkField AUTHORIZATION_ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AuthorizationEndpoint").getter(getter(OidcConfig::authorizationEndpoint)) .setter(setter(Builder::authorizationEndpoint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthorizationEndpoint").build()) .build(); private static final SdkField TOKEN_ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TokenEndpoint").getter(getter(OidcConfig::tokenEndpoint)).setter(setter(Builder::tokenEndpoint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TokenEndpoint").build()).build(); private static final SdkField USER_INFO_ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("UserInfoEndpoint").getter(getter(OidcConfig::userInfoEndpoint)) .setter(setter(Builder::userInfoEndpoint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserInfoEndpoint").build()).build(); private static final SdkField LOGOUT_ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LogoutEndpoint").getter(getter(OidcConfig::logoutEndpoint)).setter(setter(Builder::logoutEndpoint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogoutEndpoint").build()).build(); private static final SdkField JWKS_URI_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("JwksUri").getter(getter(OidcConfig::jwksUri)).setter(setter(Builder::jwksUri)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JwksUri").build()).build(); private static final SdkField SCOPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Scope") .getter(getter(OidcConfig::scope)).setter(setter(Builder::scope)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Scope").build()).build(); private static final SdkField> AUTHENTICATION_REQUEST_EXTRA_PARAMS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("AuthenticationRequestExtraParams") .getter(getter(OidcConfig::authenticationRequestExtraParams)) .setter(setter(Builder::authenticationRequestExtraParams)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthenticationRequestExtraParams") .build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLIENT_ID_FIELD, CLIENT_SECRET_FIELD, ISSUER_FIELD, AUTHORIZATION_ENDPOINT_FIELD, TOKEN_ENDPOINT_FIELD, USER_INFO_ENDPOINT_FIELD, LOGOUT_ENDPOINT_FIELD, JWKS_URI_FIELD, SCOPE_FIELD, AUTHENTICATION_REQUEST_EXTRA_PARAMS_FIELD)); private static final long serialVersionUID = 1L; private final String clientId; private final String clientSecret; private final String issuer; private final String authorizationEndpoint; private final String tokenEndpoint; private final String userInfoEndpoint; private final String logoutEndpoint; private final String jwksUri; private final String scope; private final Map authenticationRequestExtraParams; private OidcConfig(BuilderImpl builder) { this.clientId = builder.clientId; this.clientSecret = builder.clientSecret; this.issuer = builder.issuer; this.authorizationEndpoint = builder.authorizationEndpoint; this.tokenEndpoint = builder.tokenEndpoint; this.userInfoEndpoint = builder.userInfoEndpoint; this.logoutEndpoint = builder.logoutEndpoint; this.jwksUri = builder.jwksUri; this.scope = builder.scope; this.authenticationRequestExtraParams = builder.authenticationRequestExtraParams; } /** *

* The OIDC IdP client ID used to configure your private workforce. *

* * @return The OIDC IdP client ID used to configure your private workforce. */ public final String clientId() { return clientId; } /** *

* The OIDC IdP client secret used to configure your private workforce. *

* * @return The OIDC IdP client secret used to configure your private workforce. */ public final String clientSecret() { return clientSecret; } /** *

* The OIDC IdP issuer used to configure your private workforce. *

* * @return The OIDC IdP issuer used to configure your private workforce. */ public final String issuer() { return issuer; } /** *

* The OIDC IdP authorization endpoint used to configure your private workforce. *

* * @return The OIDC IdP authorization endpoint used to configure your private workforce. */ public final String authorizationEndpoint() { return authorizationEndpoint; } /** *

* The OIDC IdP token endpoint used to configure your private workforce. *

* * @return The OIDC IdP token endpoint used to configure your private workforce. */ public final String tokenEndpoint() { return tokenEndpoint; } /** *

* The OIDC IdP user information endpoint used to configure your private workforce. *

* * @return The OIDC IdP user information endpoint used to configure your private workforce. */ public final String userInfoEndpoint() { return userInfoEndpoint; } /** *

* The OIDC IdP logout endpoint used to configure your private workforce. *

* * @return The OIDC IdP logout endpoint used to configure your private workforce. */ public final String logoutEndpoint() { return logoutEndpoint; } /** *

* The OIDC IdP JSON Web Key Set (Jwks) URI used to configure your private workforce. *

* * @return The OIDC IdP JSON Web Key Set (Jwks) URI used to configure your private workforce. */ public final String jwksUri() { return jwksUri; } /** *

* An array of string identifiers used to refer to the specific pieces of user data or claims that the client * application wants to access. *

* * @return An array of string identifiers used to refer to the specific pieces of user data or claims that the * client application wants to access. */ public final String scope() { return scope; } /** * For responses, this returns true if the service returned a value for the AuthenticationRequestExtraParams * property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} * method on the property). This is useful because the SDK will never return a null collection or map, but you may * need to differentiate between the service returning nothing (or null) and the service returning an empty * collection or map. For requests, this returns true if a value for the property was specified in the request * builder, and false if a value was not specified. */ public final boolean hasAuthenticationRequestExtraParams() { return authenticationRequestExtraParams != null && !(authenticationRequestExtraParams instanceof SdkAutoConstructMap); } /** *

* A string to string map of identifiers specific to the custom identity provider (IdP) being used. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAuthenticationRequestExtraParams} * method. *

* * @return A string to string map of identifiers specific to the custom identity provider (IdP) being used. */ public final Map authenticationRequestExtraParams() { return authenticationRequestExtraParams; } @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(clientId()); hashCode = 31 * hashCode + Objects.hashCode(clientSecret()); hashCode = 31 * hashCode + Objects.hashCode(issuer()); hashCode = 31 * hashCode + Objects.hashCode(authorizationEndpoint()); hashCode = 31 * hashCode + Objects.hashCode(tokenEndpoint()); hashCode = 31 * hashCode + Objects.hashCode(userInfoEndpoint()); hashCode = 31 * hashCode + Objects.hashCode(logoutEndpoint()); hashCode = 31 * hashCode + Objects.hashCode(jwksUri()); hashCode = 31 * hashCode + Objects.hashCode(scope()); hashCode = 31 * hashCode + Objects.hashCode(hasAuthenticationRequestExtraParams() ? authenticationRequestExtraParams() : null); 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 OidcConfig)) { return false; } OidcConfig other = (OidcConfig) obj; return Objects.equals(clientId(), other.clientId()) && Objects.equals(clientSecret(), other.clientSecret()) && Objects.equals(issuer(), other.issuer()) && Objects.equals(authorizationEndpoint(), other.authorizationEndpoint()) && Objects.equals(tokenEndpoint(), other.tokenEndpoint()) && Objects.equals(userInfoEndpoint(), other.userInfoEndpoint()) && Objects.equals(logoutEndpoint(), other.logoutEndpoint()) && Objects.equals(jwksUri(), other.jwksUri()) && Objects.equals(scope(), other.scope()) && hasAuthenticationRequestExtraParams() == other.hasAuthenticationRequestExtraParams() && Objects.equals(authenticationRequestExtraParams(), other.authenticationRequestExtraParams()); } /** * 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("OidcConfig") .add("ClientId", clientId()) .add("ClientSecret", clientSecret() == null ? null : "*** Sensitive Data Redacted ***") .add("Issuer", issuer()) .add("AuthorizationEndpoint", authorizationEndpoint()) .add("TokenEndpoint", tokenEndpoint()) .add("UserInfoEndpoint", userInfoEndpoint()) .add("LogoutEndpoint", logoutEndpoint()) .add("JwksUri", jwksUri()) .add("Scope", scope()) .add("AuthenticationRequestExtraParams", hasAuthenticationRequestExtraParams() ? authenticationRequestExtraParams() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ClientId": return Optional.ofNullable(clazz.cast(clientId())); case "ClientSecret": return Optional.ofNullable(clazz.cast(clientSecret())); case "Issuer": return Optional.ofNullable(clazz.cast(issuer())); case "AuthorizationEndpoint": return Optional.ofNullable(clazz.cast(authorizationEndpoint())); case "TokenEndpoint": return Optional.ofNullable(clazz.cast(tokenEndpoint())); case "UserInfoEndpoint": return Optional.ofNullable(clazz.cast(userInfoEndpoint())); case "LogoutEndpoint": return Optional.ofNullable(clazz.cast(logoutEndpoint())); case "JwksUri": return Optional.ofNullable(clazz.cast(jwksUri())); case "Scope": return Optional.ofNullable(clazz.cast(scope())); case "AuthenticationRequestExtraParams": return Optional.ofNullable(clazz.cast(authenticationRequestExtraParams())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((OidcConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The OIDC IdP client ID used to configure your private workforce. *

* * @param clientId * The OIDC IdP client ID used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientId(String clientId); /** *

* The OIDC IdP client secret used to configure your private workforce. *

* * @param clientSecret * The OIDC IdP client secret used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientSecret(String clientSecret); /** *

* The OIDC IdP issuer used to configure your private workforce. *

* * @param issuer * The OIDC IdP issuer used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder issuer(String issuer); /** *

* The OIDC IdP authorization endpoint used to configure your private workforce. *

* * @param authorizationEndpoint * The OIDC IdP authorization endpoint used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder authorizationEndpoint(String authorizationEndpoint); /** *

* The OIDC IdP token endpoint used to configure your private workforce. *

* * @param tokenEndpoint * The OIDC IdP token endpoint used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tokenEndpoint(String tokenEndpoint); /** *

* The OIDC IdP user information endpoint used to configure your private workforce. *

* * @param userInfoEndpoint * The OIDC IdP user information endpoint used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userInfoEndpoint(String userInfoEndpoint); /** *

* The OIDC IdP logout endpoint used to configure your private workforce. *

* * @param logoutEndpoint * The OIDC IdP logout endpoint used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder logoutEndpoint(String logoutEndpoint); /** *

* The OIDC IdP JSON Web Key Set (Jwks) URI used to configure your private workforce. *

* * @param jwksUri * The OIDC IdP JSON Web Key Set (Jwks) URI used to configure your private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jwksUri(String jwksUri); /** *

* An array of string identifiers used to refer to the specific pieces of user data or claims that the client * application wants to access. *

* * @param scope * An array of string identifiers used to refer to the specific pieces of user data or claims that the * client application wants to access. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scope(String scope); /** *

* A string to string map of identifiers specific to the custom identity provider (IdP) being used. *

* * @param authenticationRequestExtraParams * A string to string map of identifiers specific to the custom identity provider (IdP) being used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder authenticationRequestExtraParams(Map authenticationRequestExtraParams); } static final class BuilderImpl implements Builder { private String clientId; private String clientSecret; private String issuer; private String authorizationEndpoint; private String tokenEndpoint; private String userInfoEndpoint; private String logoutEndpoint; private String jwksUri; private String scope; private Map authenticationRequestExtraParams = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(OidcConfig model) { clientId(model.clientId); clientSecret(model.clientSecret); issuer(model.issuer); authorizationEndpoint(model.authorizationEndpoint); tokenEndpoint(model.tokenEndpoint); userInfoEndpoint(model.userInfoEndpoint); logoutEndpoint(model.logoutEndpoint); jwksUri(model.jwksUri); scope(model.scope); authenticationRequestExtraParams(model.authenticationRequestExtraParams); } public final String getClientId() { return clientId; } public final void setClientId(String clientId) { this.clientId = clientId; } @Override public final Builder clientId(String clientId) { this.clientId = clientId; return this; } public final String getClientSecret() { return clientSecret; } public final void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } @Override public final Builder clientSecret(String clientSecret) { this.clientSecret = clientSecret; return this; } public final String getIssuer() { return issuer; } public final void setIssuer(String issuer) { this.issuer = issuer; } @Override public final Builder issuer(String issuer) { this.issuer = issuer; return this; } public final String getAuthorizationEndpoint() { return authorizationEndpoint; } public final void setAuthorizationEndpoint(String authorizationEndpoint) { this.authorizationEndpoint = authorizationEndpoint; } @Override public final Builder authorizationEndpoint(String authorizationEndpoint) { this.authorizationEndpoint = authorizationEndpoint; return this; } public final String getTokenEndpoint() { return tokenEndpoint; } public final void setTokenEndpoint(String tokenEndpoint) { this.tokenEndpoint = tokenEndpoint; } @Override public final Builder tokenEndpoint(String tokenEndpoint) { this.tokenEndpoint = tokenEndpoint; return this; } public final String getUserInfoEndpoint() { return userInfoEndpoint; } public final void setUserInfoEndpoint(String userInfoEndpoint) { this.userInfoEndpoint = userInfoEndpoint; } @Override public final Builder userInfoEndpoint(String userInfoEndpoint) { this.userInfoEndpoint = userInfoEndpoint; return this; } public final String getLogoutEndpoint() { return logoutEndpoint; } public final void setLogoutEndpoint(String logoutEndpoint) { this.logoutEndpoint = logoutEndpoint; } @Override public final Builder logoutEndpoint(String logoutEndpoint) { this.logoutEndpoint = logoutEndpoint; return this; } public final String getJwksUri() { return jwksUri; } public final void setJwksUri(String jwksUri) { this.jwksUri = jwksUri; } @Override public final Builder jwksUri(String jwksUri) { this.jwksUri = jwksUri; return this; } public final String getScope() { return scope; } public final void setScope(String scope) { this.scope = scope; } @Override public final Builder scope(String scope) { this.scope = scope; return this; } public final Map getAuthenticationRequestExtraParams() { if (authenticationRequestExtraParams instanceof SdkAutoConstructMap) { return null; } return authenticationRequestExtraParams; } public final void setAuthenticationRequestExtraParams(Map authenticationRequestExtraParams) { this.authenticationRequestExtraParams = AuthenticationRequestExtraParamsCopier.copy(authenticationRequestExtraParams); } @Override public final Builder authenticationRequestExtraParams(Map authenticationRequestExtraParams) { this.authenticationRequestExtraParams = AuthenticationRequestExtraParamsCopier.copy(authenticationRequestExtraParams); return this; } @Override public OidcConfig build() { return new OidcConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy