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

software.amazon.awssdk.services.codestar.model.DescribeUserProfileResponse Maven / Gradle / Ivy

/*
 * 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.codestar.model;

import java.time.Instant;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class DescribeUserProfileResponse extends CodeStarResponse implements
        ToCopyableBuilder {
    private static final SdkField USER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("userArn").getter(getter(DescribeUserProfileResponse::userArn)).setter(setter(Builder::userArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("userArn").build()).build();

    private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("displayName").getter(getter(DescribeUserProfileResponse::displayName))
            .setter(setter(Builder::displayName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("displayName").build()).build();

    private static final SdkField EMAIL_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("emailAddress").getter(getter(DescribeUserProfileResponse::emailAddress))
            .setter(setter(Builder::emailAddress))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("emailAddress").build()).build();

    private static final SdkField SSH_PUBLIC_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("sshPublicKey").getter(getter(DescribeUserProfileResponse::sshPublicKey))
            .setter(setter(Builder::sshPublicKey))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sshPublicKey").build()).build();

    private static final SdkField CREATED_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("createdTimestamp").getter(getter(DescribeUserProfileResponse::createdTimestamp))
            .setter(setter(Builder::createdTimestamp))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdTimestamp").build()).build();

    private static final SdkField LAST_MODIFIED_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("lastModifiedTimestamp").getter(getter(DescribeUserProfileResponse::lastModifiedTimestamp))
            .setter(setter(Builder::lastModifiedTimestamp))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastModifiedTimestamp").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays
            .asList(USER_ARN_FIELD, DISPLAY_NAME_FIELD, EMAIL_ADDRESS_FIELD, SSH_PUBLIC_KEY_FIELD, CREATED_TIMESTAMP_FIELD,
                    LAST_MODIFIED_TIMESTAMP_FIELD));

    private final String userArn;

    private final String displayName;

    private final String emailAddress;

    private final String sshPublicKey;

    private final Instant createdTimestamp;

    private final Instant lastModifiedTimestamp;

    private DescribeUserProfileResponse(BuilderImpl builder) {
        super(builder);
        this.userArn = builder.userArn;
        this.displayName = builder.displayName;
        this.emailAddress = builder.emailAddress;
        this.sshPublicKey = builder.sshPublicKey;
        this.createdTimestamp = builder.createdTimestamp;
        this.lastModifiedTimestamp = builder.lastModifiedTimestamp;
    }

    /**
     * 

* The Amazon Resource Name (ARN) of the user. *

* * @return The Amazon Resource Name (ARN) of the user. */ public final String userArn() { return userArn; } /** *

* The display name shown for the user in AWS CodeStar projects. For example, this could be set to both first and * last name ("Mary Major") or a single name ("Mary"). The display name is also used to generate the initial icon * associated with the user in AWS CodeStar projects. If spaces are included in the display name, the first * character that appears after the space will be used as the second character in the user initial icon. The initial * icon displays a maximum of two characters, so a display name with more than one space (for example * "Mary Jane Major") would generate an initial icon using the first character and the first character after the * space ("MJ", not "MM"). *

* * @return The display name shown for the user in AWS CodeStar projects. For example, this could be set to both * first and last name ("Mary Major") or a single name ("Mary"). The display name is also used to generate * the initial icon associated with the user in AWS CodeStar projects. If spaces are included in the display * name, the first character that appears after the space will be used as the second character in the user * initial icon. The initial icon displays a maximum of two characters, so a display name with more than one * space (for example "Mary Jane Major") would generate an initial icon using the first character and the * first character after the space ("MJ", not "MM"). */ public final String displayName() { return displayName; } /** *

* The email address for the user. Optional. *

* * @return The email address for the user. Optional. */ public final String emailAddress() { return emailAddress; } /** *

* The SSH public key associated with the user. This SSH public key is associated with the user profile, and can be * used in conjunction with the associated private key for access to project resources, such as Amazon EC2 * instances, if a project owner grants remote access to those resources. *

* * @return The SSH public key associated with the user. This SSH public key is associated with the user profile, and * can be used in conjunction with the associated private key for access to project resources, such as * Amazon EC2 instances, if a project owner grants remote access to those resources. */ public final String sshPublicKey() { return sshPublicKey; } /** *

* The date and time when the user profile was created in AWS CodeStar, in timestamp format. *

* * @return The date and time when the user profile was created in AWS CodeStar, in timestamp format. */ public final Instant createdTimestamp() { return createdTimestamp; } /** *

* The date and time when the user profile was last modified, in timestamp format. *

* * @return The date and time when the user profile was last modified, in timestamp format. */ public final Instant lastModifiedTimestamp() { return lastModifiedTimestamp; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(userArn()); hashCode = 31 * hashCode + Objects.hashCode(displayName()); hashCode = 31 * hashCode + Objects.hashCode(emailAddress()); hashCode = 31 * hashCode + Objects.hashCode(sshPublicKey()); hashCode = 31 * hashCode + Objects.hashCode(createdTimestamp()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTimestamp()); 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 DescribeUserProfileResponse)) { return false; } DescribeUserProfileResponse other = (DescribeUserProfileResponse) obj; return Objects.equals(userArn(), other.userArn()) && Objects.equals(displayName(), other.displayName()) && Objects.equals(emailAddress(), other.emailAddress()) && Objects.equals(sshPublicKey(), other.sshPublicKey()) && Objects.equals(createdTimestamp(), other.createdTimestamp()) && Objects.equals(lastModifiedTimestamp(), other.lastModifiedTimestamp()); } /** * 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("DescribeUserProfileResponse").add("UserArn", userArn()) .add("DisplayName", displayName() == null ? null : "*** Sensitive Data Redacted ***") .add("EmailAddress", emailAddress() == null ? null : "*** Sensitive Data Redacted ***") .add("SshPublicKey", sshPublicKey()).add("CreatedTimestamp", createdTimestamp()) .add("LastModifiedTimestamp", lastModifiedTimestamp()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "userArn": return Optional.ofNullable(clazz.cast(userArn())); case "displayName": return Optional.ofNullable(clazz.cast(displayName())); case "emailAddress": return Optional.ofNullable(clazz.cast(emailAddress())); case "sshPublicKey": return Optional.ofNullable(clazz.cast(sshPublicKey())); case "createdTimestamp": return Optional.ofNullable(clazz.cast(createdTimestamp())); case "lastModifiedTimestamp": return Optional.ofNullable(clazz.cast(lastModifiedTimestamp())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeUserProfileResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends CodeStarResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the user. *

* * @param userArn * The Amazon Resource Name (ARN) of the user. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userArn(String userArn); /** *

* The display name shown for the user in AWS CodeStar projects. For example, this could be set to both first * and last name ("Mary Major") or a single name ("Mary"). The display name is also used to generate the initial * icon associated with the user in AWS CodeStar projects. If spaces are included in the display name, the first * character that appears after the space will be used as the second character in the user initial icon. The * initial icon displays a maximum of two characters, so a display name with more than one space (for example * "Mary Jane Major") would generate an initial icon using the first character and the first character after the * space ("MJ", not "MM"). *

* * @param displayName * The display name shown for the user in AWS CodeStar projects. For example, this could be set to both * first and last name ("Mary Major") or a single name ("Mary"). The display name is also used to * generate the initial icon associated with the user in AWS CodeStar projects. If spaces are included in * the display name, the first character that appears after the space will be used as the second * character in the user initial icon. The initial icon displays a maximum of two characters, so a * display name with more than one space (for example "Mary Jane Major") would generate an initial icon * using the first character and the first character after the space ("MJ", not "MM"). * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayName(String displayName); /** *

* The email address for the user. Optional. *

* * @param emailAddress * The email address for the user. Optional. * @return Returns a reference to this object so that method calls can be chained together. */ Builder emailAddress(String emailAddress); /** *

* The SSH public key associated with the user. This SSH public key is associated with the user profile, and can * be used in conjunction with the associated private key for access to project resources, such as Amazon EC2 * instances, if a project owner grants remote access to those resources. *

* * @param sshPublicKey * The SSH public key associated with the user. This SSH public key is associated with the user profile, * and can be used in conjunction with the associated private key for access to project resources, such * as Amazon EC2 instances, if a project owner grants remote access to those resources. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sshPublicKey(String sshPublicKey); /** *

* The date and time when the user profile was created in AWS CodeStar, in timestamp format. *

* * @param createdTimestamp * The date and time when the user profile was created in AWS CodeStar, in timestamp format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdTimestamp(Instant createdTimestamp); /** *

* The date and time when the user profile was last modified, in timestamp format. *

* * @param lastModifiedTimestamp * The date and time when the user profile was last modified, in timestamp format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedTimestamp(Instant lastModifiedTimestamp); } static final class BuilderImpl extends CodeStarResponse.BuilderImpl implements Builder { private String userArn; private String displayName; private String emailAddress; private String sshPublicKey; private Instant createdTimestamp; private Instant lastModifiedTimestamp; private BuilderImpl() { } private BuilderImpl(DescribeUserProfileResponse model) { super(model); userArn(model.userArn); displayName(model.displayName); emailAddress(model.emailAddress); sshPublicKey(model.sshPublicKey); createdTimestamp(model.createdTimestamp); lastModifiedTimestamp(model.lastModifiedTimestamp); } public final String getUserArn() { return userArn; } public final void setUserArn(String userArn) { this.userArn = userArn; } @Override public final Builder userArn(String userArn) { this.userArn = userArn; return this; } public final String getDisplayName() { return displayName; } public final void setDisplayName(String displayName) { this.displayName = displayName; } @Override public final Builder displayName(String displayName) { this.displayName = displayName; return this; } public final String getEmailAddress() { return emailAddress; } public final void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } @Override public final Builder emailAddress(String emailAddress) { this.emailAddress = emailAddress; return this; } public final String getSshPublicKey() { return sshPublicKey; } public final void setSshPublicKey(String sshPublicKey) { this.sshPublicKey = sshPublicKey; } @Override public final Builder sshPublicKey(String sshPublicKey) { this.sshPublicKey = sshPublicKey; return this; } public final Instant getCreatedTimestamp() { return createdTimestamp; } public final void setCreatedTimestamp(Instant createdTimestamp) { this.createdTimestamp = createdTimestamp; } @Override public final Builder createdTimestamp(Instant createdTimestamp) { this.createdTimestamp = createdTimestamp; return this; } public final Instant getLastModifiedTimestamp() { return lastModifiedTimestamp; } public final void setLastModifiedTimestamp(Instant lastModifiedTimestamp) { this.lastModifiedTimestamp = lastModifiedTimestamp; } @Override public final Builder lastModifiedTimestamp(Instant lastModifiedTimestamp) { this.lastModifiedTimestamp = lastModifiedTimestamp; return this; } @Override public DescribeUserProfileResponse build() { return new DescribeUserProfileResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy