software.amazon.awssdk.services.sagemaker.model.DeviceDeploymentSummary 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.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;
/**
*
* Contains information summarizing device details and deployment status.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeviceDeploymentSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField EDGE_DEPLOYMENT_PLAN_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EdgeDeploymentPlanArn").getter(getter(DeviceDeploymentSummary::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(DeviceDeploymentSummary::edgeDeploymentPlanName))
.setter(setter(Builder::edgeDeploymentPlanName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeDeploymentPlanName").build())
.build();
private static final SdkField STAGE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StageName").getter(getter(DeviceDeploymentSummary::stageName)).setter(setter(Builder::stageName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StageName").build()).build();
private static final SdkField DEPLOYED_STAGE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeployedStageName").getter(getter(DeviceDeploymentSummary::deployedStageName))
.setter(setter(Builder::deployedStageName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeployedStageName").build()).build();
private static final SdkField DEVICE_FLEET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceFleetName").getter(getter(DeviceDeploymentSummary::deviceFleetName))
.setter(setter(Builder::deviceFleetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceFleetName").build()).build();
private static final SdkField DEVICE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceName").getter(getter(DeviceDeploymentSummary::deviceName)).setter(setter(Builder::deviceName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceName").build()).build();
private static final SdkField DEVICE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceArn").getter(getter(DeviceDeploymentSummary::deviceArn)).setter(setter(Builder::deviceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceArn").build()).build();
private static final SdkField DEVICE_DEPLOYMENT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceDeploymentStatus").getter(getter(DeviceDeploymentSummary::deviceDeploymentStatusAsString))
.setter(setter(Builder::deviceDeploymentStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceDeploymentStatus").build())
.build();
private static final SdkField DEVICE_DEPLOYMENT_STATUS_MESSAGE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DeviceDeploymentStatusMessage")
.getter(getter(DeviceDeploymentSummary::deviceDeploymentStatusMessage))
.setter(setter(Builder::deviceDeploymentStatusMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceDeploymentStatusMessage")
.build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(DeviceDeploymentSummary::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField DEPLOYMENT_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("DeploymentStartTime").getter(getter(DeviceDeploymentSummary::deploymentStartTime))
.setter(setter(Builder::deploymentStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeploymentStartTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
EDGE_DEPLOYMENT_PLAN_ARN_FIELD, EDGE_DEPLOYMENT_PLAN_NAME_FIELD, STAGE_NAME_FIELD, DEPLOYED_STAGE_NAME_FIELD,
DEVICE_FLEET_NAME_FIELD, DEVICE_NAME_FIELD, DEVICE_ARN_FIELD, DEVICE_DEPLOYMENT_STATUS_FIELD,
DEVICE_DEPLOYMENT_STATUS_MESSAGE_FIELD, DESCRIPTION_FIELD, DEPLOYMENT_START_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String edgeDeploymentPlanArn;
private final String edgeDeploymentPlanName;
private final String stageName;
private final String deployedStageName;
private final String deviceFleetName;
private final String deviceName;
private final String deviceArn;
private final String deviceDeploymentStatus;
private final String deviceDeploymentStatusMessage;
private final String description;
private final Instant deploymentStartTime;
private DeviceDeploymentSummary(BuilderImpl builder) {
this.edgeDeploymentPlanArn = builder.edgeDeploymentPlanArn;
this.edgeDeploymentPlanName = builder.edgeDeploymentPlanName;
this.stageName = builder.stageName;
this.deployedStageName = builder.deployedStageName;
this.deviceFleetName = builder.deviceFleetName;
this.deviceName = builder.deviceName;
this.deviceArn = builder.deviceArn;
this.deviceDeploymentStatus = builder.deviceDeploymentStatus;
this.deviceDeploymentStatusMessage = builder.deviceDeploymentStatusMessage;
this.description = builder.description;
this.deploymentStartTime = builder.deploymentStartTime;
}
/**
*
* The ARN of the edge deployment plan.
*
*
* @return The ARN of the 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;
}
/**
*
* The name of the stage in the edge deployment plan.
*
*
* @return The name of the stage in the edge deployment plan.
*/
public final String stageName() {
return stageName;
}
/**
*
* The name of the deployed stage.
*
*
* @return The name of the deployed stage.
*/
public final String deployedStageName() {
return deployedStageName;
}
/**
*
* The name of the fleet to which the device belongs to.
*
*
* @return The name of the fleet to which the device belongs to.
*/
public final String deviceFleetName() {
return deviceFleetName;
}
/**
*
* The name of the device.
*
*
* @return The name of the device.
*/
public final String deviceName() {
return deviceName;
}
/**
*
* The ARN of the device.
*
*
* @return The ARN of the device.
*/
public final String deviceArn() {
return deviceArn;
}
/**
*
* The deployment status of the device.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deviceDeploymentStatus} will return {@link DeviceDeploymentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #deviceDeploymentStatusAsString}.
*
*
* @return The deployment status of the device.
* @see DeviceDeploymentStatus
*/
public final DeviceDeploymentStatus deviceDeploymentStatus() {
return DeviceDeploymentStatus.fromValue(deviceDeploymentStatus);
}
/**
*
* The deployment status of the device.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deviceDeploymentStatus} will return {@link DeviceDeploymentStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #deviceDeploymentStatusAsString}.
*
*
* @return The deployment status of the device.
* @see DeviceDeploymentStatus
*/
public final String deviceDeploymentStatusAsString() {
return deviceDeploymentStatus;
}
/**
*
* The detailed error message for the deployoment status result.
*
*
* @return The detailed error message for the deployoment status result.
*/
public final String deviceDeploymentStatusMessage() {
return deviceDeploymentStatusMessage;
}
/**
*
* The description of the device.
*
*
* @return The description of the device.
*/
public final String description() {
return description;
}
/**
*
* The time when the deployment on the device started.
*
*
* @return The time when the deployment on the device started.
*/
public final Instant deploymentStartTime() {
return deploymentStartTime;
}
@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(edgeDeploymentPlanArn());
hashCode = 31 * hashCode + Objects.hashCode(edgeDeploymentPlanName());
hashCode = 31 * hashCode + Objects.hashCode(stageName());
hashCode = 31 * hashCode + Objects.hashCode(deployedStageName());
hashCode = 31 * hashCode + Objects.hashCode(deviceFleetName());
hashCode = 31 * hashCode + Objects.hashCode(deviceName());
hashCode = 31 * hashCode + Objects.hashCode(deviceArn());
hashCode = 31 * hashCode + Objects.hashCode(deviceDeploymentStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(deviceDeploymentStatusMessage());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(deploymentStartTime());
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 DeviceDeploymentSummary)) {
return false;
}
DeviceDeploymentSummary other = (DeviceDeploymentSummary) obj;
return Objects.equals(edgeDeploymentPlanArn(), other.edgeDeploymentPlanArn())
&& Objects.equals(edgeDeploymentPlanName(), other.edgeDeploymentPlanName())
&& Objects.equals(stageName(), other.stageName())
&& Objects.equals(deployedStageName(), other.deployedStageName())
&& Objects.equals(deviceFleetName(), other.deviceFleetName()) && Objects.equals(deviceName(), other.deviceName())
&& Objects.equals(deviceArn(), other.deviceArn())
&& Objects.equals(deviceDeploymentStatusAsString(), other.deviceDeploymentStatusAsString())
&& Objects.equals(deviceDeploymentStatusMessage(), other.deviceDeploymentStatusMessage())
&& Objects.equals(description(), other.description())
&& Objects.equals(deploymentStartTime(), other.deploymentStartTime());
}
/**
* 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("DeviceDeploymentSummary").add("EdgeDeploymentPlanArn", edgeDeploymentPlanArn())
.add("EdgeDeploymentPlanName", edgeDeploymentPlanName()).add("StageName", stageName())
.add("DeployedStageName", deployedStageName()).add("DeviceFleetName", deviceFleetName())
.add("DeviceName", deviceName()).add("DeviceArn", deviceArn())
.add("DeviceDeploymentStatus", deviceDeploymentStatusAsString())
.add("DeviceDeploymentStatusMessage", deviceDeploymentStatusMessage()).add("Description", description())
.add("DeploymentStartTime", deploymentStartTime()).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 "StageName":
return Optional.ofNullable(clazz.cast(stageName()));
case "DeployedStageName":
return Optional.ofNullable(clazz.cast(deployedStageName()));
case "DeviceFleetName":
return Optional.ofNullable(clazz.cast(deviceFleetName()));
case "DeviceName":
return Optional.ofNullable(clazz.cast(deviceName()));
case "DeviceArn":
return Optional.ofNullable(clazz.cast(deviceArn()));
case "DeviceDeploymentStatus":
return Optional.ofNullable(clazz.cast(deviceDeploymentStatusAsString()));
case "DeviceDeploymentStatusMessage":
return Optional.ofNullable(clazz.cast(deviceDeploymentStatusMessage()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "DeploymentStartTime":
return Optional.ofNullable(clazz.cast(deploymentStartTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function