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

software.amazon.awssdk.services.devopsguru.model.ReactiveAnomalySummary 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.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 reactive anomaly. This object is returned by DescribeAnomaly. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReactiveAnomalySummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(ReactiveAnomalySummary::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(ReactiveAnomalySummary::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(ReactiveAnomalySummary::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField ANOMALY_TIME_RANGE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("AnomalyTimeRange") .getter(getter(ReactiveAnomalySummary::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(ReactiveAnomalySummary::anomalyReportedTimeRange)).setter(setter(Builder::anomalyReportedTimeRange)) .constructor(AnomalyReportedTimeRange::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyReportedTimeRange").build()) .build(); private static final SdkField SOURCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SourceDetails") .getter(getter(ReactiveAnomalySummary::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(ReactiveAnomalySummary::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(ReactiveAnomalySummary::resourceCollection)).setter(setter(Builder::resourceCollection)) .constructor(ResourceCollection::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceCollection").build()) .build(); private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type") .getter(getter(ReactiveAnomalySummary::typeAsString)).setter(setter(Builder::type)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(ReactiveAnomalySummary::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(ReactiveAnomalySummary::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField CAUSAL_ANOMALY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CausalAnomalyId").getter(getter(ReactiveAnomalySummary::causalAnomalyId)) .setter(setter(Builder::causalAnomalyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CausalAnomalyId").build()).build(); private static final SdkField> ANOMALY_RESOURCES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("AnomalyResources") .getter(getter(ReactiveAnomalySummary::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 List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, SEVERITY_FIELD, STATUS_FIELD, ANOMALY_TIME_RANGE_FIELD, ANOMALY_REPORTED_TIME_RANGE_FIELD, SOURCE_DETAILS_FIELD, ASSOCIATED_INSIGHT_ID_FIELD, RESOURCE_COLLECTION_FIELD, TYPE_FIELD, NAME_FIELD, DESCRIPTION_FIELD, CAUSAL_ANOMALY_ID_FIELD, ANOMALY_RESOURCES_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("AnomalyTimeRange", ANOMALY_TIME_RANGE_FIELD); put("AnomalyReportedTimeRange", ANOMALY_REPORTED_TIME_RANGE_FIELD); put("SourceDetails", SOURCE_DETAILS_FIELD); put("AssociatedInsightId", ASSOCIATED_INSIGHT_ID_FIELD); put("ResourceCollection", RESOURCE_COLLECTION_FIELD); put("Type", TYPE_FIELD); put("Name", NAME_FIELD); put("Description", DESCRIPTION_FIELD); put("CausalAnomalyId", CAUSAL_ANOMALY_ID_FIELD); put("AnomalyResources", ANOMALY_RESOURCES_FIELD); } }); private static final long serialVersionUID = 1L; private final String id; private final String severity; private final String status; private final AnomalyTimeRange anomalyTimeRange; private final AnomalyReportedTimeRange anomalyReportedTimeRange; private final AnomalySourceDetails sourceDetails; private final String associatedInsightId; private final ResourceCollection resourceCollection; private final String type; private final String name; private final String description; private final String causalAnomalyId; private final List anomalyResources; private ReactiveAnomalySummary(BuilderImpl builder) { this.id = builder.id; this.severity = builder.severity; this.status = builder.status; this.anomalyTimeRange = builder.anomalyTimeRange; this.anomalyReportedTimeRange = builder.anomalyReportedTimeRange; this.sourceDetails = builder.sourceDetails; this.associatedInsightId = builder.associatedInsightId; this.resourceCollection = builder.resourceCollection; this.type = builder.type; this.name = builder.name; this.description = builder.description; this.causalAnomalyId = builder.causalAnomalyId; this.anomalyResources = builder.anomalyResources; } /** *

* The ID of the reactive anomaly. *

* * @return The ID of the reactive 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 reactive 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 reactive anomaly. * @see AnomalyStatus */ public final AnomalyStatus status() { return AnomalyStatus.fromValue(status); } /** *

* The status of the reactive 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 reactive anomaly. * @see AnomalyStatus */ public final String statusAsString() { return status; } /** * 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; } /** *

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

* The type of the reactive anomaly. It can be one of the following types. *

*
    *
  • *

    * CAUSAL - the anomaly can cause a new insight. *

    *
  • *
  • *

    * CONTEXTUAL - the anomaly contains additional information about an insight or its causal anomaly. *

    *
  • *
*

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

* * @return The type of the reactive anomaly. It can be one of the following types.

*
    *
  • *

    * CAUSAL - the anomaly can cause a new insight. *

    *
  • *
  • *

    * CONTEXTUAL - the anomaly contains additional information about an insight or its causal * anomaly. *

    *
  • * @see AnomalyType */ public final AnomalyType type() { return AnomalyType.fromValue(type); } /** *

    * The type of the reactive anomaly. It can be one of the following types. *

    *
      *
    • *

      * CAUSAL - the anomaly can cause a new insight. *

      *
    • *
    • *

      * CONTEXTUAL - the anomaly contains additional information about an insight or its causal anomaly. *

      *
    • *
    *

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

    * * @return The type of the reactive anomaly. It can be one of the following types.

    *
      *
    • *

      * CAUSAL - the anomaly can cause a new insight. *

      *
    • *
    • *

      * CONTEXTUAL - the anomaly contains additional information about an insight or its causal * anomaly. *

      *
    • * @see AnomalyType */ public final String typeAsString() { return type; } /** *

      * The name of the reactive anomaly. *

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

      * A description of the reactive anomaly. *

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

      * The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly is * always `NULL`. *

      * * @return The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly * is always `NULL`. */ public final String causalAnomalyId() { return causalAnomalyId; } /** * 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); } /** *

      * The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru. *

      *

      * 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 The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru. */ public final List anomalyResources() { return anomalyResources; } @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(anomalyTimeRange()); hashCode = 31 * hashCode + Objects.hashCode(anomalyReportedTimeRange()); hashCode = 31 * hashCode + Objects.hashCode(sourceDetails()); hashCode = 31 * hashCode + Objects.hashCode(associatedInsightId()); hashCode = 31 * hashCode + Objects.hashCode(resourceCollection()); hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(causalAnomalyId()); hashCode = 31 * hashCode + Objects.hashCode(hasAnomalyResources() ? anomalyResources() : null); 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 ReactiveAnomalySummary)) { return false; } ReactiveAnomalySummary other = (ReactiveAnomalySummary) obj; return Objects.equals(id(), other.id()) && Objects.equals(severityAsString(), other.severityAsString()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(anomalyTimeRange(), other.anomalyTimeRange()) && Objects.equals(anomalyReportedTimeRange(), other.anomalyReportedTimeRange()) && Objects.equals(sourceDetails(), other.sourceDetails()) && Objects.equals(associatedInsightId(), other.associatedInsightId()) && Objects.equals(resourceCollection(), other.resourceCollection()) && Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(causalAnomalyId(), other.causalAnomalyId()) && hasAnomalyResources() == other.hasAnomalyResources() && Objects.equals(anomalyResources(), other.anomalyResources()); } /** * 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("ReactiveAnomalySummary").add("Id", id()).add("Severity", severityAsString()) .add("Status", statusAsString()).add("AnomalyTimeRange", anomalyTimeRange()) .add("AnomalyReportedTimeRange", anomalyReportedTimeRange()).add("SourceDetails", sourceDetails()) .add("AssociatedInsightId", associatedInsightId()).add("ResourceCollection", resourceCollection()) .add("Type", typeAsString()).add("Name", name()).add("Description", description()) .add("CausalAnomalyId", causalAnomalyId()) .add("AnomalyResources", hasAnomalyResources() ? anomalyResources() : null).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 "AnomalyTimeRange": return Optional.ofNullable(clazz.cast(anomalyTimeRange())); case "AnomalyReportedTimeRange": return Optional.ofNullable(clazz.cast(anomalyReportedTimeRange())); 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 "Type": return Optional.ofNullable(clazz.cast(typeAsString())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "CausalAnomalyId": return Optional.ofNullable(clazz.cast(causalAnomalyId())); case "AnomalyResources": return Optional.ofNullable(clazz.cast(anomalyResources())); 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((ReactiveAnomalySummary) 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 reactive anomaly. *

      * * @param id * The ID of the reactive 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 reactive anomaly. *

      * * @param status * The status of the reactive 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 reactive anomaly. *

      * * @param status * The status of the reactive anomaly. * @see AnomalyStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalyStatus */ Builder status(AnomalyStatus status); /** * 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()); } /** *

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

      * The type of the reactive anomaly. It can be one of the following types. *

      *
        *
      • *

        * CAUSAL - the anomaly can cause a new insight. *

        *
      • *
      • *

        * CONTEXTUAL - the anomaly contains additional information about an insight or its causal anomaly. *

        *
      • *
      * * @param type * The type of the reactive anomaly. It can be one of the following types.

      *
        *
      • *

        * CAUSAL - the anomaly can cause a new insight. *

        *
      • *
      • *

        * CONTEXTUAL - the anomaly contains additional information about an insight or its causal * anomaly. *

        *
      • * @see AnomalyType * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalyType */ Builder type(String type); /** *

        * The type of the reactive anomaly. It can be one of the following types. *

        *
          *
        • *

          * CAUSAL - the anomaly can cause a new insight. *

          *
        • *
        • *

          * CONTEXTUAL - the anomaly contains additional information about an insight or its causal anomaly. *

          *
        • *
        * * @param type * The type of the reactive anomaly. It can be one of the following types.

        *
          *
        • *

          * CAUSAL - the anomaly can cause a new insight. *

          *
        • *
        • *

          * CONTEXTUAL - the anomaly contains additional information about an insight or its causal * anomaly. *

          *
        • * @see AnomalyType * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalyType */ Builder type(AnomalyType type); /** *

          * The name of the reactive anomaly. *

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

          * A description of the reactive anomaly. *

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

          * The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` anomaly is * always `NULL`. *

          * * @param causalAnomalyId * The ID of the causal anomaly that is associated with this reactive anomaly. The ID of a `CAUSAL` * anomaly is always `NULL`. * @return Returns a reference to this object so that method calls can be chained together. */ Builder causalAnomalyId(String causalAnomalyId); /** *

          * The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru. *

          * * @param anomalyResources * The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru. * @return Returns a reference to this object so that method calls can be chained together. */ Builder anomalyResources(Collection anomalyResources); /** *

          * The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru. *

          * * @param anomalyResources * The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru. * @return Returns a reference to this object so that method calls can be chained together. */ Builder anomalyResources(AnomalyResource... anomalyResources); /** *

          * The Amazon Web Services resources in which anomalous behavior was detected by DevOps Guru. *

          * 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); } static final class BuilderImpl implements Builder { private String id; private String severity; private String status; private AnomalyTimeRange anomalyTimeRange; private AnomalyReportedTimeRange anomalyReportedTimeRange; private AnomalySourceDetails sourceDetails; private String associatedInsightId; private ResourceCollection resourceCollection; private String type; private String name; private String description; private String causalAnomalyId; private List anomalyResources = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(ReactiveAnomalySummary model) { id(model.id); severity(model.severity); status(model.status); anomalyTimeRange(model.anomalyTimeRange); anomalyReportedTimeRange(model.anomalyReportedTimeRange); sourceDetails(model.sourceDetails); associatedInsightId(model.associatedInsightId); resourceCollection(model.resourceCollection); type(model.type); name(model.name); description(model.description); causalAnomalyId(model.causalAnomalyId); anomalyResources(model.anomalyResources); } 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 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 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 String getType() { return type; } public final void setType(String type) { this.type = type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(AnomalyType type) { this.type(type == null ? null : type.toString()); return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getCausalAnomalyId() { return causalAnomalyId; } public final void setCausalAnomalyId(String causalAnomalyId) { this.causalAnomalyId = causalAnomalyId; } @Override public final Builder causalAnomalyId(String causalAnomalyId) { this.causalAnomalyId = causalAnomalyId; 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; } @Override public ReactiveAnomalySummary build() { return new ReactiveAnomalySummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy