software.amazon.awssdk.services.sagemaker.model.DescribeAppResponse Maven / Gradle / Ivy
Show all versions of sagemaker 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.sagemaker.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.Consumer;
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 DescribeAppResponse extends SageMakerResponse implements
ToCopyableBuilder {
private static final SdkField APP_ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("AppArn")
.getter(getter(DescribeAppResponse::appArn)).setter(setter(Builder::appArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppArn").build()).build();
private static final SdkField APP_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AppType").getter(getter(DescribeAppResponse::appTypeAsString)).setter(setter(Builder::appType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppType").build()).build();
private static final SdkField APP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AppName").getter(getter(DescribeAppResponse::appName)).setter(setter(Builder::appName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppName").build()).build();
private static final SdkField DOMAIN_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DomainId").getter(getter(DescribeAppResponse::domainId)).setter(setter(Builder::domainId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainId").build()).build();
private static final SdkField USER_PROFILE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("UserProfileName").getter(getter(DescribeAppResponse::userProfileName))
.setter(setter(Builder::userProfileName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserProfileName").build()).build();
private static final SdkField SPACE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SpaceName").getter(getter(DescribeAppResponse::spaceName)).setter(setter(Builder::spaceName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SpaceName").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(DescribeAppResponse::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField LAST_HEALTH_CHECK_TIMESTAMP_FIELD = SdkField
. builder(MarshallingType.INSTANT).memberName("LastHealthCheckTimestamp")
.getter(getter(DescribeAppResponse::lastHealthCheckTimestamp)).setter(setter(Builder::lastHealthCheckTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastHealthCheckTimestamp").build())
.build();
private static final SdkField LAST_USER_ACTIVITY_TIMESTAMP_FIELD = SdkField
. builder(MarshallingType.INSTANT).memberName("LastUserActivityTimestamp")
.getter(getter(DescribeAppResponse::lastUserActivityTimestamp)).setter(setter(Builder::lastUserActivityTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUserActivityTimestamp").build())
.build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeAppResponse::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FailureReason").getter(getter(DescribeAppResponse::failureReason))
.setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build();
private static final SdkField RESOURCE_SPEC_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("ResourceSpec").getter(getter(DescribeAppResponse::resourceSpec)).setter(setter(Builder::resourceSpec))
.constructor(ResourceSpec::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceSpec").build()).build();
private static final SdkField BUILT_IN_LIFECYCLE_CONFIG_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BuiltInLifecycleConfigArn").getter(getter(DescribeAppResponse::builtInLifecycleConfigArn))
.setter(setter(Builder::builtInLifecycleConfigArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BuiltInLifecycleConfigArn").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APP_ARN_FIELD, APP_TYPE_FIELD,
APP_NAME_FIELD, DOMAIN_ID_FIELD, USER_PROFILE_NAME_FIELD, SPACE_NAME_FIELD, STATUS_FIELD,
LAST_HEALTH_CHECK_TIMESTAMP_FIELD, LAST_USER_ACTIVITY_TIMESTAMP_FIELD, CREATION_TIME_FIELD, FAILURE_REASON_FIELD,
RESOURCE_SPEC_FIELD, BUILT_IN_LIFECYCLE_CONFIG_ARN_FIELD));
private final String appArn;
private final String appType;
private final String appName;
private final String domainId;
private final String userProfileName;
private final String spaceName;
private final String status;
private final Instant lastHealthCheckTimestamp;
private final Instant lastUserActivityTimestamp;
private final Instant creationTime;
private final String failureReason;
private final ResourceSpec resourceSpec;
private final String builtInLifecycleConfigArn;
private DescribeAppResponse(BuilderImpl builder) {
super(builder);
this.appArn = builder.appArn;
this.appType = builder.appType;
this.appName = builder.appName;
this.domainId = builder.domainId;
this.userProfileName = builder.userProfileName;
this.spaceName = builder.spaceName;
this.status = builder.status;
this.lastHealthCheckTimestamp = builder.lastHealthCheckTimestamp;
this.lastUserActivityTimestamp = builder.lastUserActivityTimestamp;
this.creationTime = builder.creationTime;
this.failureReason = builder.failureReason;
this.resourceSpec = builder.resourceSpec;
this.builtInLifecycleConfigArn = builder.builtInLifecycleConfigArn;
}
/**
*
* The Amazon Resource Name (ARN) of the app.
*
*
* @return The Amazon Resource Name (ARN) of the app.
*/
public final String appArn() {
return appArn;
}
/**
*
* The type of app.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #appType} will
* return {@link AppType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #appTypeAsString}.
*
*
* @return The type of app.
* @see AppType
*/
public final AppType appType() {
return AppType.fromValue(appType);
}
/**
*
* The type of app.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #appType} will
* return {@link AppType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #appTypeAsString}.
*
*
* @return The type of app.
* @see AppType
*/
public final String appTypeAsString() {
return appType;
}
/**
*
* The name of the app.
*
*
* @return The name of the app.
*/
public final String appName() {
return appName;
}
/**
*
* The domain ID.
*
*
* @return The domain ID.
*/
public final String domainId() {
return domainId;
}
/**
*
* The user profile name.
*
*
* @return The user profile name.
*/
public final String userProfileName() {
return userProfileName;
}
/**
*
* The name of the space. If this value is not set, then UserProfileName
must be set.
*
*
* @return The name of the space. If this value is not set, then UserProfileName
must be set.
*/
public final String spaceName() {
return spaceName;
}
/**
*
* The status.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link AppStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status.
* @see AppStatus
*/
public final AppStatus status() {
return AppStatus.fromValue(status);
}
/**
*
* The status.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link AppStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status.
* @see AppStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The timestamp of the last health check.
*
*
* @return The timestamp of the last health check.
*/
public final Instant lastHealthCheckTimestamp() {
return lastHealthCheckTimestamp;
}
/**
*
* The timestamp of the last user's activity. LastUserActivityTimestamp
is also updated when SageMaker
* performs health checks without user activity. As a result, this value is set to the same value as
* LastHealthCheckTimestamp
.
*
*
* @return The timestamp of the last user's activity. LastUserActivityTimestamp
is also updated when
* SageMaker performs health checks without user activity. As a result, this value is set to the same value
* as LastHealthCheckTimestamp
.
*/
public final Instant lastUserActivityTimestamp() {
return lastUserActivityTimestamp;
}
/**
*
* The creation time of the application.
*
*
*
* After an application has been shut down for 24 hours, SageMaker deletes all metadata for the application. To be
* considered an update and retain application metadata, applications must be restarted within 24 hours after the
* previous application has been shut down. After this time window, creation of an application is considered a new
* application rather than an update of the previous application.
*
*
*
* @return The creation time of the application.
*
* After an application has been shut down for 24 hours, SageMaker deletes all metadata for the application.
* To be considered an update and retain application metadata, applications must be restarted within 24
* hours after the previous application has been shut down. After this time window, creation of an
* application is considered a new application rather than an update of the previous application.
*
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The failure reason.
*
*
* @return The failure reason.
*/
public final String failureReason() {
return failureReason;
}
/**
*
* The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.
*
*
* @return The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.
*/
public final ResourceSpec resourceSpec() {
return resourceSpec;
}
/**
*
* The lifecycle configuration that runs before the default lifecycle configuration
*
*
* @return The lifecycle configuration that runs before the default lifecycle configuration
*/
public final String builtInLifecycleConfigArn() {
return builtInLifecycleConfigArn;
}
@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(appArn());
hashCode = 31 * hashCode + Objects.hashCode(appTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(appName());
hashCode = 31 * hashCode + Objects.hashCode(domainId());
hashCode = 31 * hashCode + Objects.hashCode(userProfileName());
hashCode = 31 * hashCode + Objects.hashCode(spaceName());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(lastHealthCheckTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(lastUserActivityTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
hashCode = 31 * hashCode + Objects.hashCode(resourceSpec());
hashCode = 31 * hashCode + Objects.hashCode(builtInLifecycleConfigArn());
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 DescribeAppResponse)) {
return false;
}
DescribeAppResponse other = (DescribeAppResponse) obj;
return Objects.equals(appArn(), other.appArn()) && Objects.equals(appTypeAsString(), other.appTypeAsString())
&& Objects.equals(appName(), other.appName()) && Objects.equals(domainId(), other.domainId())
&& Objects.equals(userProfileName(), other.userProfileName()) && Objects.equals(spaceName(), other.spaceName())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(lastHealthCheckTimestamp(), other.lastHealthCheckTimestamp())
&& Objects.equals(lastUserActivityTimestamp(), other.lastUserActivityTimestamp())
&& Objects.equals(creationTime(), other.creationTime()) && Objects.equals(failureReason(), other.failureReason())
&& Objects.equals(resourceSpec(), other.resourceSpec())
&& Objects.equals(builtInLifecycleConfigArn(), other.builtInLifecycleConfigArn());
}
/**
* 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("DescribeAppResponse").add("AppArn", appArn()).add("AppType", appTypeAsString())
.add("AppName", appName()).add("DomainId", domainId()).add("UserProfileName", userProfileName())
.add("SpaceName", spaceName()).add("Status", statusAsString())
.add("LastHealthCheckTimestamp", lastHealthCheckTimestamp())
.add("LastUserActivityTimestamp", lastUserActivityTimestamp()).add("CreationTime", creationTime())
.add("FailureReason", failureReason()).add("ResourceSpec", resourceSpec())
.add("BuiltInLifecycleConfigArn", builtInLifecycleConfigArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AppArn":
return Optional.ofNullable(clazz.cast(appArn()));
case "AppType":
return Optional.ofNullable(clazz.cast(appTypeAsString()));
case "AppName":
return Optional.ofNullable(clazz.cast(appName()));
case "DomainId":
return Optional.ofNullable(clazz.cast(domainId()));
case "UserProfileName":
return Optional.ofNullable(clazz.cast(userProfileName()));
case "SpaceName":
return Optional.ofNullable(clazz.cast(spaceName()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "LastHealthCheckTimestamp":
return Optional.ofNullable(clazz.cast(lastHealthCheckTimestamp()));
case "LastUserActivityTimestamp":
return Optional.ofNullable(clazz.cast(lastUserActivityTimestamp()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "FailureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
case "ResourceSpec":
return Optional.ofNullable(clazz.cast(resourceSpec()));
case "BuiltInLifecycleConfigArn":
return Optional.ofNullable(clazz.cast(builtInLifecycleConfigArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function