software.amazon.awssdk.services.m2.model.ApplicationSummary Maven / Gradle / Ivy
Show all versions of m2 Show documentation
/*
* 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.m2.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;
/**
*
* A subset of the possible application attributes. Used in the application list.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ApplicationSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField APPLICATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("applicationArn").getter(getter(ApplicationSummary::applicationArn))
.setter(setter(Builder::applicationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("applicationArn").build()).build();
private static final SdkField APPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("applicationId").getter(getter(ApplicationSummary::applicationId)).setter(setter(Builder::applicationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("applicationId").build()).build();
private static final SdkField APPLICATION_VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("applicationVersion").getter(getter(ApplicationSummary::applicationVersion))
.setter(setter(Builder::applicationVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("applicationVersion").build())
.build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("creationTime").getter(getter(ApplicationSummary::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build()).build();
private static final SdkField DEPLOYMENT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("deploymentStatus").getter(getter(ApplicationSummary::deploymentStatusAsString))
.setter(setter(Builder::deploymentStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentStatus").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(ApplicationSummary::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField ENGINE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("engineType").getter(getter(ApplicationSummary::engineTypeAsString)).setter(setter(Builder::engineType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("engineType").build()).build();
private static final SdkField ENVIRONMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("environmentId").getter(getter(ApplicationSummary::environmentId)).setter(setter(Builder::environmentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environmentId").build()).build();
private static final SdkField LAST_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("lastStartTime").getter(getter(ApplicationSummary::lastStartTime)).setter(setter(Builder::lastStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastStartTime").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(ApplicationSummary::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("roleArn").getter(getter(ApplicationSummary::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(ApplicationSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField VERSION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("versionStatus").getter(getter(ApplicationSummary::versionStatusAsString))
.setter(setter(Builder::versionStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("versionStatus").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_ARN_FIELD,
APPLICATION_ID_FIELD, APPLICATION_VERSION_FIELD, CREATION_TIME_FIELD, DEPLOYMENT_STATUS_FIELD, DESCRIPTION_FIELD,
ENGINE_TYPE_FIELD, ENVIRONMENT_ID_FIELD, LAST_START_TIME_FIELD, NAME_FIELD, ROLE_ARN_FIELD, STATUS_FIELD,
VERSION_STATUS_FIELD));
private static final long serialVersionUID = 1L;
private final String applicationArn;
private final String applicationId;
private final Integer applicationVersion;
private final Instant creationTime;
private final String deploymentStatus;
private final String description;
private final String engineType;
private final String environmentId;
private final Instant lastStartTime;
private final String name;
private final String roleArn;
private final String status;
private final String versionStatus;
private ApplicationSummary(BuilderImpl builder) {
this.applicationArn = builder.applicationArn;
this.applicationId = builder.applicationId;
this.applicationVersion = builder.applicationVersion;
this.creationTime = builder.creationTime;
this.deploymentStatus = builder.deploymentStatus;
this.description = builder.description;
this.engineType = builder.engineType;
this.environmentId = builder.environmentId;
this.lastStartTime = builder.lastStartTime;
this.name = builder.name;
this.roleArn = builder.roleArn;
this.status = builder.status;
this.versionStatus = builder.versionStatus;
}
/**
*
* The Amazon Resource Name (ARN) of the application.
*
*
* @return The Amazon Resource Name (ARN) of the application.
*/
public final String applicationArn() {
return applicationArn;
}
/**
*
* The unique identifier of the application.
*
*
* @return The unique identifier of the application.
*/
public final String applicationId() {
return applicationId;
}
/**
*
* The version of the application.
*
*
* @return The version of the application.
*/
public final Integer applicationVersion() {
return applicationVersion;
}
/**
*
* The timestamp when the application was created.
*
*
* @return The timestamp when the application was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* Indicates either an ongoing deployment or if the application has ever deployed successfully.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentStatus}
* will return {@link ApplicationDeploymentLifecycle#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service
* is available from {@link #deploymentStatusAsString}.
*
*
* @return Indicates either an ongoing deployment or if the application has ever deployed successfully.
* @see ApplicationDeploymentLifecycle
*/
public final ApplicationDeploymentLifecycle deploymentStatus() {
return ApplicationDeploymentLifecycle.fromValue(deploymentStatus);
}
/**
*
* Indicates either an ongoing deployment or if the application has ever deployed successfully.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentStatus}
* will return {@link ApplicationDeploymentLifecycle#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service
* is available from {@link #deploymentStatusAsString}.
*
*
* @return Indicates either an ongoing deployment or if the application has ever deployed successfully.
* @see ApplicationDeploymentLifecycle
*/
public final String deploymentStatusAsString() {
return deploymentStatus;
}
/**
*
* The description of the application.
*
*
* @return The description of the application.
*/
public final String description() {
return description;
}
/**
*
* The type of the target platform for this application.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #engineType} will
* return {@link EngineType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #engineTypeAsString}.
*
*
* @return The type of the target platform for this application.
* @see EngineType
*/
public final EngineType engineType() {
return EngineType.fromValue(engineType);
}
/**
*
* The type of the target platform for this application.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #engineType} will
* return {@link EngineType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #engineTypeAsString}.
*
*
* @return The type of the target platform for this application.
* @see EngineType
*/
public final String engineTypeAsString() {
return engineType;
}
/**
*
* The unique identifier of the runtime environment that hosts this application.
*
*
* @return The unique identifier of the runtime environment that hosts this application.
*/
public final String environmentId() {
return environmentId;
}
/**
*
* The timestamp when you last started the application. Null until the application runs for the first time.
*
*
* @return The timestamp when you last started the application. Null until the application runs for the first time.
*/
public final Instant lastStartTime() {
return lastStartTime;
}
/**
*
* The name of the application.
*
*
* @return The name of the application.
*/
public final String name() {
return name;
}
/**
*
* The Amazon Resource Name (ARN) of the role associated with the application.
*
*
* @return The Amazon Resource Name (ARN) of the role associated with the application.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* The status of the application.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ApplicationLifecycle#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #statusAsString}.
*
*
* @return The status of the application.
* @see ApplicationLifecycle
*/
public final ApplicationLifecycle status() {
return ApplicationLifecycle.fromValue(status);
}
/**
*
* The status of the application.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ApplicationLifecycle#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #statusAsString}.
*
*
* @return The status of the application.
* @see ApplicationLifecycle
*/
public final String statusAsString() {
return status;
}
/**
*
* Indicates the status of the latest version of the application.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #versionStatus}
* will return {@link ApplicationVersionLifecycle#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #versionStatusAsString}.
*
*
* @return Indicates the status of the latest version of the application.
* @see ApplicationVersionLifecycle
*/
public final ApplicationVersionLifecycle versionStatus() {
return ApplicationVersionLifecycle.fromValue(versionStatus);
}
/**
*
* Indicates the status of the latest version of the application.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #versionStatus}
* will return {@link ApplicationVersionLifecycle#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #versionStatusAsString}.
*
*
* @return Indicates the status of the latest version of the application.
* @see ApplicationVersionLifecycle
*/
public final String versionStatusAsString() {
return versionStatus;
}
@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(applicationArn());
hashCode = 31 * hashCode + Objects.hashCode(applicationId());
hashCode = 31 * hashCode + Objects.hashCode(applicationVersion());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(deploymentStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(engineTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(environmentId());
hashCode = 31 * hashCode + Objects.hashCode(lastStartTime());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(versionStatusAsString());
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 ApplicationSummary)) {
return false;
}
ApplicationSummary other = (ApplicationSummary) obj;
return Objects.equals(applicationArn(), other.applicationArn()) && Objects.equals(applicationId(), other.applicationId())
&& Objects.equals(applicationVersion(), other.applicationVersion())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(deploymentStatusAsString(), other.deploymentStatusAsString())
&& Objects.equals(description(), other.description())
&& Objects.equals(engineTypeAsString(), other.engineTypeAsString())
&& Objects.equals(environmentId(), other.environmentId())
&& Objects.equals(lastStartTime(), other.lastStartTime()) && Objects.equals(name(), other.name())
&& Objects.equals(roleArn(), other.roleArn()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(versionStatusAsString(), other.versionStatusAsString());
}
/**
* 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("ApplicationSummary").add("ApplicationArn", applicationArn())
.add("ApplicationId", applicationId()).add("ApplicationVersion", applicationVersion())
.add("CreationTime", creationTime()).add("DeploymentStatus", deploymentStatusAsString())
.add("Description", description()).add("EngineType", engineTypeAsString()).add("EnvironmentId", environmentId())
.add("LastStartTime", lastStartTime()).add("Name", name()).add("RoleArn", roleArn())
.add("Status", statusAsString()).add("VersionStatus", versionStatusAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "applicationArn":
return Optional.ofNullable(clazz.cast(applicationArn()));
case "applicationId":
return Optional.ofNullable(clazz.cast(applicationId()));
case "applicationVersion":
return Optional.ofNullable(clazz.cast(applicationVersion()));
case "creationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "deploymentStatus":
return Optional.ofNullable(clazz.cast(deploymentStatusAsString()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "engineType":
return Optional.ofNullable(clazz.cast(engineTypeAsString()));
case "environmentId":
return Optional.ofNullable(clazz.cast(environmentId()));
case "lastStartTime":
return Optional.ofNullable(clazz.cast(lastStartTime()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "roleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "versionStatus":
return Optional.ofNullable(clazz.cast(versionStatusAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function