All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sagemaker.model.DescribeDeviceResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating with Amazon SageMaker Service

There is a newer version: 2.31.2
Show newest version
/*
 * 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 DescribeDeviceResponse extends SageMakerResponse implements
        ToCopyableBuilder {
    private static final SdkField DEVICE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DeviceArn").getter(getter(DescribeDeviceResponse::deviceArn)).setter(setter(Builder::deviceArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceArn").build()).build();

    private static final SdkField DEVICE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DeviceName").getter(getter(DescribeDeviceResponse::deviceName)).setter(setter(Builder::deviceName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceName").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(DescribeDeviceResponse::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField DEVICE_FLEET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DeviceFleetName").getter(getter(DescribeDeviceResponse::deviceFleetName))
            .setter(setter(Builder::deviceFleetName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceFleetName").build()).build();

    private static final SdkField IOT_THING_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("IotThingName").getter(getter(DescribeDeviceResponse::iotThingName))
            .setter(setter(Builder::iotThingName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IotThingName").build()).build();

    private static final SdkField REGISTRATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("RegistrationTime").getter(getter(DescribeDeviceResponse::registrationTime))
            .setter(setter(Builder::registrationTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RegistrationTime").build()).build();

    private static final SdkField LATEST_HEARTBEAT_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("LatestHeartbeat").getter(getter(DescribeDeviceResponse::latestHeartbeat))
            .setter(setter(Builder::latestHeartbeat))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LatestHeartbeat").build()).build();

    private static final SdkField> MODELS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Models")
            .getter(getter(DescribeDeviceResponse::models))
            .setter(setter(Builder::models))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Models").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(EdgeModel::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField MAX_MODELS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("MaxModels").getter(getter(DescribeDeviceResponse::maxModels)).setter(setter(Builder::maxModels))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxModels").build()).build();

    private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("NextToken").getter(getter(DescribeDeviceResponse::nextToken)).setter(setter(Builder::nextToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();

    private static final SdkField AGENT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("AgentVersion").getter(getter(DescribeDeviceResponse::agentVersion))
            .setter(setter(Builder::agentVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgentVersion").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DEVICE_ARN_FIELD,
            DEVICE_NAME_FIELD, DESCRIPTION_FIELD, DEVICE_FLEET_NAME_FIELD, IOT_THING_NAME_FIELD, REGISTRATION_TIME_FIELD,
            LATEST_HEARTBEAT_FIELD, MODELS_FIELD, MAX_MODELS_FIELD, NEXT_TOKEN_FIELD, AGENT_VERSION_FIELD));

    private final String deviceArn;

    private final String deviceName;

    private final String description;

    private final String deviceFleetName;

    private final String iotThingName;

    private final Instant registrationTime;

    private final Instant latestHeartbeat;

    private final List models;

    private final Integer maxModels;

    private final String nextToken;

    private final String agentVersion;

    private DescribeDeviceResponse(BuilderImpl builder) {
        super(builder);
        this.deviceArn = builder.deviceArn;
        this.deviceName = builder.deviceName;
        this.description = builder.description;
        this.deviceFleetName = builder.deviceFleetName;
        this.iotThingName = builder.iotThingName;
        this.registrationTime = builder.registrationTime;
        this.latestHeartbeat = builder.latestHeartbeat;
        this.models = builder.models;
        this.maxModels = builder.maxModels;
        this.nextToken = builder.nextToken;
        this.agentVersion = builder.agentVersion;
    }

    /**
     * 

* The Amazon Resource Name (ARN) of the device. *

* * @return The Amazon Resource Name (ARN) of the device. */ public final String deviceArn() { return deviceArn; } /** *

* The unique identifier of the device. *

* * @return The unique identifier of the device. */ public final String deviceName() { return deviceName; } /** *

* A description of the device. *

* * @return A description of the device. */ public final String description() { return description; } /** *

* The name of the fleet the device belongs to. *

* * @return The name of the fleet the device belongs to. */ public final String deviceFleetName() { return deviceFleetName; } /** *

* The Amazon Web Services Internet of Things (IoT) object thing name associated with the device. *

* * @return The Amazon Web Services Internet of Things (IoT) object thing name associated with the device. */ public final String iotThingName() { return iotThingName; } /** *

* The timestamp of the last registration or de-reregistration. *

* * @return The timestamp of the last registration or de-reregistration. */ public final Instant registrationTime() { return registrationTime; } /** *

* The last heartbeat received from the device. *

* * @return The last heartbeat received from the device. */ public final Instant latestHeartbeat() { return latestHeartbeat; } /** * For responses, this returns true if the service returned a value for the Models 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 hasModels() { return models != null && !(models instanceof SdkAutoConstructList); } /** *

* Models on the device. *

*

* 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 #hasModels} method. *

* * @return Models on the device. */ public final List models() { return models; } /** *

* The maximum number of models. *

* * @return The maximum number of models. */ public final Integer maxModels() { return maxModels; } /** *

* The response from the last list when returning a list large enough to need tokening. *

* * @return The response from the last list when returning a list large enough to need tokening. */ public final String nextToken() { return nextToken; } /** *

* Edge Manager agent version. *

* * @return Edge Manager agent version. */ public final String agentVersion() { return agentVersion; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(deviceArn()); hashCode = 31 * hashCode + Objects.hashCode(deviceName()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(deviceFleetName()); hashCode = 31 * hashCode + Objects.hashCode(iotThingName()); hashCode = 31 * hashCode + Objects.hashCode(registrationTime()); hashCode = 31 * hashCode + Objects.hashCode(latestHeartbeat()); hashCode = 31 * hashCode + Objects.hashCode(hasModels() ? models() : null); hashCode = 31 * hashCode + Objects.hashCode(maxModels()); hashCode = 31 * hashCode + Objects.hashCode(nextToken()); hashCode = 31 * hashCode + Objects.hashCode(agentVersion()); 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 DescribeDeviceResponse)) { return false; } DescribeDeviceResponse other = (DescribeDeviceResponse) obj; return Objects.equals(deviceArn(), other.deviceArn()) && Objects.equals(deviceName(), other.deviceName()) && Objects.equals(description(), other.description()) && Objects.equals(deviceFleetName(), other.deviceFleetName()) && Objects.equals(iotThingName(), other.iotThingName()) && Objects.equals(registrationTime(), other.registrationTime()) && Objects.equals(latestHeartbeat(), other.latestHeartbeat()) && hasModels() == other.hasModels() && Objects.equals(models(), other.models()) && Objects.equals(maxModels(), other.maxModels()) && Objects.equals(nextToken(), other.nextToken()) && Objects.equals(agentVersion(), other.agentVersion()); } /** * 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("DescribeDeviceResponse").add("DeviceArn", deviceArn()).add("DeviceName", deviceName()) .add("Description", description()).add("DeviceFleetName", deviceFleetName()).add("IotThingName", iotThingName()) .add("RegistrationTime", registrationTime()).add("LatestHeartbeat", latestHeartbeat()) .add("Models", hasModels() ? models() : null).add("MaxModels", maxModels()).add("NextToken", nextToken()) .add("AgentVersion", agentVersion()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DeviceArn": return Optional.ofNullable(clazz.cast(deviceArn())); case "DeviceName": return Optional.ofNullable(clazz.cast(deviceName())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "DeviceFleetName": return Optional.ofNullable(clazz.cast(deviceFleetName())); case "IotThingName": return Optional.ofNullable(clazz.cast(iotThingName())); case "RegistrationTime": return Optional.ofNullable(clazz.cast(registrationTime())); case "LatestHeartbeat": return Optional.ofNullable(clazz.cast(latestHeartbeat())); case "Models": return Optional.ofNullable(clazz.cast(models())); case "MaxModels": return Optional.ofNullable(clazz.cast(maxModels())); case "NextToken": return Optional.ofNullable(clazz.cast(nextToken())); case "AgentVersion": return Optional.ofNullable(clazz.cast(agentVersion())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeDeviceResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the device. *

* * @param deviceArn * The Amazon Resource Name (ARN) of the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceArn(String deviceArn); /** *

* The unique identifier of the device. *

* * @param deviceName * The unique identifier of the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceName(String deviceName); /** *

* A description of the device. *

* * @param description * A description of the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The name of the fleet the device belongs to. *

* * @param deviceFleetName * The name of the fleet the device belongs to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceFleetName(String deviceFleetName); /** *

* The Amazon Web Services Internet of Things (IoT) object thing name associated with the device. *

* * @param iotThingName * The Amazon Web Services Internet of Things (IoT) object thing name associated with the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iotThingName(String iotThingName); /** *

* The timestamp of the last registration or de-reregistration. *

* * @param registrationTime * The timestamp of the last registration or de-reregistration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registrationTime(Instant registrationTime); /** *

* The last heartbeat received from the device. *

* * @param latestHeartbeat * The last heartbeat received from the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder latestHeartbeat(Instant latestHeartbeat); /** *

* Models on the device. *

* * @param models * Models on the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder models(Collection models); /** *

* Models on the device. *

* * @param models * Models on the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder models(EdgeModel... models); /** *

* Models on the device. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.EdgeModel.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.sagemaker.model.EdgeModel#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.EdgeModel.Builder#build()} is called immediately and * its result is passed to {@link #models(List)}. * * @param models * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.EdgeModel.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #models(java.util.Collection) */ Builder models(Consumer... models); /** *

* The maximum number of models. *

* * @param maxModels * The maximum number of models. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxModels(Integer maxModels); /** *

* The response from the last list when returning a list large enough to need tokening. *

* * @param nextToken * The response from the last list when returning a list large enough to need tokening. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextToken(String nextToken); /** *

* Edge Manager agent version. *

* * @param agentVersion * Edge Manager agent version. * @return Returns a reference to this object so that method calls can be chained together. */ Builder agentVersion(String agentVersion); } static final class BuilderImpl extends SageMakerResponse.BuilderImpl implements Builder { private String deviceArn; private String deviceName; private String description; private String deviceFleetName; private String iotThingName; private Instant registrationTime; private Instant latestHeartbeat; private List models = DefaultSdkAutoConstructList.getInstance(); private Integer maxModels; private String nextToken; private String agentVersion; private BuilderImpl() { } private BuilderImpl(DescribeDeviceResponse model) { super(model); deviceArn(model.deviceArn); deviceName(model.deviceName); description(model.description); deviceFleetName(model.deviceFleetName); iotThingName(model.iotThingName); registrationTime(model.registrationTime); latestHeartbeat(model.latestHeartbeat); models(model.models); maxModels(model.maxModels); nextToken(model.nextToken); agentVersion(model.agentVersion); } public final String getDeviceArn() { return deviceArn; } public final void setDeviceArn(String deviceArn) { this.deviceArn = deviceArn; } @Override public final Builder deviceArn(String deviceArn) { this.deviceArn = deviceArn; return this; } public final String getDeviceName() { return deviceName; } public final void setDeviceName(String deviceName) { this.deviceName = deviceName; } @Override public final Builder deviceName(String deviceName) { this.deviceName = deviceName; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getDeviceFleetName() { return deviceFleetName; } public final void setDeviceFleetName(String deviceFleetName) { this.deviceFleetName = deviceFleetName; } @Override public final Builder deviceFleetName(String deviceFleetName) { this.deviceFleetName = deviceFleetName; return this; } public final String getIotThingName() { return iotThingName; } public final void setIotThingName(String iotThingName) { this.iotThingName = iotThingName; } @Override public final Builder iotThingName(String iotThingName) { this.iotThingName = iotThingName; return this; } public final Instant getRegistrationTime() { return registrationTime; } public final void setRegistrationTime(Instant registrationTime) { this.registrationTime = registrationTime; } @Override public final Builder registrationTime(Instant registrationTime) { this.registrationTime = registrationTime; return this; } public final Instant getLatestHeartbeat() { return latestHeartbeat; } public final void setLatestHeartbeat(Instant latestHeartbeat) { this.latestHeartbeat = latestHeartbeat; } @Override public final Builder latestHeartbeat(Instant latestHeartbeat) { this.latestHeartbeat = latestHeartbeat; return this; } public final List getModels() { List result = EdgeModelsCopier.copyToBuilder(this.models); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setModels(Collection models) { this.models = EdgeModelsCopier.copyFromBuilder(models); } @Override public final Builder models(Collection models) { this.models = EdgeModelsCopier.copy(models); return this; } @Override @SafeVarargs public final Builder models(EdgeModel... models) { models(Arrays.asList(models)); return this; } @Override @SafeVarargs public final Builder models(Consumer... models) { models(Stream.of(models).map(c -> EdgeModel.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Integer getMaxModels() { return maxModels; } public final void setMaxModels(Integer maxModels) { this.maxModels = maxModels; } @Override public final Builder maxModels(Integer maxModels) { this.maxModels = maxModels; return this; } public final String getNextToken() { return nextToken; } public final void setNextToken(String nextToken) { this.nextToken = nextToken; } @Override public final Builder nextToken(String nextToken) { this.nextToken = nextToken; return this; } public final String getAgentVersion() { return agentVersion; } public final void setAgentVersion(String agentVersion) { this.agentVersion = agentVersion; } @Override public final Builder agentVersion(String agentVersion) { this.agentVersion = agentVersion; return this; } @Override public DescribeDeviceResponse build() { return new DescribeDeviceResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy