software.amazon.awssdk.services.applicationinsights.model.ConfigurationEvent Maven / Gradle / Ivy
Show all versions of applicationinsights Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.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 RESOURCE_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResourceGroupName").getter(getter(ConfigurationEvent::resourceGroupName))
.setter(setter(Builder::resourceGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceGroupName").build()).build();
private static final SdkField ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AccountId").getter(getter(ConfigurationEvent::accountId)).setter(setter(Builder::accountId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountId").build()).build();
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(RESOURCE_GROUP_NAME_FIELD,
ACCOUNT_ID_FIELD, 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 resourceGroupName;
private final String accountId;
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.resourceGroupName = builder.resourceGroupName;
this.accountId = builder.accountId;
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 name of the resource group of the application to which the configuration event belongs.
*
*
* @return The name of the resource group of the application to which the configuration event belongs.
*/
public final String resourceGroupName() {
return resourceGroupName;
}
/**
*
* The AWS account ID for the owner of the application to which the configuration event belongs.
*
*
* @return The AWS account ID for the owner of the application to which the configuration event belongs.
*/
public final String accountId() {
return accountId;
}
/**
*
* 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 extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(resourceGroupName());
hashCode = 31 * hashCode + Objects.hashCode(accountId());
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(resourceGroupName(), other.resourceGroupName()) && Objects.equals(accountId(), other.accountId())
&& 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("ResourceGroupName", resourceGroupName()).add("AccountId", accountId())
.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 "ResourceGroupName":
return Optional.ofNullable(clazz.cast(resourceGroupName()));
case "AccountId":
return Optional.ofNullable(clazz.cast(accountId()));
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