software.amazon.awssdk.services.xray.model.GetTimeSeriesServiceStatisticsRequest Maven / Gradle / Ivy
Show all versions of xray 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.xray.model;
import java.time.Instant;
import java.util.Arrays;
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 software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetTimeSeriesServiceStatisticsRequest extends XRayRequest implements
ToCopyableBuilder {
private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("StartTime").getter(getter(GetTimeSeriesServiceStatisticsRequest::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(GetTimeSeriesServiceStatisticsRequest::endTime))
.setter(setter(Builder::endTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build();
private static final SdkField GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("GroupName").getter(getter(GetTimeSeriesServiceStatisticsRequest::groupName))
.setter(setter(Builder::groupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GroupName").build()).build();
private static final SdkField GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("GroupARN").getter(getter(GetTimeSeriesServiceStatisticsRequest::groupARN))
.setter(setter(Builder::groupARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GroupARN").build()).build();
private static final SdkField ENTITY_SELECTOR_EXPRESSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EntitySelectorExpression")
.getter(getter(GetTimeSeriesServiceStatisticsRequest::entitySelectorExpression))
.setter(setter(Builder::entitySelectorExpression))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EntitySelectorExpression").build())
.build();
private static final SdkField PERIOD_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Period").getter(getter(GetTimeSeriesServiceStatisticsRequest::period)).setter(setter(Builder::period))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Period").build()).build();
private static final SdkField FORECAST_STATISTICS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ForecastStatistics").getter(getter(GetTimeSeriesServiceStatisticsRequest::forecastStatistics))
.setter(setter(Builder::forecastStatistics))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ForecastStatistics").build())
.build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextToken").getter(getter(GetTimeSeriesServiceStatisticsRequest::nextToken))
.setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(START_TIME_FIELD,
END_TIME_FIELD, GROUP_NAME_FIELD, GROUP_ARN_FIELD, ENTITY_SELECTOR_EXPRESSION_FIELD, PERIOD_FIELD,
FORECAST_STATISTICS_FIELD, NEXT_TOKEN_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("StartTime", START_TIME_FIELD);
put("EndTime", END_TIME_FIELD);
put("GroupName", GROUP_NAME_FIELD);
put("GroupARN", GROUP_ARN_FIELD);
put("EntitySelectorExpression", ENTITY_SELECTOR_EXPRESSION_FIELD);
put("Period", PERIOD_FIELD);
put("ForecastStatistics", FORECAST_STATISTICS_FIELD);
put("NextToken", NEXT_TOKEN_FIELD);
}
});
private final Instant startTime;
private final Instant endTime;
private final String groupName;
private final String groupARN;
private final String entitySelectorExpression;
private final Integer period;
private final Boolean forecastStatistics;
private final String nextToken;
private GetTimeSeriesServiceStatisticsRequest(BuilderImpl builder) {
super(builder);
this.startTime = builder.startTime;
this.endTime = builder.endTime;
this.groupName = builder.groupName;
this.groupARN = builder.groupARN;
this.entitySelectorExpression = builder.entitySelectorExpression;
this.period = builder.period;
this.forecastStatistics = builder.forecastStatistics;
this.nextToken = builder.nextToken;
}
/**
*
* The start of the time frame for which to aggregate statistics.
*
*
* @return The start of the time frame for which to aggregate statistics.
*/
public final Instant startTime() {
return startTime;
}
/**
*
* The end of the time frame for which to aggregate statistics.
*
*
* @return The end of the time frame for which to aggregate statistics.
*/
public final Instant endTime() {
return endTime;
}
/**
*
* The case-sensitive name of the group for which to pull statistics from.
*
*
* @return The case-sensitive name of the group for which to pull statistics from.
*/
public final String groupName() {
return groupName;
}
/**
*
* The Amazon Resource Name (ARN) of the group for which to pull statistics from.
*
*
* @return The Amazon Resource Name (ARN) of the group for which to pull statistics from.
*/
public final String groupARN() {
return groupARN;
}
/**
*
* A filter expression defining entities that will be aggregated for statistics. Supports ID, service, and edge
* functions. If no selector expression is specified, edge statistics are returned.
*
*
* @return A filter expression defining entities that will be aggregated for statistics. Supports ID, service, and
* edge functions. If no selector expression is specified, edge statistics are returned.
*/
public final String entitySelectorExpression() {
return entitySelectorExpression;
}
/**
*
* Aggregation period in seconds.
*
*
* @return Aggregation period in seconds.
*/
public final Integer period() {
return period;
}
/**
*
* The forecasted high and low fault count values. Forecast enabled requests require the EntitySelectorExpression ID
* be provided.
*
*
* @return The forecasted high and low fault count values. Forecast enabled requests require the
* EntitySelectorExpression ID be provided.
*/
public final Boolean forecastStatistics() {
return forecastStatistics;
}
/**
*
* Pagination token.
*
*
* @return Pagination token.
*/
public final String nextToken() {
return nextToken;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(startTime());
hashCode = 31 * hashCode + Objects.hashCode(endTime());
hashCode = 31 * hashCode + Objects.hashCode(groupName());
hashCode = 31 * hashCode + Objects.hashCode(groupARN());
hashCode = 31 * hashCode + Objects.hashCode(entitySelectorExpression());
hashCode = 31 * hashCode + Objects.hashCode(period());
hashCode = 31 * hashCode + Objects.hashCode(forecastStatistics());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetTimeSeriesServiceStatisticsRequest)) {
return false;
}
GetTimeSeriesServiceStatisticsRequest other = (GetTimeSeriesServiceStatisticsRequest) obj;
return Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime())
&& Objects.equals(groupName(), other.groupName()) && Objects.equals(groupARN(), other.groupARN())
&& Objects.equals(entitySelectorExpression(), other.entitySelectorExpression())
&& Objects.equals(period(), other.period()) && Objects.equals(forecastStatistics(), other.forecastStatistics())
&& Objects.equals(nextToken(), other.nextToken());
}
/**
* 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("GetTimeSeriesServiceStatisticsRequest").add("StartTime", startTime()).add("EndTime", endTime())
.add("GroupName", groupName()).add("GroupARN", groupARN())
.add("EntitySelectorExpression", entitySelectorExpression()).add("Period", period())
.add("ForecastStatistics", forecastStatistics()).add("NextToken", nextToken()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StartTime":
return Optional.ofNullable(clazz.cast(startTime()));
case "EndTime":
return Optional.ofNullable(clazz.cast(endTime()));
case "GroupName":
return Optional.ofNullable(clazz.cast(groupName()));
case "GroupARN":
return Optional.ofNullable(clazz.cast(groupARN()));
case "EntitySelectorExpression":
return Optional.ofNullable(clazz.cast(entitySelectorExpression()));
case "Period":
return Optional.ofNullable(clazz.cast(period()));
case "ForecastStatistics":
return Optional.ofNullable(clazz.cast(forecastStatistics()));
case "NextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
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