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

software.amazon.awssdk.services.devopsguru.model.ProactiveAnomalySummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Dev Ops Guru module holds the client classes that are used for communicating with Dev Ops Guru.

There is a newer version: 2.29.16
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.devopsguru.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;

/**
 * 

* Details about a proactive anomaly. This object is returned by DescribeAnomaly. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ProactiveAnomalySummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(ProactiveAnomalySummary::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField SEVERITY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Severity").getter(getter(ProactiveAnomalySummary::severityAsString)).setter(setter(Builder::severity)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Severity").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(ProactiveAnomalySummary::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField UPDATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("UpdateTime").getter(getter(ProactiveAnomalySummary::updateTime)).setter(setter(Builder::updateTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpdateTime").build()).build(); private static final SdkField ANOMALY_TIME_RANGE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("AnomalyTimeRange") .getter(getter(ProactiveAnomalySummary::anomalyTimeRange)).setter(setter(Builder::anomalyTimeRange)) .constructor(AnomalyTimeRange::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyTimeRange").build()).build(); private static final SdkField ANOMALY_REPORTED_TIME_RANGE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("AnomalyReportedTimeRange") .getter(getter(ProactiveAnomalySummary::anomalyReportedTimeRange)).setter(setter(Builder::anomalyReportedTimeRange)) .constructor(AnomalyReportedTimeRange::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyReportedTimeRange").build()) .build(); private static final SdkField PREDICTION_TIME_RANGE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("PredictionTimeRange") .getter(getter(ProactiveAnomalySummary::predictionTimeRange)).setter(setter(Builder::predictionTimeRange)) .constructor(PredictionTimeRange::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PredictionTimeRange").build()) .build(); private static final SdkField SOURCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SourceDetails") .getter(getter(ProactiveAnomalySummary::sourceDetails)).setter(setter(Builder::sourceDetails)) .constructor(AnomalySourceDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceDetails").build()).build(); private static final SdkField ASSOCIATED_INSIGHT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AssociatedInsightId").getter(getter(ProactiveAnomalySummary::associatedInsightId)) .setter(setter(Builder::associatedInsightId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssociatedInsightId").build()) .build(); private static final SdkField RESOURCE_COLLECTION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ResourceCollection") .getter(getter(ProactiveAnomalySummary::resourceCollection)).setter(setter(Builder::resourceCollection)) .constructor(ResourceCollection::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceCollection").build()) .build(); private static final SdkField LIMIT_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("Limit") .getter(getter(ProactiveAnomalySummary::limit)).setter(setter(Builder::limit)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Limit").build()).build(); private static final SdkField SOURCE_METADATA_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SourceMetadata") .getter(getter(ProactiveAnomalySummary::sourceMetadata)).setter(setter(Builder::sourceMetadata)) .constructor(AnomalySourceMetadata::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceMetadata").build()).build(); private static final SdkField> ANOMALY_RESOURCES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("AnomalyResources") .getter(getter(ProactiveAnomalySummary::anomalyResources)) .setter(setter(Builder::anomalyResources)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyResources").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AnomalyResource::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(ProactiveAnomalySummary::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, SEVERITY_FIELD, STATUS_FIELD, UPDATE_TIME_FIELD, ANOMALY_TIME_RANGE_FIELD, ANOMALY_REPORTED_TIME_RANGE_FIELD, PREDICTION_TIME_RANGE_FIELD, SOURCE_DETAILS_FIELD, ASSOCIATED_INSIGHT_ID_FIELD, RESOURCE_COLLECTION_FIELD, LIMIT_FIELD, SOURCE_METADATA_FIELD, ANOMALY_RESOURCES_FIELD, DESCRIPTION_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("Id", ID_FIELD); put("Severity", SEVERITY_FIELD); put("Status", STATUS_FIELD); put("UpdateTime", UPDATE_TIME_FIELD); put("AnomalyTimeRange", ANOMALY_TIME_RANGE_FIELD); put("AnomalyReportedTimeRange", ANOMALY_REPORTED_TIME_RANGE_FIELD); put("PredictionTimeRange", PREDICTION_TIME_RANGE_FIELD); put("SourceDetails", SOURCE_DETAILS_FIELD); put("AssociatedInsightId", ASSOCIATED_INSIGHT_ID_FIELD); put("ResourceCollection", RESOURCE_COLLECTION_FIELD); put("Limit", LIMIT_FIELD); put("SourceMetadata", SOURCE_METADATA_FIELD); put("AnomalyResources", ANOMALY_RESOURCES_FIELD); put("Description", DESCRIPTION_FIELD); } }); private static final long serialVersionUID = 1L; private final String id; private final String severity; private final String status; private final Instant updateTime; private final AnomalyTimeRange anomalyTimeRange; private final AnomalyReportedTimeRange anomalyReportedTimeRange; private final PredictionTimeRange predictionTimeRange; private final AnomalySourceDetails sourceDetails; private final String associatedInsightId; private final ResourceCollection resourceCollection; private final Double limit; private final AnomalySourceMetadata sourceMetadata; private final List anomalyResources; private final String description; private ProactiveAnomalySummary(BuilderImpl builder) { this.id = builder.id; this.severity = builder.severity; this.status = builder.status; this.updateTime = builder.updateTime; this.anomalyTimeRange = builder.anomalyTimeRange; this.anomalyReportedTimeRange = builder.anomalyReportedTimeRange; this.predictionTimeRange = builder.predictionTimeRange; this.sourceDetails = builder.sourceDetails; this.associatedInsightId = builder.associatedInsightId; this.resourceCollection = builder.resourceCollection; this.limit = builder.limit; this.sourceMetadata = builder.sourceMetadata; this.anomalyResources = builder.anomalyResources; this.description = builder.description; } /** *

* The ID of the anomaly. *

* * @return The ID of the anomaly. */ public final String id() { return id; } /** *

* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's * severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #severity} will * return {@link AnomalySeverity#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #severityAsString}. *

* * @return The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's * severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. * @see AnomalySeverity */ public final AnomalySeverity severity() { return AnomalySeverity.fromValue(severity); } /** *

* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's * severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #severity} will * return {@link AnomalySeverity#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #severityAsString}. *

* * @return The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's * severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. * @see AnomalySeverity */ public final String severityAsString() { return severity; } /** *

* The status of the anomaly. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link AnomalyStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the anomaly. * @see AnomalyStatus */ public final AnomalyStatus status() { return AnomalyStatus.fromValue(status); } /** *

* The status of the anomaly. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link AnomalyStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the anomaly. * @see AnomalyStatus */ public final String statusAsString() { return status; } /** *

* The time of the anomaly's most recent update. *

* * @return The time of the anomaly's most recent update. */ public final Instant updateTime() { return updateTime; } /** * Returns the value of the AnomalyTimeRange property for this object. * * @return The value of the AnomalyTimeRange property for this object. */ public final AnomalyTimeRange anomalyTimeRange() { return anomalyTimeRange; } /** *

* An AnomalyReportedTimeRange object that specifies the time range between when the anomaly is opened * and the time when it is closed. *

* * @return An AnomalyReportedTimeRange object that specifies the time range between when the anomaly is * opened and the time when it is closed. */ public final AnomalyReportedTimeRange anomalyReportedTimeRange() { return anomalyReportedTimeRange; } /** * Returns the value of the PredictionTimeRange property for this object. * * @return The value of the PredictionTimeRange property for this object. */ public final PredictionTimeRange predictionTimeRange() { return predictionTimeRange; } /** *

* Details about the source of the analyzed operational data that triggered the anomaly. The one supported source is * Amazon CloudWatch metrics. *

* * @return Details about the source of the analyzed operational data that triggered the anomaly. The one supported * source is Amazon CloudWatch metrics. */ public final AnomalySourceDetails sourceDetails() { return sourceDetails; } /** *

* The ID of the insight that contains this anomaly. An insight is composed of related anomalies. *

* * @return The ID of the insight that contains this anomaly. An insight is composed of related anomalies. */ public final String associatedInsightId() { return associatedInsightId; } /** * Returns the value of the ResourceCollection property for this object. * * @return The value of the ResourceCollection property for this object. */ public final ResourceCollection resourceCollection() { return resourceCollection; } /** *

* A threshold that was exceeded by behavior in analyzed resources. Exceeding this threshold is related to the * anomalous behavior that generated this anomaly. *

* * @return A threshold that was exceeded by behavior in analyzed resources. Exceeding this threshold is related to * the anomalous behavior that generated this anomaly. */ public final Double limit() { return limit; } /** *

* The metadata of the source which detects proactive anomalies. *

* * @return The metadata of the source which detects proactive anomalies. */ public final AnomalySourceMetadata sourceMetadata() { return sourceMetadata; } /** * For responses, this returns true if the service returned a value for the AnomalyResources 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 hasAnomalyResources() { return anomalyResources != null && !(anomalyResources instanceof SdkAutoConstructList); } /** *

* Information about a resource in which DevOps Guru detected anomalous behavior. *

*

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

* * @return Information about a resource in which DevOps Guru detected anomalous behavior. */ public final List anomalyResources() { return anomalyResources; } /** *

* A description of the proactive anomaly. *

* * @return A description of the proactive anomaly. */ public final String description() { return description; } @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(id()); hashCode = 31 * hashCode + Objects.hashCode(severityAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(updateTime()); hashCode = 31 * hashCode + Objects.hashCode(anomalyTimeRange()); hashCode = 31 * hashCode + Objects.hashCode(anomalyReportedTimeRange()); hashCode = 31 * hashCode + Objects.hashCode(predictionTimeRange()); hashCode = 31 * hashCode + Objects.hashCode(sourceDetails()); hashCode = 31 * hashCode + Objects.hashCode(associatedInsightId()); hashCode = 31 * hashCode + Objects.hashCode(resourceCollection()); hashCode = 31 * hashCode + Objects.hashCode(limit()); hashCode = 31 * hashCode + Objects.hashCode(sourceMetadata()); hashCode = 31 * hashCode + Objects.hashCode(hasAnomalyResources() ? anomalyResources() : null); hashCode = 31 * hashCode + Objects.hashCode(description()); 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 ProactiveAnomalySummary)) { return false; } ProactiveAnomalySummary other = (ProactiveAnomalySummary) obj; return Objects.equals(id(), other.id()) && Objects.equals(severityAsString(), other.severityAsString()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(updateTime(), other.updateTime()) && Objects.equals(anomalyTimeRange(), other.anomalyTimeRange()) && Objects.equals(anomalyReportedTimeRange(), other.anomalyReportedTimeRange()) && Objects.equals(predictionTimeRange(), other.predictionTimeRange()) && Objects.equals(sourceDetails(), other.sourceDetails()) && Objects.equals(associatedInsightId(), other.associatedInsightId()) && Objects.equals(resourceCollection(), other.resourceCollection()) && Objects.equals(limit(), other.limit()) && Objects.equals(sourceMetadata(), other.sourceMetadata()) && hasAnomalyResources() == other.hasAnomalyResources() && Objects.equals(anomalyResources(), other.anomalyResources()) && Objects.equals(description(), other.description()); } /** * 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("ProactiveAnomalySummary").add("Id", id()).add("Severity", severityAsString()) .add("Status", statusAsString()).add("UpdateTime", updateTime()).add("AnomalyTimeRange", anomalyTimeRange()) .add("AnomalyReportedTimeRange", anomalyReportedTimeRange()).add("PredictionTimeRange", predictionTimeRange()) .add("SourceDetails", sourceDetails()).add("AssociatedInsightId", associatedInsightId()) .add("ResourceCollection", resourceCollection()).add("Limit", limit()).add("SourceMetadata", sourceMetadata()) .add("AnomalyResources", hasAnomalyResources() ? anomalyResources() : null).add("Description", description()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Id": return Optional.ofNullable(clazz.cast(id())); case "Severity": return Optional.ofNullable(clazz.cast(severityAsString())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "UpdateTime": return Optional.ofNullable(clazz.cast(updateTime())); case "AnomalyTimeRange": return Optional.ofNullable(clazz.cast(anomalyTimeRange())); case "AnomalyReportedTimeRange": return Optional.ofNullable(clazz.cast(anomalyReportedTimeRange())); case "PredictionTimeRange": return Optional.ofNullable(clazz.cast(predictionTimeRange())); case "SourceDetails": return Optional.ofNullable(clazz.cast(sourceDetails())); case "AssociatedInsightId": return Optional.ofNullable(clazz.cast(associatedInsightId())); case "ResourceCollection": return Optional.ofNullable(clazz.cast(resourceCollection())); case "Limit": return Optional.ofNullable(clazz.cast(limit())); case "SourceMetadata": return Optional.ofNullable(clazz.cast(sourceMetadata())); case "AnomalyResources": return Optional.ofNullable(clazz.cast(anomalyResources())); case "Description": return Optional.ofNullable(clazz.cast(description())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((ProactiveAnomalySummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the anomaly. *

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

* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's * severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. *

* * @param severity * The severity of the anomaly. The severity of anomalies that generate an insight determine that * insight's severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. * @see AnomalySeverity * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalySeverity */ Builder severity(String severity); /** *

* The severity of the anomaly. The severity of anomalies that generate an insight determine that insight's * severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. *

* * @param severity * The severity of the anomaly. The severity of anomalies that generate an insight determine that * insight's severity. For more information, see Understanding insight severities in the Amazon DevOps Guru User Guide. * @see AnomalySeverity * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalySeverity */ Builder severity(AnomalySeverity severity); /** *

* The status of the anomaly. *

* * @param status * The status of the anomaly. * @see AnomalyStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalyStatus */ Builder status(String status); /** *

* The status of the anomaly. *

* * @param status * The status of the anomaly. * @see AnomalyStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalyStatus */ Builder status(AnomalyStatus status); /** *

* The time of the anomaly's most recent update. *

* * @param updateTime * The time of the anomaly's most recent update. * @return Returns a reference to this object so that method calls can be chained together. */ Builder updateTime(Instant updateTime); /** * Sets the value of the AnomalyTimeRange property for this object. * * @param anomalyTimeRange * The new value for the AnomalyTimeRange property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder anomalyTimeRange(AnomalyTimeRange anomalyTimeRange); /** * Sets the value of the AnomalyTimeRange property for this object. * * This is a convenience method that creates an instance of the {@link AnomalyTimeRange.Builder} avoiding the * need to create one manually via {@link AnomalyTimeRange#builder()}. * *

* When the {@link Consumer} completes, {@link AnomalyTimeRange.Builder#build()} is called immediately and its * result is passed to {@link #anomalyTimeRange(AnomalyTimeRange)}. * * @param anomalyTimeRange * a consumer that will call methods on {@link AnomalyTimeRange.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #anomalyTimeRange(AnomalyTimeRange) */ default Builder anomalyTimeRange(Consumer anomalyTimeRange) { return anomalyTimeRange(AnomalyTimeRange.builder().applyMutation(anomalyTimeRange).build()); } /** *

* An AnomalyReportedTimeRange object that specifies the time range between when the anomaly is * opened and the time when it is closed. *

* * @param anomalyReportedTimeRange * An AnomalyReportedTimeRange object that specifies the time range between when the anomaly * is opened and the time when it is closed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder anomalyReportedTimeRange(AnomalyReportedTimeRange anomalyReportedTimeRange); /** *

* An AnomalyReportedTimeRange object that specifies the time range between when the anomaly is * opened and the time when it is closed. *

* This is a convenience method that creates an instance of the {@link AnomalyReportedTimeRange.Builder} * avoiding the need to create one manually via {@link AnomalyReportedTimeRange#builder()}. * *

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

* When the {@link Consumer} completes, {@link PredictionTimeRange.Builder#build()} is called immediately and * its result is passed to {@link #predictionTimeRange(PredictionTimeRange)}. * * @param predictionTimeRange * a consumer that will call methods on {@link PredictionTimeRange.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #predictionTimeRange(PredictionTimeRange) */ default Builder predictionTimeRange(Consumer predictionTimeRange) { return predictionTimeRange(PredictionTimeRange.builder().applyMutation(predictionTimeRange).build()); } /** *

* Details about the source of the analyzed operational data that triggered the anomaly. The one supported * source is Amazon CloudWatch metrics. *

* * @param sourceDetails * Details about the source of the analyzed operational data that triggered the anomaly. The one * supported source is Amazon CloudWatch metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceDetails(AnomalySourceDetails sourceDetails); /** *

* Details about the source of the analyzed operational data that triggered the anomaly. The one supported * source is Amazon CloudWatch metrics. *

* This is a convenience method that creates an instance of the {@link AnomalySourceDetails.Builder} avoiding * the need to create one manually via {@link AnomalySourceDetails#builder()}. * *

* When the {@link Consumer} completes, {@link AnomalySourceDetails.Builder#build()} is called immediately and * its result is passed to {@link #sourceDetails(AnomalySourceDetails)}. * * @param sourceDetails * a consumer that will call methods on {@link AnomalySourceDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sourceDetails(AnomalySourceDetails) */ default Builder sourceDetails(Consumer sourceDetails) { return sourceDetails(AnomalySourceDetails.builder().applyMutation(sourceDetails).build()); } /** *

* The ID of the insight that contains this anomaly. An insight is composed of related anomalies. *

* * @param associatedInsightId * The ID of the insight that contains this anomaly. An insight is composed of related anomalies. * @return Returns a reference to this object so that method calls can be chained together. */ Builder associatedInsightId(String associatedInsightId); /** * Sets the value of the ResourceCollection property for this object. * * @param resourceCollection * The new value for the ResourceCollection property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceCollection(ResourceCollection resourceCollection); /** * Sets the value of the ResourceCollection property for this object. * * This is a convenience method that creates an instance of the {@link ResourceCollection.Builder} avoiding the * need to create one manually via {@link ResourceCollection#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCollection.Builder#build()} is called immediately and its * result is passed to {@link #resourceCollection(ResourceCollection)}. * * @param resourceCollection * a consumer that will call methods on {@link ResourceCollection.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #resourceCollection(ResourceCollection) */ default Builder resourceCollection(Consumer resourceCollection) { return resourceCollection(ResourceCollection.builder().applyMutation(resourceCollection).build()); } /** *

* A threshold that was exceeded by behavior in analyzed resources. Exceeding this threshold is related to the * anomalous behavior that generated this anomaly. *

* * @param limit * A threshold that was exceeded by behavior in analyzed resources. Exceeding this threshold is related * to the anomalous behavior that generated this anomaly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder limit(Double limit); /** *

* The metadata of the source which detects proactive anomalies. *

* * @param sourceMetadata * The metadata of the source which detects proactive anomalies. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceMetadata(AnomalySourceMetadata sourceMetadata); /** *

* The metadata of the source which detects proactive anomalies. *

* This is a convenience method that creates an instance of the {@link AnomalySourceMetadata.Builder} avoiding * the need to create one manually via {@link AnomalySourceMetadata#builder()}. * *

* When the {@link Consumer} completes, {@link AnomalySourceMetadata.Builder#build()} is called immediately and * its result is passed to {@link #sourceMetadata(AnomalySourceMetadata)}. * * @param sourceMetadata * a consumer that will call methods on {@link AnomalySourceMetadata.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sourceMetadata(AnomalySourceMetadata) */ default Builder sourceMetadata(Consumer sourceMetadata) { return sourceMetadata(AnomalySourceMetadata.builder().applyMutation(sourceMetadata).build()); } /** *

* Information about a resource in which DevOps Guru detected anomalous behavior. *

* * @param anomalyResources * Information about a resource in which DevOps Guru detected anomalous behavior. * @return Returns a reference to this object so that method calls can be chained together. */ Builder anomalyResources(Collection anomalyResources); /** *

* Information about a resource in which DevOps Guru detected anomalous behavior. *

* * @param anomalyResources * Information about a resource in which DevOps Guru detected anomalous behavior. * @return Returns a reference to this object so that method calls can be chained together. */ Builder anomalyResources(AnomalyResource... anomalyResources); /** *

* Information about a resource in which DevOps Guru detected anomalous behavior. *

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

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

* A description of the proactive anomaly. *

* * @param description * A description of the proactive anomaly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); } static final class BuilderImpl implements Builder { private String id; private String severity; private String status; private Instant updateTime; private AnomalyTimeRange anomalyTimeRange; private AnomalyReportedTimeRange anomalyReportedTimeRange; private PredictionTimeRange predictionTimeRange; private AnomalySourceDetails sourceDetails; private String associatedInsightId; private ResourceCollection resourceCollection; private Double limit; private AnomalySourceMetadata sourceMetadata; private List anomalyResources = DefaultSdkAutoConstructList.getInstance(); private String description; private BuilderImpl() { } private BuilderImpl(ProactiveAnomalySummary model) { id(model.id); severity(model.severity); status(model.status); updateTime(model.updateTime); anomalyTimeRange(model.anomalyTimeRange); anomalyReportedTimeRange(model.anomalyReportedTimeRange); predictionTimeRange(model.predictionTimeRange); sourceDetails(model.sourceDetails); associatedInsightId(model.associatedInsightId); resourceCollection(model.resourceCollection); limit(model.limit); sourceMetadata(model.sourceMetadata); anomalyResources(model.anomalyResources); description(model.description); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getSeverity() { return severity; } public final void setSeverity(String severity) { this.severity = severity; } @Override public final Builder severity(String severity) { this.severity = severity; return this; } @Override public final Builder severity(AnomalySeverity severity) { this.severity(severity == null ? null : severity.toString()); return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(AnomalyStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getUpdateTime() { return updateTime; } public final void setUpdateTime(Instant updateTime) { this.updateTime = updateTime; } @Override public final Builder updateTime(Instant updateTime) { this.updateTime = updateTime; return this; } public final AnomalyTimeRange.Builder getAnomalyTimeRange() { return anomalyTimeRange != null ? anomalyTimeRange.toBuilder() : null; } public final void setAnomalyTimeRange(AnomalyTimeRange.BuilderImpl anomalyTimeRange) { this.anomalyTimeRange = anomalyTimeRange != null ? anomalyTimeRange.build() : null; } @Override public final Builder anomalyTimeRange(AnomalyTimeRange anomalyTimeRange) { this.anomalyTimeRange = anomalyTimeRange; return this; } public final AnomalyReportedTimeRange.Builder getAnomalyReportedTimeRange() { return anomalyReportedTimeRange != null ? anomalyReportedTimeRange.toBuilder() : null; } public final void setAnomalyReportedTimeRange(AnomalyReportedTimeRange.BuilderImpl anomalyReportedTimeRange) { this.anomalyReportedTimeRange = anomalyReportedTimeRange != null ? anomalyReportedTimeRange.build() : null; } @Override public final Builder anomalyReportedTimeRange(AnomalyReportedTimeRange anomalyReportedTimeRange) { this.anomalyReportedTimeRange = anomalyReportedTimeRange; return this; } public final PredictionTimeRange.Builder getPredictionTimeRange() { return predictionTimeRange != null ? predictionTimeRange.toBuilder() : null; } public final void setPredictionTimeRange(PredictionTimeRange.BuilderImpl predictionTimeRange) { this.predictionTimeRange = predictionTimeRange != null ? predictionTimeRange.build() : null; } @Override public final Builder predictionTimeRange(PredictionTimeRange predictionTimeRange) { this.predictionTimeRange = predictionTimeRange; return this; } public final AnomalySourceDetails.Builder getSourceDetails() { return sourceDetails != null ? sourceDetails.toBuilder() : null; } public final void setSourceDetails(AnomalySourceDetails.BuilderImpl sourceDetails) { this.sourceDetails = sourceDetails != null ? sourceDetails.build() : null; } @Override public final Builder sourceDetails(AnomalySourceDetails sourceDetails) { this.sourceDetails = sourceDetails; return this; } public final String getAssociatedInsightId() { return associatedInsightId; } public final void setAssociatedInsightId(String associatedInsightId) { this.associatedInsightId = associatedInsightId; } @Override public final Builder associatedInsightId(String associatedInsightId) { this.associatedInsightId = associatedInsightId; return this; } public final ResourceCollection.Builder getResourceCollection() { return resourceCollection != null ? resourceCollection.toBuilder() : null; } public final void setResourceCollection(ResourceCollection.BuilderImpl resourceCollection) { this.resourceCollection = resourceCollection != null ? resourceCollection.build() : null; } @Override public final Builder resourceCollection(ResourceCollection resourceCollection) { this.resourceCollection = resourceCollection; return this; } public final Double getLimit() { return limit; } public final void setLimit(Double limit) { this.limit = limit; } @Override public final Builder limit(Double limit) { this.limit = limit; return this; } public final AnomalySourceMetadata.Builder getSourceMetadata() { return sourceMetadata != null ? sourceMetadata.toBuilder() : null; } public final void setSourceMetadata(AnomalySourceMetadata.BuilderImpl sourceMetadata) { this.sourceMetadata = sourceMetadata != null ? sourceMetadata.build() : null; } @Override public final Builder sourceMetadata(AnomalySourceMetadata sourceMetadata) { this.sourceMetadata = sourceMetadata; return this; } public final List getAnomalyResources() { List result = AnomalyResourcesCopier.copyToBuilder(this.anomalyResources); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAnomalyResources(Collection anomalyResources) { this.anomalyResources = AnomalyResourcesCopier.copyFromBuilder(anomalyResources); } @Override public final Builder anomalyResources(Collection anomalyResources) { this.anomalyResources = AnomalyResourcesCopier.copy(anomalyResources); return this; } @Override @SafeVarargs public final Builder anomalyResources(AnomalyResource... anomalyResources) { anomalyResources(Arrays.asList(anomalyResources)); return this; } @Override @SafeVarargs public final Builder anomalyResources(Consumer... anomalyResources) { anomalyResources(Stream.of(anomalyResources).map(c -> AnomalyResource.builder().applyMutation(c).build()) .collect(Collectors.toList())); 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; } @Override public ProactiveAnomalySummary build() { return new ProactiveAnomalySummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy