software.amazon.awssdk.services.applicationinsights.model.Observation 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;
/**
*
* Describes an anomaly or error with the application.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Observation implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id")
.getter(getter(Observation::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build();
private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("StartTime").getter(getter(Observation::startTime)).setter(setter(Builder::startTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build();
private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("EndTime").getter(getter(Observation::endTime)).setter(setter(Builder::endTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build();
private static final SdkField SOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceType").getter(getter(Observation::sourceType)).setter(setter(Builder::sourceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceType").build()).build();
private static final SdkField SOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceARN").getter(getter(Observation::sourceARN)).setter(setter(Builder::sourceARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceARN").build()).build();
private static final SdkField LOG_GROUP_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LogGroup").getter(getter(Observation::logGroup)).setter(setter(Builder::logGroup))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogGroup").build()).build();
private static final SdkField LINE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LineTime").getter(getter(Observation::lineTime)).setter(setter(Builder::lineTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LineTime").build()).build();
private static final SdkField LOG_TEXT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LogText").getter(getter(Observation::logText)).setter(setter(Builder::logText))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogText").build()).build();
private static final SdkField LOG_FILTER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LogFilter").getter(getter(Observation::logFilterAsString)).setter(setter(Builder::logFilter))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogFilter").build()).build();
private static final SdkField METRIC_NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MetricNamespace").getter(getter(Observation::metricNamespace)).setter(setter(Builder::metricNamespace))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetricNamespace").build()).build();
private static final SdkField METRIC_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MetricName").getter(getter(Observation::metricName)).setter(setter(Builder::metricName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetricName").build()).build();
private static final SdkField UNIT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Unit")
.getter(getter(Observation::unit)).setter(setter(Builder::unit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Unit").build()).build();
private static final SdkField VALUE_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("Value")
.getter(getter(Observation::value)).setter(setter(Builder::value))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Value").build()).build();
private static final SdkField CLOUD_WATCH_EVENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CloudWatchEventId").getter(getter(Observation::cloudWatchEventId))
.setter(setter(Builder::cloudWatchEventId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchEventId").build()).build();
private static final SdkField CLOUD_WATCH_EVENT_SOURCE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CloudWatchEventSource").getter(getter(Observation::cloudWatchEventSourceAsString))
.setter(setter(Builder::cloudWatchEventSource))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchEventSource").build())
.build();
private static final SdkField CLOUD_WATCH_EVENT_DETAIL_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CloudWatchEventDetailType").getter(getter(Observation::cloudWatchEventDetailType))
.setter(setter(Builder::cloudWatchEventDetailType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchEventDetailType").build())
.build();
private static final SdkField HEALTH_EVENT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HealthEventArn").getter(getter(Observation::healthEventArn)).setter(setter(Builder::healthEventArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthEventArn").build()).build();
private static final SdkField HEALTH_SERVICE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HealthService").getter(getter(Observation::healthService)).setter(setter(Builder::healthService))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthService").build()).build();
private static final SdkField HEALTH_EVENT_TYPE_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HealthEventTypeCode").getter(getter(Observation::healthEventTypeCode))
.setter(setter(Builder::healthEventTypeCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthEventTypeCode").build())
.build();
private static final SdkField HEALTH_EVENT_TYPE_CATEGORY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HealthEventTypeCategory").getter(getter(Observation::healthEventTypeCategory))
.setter(setter(Builder::healthEventTypeCategory))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthEventTypeCategory").build())
.build();
private static final SdkField HEALTH_EVENT_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HealthEventDescription").getter(getter(Observation::healthEventDescription))
.setter(setter(Builder::healthEventDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthEventDescription").build())
.build();
private static final SdkField CODE_DEPLOY_DEPLOYMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CodeDeployDeploymentId").getter(getter(Observation::codeDeployDeploymentId))
.setter(setter(Builder::codeDeployDeploymentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeDeployDeploymentId").build())
.build();
private static final SdkField CODE_DEPLOY_DEPLOYMENT_GROUP_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CodeDeployDeploymentGroup").getter(getter(Observation::codeDeployDeploymentGroup))
.setter(setter(Builder::codeDeployDeploymentGroup))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeDeployDeploymentGroup").build())
.build();
private static final SdkField CODE_DEPLOY_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CodeDeployState").getter(getter(Observation::codeDeployState)).setter(setter(Builder::codeDeployState))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeDeployState").build()).build();
private static final SdkField CODE_DEPLOY_APPLICATION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CodeDeployApplication").getter(getter(Observation::codeDeployApplication))
.setter(setter(Builder::codeDeployApplication))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeDeployApplication").build())
.build();
private static final SdkField CODE_DEPLOY_INSTANCE_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CodeDeployInstanceGroupId").getter(getter(Observation::codeDeployInstanceGroupId))
.setter(setter(Builder::codeDeployInstanceGroupId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeDeployInstanceGroupId").build())
.build();
private static final SdkField EC2_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Ec2State").getter(getter(Observation::ec2State)).setter(setter(Builder::ec2State))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ec2State").build()).build();
private static final SdkField RDS_EVENT_CATEGORIES_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RdsEventCategories").getter(getter(Observation::rdsEventCategories))
.setter(setter(Builder::rdsEventCategories))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RdsEventCategories").build())
.build();
private static final SdkField RDS_EVENT_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RdsEventMessage").getter(getter(Observation::rdsEventMessage)).setter(setter(Builder::rdsEventMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RdsEventMessage").build()).build();
private static final SdkField S3_EVENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("S3EventName").getter(getter(Observation::s3EventName)).setter(setter(Builder::s3EventName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3EventName").build()).build();
private static final SdkField STATES_EXECUTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatesExecutionArn").getter(getter(Observation::statesExecutionArn))
.setter(setter(Builder::statesExecutionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatesExecutionArn").build())
.build();
private static final SdkField STATES_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatesArn").getter(getter(Observation::statesArn)).setter(setter(Builder::statesArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatesArn").build()).build();
private static final SdkField STATES_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatesStatus").getter(getter(Observation::statesStatus)).setter(setter(Builder::statesStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatesStatus").build()).build();
private static final SdkField STATES_INPUT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatesInput").getter(getter(Observation::statesInput)).setter(setter(Builder::statesInput))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatesInput").build()).build();
private static final SdkField EBS_EVENT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EbsEvent").getter(getter(Observation::ebsEvent)).setter(setter(Builder::ebsEvent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EbsEvent").build()).build();
private static final SdkField EBS_RESULT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EbsResult").getter(getter(Observation::ebsResult)).setter(setter(Builder::ebsResult))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EbsResult").build()).build();
private static final SdkField EBS_CAUSE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EbsCause").getter(getter(Observation::ebsCause)).setter(setter(Builder::ebsCause))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EbsCause").build()).build();
private static final SdkField EBS_REQUEST_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EbsRequestId").getter(getter(Observation::ebsRequestId)).setter(setter(Builder::ebsRequestId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EbsRequestId").build()).build();
private static final SdkField X_RAY_FAULT_PERCENT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("XRayFaultPercent").getter(getter(Observation::xRayFaultPercent))
.setter(setter(Builder::xRayFaultPercent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XRayFaultPercent").build()).build();
private static final SdkField X_RAY_THROTTLE_PERCENT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("XRayThrottlePercent").getter(getter(Observation::xRayThrottlePercent))
.setter(setter(Builder::xRayThrottlePercent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XRayThrottlePercent").build())
.build();
private static final SdkField X_RAY_ERROR_PERCENT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("XRayErrorPercent").getter(getter(Observation::xRayErrorPercent))
.setter(setter(Builder::xRayErrorPercent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XRayErrorPercent").build()).build();
private static final SdkField X_RAY_REQUEST_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("XRayRequestCount").getter(getter(Observation::xRayRequestCount))
.setter(setter(Builder::xRayRequestCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XRayRequestCount").build()).build();
private static final SdkField X_RAY_REQUEST_AVERAGE_LATENCY_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("XRayRequestAverageLatency").getter(getter(Observation::xRayRequestAverageLatency))
.setter(setter(Builder::xRayRequestAverageLatency))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XRayRequestAverageLatency").build())
.build();
private static final SdkField X_RAY_NODE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("XRayNodeName").getter(getter(Observation::xRayNodeName)).setter(setter(Builder::xRayNodeName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XRayNodeName").build()).build();
private static final SdkField X_RAY_NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("XRayNodeType").getter(getter(Observation::xRayNodeType)).setter(setter(Builder::xRayNodeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XRayNodeType").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, START_TIME_FIELD,
END_TIME_FIELD, SOURCE_TYPE_FIELD, SOURCE_ARN_FIELD, LOG_GROUP_FIELD, LINE_TIME_FIELD, LOG_TEXT_FIELD,
LOG_FILTER_FIELD, METRIC_NAMESPACE_FIELD, METRIC_NAME_FIELD, UNIT_FIELD, VALUE_FIELD, CLOUD_WATCH_EVENT_ID_FIELD,
CLOUD_WATCH_EVENT_SOURCE_FIELD, CLOUD_WATCH_EVENT_DETAIL_TYPE_FIELD, HEALTH_EVENT_ARN_FIELD, HEALTH_SERVICE_FIELD,
HEALTH_EVENT_TYPE_CODE_FIELD, HEALTH_EVENT_TYPE_CATEGORY_FIELD, HEALTH_EVENT_DESCRIPTION_FIELD,
CODE_DEPLOY_DEPLOYMENT_ID_FIELD, CODE_DEPLOY_DEPLOYMENT_GROUP_FIELD, CODE_DEPLOY_STATE_FIELD,
CODE_DEPLOY_APPLICATION_FIELD, CODE_DEPLOY_INSTANCE_GROUP_ID_FIELD, EC2_STATE_FIELD, RDS_EVENT_CATEGORIES_FIELD,
RDS_EVENT_MESSAGE_FIELD, S3_EVENT_NAME_FIELD, STATES_EXECUTION_ARN_FIELD, STATES_ARN_FIELD, STATES_STATUS_FIELD,
STATES_INPUT_FIELD, EBS_EVENT_FIELD, EBS_RESULT_FIELD, EBS_CAUSE_FIELD, EBS_REQUEST_ID_FIELD,
X_RAY_FAULT_PERCENT_FIELD, X_RAY_THROTTLE_PERCENT_FIELD, X_RAY_ERROR_PERCENT_FIELD, X_RAY_REQUEST_COUNT_FIELD,
X_RAY_REQUEST_AVERAGE_LATENCY_FIELD, X_RAY_NODE_NAME_FIELD, X_RAY_NODE_TYPE_FIELD));
private static final long serialVersionUID = 1L;
private final String id;
private final Instant startTime;
private final Instant endTime;
private final String sourceType;
private final String sourceARN;
private final String logGroup;
private final Instant lineTime;
private final String logText;
private final String logFilter;
private final String metricNamespace;
private final String metricName;
private final String unit;
private final Double value;
private final String cloudWatchEventId;
private final String cloudWatchEventSource;
private final String cloudWatchEventDetailType;
private final String healthEventArn;
private final String healthService;
private final String healthEventTypeCode;
private final String healthEventTypeCategory;
private final String healthEventDescription;
private final String codeDeployDeploymentId;
private final String codeDeployDeploymentGroup;
private final String codeDeployState;
private final String codeDeployApplication;
private final String codeDeployInstanceGroupId;
private final String ec2State;
private final String rdsEventCategories;
private final String rdsEventMessage;
private final String s3EventName;
private final String statesExecutionArn;
private final String statesArn;
private final String statesStatus;
private final String statesInput;
private final String ebsEvent;
private final String ebsResult;
private final String ebsCause;
private final String ebsRequestId;
private final Integer xRayFaultPercent;
private final Integer xRayThrottlePercent;
private final Integer xRayErrorPercent;
private final Integer xRayRequestCount;
private final Long xRayRequestAverageLatency;
private final String xRayNodeName;
private final String xRayNodeType;
private Observation(BuilderImpl builder) {
this.id = builder.id;
this.startTime = builder.startTime;
this.endTime = builder.endTime;
this.sourceType = builder.sourceType;
this.sourceARN = builder.sourceARN;
this.logGroup = builder.logGroup;
this.lineTime = builder.lineTime;
this.logText = builder.logText;
this.logFilter = builder.logFilter;
this.metricNamespace = builder.metricNamespace;
this.metricName = builder.metricName;
this.unit = builder.unit;
this.value = builder.value;
this.cloudWatchEventId = builder.cloudWatchEventId;
this.cloudWatchEventSource = builder.cloudWatchEventSource;
this.cloudWatchEventDetailType = builder.cloudWatchEventDetailType;
this.healthEventArn = builder.healthEventArn;
this.healthService = builder.healthService;
this.healthEventTypeCode = builder.healthEventTypeCode;
this.healthEventTypeCategory = builder.healthEventTypeCategory;
this.healthEventDescription = builder.healthEventDescription;
this.codeDeployDeploymentId = builder.codeDeployDeploymentId;
this.codeDeployDeploymentGroup = builder.codeDeployDeploymentGroup;
this.codeDeployState = builder.codeDeployState;
this.codeDeployApplication = builder.codeDeployApplication;
this.codeDeployInstanceGroupId = builder.codeDeployInstanceGroupId;
this.ec2State = builder.ec2State;
this.rdsEventCategories = builder.rdsEventCategories;
this.rdsEventMessage = builder.rdsEventMessage;
this.s3EventName = builder.s3EventName;
this.statesExecutionArn = builder.statesExecutionArn;
this.statesArn = builder.statesArn;
this.statesStatus = builder.statesStatus;
this.statesInput = builder.statesInput;
this.ebsEvent = builder.ebsEvent;
this.ebsResult = builder.ebsResult;
this.ebsCause = builder.ebsCause;
this.ebsRequestId = builder.ebsRequestId;
this.xRayFaultPercent = builder.xRayFaultPercent;
this.xRayThrottlePercent = builder.xRayThrottlePercent;
this.xRayErrorPercent = builder.xRayErrorPercent;
this.xRayRequestCount = builder.xRayRequestCount;
this.xRayRequestAverageLatency = builder.xRayRequestAverageLatency;
this.xRayNodeName = builder.xRayNodeName;
this.xRayNodeType = builder.xRayNodeType;
}
/**
*
* The ID of the observation type.
*
*
* @return The ID of the observation type.
*/
public final String id() {
return id;
}
/**
*
* The time when the observation was first detected, in epoch seconds.
*
*
* @return The time when the observation was first detected, in epoch seconds.
*/
public final Instant startTime() {
return startTime;
}
/**
*
* The time when the observation ended, in epoch seconds.
*
*
* @return The time when the observation ended, in epoch seconds.
*/
public final Instant endTime() {
return endTime;
}
/**
*
* The source type of the observation.
*
*
* @return The source type of the observation.
*/
public final String sourceType() {
return sourceType;
}
/**
*
* The source resource ARN of the observation.
*
*
* @return The source resource ARN of the observation.
*/
public final String sourceARN() {
return sourceARN;
}
/**
*
* The log group name.
*
*
* @return The log group name.
*/
public final String logGroup() {
return logGroup;
}
/**
*
* The timestamp in the CloudWatch Logs that specifies when the matched line occurred.
*
*
* @return The timestamp in the CloudWatch Logs that specifies when the matched line occurred.
*/
public final Instant lineTime() {
return lineTime;
}
/**
*
* The log text of the observation.
*
*
* @return The log text of the observation.
*/
public final String logText() {
return logText;
}
/**
*
* The log filter of the observation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #logFilter} will
* return {@link LogFilter#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #logFilterAsString}.
*
*
* @return The log filter of the observation.
* @see LogFilter
*/
public final LogFilter logFilter() {
return LogFilter.fromValue(logFilter);
}
/**
*
* The log filter of the observation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #logFilter} will
* return {@link LogFilter#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #logFilterAsString}.
*
*
* @return The log filter of the observation.
* @see LogFilter
*/
public final String logFilterAsString() {
return logFilter;
}
/**
*
* The namespace of the observation metric.
*
*
* @return The namespace of the observation metric.
*/
public final String metricNamespace() {
return metricNamespace;
}
/**
*
* The name of the observation metric.
*
*
* @return The name of the observation metric.
*/
public final String metricName() {
return metricName;
}
/**
*
* The unit of the source observation metric.
*
*
* @return The unit of the source observation metric.
*/
public final String unit() {
return unit;
}
/**
*
* The value of the source observation metric.
*
*
* @return The value of the source observation metric.
*/
public final Double value() {
return value;
}
/**
*
* The ID of the CloudWatch Event-based observation related to the detected problem.
*
*
* @return The ID of the CloudWatch Event-based observation related to the detected problem.
*/
public final String cloudWatchEventId() {
return cloudWatchEventId;
}
/**
*
* The source of the CloudWatch Event.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #cloudWatchEventSource} will return {@link CloudWatchEventSource#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #cloudWatchEventSourceAsString}.
*
*
* @return The source of the CloudWatch Event.
* @see CloudWatchEventSource
*/
public final CloudWatchEventSource cloudWatchEventSource() {
return CloudWatchEventSource.fromValue(cloudWatchEventSource);
}
/**
*
* The source of the CloudWatch Event.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #cloudWatchEventSource} will return {@link CloudWatchEventSource#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #cloudWatchEventSourceAsString}.
*
*
* @return The source of the CloudWatch Event.
* @see CloudWatchEventSource
*/
public final String cloudWatchEventSourceAsString() {
return cloudWatchEventSource;
}
/**
*
* The detail type of the CloudWatch Event-based observation, for example,
* EC2 Instance State-change Notification
.
*
*
* @return The detail type of the CloudWatch Event-based observation, for example,
* EC2 Instance State-change Notification
.
*/
public final String cloudWatchEventDetailType() {
return cloudWatchEventDetailType;
}
/**
*
* The Amazon Resource Name (ARN) of the Health Event-based observation.
*
*
* @return The Amazon Resource Name (ARN) of the Health Event-based observation.
*/
public final String healthEventArn() {
return healthEventArn;
}
/**
*
* The service to which the Health Event belongs, such as EC2.
*
*
* @return The service to which the Health Event belongs, such as EC2.
*/
public final String healthService() {
return healthService;
}
/**
*
* The type of the Health event, for example, AWS_EC2_POWER_CONNECTIVITY_ISSUE
.
*
*
* @return The type of the Health event, for example, AWS_EC2_POWER_CONNECTIVITY_ISSUE
.
*/
public final String healthEventTypeCode() {
return healthEventTypeCode;
}
/**
*
* The category of the Health event, such as issue
.
*
*
* @return The category of the Health event, such as issue
.
*/
public final String healthEventTypeCategory() {
return healthEventTypeCategory;
}
/**
*
* The description of the Health event provided by the service, such as Amazon EC2.
*
*
* @return The description of the Health event provided by the service, such as Amazon EC2.
*/
public final String healthEventDescription() {
return healthEventDescription;
}
/**
*
* The deployment ID of the CodeDeploy-based observation related to the detected problem.
*
*
* @return The deployment ID of the CodeDeploy-based observation related to the detected problem.
*/
public final String codeDeployDeploymentId() {
return codeDeployDeploymentId;
}
/**
*
* The deployment group to which the CodeDeploy deployment belongs.
*
*
* @return The deployment group to which the CodeDeploy deployment belongs.
*/
public final String codeDeployDeploymentGroup() {
return codeDeployDeploymentGroup;
}
/**
*
* The status of the CodeDeploy deployment, for example SUCCESS
or FAILURE
.
*
*
* @return The status of the CodeDeploy deployment, for example SUCCESS
or FAILURE
.
*/
public final String codeDeployState() {
return codeDeployState;
}
/**
*
* The CodeDeploy application to which the deployment belongs.
*
*
* @return The CodeDeploy application to which the deployment belongs.
*/
public final String codeDeployApplication() {
return codeDeployApplication;
}
/**
*
* The instance group to which the CodeDeploy instance belongs.
*
*
* @return The instance group to which the CodeDeploy instance belongs.
*/
public final String codeDeployInstanceGroupId() {
return codeDeployInstanceGroupId;
}
/**
*
* The state of the instance, such as STOPPING
or TERMINATING
.
*
*
* @return The state of the instance, such as STOPPING
or TERMINATING
.
*/
public final String ec2State() {
return ec2State;
}
/**
*
* The category of an RDS event.
*
*
* @return The category of an RDS event.
*/
public final String rdsEventCategories() {
return rdsEventCategories;
}
/**
*
* The message of an RDS event.
*
*
* @return The message of an RDS event.
*/
public final String rdsEventMessage() {
return rdsEventMessage;
}
/**
*
* The name of the S3 CloudWatch Event-based observation.
*
*
* @return The name of the S3 CloudWatch Event-based observation.
*/
public final String s3EventName() {
return s3EventName;
}
/**
*
* The Amazon Resource Name (ARN) of the step function execution-based observation.
*
*
* @return The Amazon Resource Name (ARN) of the step function execution-based observation.
*/
public final String statesExecutionArn() {
return statesExecutionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the step function-based observation.
*
*
* @return The Amazon Resource Name (ARN) of the step function-based observation.
*/
public final String statesArn() {
return statesArn;
}
/**
*
* The status of the step function-related observation.
*
*
* @return The status of the step function-related observation.
*/
public final String statesStatus() {
return statesStatus;
}
/**
*
* The input to the step function-based observation.
*
*
* @return The input to the step function-based observation.
*/
public final String statesInput() {
return statesInput;
}
/**
*
* The type of EBS CloudWatch event, such as createVolume
, deleteVolume
or
* attachVolume
.
*
*
* @return The type of EBS CloudWatch event, such as createVolume
, deleteVolume
or
* attachVolume
.
*/
public final String ebsEvent() {
return ebsEvent;
}
/**
*
* The result of an EBS CloudWatch event, such as failed
or succeeded
.
*
*
* @return The result of an EBS CloudWatch event, such as failed
or succeeded
.
*/
public final String ebsResult() {
return ebsResult;
}
/**
*
* The cause of an EBS CloudWatch event.
*
*
* @return The cause of an EBS CloudWatch event.
*/
public final String ebsCause() {
return ebsCause;
}
/**
*
* The request ID of an EBS CloudWatch event.
*
*
* @return The request ID of an EBS CloudWatch event.
*/
public final String ebsRequestId() {
return ebsRequestId;
}
/**
*
* The X-Ray request fault percentage for this node.
*
*
* @return The X-Ray request fault percentage for this node.
*/
public final Integer xRayFaultPercent() {
return xRayFaultPercent;
}
/**
*
* The X-Ray request throttle percentage for this node.
*
*
* @return The X-Ray request throttle percentage for this node.
*/
public final Integer xRayThrottlePercent() {
return xRayThrottlePercent;
}
/**
*
* The X-Ray request error percentage for this node.
*
*
* @return The X-Ray request error percentage for this node.
*/
public final Integer xRayErrorPercent() {
return xRayErrorPercent;
}
/**
*
* The X-Ray request count for this node.
*
*
* @return The X-Ray request count for this node.
*/
public final Integer xRayRequestCount() {
return xRayRequestCount;
}
/**
*
* The X-Ray node request average latency for this node.
*
*
* @return The X-Ray node request average latency for this node.
*/
public final Long xRayRequestAverageLatency() {
return xRayRequestAverageLatency;
}
/**
*
* The name of the X-Ray node.
*
*
* @return The name of the X-Ray node.
*/
public final String xRayNodeName() {
return xRayNodeName;
}
/**
*
* The type of the X-Ray node.
*
*
* @return The type of the X-Ray node.
*/
public final String xRayNodeType() {
return xRayNodeType;
}
@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(id());
hashCode = 31 * hashCode + Objects.hashCode(startTime());
hashCode = 31 * hashCode + Objects.hashCode(endTime());
hashCode = 31 * hashCode + Objects.hashCode(sourceType());
hashCode = 31 * hashCode + Objects.hashCode(sourceARN());
hashCode = 31 * hashCode + Objects.hashCode(logGroup());
hashCode = 31 * hashCode + Objects.hashCode(lineTime());
hashCode = 31 * hashCode + Objects.hashCode(logText());
hashCode = 31 * hashCode + Objects.hashCode(logFilterAsString());
hashCode = 31 * hashCode + Objects.hashCode(metricNamespace());
hashCode = 31 * hashCode + Objects.hashCode(metricName());
hashCode = 31 * hashCode + Objects.hashCode(unit());
hashCode = 31 * hashCode + Objects.hashCode(value());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchEventId());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchEventSourceAsString());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchEventDetailType());
hashCode = 31 * hashCode + Objects.hashCode(healthEventArn());
hashCode = 31 * hashCode + Objects.hashCode(healthService());
hashCode = 31 * hashCode + Objects.hashCode(healthEventTypeCode());
hashCode = 31 * hashCode + Objects.hashCode(healthEventTypeCategory());
hashCode = 31 * hashCode + Objects.hashCode(healthEventDescription());
hashCode = 31 * hashCode + Objects.hashCode(codeDeployDeploymentId());
hashCode = 31 * hashCode + Objects.hashCode(codeDeployDeploymentGroup());
hashCode = 31 * hashCode + Objects.hashCode(codeDeployState());
hashCode = 31 * hashCode + Objects.hashCode(codeDeployApplication());
hashCode = 31 * hashCode + Objects.hashCode(codeDeployInstanceGroupId());
hashCode = 31 * hashCode + Objects.hashCode(ec2State());
hashCode = 31 * hashCode + Objects.hashCode(rdsEventCategories());
hashCode = 31 * hashCode + Objects.hashCode(rdsEventMessage());
hashCode = 31 * hashCode + Objects.hashCode(s3EventName());
hashCode = 31 * hashCode + Objects.hashCode(statesExecutionArn());
hashCode = 31 * hashCode + Objects.hashCode(statesArn());
hashCode = 31 * hashCode + Objects.hashCode(statesStatus());
hashCode = 31 * hashCode + Objects.hashCode(statesInput());
hashCode = 31 * hashCode + Objects.hashCode(ebsEvent());
hashCode = 31 * hashCode + Objects.hashCode(ebsResult());
hashCode = 31 * hashCode + Objects.hashCode(ebsCause());
hashCode = 31 * hashCode + Objects.hashCode(ebsRequestId());
hashCode = 31 * hashCode + Objects.hashCode(xRayFaultPercent());
hashCode = 31 * hashCode + Objects.hashCode(xRayThrottlePercent());
hashCode = 31 * hashCode + Objects.hashCode(xRayErrorPercent());
hashCode = 31 * hashCode + Objects.hashCode(xRayRequestCount());
hashCode = 31 * hashCode + Objects.hashCode(xRayRequestAverageLatency());
hashCode = 31 * hashCode + Objects.hashCode(xRayNodeName());
hashCode = 31 * hashCode + Objects.hashCode(xRayNodeType());
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 Observation)) {
return false;
}
Observation other = (Observation) obj;
return Objects.equals(id(), other.id()) && Objects.equals(startTime(), other.startTime())
&& Objects.equals(endTime(), other.endTime()) && Objects.equals(sourceType(), other.sourceType())
&& Objects.equals(sourceARN(), other.sourceARN()) && Objects.equals(logGroup(), other.logGroup())
&& Objects.equals(lineTime(), other.lineTime()) && Objects.equals(logText(), other.logText())
&& Objects.equals(logFilterAsString(), other.logFilterAsString())
&& Objects.equals(metricNamespace(), other.metricNamespace()) && Objects.equals(metricName(), other.metricName())
&& Objects.equals(unit(), other.unit()) && Objects.equals(value(), other.value())
&& Objects.equals(cloudWatchEventId(), other.cloudWatchEventId())
&& Objects.equals(cloudWatchEventSourceAsString(), other.cloudWatchEventSourceAsString())
&& Objects.equals(cloudWatchEventDetailType(), other.cloudWatchEventDetailType())
&& Objects.equals(healthEventArn(), other.healthEventArn())
&& Objects.equals(healthService(), other.healthService())
&& Objects.equals(healthEventTypeCode(), other.healthEventTypeCode())
&& Objects.equals(healthEventTypeCategory(), other.healthEventTypeCategory())
&& Objects.equals(healthEventDescription(), other.healthEventDescription())
&& Objects.equals(codeDeployDeploymentId(), other.codeDeployDeploymentId())
&& Objects.equals(codeDeployDeploymentGroup(), other.codeDeployDeploymentGroup())
&& Objects.equals(codeDeployState(), other.codeDeployState())
&& Objects.equals(codeDeployApplication(), other.codeDeployApplication())
&& Objects.equals(codeDeployInstanceGroupId(), other.codeDeployInstanceGroupId())
&& Objects.equals(ec2State(), other.ec2State())
&& Objects.equals(rdsEventCategories(), other.rdsEventCategories())
&& Objects.equals(rdsEventMessage(), other.rdsEventMessage())
&& Objects.equals(s3EventName(), other.s3EventName())
&& Objects.equals(statesExecutionArn(), other.statesExecutionArn())
&& Objects.equals(statesArn(), other.statesArn()) && Objects.equals(statesStatus(), other.statesStatus())
&& Objects.equals(statesInput(), other.statesInput()) && Objects.equals(ebsEvent(), other.ebsEvent())
&& Objects.equals(ebsResult(), other.ebsResult()) && Objects.equals(ebsCause(), other.ebsCause())
&& Objects.equals(ebsRequestId(), other.ebsRequestId())
&& Objects.equals(xRayFaultPercent(), other.xRayFaultPercent())
&& Objects.equals(xRayThrottlePercent(), other.xRayThrottlePercent())
&& Objects.equals(xRayErrorPercent(), other.xRayErrorPercent())
&& Objects.equals(xRayRequestCount(), other.xRayRequestCount())
&& Objects.equals(xRayRequestAverageLatency(), other.xRayRequestAverageLatency())
&& Objects.equals(xRayNodeName(), other.xRayNodeName()) && Objects.equals(xRayNodeType(), other.xRayNodeType());
}
/**
* 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("Observation").add("Id", id()).add("StartTime", startTime()).add("EndTime", endTime())
.add("SourceType", sourceType()).add("SourceARN", sourceARN()).add("LogGroup", logGroup())
.add("LineTime", lineTime()).add("LogText", logText()).add("LogFilter", logFilterAsString())
.add("MetricNamespace", metricNamespace()).add("MetricName", metricName()).add("Unit", unit())
.add("Value", value()).add("CloudWatchEventId", cloudWatchEventId())
.add("CloudWatchEventSource", cloudWatchEventSourceAsString())
.add("CloudWatchEventDetailType", cloudWatchEventDetailType()).add("HealthEventArn", healthEventArn())
.add("HealthService", healthService()).add("HealthEventTypeCode", healthEventTypeCode())
.add("HealthEventTypeCategory", healthEventTypeCategory())
.add("HealthEventDescription", healthEventDescription()).add("CodeDeployDeploymentId", codeDeployDeploymentId())
.add("CodeDeployDeploymentGroup", codeDeployDeploymentGroup()).add("CodeDeployState", codeDeployState())
.add("CodeDeployApplication", codeDeployApplication())
.add("CodeDeployInstanceGroupId", codeDeployInstanceGroupId()).add("Ec2State", ec2State())
.add("RdsEventCategories", rdsEventCategories()).add("RdsEventMessage", rdsEventMessage())
.add("S3EventName", s3EventName()).add("StatesExecutionArn", statesExecutionArn()).add("StatesArn", statesArn())
.add("StatesStatus", statesStatus()).add("StatesInput", statesInput()).add("EbsEvent", ebsEvent())
.add("EbsResult", ebsResult()).add("EbsCause", ebsCause()).add("EbsRequestId", ebsRequestId())
.add("XRayFaultPercent", xRayFaultPercent()).add("XRayThrottlePercent", xRayThrottlePercent())
.add("XRayErrorPercent", xRayErrorPercent()).add("XRayRequestCount", xRayRequestCount())
.add("XRayRequestAverageLatency", xRayRequestAverageLatency()).add("XRayNodeName", xRayNodeName())
.add("XRayNodeType", xRayNodeType()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "StartTime":
return Optional.ofNullable(clazz.cast(startTime()));
case "EndTime":
return Optional.ofNullable(clazz.cast(endTime()));
case "SourceType":
return Optional.ofNullable(clazz.cast(sourceType()));
case "SourceARN":
return Optional.ofNullable(clazz.cast(sourceARN()));
case "LogGroup":
return Optional.ofNullable(clazz.cast(logGroup()));
case "LineTime":
return Optional.ofNullable(clazz.cast(lineTime()));
case "LogText":
return Optional.ofNullable(clazz.cast(logText()));
case "LogFilter":
return Optional.ofNullable(clazz.cast(logFilterAsString()));
case "MetricNamespace":
return Optional.ofNullable(clazz.cast(metricNamespace()));
case "MetricName":
return Optional.ofNullable(clazz.cast(metricName()));
case "Unit":
return Optional.ofNullable(clazz.cast(unit()));
case "Value":
return Optional.ofNullable(clazz.cast(value()));
case "CloudWatchEventId":
return Optional.ofNullable(clazz.cast(cloudWatchEventId()));
case "CloudWatchEventSource":
return Optional.ofNullable(clazz.cast(cloudWatchEventSourceAsString()));
case "CloudWatchEventDetailType":
return Optional.ofNullable(clazz.cast(cloudWatchEventDetailType()));
case "HealthEventArn":
return Optional.ofNullable(clazz.cast(healthEventArn()));
case "HealthService":
return Optional.ofNullable(clazz.cast(healthService()));
case "HealthEventTypeCode":
return Optional.ofNullable(clazz.cast(healthEventTypeCode()));
case "HealthEventTypeCategory":
return Optional.ofNullable(clazz.cast(healthEventTypeCategory()));
case "HealthEventDescription":
return Optional.ofNullable(clazz.cast(healthEventDescription()));
case "CodeDeployDeploymentId":
return Optional.ofNullable(clazz.cast(codeDeployDeploymentId()));
case "CodeDeployDeploymentGroup":
return Optional.ofNullable(clazz.cast(codeDeployDeploymentGroup()));
case "CodeDeployState":
return Optional.ofNullable(clazz.cast(codeDeployState()));
case "CodeDeployApplication":
return Optional.ofNullable(clazz.cast(codeDeployApplication()));
case "CodeDeployInstanceGroupId":
return Optional.ofNullable(clazz.cast(codeDeployInstanceGroupId()));
case "Ec2State":
return Optional.ofNullable(clazz.cast(ec2State()));
case "RdsEventCategories":
return Optional.ofNullable(clazz.cast(rdsEventCategories()));
case "RdsEventMessage":
return Optional.ofNullable(clazz.cast(rdsEventMessage()));
case "S3EventName":
return Optional.ofNullable(clazz.cast(s3EventName()));
case "StatesExecutionArn":
return Optional.ofNullable(clazz.cast(statesExecutionArn()));
case "StatesArn":
return Optional.ofNullable(clazz.cast(statesArn()));
case "StatesStatus":
return Optional.ofNullable(clazz.cast(statesStatus()));
case "StatesInput":
return Optional.ofNullable(clazz.cast(statesInput()));
case "EbsEvent":
return Optional.ofNullable(clazz.cast(ebsEvent()));
case "EbsResult":
return Optional.ofNullable(clazz.cast(ebsResult()));
case "EbsCause":
return Optional.ofNullable(clazz.cast(ebsCause()));
case "EbsRequestId":
return Optional.ofNullable(clazz.cast(ebsRequestId()));
case "XRayFaultPercent":
return Optional.ofNullable(clazz.cast(xRayFaultPercent()));
case "XRayThrottlePercent":
return Optional.ofNullable(clazz.cast(xRayThrottlePercent()));
case "XRayErrorPercent":
return Optional.ofNullable(clazz.cast(xRayErrorPercent()));
case "XRayRequestCount":
return Optional.ofNullable(clazz.cast(xRayRequestCount()));
case "XRayRequestAverageLatency":
return Optional.ofNullable(clazz.cast(xRayRequestAverageLatency()));
case "XRayNodeName":
return Optional.ofNullable(clazz.cast(xRayNodeName()));
case "XRayNodeType":
return Optional.ofNullable(clazz.cast(xRayNodeType()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function