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

software.amazon.awssdk.services.sagemaker.model.DeviceSummary 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.29.39
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.beans.Transient;
import java.io.Serializable;
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;

/**
 * 

* Summary of the device. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DeviceSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DEVICE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DeviceName").getter(getter(DeviceSummary::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(DeviceSummary::deviceArn)).setter(setter(Builder::deviceArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceArn").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(DeviceSummary::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(DeviceSummary::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(DeviceSummary::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(DeviceSummary::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(DeviceSummary::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(DeviceSummary::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(EdgeModelSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField AGENT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AgentVersion").getter(getter(DeviceSummary::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_NAME_FIELD, DEVICE_ARN_FIELD, DESCRIPTION_FIELD, DEVICE_FLEET_NAME_FIELD, IOT_THING_NAME_FIELD, REGISTRATION_TIME_FIELD, LATEST_HEARTBEAT_FIELD, MODELS_FIELD, AGENT_VERSION_FIELD)); private static final long serialVersionUID = 1L; private final String deviceName; private final String deviceArn; 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 String agentVersion; private DeviceSummary(BuilderImpl builder) { this.deviceName = builder.deviceName; this.deviceArn = builder.deviceArn; 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.agentVersion = builder.agentVersion; } /** *

* The unique identifier of the device. *

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

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

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

* 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; } /** *

* 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 + Objects.hashCode(deviceName()); hashCode = 31 * hashCode + Objects.hashCode(deviceArn()); 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(agentVersion()); 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 DeviceSummary)) { return false; } DeviceSummary other = (DeviceSummary) obj; return Objects.equals(deviceName(), other.deviceName()) && Objects.equals(deviceArn(), other.deviceArn()) && 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(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("DeviceSummary").add("DeviceName", deviceName()).add("DeviceArn", deviceArn()) .add("Description", description()).add("DeviceFleetName", deviceFleetName()).add("IotThingName", iotThingName()) .add("RegistrationTime", registrationTime()).add("LatestHeartbeat", latestHeartbeat()) .add("Models", hasModels() ? models() : null).add("AgentVersion", agentVersion()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DeviceName": return Optional.ofNullable(clazz.cast(deviceName())); case "DeviceArn": return Optional.ofNullable(clazz.cast(deviceArn())); 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 "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((DeviceSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* 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); /** *

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

* * @param deviceArn * 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); /** *

* 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(EdgeModelSummary... models); /** *

* Models on the device. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and * its result is passed to {@link #models(List)}. * * @param models * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #models(List) */ Builder models(Consumer... models); /** *

* 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 implements Builder { private String deviceName; private String deviceArn; private String description; private String deviceFleetName; private String iotThingName; private Instant registrationTime; private Instant latestHeartbeat; private List models = DefaultSdkAutoConstructList.getInstance(); private String agentVersion; private BuilderImpl() { } private BuilderImpl(DeviceSummary model) { deviceName(model.deviceName); deviceArn(model.deviceArn); description(model.description); deviceFleetName(model.deviceFleetName); iotThingName(model.iotThingName); registrationTime(model.registrationTime); latestHeartbeat(model.latestHeartbeat); models(model.models); agentVersion(model.agentVersion); } public final String getDeviceName() { return deviceName; } public final void setDeviceName(String deviceName) { this.deviceName = deviceName; } @Override @Transient public final Builder deviceName(String deviceName) { this.deviceName = deviceName; return this; } public final String getDeviceArn() { return deviceArn; } public final void setDeviceArn(String deviceArn) { this.deviceArn = deviceArn; } @Override @Transient public final Builder deviceArn(String deviceArn) { this.deviceArn = deviceArn; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override @Transient 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 @Transient 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 @Transient 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 @Transient 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 @Transient public final Builder latestHeartbeat(Instant latestHeartbeat) { this.latestHeartbeat = latestHeartbeat; return this; } public final List getModels() { List result = EdgeModelSummariesCopier.copyToBuilder(this.models); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setModels(Collection models) { this.models = EdgeModelSummariesCopier.copyFromBuilder(models); } @Override @Transient public final Builder models(Collection models) { this.models = EdgeModelSummariesCopier.copy(models); return this; } @Override @Transient @SafeVarargs public final Builder models(EdgeModelSummary... models) { models(Arrays.asList(models)); return this; } @Override @Transient @SafeVarargs public final Builder models(Consumer... models) { models(Stream.of(models).map(c -> EdgeModelSummary.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getAgentVersion() { return agentVersion; } public final void setAgentVersion(String agentVersion) { this.agentVersion = agentVersion; } @Override @Transient public final Builder agentVersion(String agentVersion) { this.agentVersion = agentVersion; return this; } @Override public DeviceSummary build() { return new DeviceSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy