Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.cognitoidentity.model.CreateIdentityPoolRequest Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Amazon Cognito Identity module holds the client classes that are used for
communicating with Amazon Cognito Identity Service
/*
* 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.cognitoidentity.model;
import java.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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;
/**
*
* Input to the CreateIdentityPool action.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateIdentityPoolRequest extends CognitoIdentityRequest implements
ToCopyableBuilder {
private static final SdkField IDENTITY_POOL_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IdentityPoolName").getter(getter(CreateIdentityPoolRequest::identityPoolName))
.setter(setter(Builder::identityPoolName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityPoolName").build()).build();
private static final SdkField ALLOW_UNAUTHENTICATED_IDENTITIES_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("AllowUnauthenticatedIdentities")
.getter(getter(CreateIdentityPoolRequest::allowUnauthenticatedIdentities))
.setter(setter(Builder::allowUnauthenticatedIdentities))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllowUnauthenticatedIdentities")
.build()).build();
private static final SdkField ALLOW_CLASSIC_FLOW_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AllowClassicFlow").getter(getter(CreateIdentityPoolRequest::allowClassicFlow))
.setter(setter(Builder::allowClassicFlow))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllowClassicFlow").build()).build();
private static final SdkField> SUPPORTED_LOGIN_PROVIDERS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("SupportedLoginProviders")
.getter(getter(CreateIdentityPoolRequest::supportedLoginProviders))
.setter(setter(Builder::supportedLoginProviders))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedLoginProviders").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 SdkField DEVELOPER_PROVIDER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeveloperProviderName").getter(getter(CreateIdentityPoolRequest::developerProviderName))
.setter(setter(Builder::developerProviderName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeveloperProviderName").build())
.build();
private static final SdkField> OPEN_ID_CONNECT_PROVIDER_AR_NS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("OpenIdConnectProviderARNs")
.getter(getter(CreateIdentityPoolRequest::openIdConnectProviderARNs))
.setter(setter(Builder::openIdConnectProviderARNs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpenIdConnectProviderARNs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> COGNITO_IDENTITY_PROVIDERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("CognitoIdentityProviders")
.getter(getter(CreateIdentityPoolRequest::cognitoIdentityProviders))
.setter(setter(Builder::cognitoIdentityProviders))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CognitoIdentityProviders").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(CognitoIdentityProvider::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SAML_PROVIDER_AR_NS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SamlProviderARNs")
.getter(getter(CreateIdentityPoolRequest::samlProviderARNs))
.setter(setter(Builder::samlProviderARNs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SamlProviderARNs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> IDENTITY_POOL_TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("IdentityPoolTags")
.getter(getter(CreateIdentityPoolRequest::identityPoolTags))
.setter(setter(Builder::identityPoolTags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityPoolTags").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(IDENTITY_POOL_NAME_FIELD,
ALLOW_UNAUTHENTICATED_IDENTITIES_FIELD, ALLOW_CLASSIC_FLOW_FIELD, SUPPORTED_LOGIN_PROVIDERS_FIELD,
DEVELOPER_PROVIDER_NAME_FIELD, OPEN_ID_CONNECT_PROVIDER_AR_NS_FIELD, COGNITO_IDENTITY_PROVIDERS_FIELD,
SAML_PROVIDER_AR_NS_FIELD, IDENTITY_POOL_TAGS_FIELD));
private final String identityPoolName;
private final Boolean allowUnauthenticatedIdentities;
private final Boolean allowClassicFlow;
private final Map supportedLoginProviders;
private final String developerProviderName;
private final List openIdConnectProviderARNs;
private final List cognitoIdentityProviders;
private final List samlProviderARNs;
private final Map identityPoolTags;
private CreateIdentityPoolRequest(BuilderImpl builder) {
super(builder);
this.identityPoolName = builder.identityPoolName;
this.allowUnauthenticatedIdentities = builder.allowUnauthenticatedIdentities;
this.allowClassicFlow = builder.allowClassicFlow;
this.supportedLoginProviders = builder.supportedLoginProviders;
this.developerProviderName = builder.developerProviderName;
this.openIdConnectProviderARNs = builder.openIdConnectProviderARNs;
this.cognitoIdentityProviders = builder.cognitoIdentityProviders;
this.samlProviderARNs = builder.samlProviderARNs;
this.identityPoolTags = builder.identityPoolTags;
}
/**
*
* A string that you provide.
*
*
* @return A string that you provide.
*/
public final String identityPoolName() {
return identityPoolName;
}
/**
*
* TRUE if the identity pool supports unauthenticated logins.
*
*
* @return TRUE if the identity pool supports unauthenticated logins.
*/
public final Boolean allowUnauthenticatedIdentities() {
return allowUnauthenticatedIdentities;
}
/**
*
* Enables or disables the Basic (Classic) authentication flow. For more information, see Identity Pools
* (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide .
*
*
* @return Enables or disables the Basic (Classic) authentication flow. For more information, see Identity Pools
* (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide .
*/
public final Boolean allowClassicFlow() {
return allowClassicFlow;
}
/**
* For responses, this returns true if the service returned a value for the SupportedLoginProviders 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 hasSupportedLoginProviders() {
return supportedLoginProviders != null && !(supportedLoginProviders instanceof SdkAutoConstructMap);
}
/**
*
* Optional key:value pairs mapping provider names to provider app IDs.
*
*
* 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 #hasSupportedLoginProviders} method.
*
*
* @return Optional key:value pairs mapping provider names to provider app IDs.
*/
public final Map supportedLoginProviders() {
return supportedLoginProviders;
}
/**
*
* The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your backend
* and the Cognito service to communicate about the developer provider. For the DeveloperProviderName
,
* you can use letters as well as period (.
), underscore (_
), and dash (-
).
*
*
* Once you have set a developer provider name, you cannot change it. Please take care in setting this parameter.
*
*
* @return The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your
* backend and the Cognito service to communicate about the developer provider. For the
* DeveloperProviderName
, you can use letters as well as period (.
), underscore (
* _
), and dash (-
).
*
* Once you have set a developer provider name, you cannot change it. Please take care in setting this
* parameter.
*/
public final String developerProviderName() {
return developerProviderName;
}
/**
* For responses, this returns true if the service returned a value for the OpenIdConnectProviderARNs 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 hasOpenIdConnectProviderARNs() {
return openIdConnectProviderARNs != null && !(openIdConnectProviderARNs instanceof SdkAutoConstructList);
}
/**
*
* The Amazon Resource Names (ARN) of the OpenID Connect providers.
*
*
* 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 #hasOpenIdConnectProviderARNs} method.
*
*
* @return The Amazon Resource Names (ARN) of the OpenID Connect providers.
*/
public final List openIdConnectProviderARNs() {
return openIdConnectProviderARNs;
}
/**
* For responses, this returns true if the service returned a value for the CognitoIdentityProviders 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 hasCognitoIdentityProviders() {
return cognitoIdentityProviders != null && !(cognitoIdentityProviders instanceof SdkAutoConstructList);
}
/**
*
* An array of Amazon Cognito user pools and their client IDs.
*
*
* 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 #hasCognitoIdentityProviders} method.
*
*
* @return An array of Amazon Cognito user pools and their client IDs.
*/
public final List cognitoIdentityProviders() {
return cognitoIdentityProviders;
}
/**
* For responses, this returns true if the service returned a value for the SamlProviderARNs 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 hasSamlProviderARNs() {
return samlProviderARNs != null && !(samlProviderARNs instanceof SdkAutoConstructList);
}
/**
*
* An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.
*
*
* 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 #hasSamlProviderARNs} method.
*
*
* @return An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.
*/
public final List samlProviderARNs() {
return samlProviderARNs;
}
/**
* For responses, this returns true if the service returned a value for the IdentityPoolTags 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 hasIdentityPoolTags() {
return identityPoolTags != null && !(identityPoolTags instanceof SdkAutoConstructMap);
}
/**
*
* Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and
* manage them in different ways, such as by purpose, owner, environment, or other criteria.
*
*
* 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 #hasIdentityPoolTags} method.
*
*
* @return Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize
* and manage them in different ways, such as by purpose, owner, environment, or other criteria.
*/
public final Map identityPoolTags() {
return identityPoolTags;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(identityPoolName());
hashCode = 31 * hashCode + Objects.hashCode(allowUnauthenticatedIdentities());
hashCode = 31 * hashCode + Objects.hashCode(allowClassicFlow());
hashCode = 31 * hashCode + Objects.hashCode(hasSupportedLoginProviders() ? supportedLoginProviders() : null);
hashCode = 31 * hashCode + Objects.hashCode(developerProviderName());
hashCode = 31 * hashCode + Objects.hashCode(hasOpenIdConnectProviderARNs() ? openIdConnectProviderARNs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasCognitoIdentityProviders() ? cognitoIdentityProviders() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSamlProviderARNs() ? samlProviderARNs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasIdentityPoolTags() ? identityPoolTags() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateIdentityPoolRequest)) {
return false;
}
CreateIdentityPoolRequest other = (CreateIdentityPoolRequest) obj;
return Objects.equals(identityPoolName(), other.identityPoolName())
&& Objects.equals(allowUnauthenticatedIdentities(), other.allowUnauthenticatedIdentities())
&& Objects.equals(allowClassicFlow(), other.allowClassicFlow())
&& hasSupportedLoginProviders() == other.hasSupportedLoginProviders()
&& Objects.equals(supportedLoginProviders(), other.supportedLoginProviders())
&& Objects.equals(developerProviderName(), other.developerProviderName())
&& hasOpenIdConnectProviderARNs() == other.hasOpenIdConnectProviderARNs()
&& Objects.equals(openIdConnectProviderARNs(), other.openIdConnectProviderARNs())
&& hasCognitoIdentityProviders() == other.hasCognitoIdentityProviders()
&& Objects.equals(cognitoIdentityProviders(), other.cognitoIdentityProviders())
&& hasSamlProviderARNs() == other.hasSamlProviderARNs()
&& Objects.equals(samlProviderARNs(), other.samlProviderARNs())
&& hasIdentityPoolTags() == other.hasIdentityPoolTags()
&& Objects.equals(identityPoolTags(), other.identityPoolTags());
}
/**
* 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("CreateIdentityPoolRequest").add("IdentityPoolName", identityPoolName())
.add("AllowUnauthenticatedIdentities", allowUnauthenticatedIdentities())
.add("AllowClassicFlow", allowClassicFlow())
.add("SupportedLoginProviders", hasSupportedLoginProviders() ? supportedLoginProviders() : null)
.add("DeveloperProviderName", developerProviderName())
.add("OpenIdConnectProviderARNs", hasOpenIdConnectProviderARNs() ? openIdConnectProviderARNs() : null)
.add("CognitoIdentityProviders", hasCognitoIdentityProviders() ? cognitoIdentityProviders() : null)
.add("SamlProviderARNs", hasSamlProviderARNs() ? samlProviderARNs() : null)
.add("IdentityPoolTags", hasIdentityPoolTags() ? identityPoolTags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "IdentityPoolName":
return Optional.ofNullable(clazz.cast(identityPoolName()));
case "AllowUnauthenticatedIdentities":
return Optional.ofNullable(clazz.cast(allowUnauthenticatedIdentities()));
case "AllowClassicFlow":
return Optional.ofNullable(clazz.cast(allowClassicFlow()));
case "SupportedLoginProviders":
return Optional.ofNullable(clazz.cast(supportedLoginProviders()));
case "DeveloperProviderName":
return Optional.ofNullable(clazz.cast(developerProviderName()));
case "OpenIdConnectProviderARNs":
return Optional.ofNullable(clazz.cast(openIdConnectProviderARNs()));
case "CognitoIdentityProviders":
return Optional.ofNullable(clazz.cast(cognitoIdentityProviders()));
case "SamlProviderARNs":
return Optional.ofNullable(clazz.cast(samlProviderARNs()));
case "IdentityPoolTags":
return Optional.ofNullable(clazz.cast(identityPoolTags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((CreateIdentityPoolRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends CognitoIdentityRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* A string that you provide.
*
*
* @param identityPoolName
* A string that you provide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder identityPoolName(String identityPoolName);
/**
*
* TRUE if the identity pool supports unauthenticated logins.
*
*
* @param allowUnauthenticatedIdentities
* TRUE if the identity pool supports unauthenticated logins.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allowUnauthenticatedIdentities(Boolean allowUnauthenticatedIdentities);
/**
*
* Enables or disables the Basic (Classic) authentication flow. For more information, see Identity Pools
* (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide .
*
*
* @param allowClassicFlow
* Enables or disables the Basic (Classic) authentication flow. For more information, see Identity
* Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allowClassicFlow(Boolean allowClassicFlow);
/**
*
* Optional key:value pairs mapping provider names to provider app IDs.
*
*
* @param supportedLoginProviders
* Optional key:value pairs mapping provider names to provider app IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder supportedLoginProviders(Map supportedLoginProviders);
/**
*
* The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your
* backend and the Cognito service to communicate about the developer provider. For the
* DeveloperProviderName
, you can use letters as well as period (.
), underscore (
* _
), and dash (-
).
*
*
* Once you have set a developer provider name, you cannot change it. Please take care in setting this
* parameter.
*
*
* @param developerProviderName
* The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows
* your backend and the Cognito service to communicate about the developer provider. For the
* DeveloperProviderName
, you can use letters as well as period (.
), underscore
* (_
), and dash (-
).
*
* Once you have set a developer provider name, you cannot change it. Please take care in setting this
* parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder developerProviderName(String developerProviderName);
/**
*
* The Amazon Resource Names (ARN) of the OpenID Connect providers.
*
*
* @param openIdConnectProviderARNs
* The Amazon Resource Names (ARN) of the OpenID Connect providers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder openIdConnectProviderARNs(Collection openIdConnectProviderARNs);
/**
*
* The Amazon Resource Names (ARN) of the OpenID Connect providers.
*
*
* @param openIdConnectProviderARNs
* The Amazon Resource Names (ARN) of the OpenID Connect providers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder openIdConnectProviderARNs(String... openIdConnectProviderARNs);
/**
*
* An array of Amazon Cognito user pools and their client IDs.
*
*
* @param cognitoIdentityProviders
* An array of Amazon Cognito user pools and their client IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cognitoIdentityProviders(Collection cognitoIdentityProviders);
/**
*
* An array of Amazon Cognito user pools and their client IDs.
*
*
* @param cognitoIdentityProviders
* An array of Amazon Cognito user pools and their client IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cognitoIdentityProviders(CognitoIdentityProvider... cognitoIdentityProviders);
/**
*
* An array of Amazon Cognito user pools and their client IDs.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.cognitoidentity.model.CognitoIdentityProvider.Builder} avoiding the
* need to create one manually via
* {@link software.amazon.awssdk.services.cognitoidentity.model.CognitoIdentityProvider#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.cognitoidentity.model.CognitoIdentityProvider.Builder#build()} is
* called immediately and its result is passed to {@link
* #cognitoIdentityProviders(List)}.
*
* @param cognitoIdentityProviders
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.cognitoidentity.model.CognitoIdentityProvider.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #cognitoIdentityProviders(java.util.Collection)
*/
Builder cognitoIdentityProviders(Consumer... cognitoIdentityProviders);
/**
*
* An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.
*
*
* @param samlProviderARNs
* An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder samlProviderARNs(Collection samlProviderARNs);
/**
*
* An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.
*
*
* @param samlProviderARNs
* An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder samlProviderARNs(String... samlProviderARNs);
/**
*
* Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and
* manage them in different ways, such as by purpose, owner, environment, or other criteria.
*
*
* @param identityPoolTags
* Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to
* categorize and manage them in different ways, such as by purpose, owner, environment, or other
* criteria.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder identityPoolTags(Map identityPoolTags);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends CognitoIdentityRequest.BuilderImpl implements Builder {
private String identityPoolName;
private Boolean allowUnauthenticatedIdentities;
private Boolean allowClassicFlow;
private Map supportedLoginProviders = DefaultSdkAutoConstructMap.getInstance();
private String developerProviderName;
private List openIdConnectProviderARNs = DefaultSdkAutoConstructList.getInstance();
private List cognitoIdentityProviders = DefaultSdkAutoConstructList.getInstance();
private List samlProviderARNs = DefaultSdkAutoConstructList.getInstance();
private Map identityPoolTags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(CreateIdentityPoolRequest model) {
super(model);
identityPoolName(model.identityPoolName);
allowUnauthenticatedIdentities(model.allowUnauthenticatedIdentities);
allowClassicFlow(model.allowClassicFlow);
supportedLoginProviders(model.supportedLoginProviders);
developerProviderName(model.developerProviderName);
openIdConnectProviderARNs(model.openIdConnectProviderARNs);
cognitoIdentityProviders(model.cognitoIdentityProviders);
samlProviderARNs(model.samlProviderARNs);
identityPoolTags(model.identityPoolTags);
}
public final String getIdentityPoolName() {
return identityPoolName;
}
public final void setIdentityPoolName(String identityPoolName) {
this.identityPoolName = identityPoolName;
}
@Override
public final Builder identityPoolName(String identityPoolName) {
this.identityPoolName = identityPoolName;
return this;
}
public final Boolean getAllowUnauthenticatedIdentities() {
return allowUnauthenticatedIdentities;
}
public final void setAllowUnauthenticatedIdentities(Boolean allowUnauthenticatedIdentities) {
this.allowUnauthenticatedIdentities = allowUnauthenticatedIdentities;
}
@Override
public final Builder allowUnauthenticatedIdentities(Boolean allowUnauthenticatedIdentities) {
this.allowUnauthenticatedIdentities = allowUnauthenticatedIdentities;
return this;
}
public final Boolean getAllowClassicFlow() {
return allowClassicFlow;
}
public final void setAllowClassicFlow(Boolean allowClassicFlow) {
this.allowClassicFlow = allowClassicFlow;
}
@Override
public final Builder allowClassicFlow(Boolean allowClassicFlow) {
this.allowClassicFlow = allowClassicFlow;
return this;
}
public final Map getSupportedLoginProviders() {
if (supportedLoginProviders instanceof SdkAutoConstructMap) {
return null;
}
return supportedLoginProviders;
}
public final void setSupportedLoginProviders(Map supportedLoginProviders) {
this.supportedLoginProviders = IdentityProvidersCopier.copy(supportedLoginProviders);
}
@Override
public final Builder supportedLoginProviders(Map supportedLoginProviders) {
this.supportedLoginProviders = IdentityProvidersCopier.copy(supportedLoginProviders);
return this;
}
public final String getDeveloperProviderName() {
return developerProviderName;
}
public final void setDeveloperProviderName(String developerProviderName) {
this.developerProviderName = developerProviderName;
}
@Override
public final Builder developerProviderName(String developerProviderName) {
this.developerProviderName = developerProviderName;
return this;
}
public final Collection getOpenIdConnectProviderARNs() {
if (openIdConnectProviderARNs instanceof SdkAutoConstructList) {
return null;
}
return openIdConnectProviderARNs;
}
public final void setOpenIdConnectProviderARNs(Collection openIdConnectProviderARNs) {
this.openIdConnectProviderARNs = OIDCProviderListCopier.copy(openIdConnectProviderARNs);
}
@Override
public final Builder openIdConnectProviderARNs(Collection openIdConnectProviderARNs) {
this.openIdConnectProviderARNs = OIDCProviderListCopier.copy(openIdConnectProviderARNs);
return this;
}
@Override
@SafeVarargs
public final Builder openIdConnectProviderARNs(String... openIdConnectProviderARNs) {
openIdConnectProviderARNs(Arrays.asList(openIdConnectProviderARNs));
return this;
}
public final List getCognitoIdentityProviders() {
List result = CognitoIdentityProviderListCopier
.copyToBuilder(this.cognitoIdentityProviders);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setCognitoIdentityProviders(Collection cognitoIdentityProviders) {
this.cognitoIdentityProviders = CognitoIdentityProviderListCopier.copyFromBuilder(cognitoIdentityProviders);
}
@Override
public final Builder cognitoIdentityProviders(Collection cognitoIdentityProviders) {
this.cognitoIdentityProviders = CognitoIdentityProviderListCopier.copy(cognitoIdentityProviders);
return this;
}
@Override
@SafeVarargs
public final Builder cognitoIdentityProviders(CognitoIdentityProvider... cognitoIdentityProviders) {
cognitoIdentityProviders(Arrays.asList(cognitoIdentityProviders));
return this;
}
@Override
@SafeVarargs
public final Builder cognitoIdentityProviders(Consumer... cognitoIdentityProviders) {
cognitoIdentityProviders(Stream.of(cognitoIdentityProviders)
.map(c -> CognitoIdentityProvider.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final Collection getSamlProviderARNs() {
if (samlProviderARNs instanceof SdkAutoConstructList) {
return null;
}
return samlProviderARNs;
}
public final void setSamlProviderARNs(Collection samlProviderARNs) {
this.samlProviderARNs = SAMLProviderListCopier.copy(samlProviderARNs);
}
@Override
public final Builder samlProviderARNs(Collection samlProviderARNs) {
this.samlProviderARNs = SAMLProviderListCopier.copy(samlProviderARNs);
return this;
}
@Override
@SafeVarargs
public final Builder samlProviderARNs(String... samlProviderARNs) {
samlProviderARNs(Arrays.asList(samlProviderARNs));
return this;
}
public final Map getIdentityPoolTags() {
if (identityPoolTags instanceof SdkAutoConstructMap) {
return null;
}
return identityPoolTags;
}
public final void setIdentityPoolTags(Map identityPoolTags) {
this.identityPoolTags = IdentityPoolTagsTypeCopier.copy(identityPoolTags);
}
@Override
public final Builder identityPoolTags(Map identityPoolTags) {
this.identityPoolTags = IdentityPoolTagsTypeCopier.copy(identityPoolTags);
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateIdentityPoolRequest build() {
return new CreateIdentityPoolRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}