software.amazon.awssdk.services.sagemaker.model.DescribeEdgeDeploymentPlanResponse 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.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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeEdgeDeploymentPlanResponse extends SageMakerResponse implements
ToCopyableBuilder {
private static final SdkField EDGE_DEPLOYMENT_PLAN_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EdgeDeploymentPlanArn").getter(getter(DescribeEdgeDeploymentPlanResponse::edgeDeploymentPlanArn))
.setter(setter(Builder::edgeDeploymentPlanArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeDeploymentPlanArn").build())
.build();
private static final SdkField EDGE_DEPLOYMENT_PLAN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EdgeDeploymentPlanName").getter(getter(DescribeEdgeDeploymentPlanResponse::edgeDeploymentPlanName))
.setter(setter(Builder::edgeDeploymentPlanName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeDeploymentPlanName").build())
.build();
private static final SdkField> MODEL_CONFIGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ModelConfigs")
.getter(getter(DescribeEdgeDeploymentPlanResponse::modelConfigs))
.setter(setter(Builder::modelConfigs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelConfigs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(EdgeDeploymentModelConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField DEVICE_FLEET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceFleetName").getter(getter(DescribeEdgeDeploymentPlanResponse::deviceFleetName))
.setter(setter(Builder::deviceFleetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceFleetName").build()).build();
private static final SdkField EDGE_DEPLOYMENT_SUCCESS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("EdgeDeploymentSuccess").getter(getter(DescribeEdgeDeploymentPlanResponse::edgeDeploymentSuccess))
.setter(setter(Builder::edgeDeploymentSuccess))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeDeploymentSuccess").build())
.build();
private static final SdkField EDGE_DEPLOYMENT_PENDING_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("EdgeDeploymentPending").getter(getter(DescribeEdgeDeploymentPlanResponse::edgeDeploymentPending))
.setter(setter(Builder::edgeDeploymentPending))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeDeploymentPending").build())
.build();
private static final SdkField EDGE_DEPLOYMENT_FAILED_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("EdgeDeploymentFailed").getter(getter(DescribeEdgeDeploymentPlanResponse::edgeDeploymentFailed))
.setter(setter(Builder::edgeDeploymentFailed))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeDeploymentFailed").build())
.build();
private static final SdkField> STAGES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Stages")
.getter(getter(DescribeEdgeDeploymentPlanResponse::stages))
.setter(setter(Builder::stages))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Stages").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(DeploymentStageStatusSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextToken").getter(getter(DescribeEdgeDeploymentPlanResponse::nextToken))
.setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeEdgeDeploymentPlanResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(DescribeEdgeDeploymentPlanResponse::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
EDGE_DEPLOYMENT_PLAN_ARN_FIELD, EDGE_DEPLOYMENT_PLAN_NAME_FIELD, MODEL_CONFIGS_FIELD, DEVICE_FLEET_NAME_FIELD,
EDGE_DEPLOYMENT_SUCCESS_FIELD, EDGE_DEPLOYMENT_PENDING_FIELD, EDGE_DEPLOYMENT_FAILED_FIELD, STAGES_FIELD,
NEXT_TOKEN_FIELD, CREATION_TIME_FIELD, LAST_MODIFIED_TIME_FIELD));
private final String edgeDeploymentPlanArn;
private final String edgeDeploymentPlanName;
private final List modelConfigs;
private final String deviceFleetName;
private final Integer edgeDeploymentSuccess;
private final Integer edgeDeploymentPending;
private final Integer edgeDeploymentFailed;
private final List stages;
private final String nextToken;
private final Instant creationTime;
private final Instant lastModifiedTime;
private DescribeEdgeDeploymentPlanResponse(BuilderImpl builder) {
super(builder);
this.edgeDeploymentPlanArn = builder.edgeDeploymentPlanArn;
this.edgeDeploymentPlanName = builder.edgeDeploymentPlanName;
this.modelConfigs = builder.modelConfigs;
this.deviceFleetName = builder.deviceFleetName;
this.edgeDeploymentSuccess = builder.edgeDeploymentSuccess;
this.edgeDeploymentPending = builder.edgeDeploymentPending;
this.edgeDeploymentFailed = builder.edgeDeploymentFailed;
this.stages = builder.stages;
this.nextToken = builder.nextToken;
this.creationTime = builder.creationTime;
this.lastModifiedTime = builder.lastModifiedTime;
}
/**
*
* The ARN of edge deployment plan.
*
*
* @return The ARN of edge deployment plan.
*/
public final String edgeDeploymentPlanArn() {
return edgeDeploymentPlanArn;
}
/**
*
* The name of the edge deployment plan.
*
*
* @return The name of the edge deployment plan.
*/
public final String edgeDeploymentPlanName() {
return edgeDeploymentPlanName;
}
/**
* For responses, this returns true if the service returned a value for the ModelConfigs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasModelConfigs() {
return modelConfigs != null && !(modelConfigs instanceof SdkAutoConstructList);
}
/**
*
* List of models associated with the edge deployment plan.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasModelConfigs} method.
*
*
* @return List of models associated with the edge deployment plan.
*/
public final List modelConfigs() {
return modelConfigs;
}
/**
*
* The device fleet used for this edge deployment plan.
*
*
* @return The device fleet used for this edge deployment plan.
*/
public final String deviceFleetName() {
return deviceFleetName;
}
/**
*
* The number of edge devices with the successful deployment.
*
*
* @return The number of edge devices with the successful deployment.
*/
public final Integer edgeDeploymentSuccess() {
return edgeDeploymentSuccess;
}
/**
*
* The number of edge devices yet to pick up deployment, or in progress.
*
*
* @return The number of edge devices yet to pick up deployment, or in progress.
*/
public final Integer edgeDeploymentPending() {
return edgeDeploymentPending;
}
/**
*
* The number of edge devices that failed the deployment.
*
*
* @return The number of edge devices that failed the deployment.
*/
public final Integer edgeDeploymentFailed() {
return edgeDeploymentFailed;
}
/**
* For responses, this returns true if the service returned a value for the Stages property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasStages() {
return stages != null && !(stages instanceof SdkAutoConstructList);
}
/**
*
* List of stages in the edge deployment plan.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasStages} method.
*
*
* @return List of stages in the edge deployment plan.
*/
public final List stages() {
return stages;
}
/**
*
* Token to use when calling the next set of stages in the edge deployment plan.
*
*
* @return Token to use when calling the next set of stages in the edge deployment plan.
*/
public final String nextToken() {
return nextToken;
}
/**
*
* The time when the edge deployment plan was created.
*
*
* @return The time when the edge deployment plan was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The time when the edge deployment plan was last updated.
*
*
* @return The time when the edge deployment plan was last updated.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
@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(edgeDeploymentPlanArn());
hashCode = 31 * hashCode + Objects.hashCode(edgeDeploymentPlanName());
hashCode = 31 * hashCode + Objects.hashCode(hasModelConfigs() ? modelConfigs() : null);
hashCode = 31 * hashCode + Objects.hashCode(deviceFleetName());
hashCode = 31 * hashCode + Objects.hashCode(edgeDeploymentSuccess());
hashCode = 31 * hashCode + Objects.hashCode(edgeDeploymentPending());
hashCode = 31 * hashCode + Objects.hashCode(edgeDeploymentFailed());
hashCode = 31 * hashCode + Objects.hashCode(hasStages() ? stages() : null);
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
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 DescribeEdgeDeploymentPlanResponse)) {
return false;
}
DescribeEdgeDeploymentPlanResponse other = (DescribeEdgeDeploymentPlanResponse) obj;
return Objects.equals(edgeDeploymentPlanArn(), other.edgeDeploymentPlanArn())
&& Objects.equals(edgeDeploymentPlanName(), other.edgeDeploymentPlanName())
&& hasModelConfigs() == other.hasModelConfigs() && Objects.equals(modelConfigs(), other.modelConfigs())
&& Objects.equals(deviceFleetName(), other.deviceFleetName())
&& Objects.equals(edgeDeploymentSuccess(), other.edgeDeploymentSuccess())
&& Objects.equals(edgeDeploymentPending(), other.edgeDeploymentPending())
&& Objects.equals(edgeDeploymentFailed(), other.edgeDeploymentFailed()) && hasStages() == other.hasStages()
&& Objects.equals(stages(), other.stages()) && Objects.equals(nextToken(), other.nextToken())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime());
}
/**
* 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("DescribeEdgeDeploymentPlanResponse").add("EdgeDeploymentPlanArn", edgeDeploymentPlanArn())
.add("EdgeDeploymentPlanName", edgeDeploymentPlanName())
.add("ModelConfigs", hasModelConfigs() ? modelConfigs() : null).add("DeviceFleetName", deviceFleetName())
.add("EdgeDeploymentSuccess", edgeDeploymentSuccess()).add("EdgeDeploymentPending", edgeDeploymentPending())
.add("EdgeDeploymentFailed", edgeDeploymentFailed()).add("Stages", hasStages() ? stages() : null)
.add("NextToken", nextToken()).add("CreationTime", creationTime()).add("LastModifiedTime", lastModifiedTime())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "EdgeDeploymentPlanArn":
return Optional.ofNullable(clazz.cast(edgeDeploymentPlanArn()));
case "EdgeDeploymentPlanName":
return Optional.ofNullable(clazz.cast(edgeDeploymentPlanName()));
case "ModelConfigs":
return Optional.ofNullable(clazz.cast(modelConfigs()));
case "DeviceFleetName":
return Optional.ofNullable(clazz.cast(deviceFleetName()));
case "EdgeDeploymentSuccess":
return Optional.ofNullable(clazz.cast(edgeDeploymentSuccess()));
case "EdgeDeploymentPending":
return Optional.ofNullable(clazz.cast(edgeDeploymentPending()));
case "EdgeDeploymentFailed":
return Optional.ofNullable(clazz.cast(edgeDeploymentFailed()));
case "Stages":
return Optional.ofNullable(clazz.cast(stages()));
case "NextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function