software.amazon.awssdk.services.sagemaker.model.GetDeviceFleetReportResponse 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 GetDeviceFleetReportResponse extends SageMakerResponse implements
ToCopyableBuilder {
private static final SdkField DEVICE_FLEET_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceFleetArn").getter(getter(GetDeviceFleetReportResponse::deviceFleetArn))
.setter(setter(Builder::deviceFleetArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceFleetArn").build()).build();
private static final SdkField DEVICE_FLEET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceFleetName").getter(getter(GetDeviceFleetReportResponse::deviceFleetName))
.setter(setter(Builder::deviceFleetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceFleetName").build()).build();
private static final SdkField OUTPUT_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("OutputConfig")
.getter(getter(GetDeviceFleetReportResponse::outputConfig)).setter(setter(Builder::outputConfig))
.constructor(EdgeOutputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputConfig").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(GetDeviceFleetReportResponse::description))
.setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField REPORT_GENERATED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("ReportGenerated").getter(getter(GetDeviceFleetReportResponse::reportGenerated))
.setter(setter(Builder::reportGenerated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportGenerated").build()).build();
private static final SdkField DEVICE_STATS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("DeviceStats").getter(getter(GetDeviceFleetReportResponse::deviceStats))
.setter(setter(Builder::deviceStats)).constructor(DeviceStats::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceStats").build()).build();
private static final SdkField> AGENT_VERSIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AgentVersions")
.getter(getter(GetDeviceFleetReportResponse::agentVersions))
.setter(setter(Builder::agentVersions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgentVersions").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AgentVersion::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> MODEL_STATS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ModelStats")
.getter(getter(GetDeviceFleetReportResponse::modelStats))
.setter(setter(Builder::modelStats))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelStats").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(EdgeModelStat::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DEVICE_FLEET_ARN_FIELD,
DEVICE_FLEET_NAME_FIELD, OUTPUT_CONFIG_FIELD, DESCRIPTION_FIELD, REPORT_GENERATED_FIELD, DEVICE_STATS_FIELD,
AGENT_VERSIONS_FIELD, MODEL_STATS_FIELD));
private final String deviceFleetArn;
private final String deviceFleetName;
private final EdgeOutputConfig outputConfig;
private final String description;
private final Instant reportGenerated;
private final DeviceStats deviceStats;
private final List agentVersions;
private final List modelStats;
private GetDeviceFleetReportResponse(BuilderImpl builder) {
super(builder);
this.deviceFleetArn = builder.deviceFleetArn;
this.deviceFleetName = builder.deviceFleetName;
this.outputConfig = builder.outputConfig;
this.description = builder.description;
this.reportGenerated = builder.reportGenerated;
this.deviceStats = builder.deviceStats;
this.agentVersions = builder.agentVersions;
this.modelStats = builder.modelStats;
}
/**
*
* The Amazon Resource Name (ARN) of the device.
*
*
* @return The Amazon Resource Name (ARN) of the device.
*/
public final String deviceFleetArn() {
return deviceFleetArn;
}
/**
*
* The name of the fleet.
*
*
* @return The name of the fleet.
*/
public final String deviceFleetName() {
return deviceFleetName;
}
/**
*
* The output configuration for storing sample data collected by the fleet.
*
*
* @return The output configuration for storing sample data collected by the fleet.
*/
public final EdgeOutputConfig outputConfig() {
return outputConfig;
}
/**
*
* Description of the fleet.
*
*
* @return Description of the fleet.
*/
public final String description() {
return description;
}
/**
*
* Timestamp of when the report was generated.
*
*
* @return Timestamp of when the report was generated.
*/
public final Instant reportGenerated() {
return reportGenerated;
}
/**
*
* Status of devices.
*
*
* @return Status of devices.
*/
public final DeviceStats deviceStats() {
return deviceStats;
}
/**
* For responses, this returns true if the service returned a value for the AgentVersions 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 hasAgentVersions() {
return agentVersions != null && !(agentVersions instanceof SdkAutoConstructList);
}
/**
*
* The versions of Edge Manager agent deployed on the fleet.
*
*
* 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 #hasAgentVersions} method.
*
*
* @return The versions of Edge Manager agent deployed on the fleet.
*/
public final List agentVersions() {
return agentVersions;
}
/**
* For responses, this returns true if the service returned a value for the ModelStats 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 hasModelStats() {
return modelStats != null && !(modelStats instanceof SdkAutoConstructList);
}
/**
*
* Status of model on 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 #hasModelStats} method.
*
*
* @return Status of model on device.
*/
public final List modelStats() {
return modelStats;
}
@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(deviceFleetArn());
hashCode = 31 * hashCode + Objects.hashCode(deviceFleetName());
hashCode = 31 * hashCode + Objects.hashCode(outputConfig());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(reportGenerated());
hashCode = 31 * hashCode + Objects.hashCode(deviceStats());
hashCode = 31 * hashCode + Objects.hashCode(hasAgentVersions() ? agentVersions() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasModelStats() ? modelStats() : null);
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 GetDeviceFleetReportResponse)) {
return false;
}
GetDeviceFleetReportResponse other = (GetDeviceFleetReportResponse) obj;
return Objects.equals(deviceFleetArn(), other.deviceFleetArn())
&& Objects.equals(deviceFleetName(), other.deviceFleetName())
&& Objects.equals(outputConfig(), other.outputConfig()) && Objects.equals(description(), other.description())
&& Objects.equals(reportGenerated(), other.reportGenerated())
&& Objects.equals(deviceStats(), other.deviceStats()) && hasAgentVersions() == other.hasAgentVersions()
&& Objects.equals(agentVersions(), other.agentVersions()) && hasModelStats() == other.hasModelStats()
&& Objects.equals(modelStats(), other.modelStats());
}
/**
* 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("GetDeviceFleetReportResponse").add("DeviceFleetArn", deviceFleetArn())
.add("DeviceFleetName", deviceFleetName()).add("OutputConfig", outputConfig()).add("Description", description())
.add("ReportGenerated", reportGenerated()).add("DeviceStats", deviceStats())
.add("AgentVersions", hasAgentVersions() ? agentVersions() : null)
.add("ModelStats", hasModelStats() ? modelStats() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DeviceFleetArn":
return Optional.ofNullable(clazz.cast(deviceFleetArn()));
case "DeviceFleetName":
return Optional.ofNullable(clazz.cast(deviceFleetName()));
case "OutputConfig":
return Optional.ofNullable(clazz.cast(outputConfig()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "ReportGenerated":
return Optional.ofNullable(clazz.cast(reportGenerated()));
case "DeviceStats":
return Optional.ofNullable(clazz.cast(deviceStats()));
case "AgentVersions":
return Optional.ofNullable(clazz.cast(agentVersions()));
case "ModelStats":
return Optional.ofNullable(clazz.cast(modelStats()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function