software.amazon.awssdk.services.sagemaker.model.ModelDashboardMonitoringSchedule 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.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;
/**
*
* A monitoring schedule for a model displayed in the Amazon SageMaker Model Dashboard.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ModelDashboardMonitoringSchedule implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField MONITORING_SCHEDULE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MonitoringScheduleArn").getter(getter(ModelDashboardMonitoringSchedule::monitoringScheduleArn))
.setter(setter(Builder::monitoringScheduleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringScheduleArn").build())
.build();
private static final SdkField MONITORING_SCHEDULE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MonitoringScheduleName").getter(getter(ModelDashboardMonitoringSchedule::monitoringScheduleName))
.setter(setter(Builder::monitoringScheduleName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringScheduleName").build())
.build();
private static final SdkField MONITORING_SCHEDULE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MonitoringScheduleStatus")
.getter(getter(ModelDashboardMonitoringSchedule::monitoringScheduleStatusAsString))
.setter(setter(Builder::monitoringScheduleStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringScheduleStatus").build())
.build();
private static final SdkField MONITORING_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MonitoringType").getter(getter(ModelDashboardMonitoringSchedule::monitoringTypeAsString))
.setter(setter(Builder::monitoringType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringType").build()).build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FailureReason").getter(getter(ModelDashboardMonitoringSchedule::failureReason))
.setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(ModelDashboardMonitoringSchedule::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(ModelDashboardMonitoringSchedule::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final SdkField MONITORING_SCHEDULE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("MonitoringScheduleConfig")
.getter(getter(ModelDashboardMonitoringSchedule::monitoringScheduleConfig))
.setter(setter(Builder::monitoringScheduleConfig)).constructor(MonitoringScheduleConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringScheduleConfig").build())
.build();
private static final SdkField ENDPOINT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EndpointName").getter(getter(ModelDashboardMonitoringSchedule::endpointName))
.setter(setter(Builder::endpointName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointName").build()).build();
private static final SdkField> MONITORING_ALERT_SUMMARIES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("MonitoringAlertSummaries")
.getter(getter(ModelDashboardMonitoringSchedule::monitoringAlertSummaries))
.setter(setter(Builder::monitoringAlertSummaries))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringAlertSummaries").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(MonitoringAlertSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField LAST_MONITORING_EXECUTION_SUMMARY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("LastMonitoringExecutionSummary")
.getter(getter(ModelDashboardMonitoringSchedule::lastMonitoringExecutionSummary))
.setter(setter(Builder::lastMonitoringExecutionSummary))
.constructor(MonitoringExecutionSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastMonitoringExecutionSummary")
.build()).build();
private static final SdkField BATCH_TRANSFORM_INPUT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BatchTransformInput")
.getter(getter(ModelDashboardMonitoringSchedule::batchTransformInput)).setter(setter(Builder::batchTransformInput))
.constructor(BatchTransformInput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BatchTransformInput").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MONITORING_SCHEDULE_ARN_FIELD,
MONITORING_SCHEDULE_NAME_FIELD, MONITORING_SCHEDULE_STATUS_FIELD, MONITORING_TYPE_FIELD, FAILURE_REASON_FIELD,
CREATION_TIME_FIELD, LAST_MODIFIED_TIME_FIELD, MONITORING_SCHEDULE_CONFIG_FIELD, ENDPOINT_NAME_FIELD,
MONITORING_ALERT_SUMMARIES_FIELD, LAST_MONITORING_EXECUTION_SUMMARY_FIELD, BATCH_TRANSFORM_INPUT_FIELD));
private static final long serialVersionUID = 1L;
private final String monitoringScheduleArn;
private final String monitoringScheduleName;
private final String monitoringScheduleStatus;
private final String monitoringType;
private final String failureReason;
private final Instant creationTime;
private final Instant lastModifiedTime;
private final MonitoringScheduleConfig monitoringScheduleConfig;
private final String endpointName;
private final List monitoringAlertSummaries;
private final MonitoringExecutionSummary lastMonitoringExecutionSummary;
private final BatchTransformInput batchTransformInput;
private ModelDashboardMonitoringSchedule(BuilderImpl builder) {
this.monitoringScheduleArn = builder.monitoringScheduleArn;
this.monitoringScheduleName = builder.monitoringScheduleName;
this.monitoringScheduleStatus = builder.monitoringScheduleStatus;
this.monitoringType = builder.monitoringType;
this.failureReason = builder.failureReason;
this.creationTime = builder.creationTime;
this.lastModifiedTime = builder.lastModifiedTime;
this.monitoringScheduleConfig = builder.monitoringScheduleConfig;
this.endpointName = builder.endpointName;
this.monitoringAlertSummaries = builder.monitoringAlertSummaries;
this.lastMonitoringExecutionSummary = builder.lastMonitoringExecutionSummary;
this.batchTransformInput = builder.batchTransformInput;
}
/**
*
* The Amazon Resource Name (ARN) of a monitoring schedule.
*
*
* @return The Amazon Resource Name (ARN) of a monitoring schedule.
*/
public final String monitoringScheduleArn() {
return monitoringScheduleArn;
}
/**
*
* The name of a monitoring schedule.
*
*
* @return The name of a monitoring schedule.
*/
public final String monitoringScheduleName() {
return monitoringScheduleName;
}
/**
*
* The status of the monitoring schedule.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #monitoringScheduleStatus} will return {@link ScheduleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #monitoringScheduleStatusAsString}.
*
*
* @return The status of the monitoring schedule.
* @see ScheduleStatus
*/
public final ScheduleStatus monitoringScheduleStatus() {
return ScheduleStatus.fromValue(monitoringScheduleStatus);
}
/**
*
* The status of the monitoring schedule.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #monitoringScheduleStatus} will return {@link ScheduleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #monitoringScheduleStatusAsString}.
*
*
* @return The status of the monitoring schedule.
* @see ScheduleStatus
*/
public final String monitoringScheduleStatusAsString() {
return monitoringScheduleStatus;
}
/**
*
* The monitor type of a model monitor.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #monitoringType}
* will return {@link MonitoringType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #monitoringTypeAsString}.
*
*
* @return The monitor type of a model monitor.
* @see MonitoringType
*/
public final MonitoringType monitoringType() {
return MonitoringType.fromValue(monitoringType);
}
/**
*
* The monitor type of a model monitor.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #monitoringType}
* will return {@link MonitoringType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #monitoringTypeAsString}.
*
*
* @return The monitor type of a model monitor.
* @see MonitoringType
*/
public final String monitoringTypeAsString() {
return monitoringType;
}
/**
*
* If a monitoring job failed, provides the reason.
*
*
* @return If a monitoring job failed, provides the reason.
*/
public final String failureReason() {
return failureReason;
}
/**
*
* A timestamp that indicates when the monitoring schedule was created.
*
*
* @return A timestamp that indicates when the monitoring schedule was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* A timestamp that indicates when the monitoring schedule was last updated.
*
*
* @return A timestamp that indicates when the monitoring schedule was last updated.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
* Returns the value of the MonitoringScheduleConfig property for this object.
*
* @return The value of the MonitoringScheduleConfig property for this object.
*/
public final MonitoringScheduleConfig monitoringScheduleConfig() {
return monitoringScheduleConfig;
}
/**
*
* The endpoint which is monitored.
*
*
* @return The endpoint which is monitored.
*/
public final String endpointName() {
return endpointName;
}
/**
* For responses, this returns true if the service returned a value for the MonitoringAlertSummaries 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 hasMonitoringAlertSummaries() {
return monitoringAlertSummaries != null && !(monitoringAlertSummaries instanceof SdkAutoConstructList);
}
/**
*
* A JSON array where each element is a summary for a monitoring alert.
*
*
* 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 #hasMonitoringAlertSummaries} method.
*
*
* @return A JSON array where each element is a summary for a monitoring alert.
*/
public final List monitoringAlertSummaries() {
return monitoringAlertSummaries;
}
/**
* Returns the value of the LastMonitoringExecutionSummary property for this object.
*
* @return The value of the LastMonitoringExecutionSummary property for this object.
*/
public final MonitoringExecutionSummary lastMonitoringExecutionSummary() {
return lastMonitoringExecutionSummary;
}
/**
* Returns the value of the BatchTransformInput property for this object.
*
* @return The value of the BatchTransformInput property for this object.
*/
public final BatchTransformInput batchTransformInput() {
return batchTransformInput;
}
@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(monitoringScheduleArn());
hashCode = 31 * hashCode + Objects.hashCode(monitoringScheduleName());
hashCode = 31 * hashCode + Objects.hashCode(monitoringScheduleStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(monitoringTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(monitoringScheduleConfig());
hashCode = 31 * hashCode + Objects.hashCode(endpointName());
hashCode = 31 * hashCode + Objects.hashCode(hasMonitoringAlertSummaries() ? monitoringAlertSummaries() : null);
hashCode = 31 * hashCode + Objects.hashCode(lastMonitoringExecutionSummary());
hashCode = 31 * hashCode + Objects.hashCode(batchTransformInput());
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 ModelDashboardMonitoringSchedule)) {
return false;
}
ModelDashboardMonitoringSchedule other = (ModelDashboardMonitoringSchedule) obj;
return Objects.equals(monitoringScheduleArn(), other.monitoringScheduleArn())
&& Objects.equals(monitoringScheduleName(), other.monitoringScheduleName())
&& Objects.equals(monitoringScheduleStatusAsString(), other.monitoringScheduleStatusAsString())
&& Objects.equals(monitoringTypeAsString(), other.monitoringTypeAsString())
&& Objects.equals(failureReason(), other.failureReason()) && Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime())
&& Objects.equals(monitoringScheduleConfig(), other.monitoringScheduleConfig())
&& Objects.equals(endpointName(), other.endpointName())
&& hasMonitoringAlertSummaries() == other.hasMonitoringAlertSummaries()
&& Objects.equals(monitoringAlertSummaries(), other.monitoringAlertSummaries())
&& Objects.equals(lastMonitoringExecutionSummary(), other.lastMonitoringExecutionSummary())
&& Objects.equals(batchTransformInput(), other.batchTransformInput());
}
/**
* 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("ModelDashboardMonitoringSchedule").add("MonitoringScheduleArn", monitoringScheduleArn())
.add("MonitoringScheduleName", monitoringScheduleName())
.add("MonitoringScheduleStatus", monitoringScheduleStatusAsString())
.add("MonitoringType", monitoringTypeAsString()).add("FailureReason", failureReason())
.add("CreationTime", creationTime()).add("LastModifiedTime", lastModifiedTime())
.add("MonitoringScheduleConfig", monitoringScheduleConfig()).add("EndpointName", endpointName())
.add("MonitoringAlertSummaries", hasMonitoringAlertSummaries() ? monitoringAlertSummaries() : null)
.add("LastMonitoringExecutionSummary", lastMonitoringExecutionSummary())
.add("BatchTransformInput", batchTransformInput()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "MonitoringScheduleArn":
return Optional.ofNullable(clazz.cast(monitoringScheduleArn()));
case "MonitoringScheduleName":
return Optional.ofNullable(clazz.cast(monitoringScheduleName()));
case "MonitoringScheduleStatus":
return Optional.ofNullable(clazz.cast(monitoringScheduleStatusAsString()));
case "MonitoringType":
return Optional.ofNullable(clazz.cast(monitoringTypeAsString()));
case "FailureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "MonitoringScheduleConfig":
return Optional.ofNullable(clazz.cast(monitoringScheduleConfig()));
case "EndpointName":
return Optional.ofNullable(clazz.cast(endpointName()));
case "MonitoringAlertSummaries":
return Optional.ofNullable(clazz.cast(monitoringAlertSummaries()));
case "LastMonitoringExecutionSummary":
return Optional.ofNullable(clazz.cast(lastMonitoringExecutionSummary()));
case "BatchTransformInput":
return Optional.ofNullable(clazz.cast(batchTransformInput()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function