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

software.amazon.awssdk.services.applicationinsights.model.ConfigurationEvent Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Application Insights module holds the client classes that are used for communicating with Application Insights.

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

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
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.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The event information. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ConfigurationEvent implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField MONITORED_RESOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MonitoredResourceARN").getter(getter(ConfigurationEvent::monitoredResourceARN)) .setter(setter(Builder::monitoredResourceARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoredResourceARN").build()) .build(); private static final SdkField EVENT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EventStatus").getter(getter(ConfigurationEvent::eventStatusAsString)) .setter(setter(Builder::eventStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventStatus").build()).build(); private static final SdkField EVENT_RESOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EventResourceType").getter(getter(ConfigurationEvent::eventResourceTypeAsString)) .setter(setter(Builder::eventResourceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventResourceType").build()).build(); private static final SdkField EVENT_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("EventTime").getter(getter(ConfigurationEvent::eventTime)).setter(setter(Builder::eventTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventTime").build()).build(); private static final SdkField EVENT_DETAIL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EventDetail").getter(getter(ConfigurationEvent::eventDetail)).setter(setter(Builder::eventDetail)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventDetail").build()).build(); private static final SdkField EVENT_RESOURCE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EventResourceName").getter(getter(ConfigurationEvent::eventResourceName)) .setter(setter(Builder::eventResourceName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventResourceName").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MONITORED_RESOURCE_ARN_FIELD, EVENT_STATUS_FIELD, EVENT_RESOURCE_TYPE_FIELD, EVENT_TIME_FIELD, EVENT_DETAIL_FIELD, EVENT_RESOURCE_NAME_FIELD)); private static final long serialVersionUID = 1L; private final String monitoredResourceARN; private final String eventStatus; private final String eventResourceType; private final Instant eventTime; private final String eventDetail; private final String eventResourceName; private ConfigurationEvent(BuilderImpl builder) { this.monitoredResourceARN = builder.monitoredResourceARN; this.eventStatus = builder.eventStatus; this.eventResourceType = builder.eventResourceType; this.eventTime = builder.eventTime; this.eventDetail = builder.eventDetail; this.eventResourceName = builder.eventResourceName; } /** *

* The resource monitored by Application Insights. *

* * @return The resource monitored by Application Insights. */ public final String monitoredResourceARN() { return monitoredResourceARN; } /** *

* The status of the configuration update event. Possible values include INFO, WARN, and ERROR. *

*

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

* * @return The status of the configuration update event. Possible values include INFO, WARN, and ERROR. * @see ConfigurationEventStatus */ public final ConfigurationEventStatus eventStatus() { return ConfigurationEventStatus.fromValue(eventStatus); } /** *

* The status of the configuration update event. Possible values include INFO, WARN, and ERROR. *

*

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

* * @return The status of the configuration update event. Possible values include INFO, WARN, and ERROR. * @see ConfigurationEventStatus */ public final String eventStatusAsString() { return eventStatus; } /** *

* The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. *

*

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

* * @return The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. * @see ConfigurationEventResourceType */ public final ConfigurationEventResourceType eventResourceType() { return ConfigurationEventResourceType.fromValue(eventResourceType); } /** *

* The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. *

*

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

* * @return The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. * @see ConfigurationEventResourceType */ public final String eventResourceTypeAsString() { return eventResourceType; } /** *

* The timestamp of the event. *

* * @return The timestamp of the event. */ public final Instant eventTime() { return eventTime; } /** *

* The details of the event in plain text. *

* * @return The details of the event in plain text. */ public final String eventDetail() { return eventDetail; } /** *

* The name of the resource Application Insights attempted to configure. *

* * @return The name of the resource Application Insights attempted to configure. */ public final String eventResourceName() { return eventResourceName; } @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(monitoredResourceARN()); hashCode = 31 * hashCode + Objects.hashCode(eventStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(eventResourceTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(eventTime()); hashCode = 31 * hashCode + Objects.hashCode(eventDetail()); hashCode = 31 * hashCode + Objects.hashCode(eventResourceName()); 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 ConfigurationEvent)) { return false; } ConfigurationEvent other = (ConfigurationEvent) obj; return Objects.equals(monitoredResourceARN(), other.monitoredResourceARN()) && Objects.equals(eventStatusAsString(), other.eventStatusAsString()) && Objects.equals(eventResourceTypeAsString(), other.eventResourceTypeAsString()) && Objects.equals(eventTime(), other.eventTime()) && Objects.equals(eventDetail(), other.eventDetail()) && Objects.equals(eventResourceName(), other.eventResourceName()); } /** * 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("ConfigurationEvent").add("MonitoredResourceARN", monitoredResourceARN()) .add("EventStatus", eventStatusAsString()).add("EventResourceType", eventResourceTypeAsString()) .add("EventTime", eventTime()).add("EventDetail", eventDetail()).add("EventResourceName", eventResourceName()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "MonitoredResourceARN": return Optional.ofNullable(clazz.cast(monitoredResourceARN())); case "EventStatus": return Optional.ofNullable(clazz.cast(eventStatusAsString())); case "EventResourceType": return Optional.ofNullable(clazz.cast(eventResourceTypeAsString())); case "EventTime": return Optional.ofNullable(clazz.cast(eventTime())); case "EventDetail": return Optional.ofNullable(clazz.cast(eventDetail())); case "EventResourceName": return Optional.ofNullable(clazz.cast(eventResourceName())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ConfigurationEvent) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The resource monitored by Application Insights. *

* * @param monitoredResourceARN * The resource monitored by Application Insights. * @return Returns a reference to this object so that method calls can be chained together. */ Builder monitoredResourceARN(String monitoredResourceARN); /** *

* The status of the configuration update event. Possible values include INFO, WARN, and ERROR. *

* * @param eventStatus * The status of the configuration update event. Possible values include INFO, WARN, and ERROR. * @see ConfigurationEventStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationEventStatus */ Builder eventStatus(String eventStatus); /** *

* The status of the configuration update event. Possible values include INFO, WARN, and ERROR. *

* * @param eventStatus * The status of the configuration update event. Possible values include INFO, WARN, and ERROR. * @see ConfigurationEventStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationEventStatus */ Builder eventStatus(ConfigurationEventStatus eventStatus); /** *

* The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. *

* * @param eventResourceType * The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. * @see ConfigurationEventResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationEventResourceType */ Builder eventResourceType(String eventResourceType); /** *

* The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. *

* * @param eventResourceType * The resource type that Application Insights attempted to configure, for example, CLOUDWATCH_ALARM. * @see ConfigurationEventResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationEventResourceType */ Builder eventResourceType(ConfigurationEventResourceType eventResourceType); /** *

* The timestamp of the event. *

* * @param eventTime * The timestamp of the event. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventTime(Instant eventTime); /** *

* The details of the event in plain text. *

* * @param eventDetail * The details of the event in plain text. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventDetail(String eventDetail); /** *

* The name of the resource Application Insights attempted to configure. *

* * @param eventResourceName * The name of the resource Application Insights attempted to configure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventResourceName(String eventResourceName); } static final class BuilderImpl implements Builder { private String monitoredResourceARN; private String eventStatus; private String eventResourceType; private Instant eventTime; private String eventDetail; private String eventResourceName; private BuilderImpl() { } private BuilderImpl(ConfigurationEvent model) { monitoredResourceARN(model.monitoredResourceARN); eventStatus(model.eventStatus); eventResourceType(model.eventResourceType); eventTime(model.eventTime); eventDetail(model.eventDetail); eventResourceName(model.eventResourceName); } public final String getMonitoredResourceARN() { return monitoredResourceARN; } public final void setMonitoredResourceARN(String monitoredResourceARN) { this.monitoredResourceARN = monitoredResourceARN; } @Override public final Builder monitoredResourceARN(String monitoredResourceARN) { this.monitoredResourceARN = monitoredResourceARN; return this; } public final String getEventStatus() { return eventStatus; } public final void setEventStatus(String eventStatus) { this.eventStatus = eventStatus; } @Override public final Builder eventStatus(String eventStatus) { this.eventStatus = eventStatus; return this; } @Override public final Builder eventStatus(ConfigurationEventStatus eventStatus) { this.eventStatus(eventStatus == null ? null : eventStatus.toString()); return this; } public final String getEventResourceType() { return eventResourceType; } public final void setEventResourceType(String eventResourceType) { this.eventResourceType = eventResourceType; } @Override public final Builder eventResourceType(String eventResourceType) { this.eventResourceType = eventResourceType; return this; } @Override public final Builder eventResourceType(ConfigurationEventResourceType eventResourceType) { this.eventResourceType(eventResourceType == null ? null : eventResourceType.toString()); return this; } public final Instant getEventTime() { return eventTime; } public final void setEventTime(Instant eventTime) { this.eventTime = eventTime; } @Override public final Builder eventTime(Instant eventTime) { this.eventTime = eventTime; return this; } public final String getEventDetail() { return eventDetail; } public final void setEventDetail(String eventDetail) { this.eventDetail = eventDetail; } @Override public final Builder eventDetail(String eventDetail) { this.eventDetail = eventDetail; return this; } public final String getEventResourceName() { return eventResourceName; } public final void setEventResourceName(String eventResourceName) { this.eventResourceName = eventResourceName; } @Override public final Builder eventResourceName(String eventResourceName) { this.eventResourceName = eventResourceName; return this; } @Override public ConfigurationEvent build() { return new ConfigurationEvent(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy