software.amazon.awssdk.services.wellarchitected.model.ProfileSummary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wellarchitected Show documentation
Show all versions of wellarchitected Show documentation
The AWS Java SDK for Well Architected module holds the client classes that are used for
communicating with Well Architected.
/*
* 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.wellarchitected.model;
import java.io.Serializable;
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;
/**
*
* Summary of a profile.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ProfileSummary implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField PROFILE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProfileArn").getter(getter(ProfileSummary::profileArn)).setter(setter(Builder::profileArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfileArn").build()).build();
private static final SdkField PROFILE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProfileVersion").getter(getter(ProfileSummary::profileVersion)).setter(setter(Builder::profileVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfileVersion").build()).build();
private static final SdkField PROFILE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProfileName").getter(getter(ProfileSummary::profileName)).setter(setter(Builder::profileName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfileName").build()).build();
private static final SdkField PROFILE_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProfileDescription").getter(getter(ProfileSummary::profileDescription))
.setter(setter(Builder::profileDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfileDescription").build())
.build();
private static final SdkField OWNER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Owner")
.getter(getter(ProfileSummary::owner)).setter(setter(Builder::owner))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Owner").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreatedAt").getter(getter(ProfileSummary::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();
private static final SdkField UPDATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("UpdatedAt").getter(getter(ProfileSummary::updatedAt)).setter(setter(Builder::updatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpdatedAt").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays
.asList(PROFILE_ARN_FIELD, PROFILE_VERSION_FIELD, PROFILE_NAME_FIELD, PROFILE_DESCRIPTION_FIELD, OWNER_FIELD,
CREATED_AT_FIELD, UPDATED_AT_FIELD));
private static final long serialVersionUID = 1L;
private final String profileArn;
private final String profileVersion;
private final String profileName;
private final String profileDescription;
private final String owner;
private final Instant createdAt;
private final Instant updatedAt;
private ProfileSummary(BuilderImpl builder) {
this.profileArn = builder.profileArn;
this.profileVersion = builder.profileVersion;
this.profileName = builder.profileName;
this.profileDescription = builder.profileDescription;
this.owner = builder.owner;
this.createdAt = builder.createdAt;
this.updatedAt = builder.updatedAt;
}
/**
*
* The profile ARN.
*
*
* @return The profile ARN.
*/
public final String profileArn() {
return profileArn;
}
/**
*
* The profile version.
*
*
* @return The profile version.
*/
public final String profileVersion() {
return profileVersion;
}
/**
*
* The profile name.
*
*
* @return The profile name.
*/
public final String profileName() {
return profileName;
}
/**
*
* The profile description.
*
*
* @return The profile description.
*/
public final String profileDescription() {
return profileDescription;
}
/**
* Returns the value of the Owner property for this object.
*
* @return The value of the Owner property for this object.
*/
public final String owner() {
return owner;
}
/**
* Returns the value of the CreatedAt property for this object.
*
* @return The value of the CreatedAt property for this object.
*/
public final Instant createdAt() {
return createdAt;
}
/**
* Returns the value of the UpdatedAt property for this object.
*
* @return The value of the UpdatedAt property for this object.
*/
public final Instant updatedAt() {
return updatedAt;
}
@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 + Objects.hashCode(profileArn());
hashCode = 31 * hashCode + Objects.hashCode(profileVersion());
hashCode = 31 * hashCode + Objects.hashCode(profileName());
hashCode = 31 * hashCode + Objects.hashCode(profileDescription());
hashCode = 31 * hashCode + Objects.hashCode(owner());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(updatedAt());
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 ProfileSummary)) {
return false;
}
ProfileSummary other = (ProfileSummary) obj;
return Objects.equals(profileArn(), other.profileArn()) && Objects.equals(profileVersion(), other.profileVersion())
&& Objects.equals(profileName(), other.profileName())
&& Objects.equals(profileDescription(), other.profileDescription()) && Objects.equals(owner(), other.owner())
&& Objects.equals(createdAt(), other.createdAt()) && Objects.equals(updatedAt(), other.updatedAt());
}
/**
* 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("ProfileSummary").add("ProfileArn", profileArn()).add("ProfileVersion", profileVersion())
.add("ProfileName", profileName()).add("ProfileDescription", profileDescription()).add("Owner", owner())
.add("CreatedAt", createdAt()).add("UpdatedAt", updatedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ProfileArn":
return Optional.ofNullable(clazz.cast(profileArn()));
case "ProfileVersion":
return Optional.ofNullable(clazz.cast(profileVersion()));
case "ProfileName":
return Optional.ofNullable(clazz.cast(profileName()));
case "ProfileDescription":
return Optional.ofNullable(clazz.cast(profileDescription()));
case "Owner":
return Optional.ofNullable(clazz.cast(owner()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "UpdatedAt":
return Optional.ofNullable(clazz.cast(updatedAt()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function