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

software.amazon.awssdk.services.cognitoidentity.model.IdentityDescription 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

There is a newer version: 2.29.39
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.cognitoidentity.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* A description of the identity. *

*/ @Generated("software.amazon.awssdk:codegen") public final class IdentityDescription implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField IDENTITY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(IdentityDescription::identityId)).setter(setter(Builder::identityId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityId").build()).build(); private static final SdkField> LOGINS_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(IdentityDescription::logins)) .setter(setter(Builder::logins)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Logins").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 CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(IdentityDescription::creationDate)).setter(setter(Builder::creationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build()).build(); private static final SdkField LAST_MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(IdentityDescription::lastModifiedDate)).setter(setter(Builder::lastModifiedDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedDate").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IDENTITY_ID_FIELD, LOGINS_FIELD, CREATION_DATE_FIELD, LAST_MODIFIED_DATE_FIELD)); private static final long serialVersionUID = 1L; private final String identityId; private final List logins; private final Instant creationDate; private final Instant lastModifiedDate; private IdentityDescription(BuilderImpl builder) { this.identityId = builder.identityId; this.logins = builder.logins; this.creationDate = builder.creationDate; this.lastModifiedDate = builder.lastModifiedDate; } /** *

* A unique identifier in the format REGION:GUID. *

* * @return A unique identifier in the format REGION:GUID. */ public String identityId() { return identityId; } /** * Returns true if the Logins property was specified by the sender (it may be empty), or false if the sender did not * specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public boolean hasLogins() { return logins != null && !(logins instanceof SdkAutoConstructList); } /** *

* The provider names. *

*

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

*

* You can use {@link #hasLogins()} to see if a value was sent in this field. *

* * @return The provider names. */ public List logins() { return logins; } /** *

* Date on which the identity was created. *

* * @return Date on which the identity was created. */ public Instant creationDate() { return creationDate; } /** *

* Date on which the identity was last modified. *

* * @return Date on which the identity was last modified. */ public Instant lastModifiedDate() { return lastModifiedDate; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(identityId()); hashCode = 31 * hashCode + Objects.hashCode(logins()); hashCode = 31 * hashCode + Objects.hashCode(creationDate()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedDate()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof IdentityDescription)) { return false; } IdentityDescription other = (IdentityDescription) obj; return Objects.equals(identityId(), other.identityId()) && Objects.equals(logins(), other.logins()) && Objects.equals(creationDate(), other.creationDate()) && Objects.equals(lastModifiedDate(), other.lastModifiedDate()); } /** * 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 String toString() { return ToString.builder("IdentityDescription").add("IdentityId", identityId()).add("Logins", logins()) .add("CreationDate", creationDate()).add("LastModifiedDate", lastModifiedDate()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "IdentityId": return Optional.ofNullable(clazz.cast(identityId())); case "Logins": return Optional.ofNullable(clazz.cast(logins())); case "CreationDate": return Optional.ofNullable(clazz.cast(creationDate())); case "LastModifiedDate": return Optional.ofNullable(clazz.cast(lastModifiedDate())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((IdentityDescription) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A unique identifier in the format REGION:GUID. *

* * @param identityId * A unique identifier in the format REGION:GUID. * @return Returns a reference to this object so that method calls can be chained together. */ Builder identityId(String identityId); /** *

* The provider names. *

* * @param logins * The provider names. * @return Returns a reference to this object so that method calls can be chained together. */ Builder logins(Collection logins); /** *

* The provider names. *

* * @param logins * The provider names. * @return Returns a reference to this object so that method calls can be chained together. */ Builder logins(String... logins); /** *

* Date on which the identity was created. *

* * @param creationDate * Date on which the identity was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDate(Instant creationDate); /** *

* Date on which the identity was last modified. *

* * @param lastModifiedDate * Date on which the identity was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedDate(Instant lastModifiedDate); } static final class BuilderImpl implements Builder { private String identityId; private List logins = DefaultSdkAutoConstructList.getInstance(); private Instant creationDate; private Instant lastModifiedDate; private BuilderImpl() { } private BuilderImpl(IdentityDescription model) { identityId(model.identityId); logins(model.logins); creationDate(model.creationDate); lastModifiedDate(model.lastModifiedDate); } public final String getIdentityId() { return identityId; } @Override public final Builder identityId(String identityId) { this.identityId = identityId; return this; } public final void setIdentityId(String identityId) { this.identityId = identityId; } public final Collection getLogins() { return logins; } @Override public final Builder logins(Collection logins) { this.logins = LoginsListCopier.copy(logins); return this; } @Override @SafeVarargs public final Builder logins(String... logins) { logins(Arrays.asList(logins)); return this; } public final void setLogins(Collection logins) { this.logins = LoginsListCopier.copy(logins); } public final Instant getCreationDate() { return creationDate; } @Override public final Builder creationDate(Instant creationDate) { this.creationDate = creationDate; return this; } public final void setCreationDate(Instant creationDate) { this.creationDate = creationDate; } public final Instant getLastModifiedDate() { return lastModifiedDate; } @Override public final Builder lastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } public final void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } @Override public IdentityDescription build() { return new IdentityDescription(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy