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

software.amazon.awssdk.services.xray.model.GetTimeSeriesServiceStatisticsRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS X-Ray module holds the client classes that are used for communicating with AWS X-Ray Service

There is a newer version: 2.29.39
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.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 getter(Function g) { return obj -> g.apply((GetTimeSeriesServiceStatisticsRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends XRayRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The start of the time frame for which to aggregate statistics. *

* * @param startTime * The start of the time frame for which to aggregate statistics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The end of the time frame for which to aggregate statistics. *

* * @param endTime * The end of the time frame for which to aggregate statistics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

* The case-sensitive name of the group for which to pull statistics from. *

* * @param groupName * The case-sensitive name of the group for which to pull statistics from. * @return Returns a reference to this object so that method calls can be chained together. */ Builder groupName(String groupName); /** *

* The Amazon Resource Name (ARN) of the group for which to pull statistics from. *

* * @param groupARN * The Amazon Resource Name (ARN) of the group for which to pull statistics from. * @return Returns a reference to this object so that method calls can be chained together. */ Builder groupARN(String 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. *

* * @param entitySelectorExpression * 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 Returns a reference to this object so that method calls can be chained together. */ Builder entitySelectorExpression(String entitySelectorExpression); /** *

* Aggregation period in seconds. *

* * @param period * Aggregation period in seconds. * @return Returns a reference to this object so that method calls can be chained together. */ Builder period(Integer period); /** *

* The forecasted high and low fault count values. Forecast enabled requests require the * EntitySelectorExpression ID be provided. *

* * @param forecastStatistics * The forecasted high and low fault count values. Forecast enabled requests require the * EntitySelectorExpression ID be provided. * @return Returns a reference to this object so that method calls can be chained together. */ Builder forecastStatistics(Boolean forecastStatistics); /** *

* Pagination token. *

* * @param nextToken * Pagination token. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextToken(String nextToken); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends XRayRequest.BuilderImpl implements Builder { private Instant startTime; private Instant endTime; private String groupName; private String groupARN; private String entitySelectorExpression; private Integer period; private Boolean forecastStatistics; private String nextToken; private BuilderImpl() { } private BuilderImpl(GetTimeSeriesServiceStatisticsRequest model) { super(model); startTime(model.startTime); endTime(model.endTime); groupName(model.groupName); groupARN(model.groupARN); entitySelectorExpression(model.entitySelectorExpression); period(model.period); forecastStatistics(model.forecastStatistics); nextToken(model.nextToken); } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final String getGroupName() { return groupName; } public final void setGroupName(String groupName) { this.groupName = groupName; } @Override public final Builder groupName(String groupName) { this.groupName = groupName; return this; } public final String getGroupARN() { return groupARN; } public final void setGroupARN(String groupARN) { this.groupARN = groupARN; } @Override public final Builder groupARN(String groupARN) { this.groupARN = groupARN; return this; } public final String getEntitySelectorExpression() { return entitySelectorExpression; } public final void setEntitySelectorExpression(String entitySelectorExpression) { this.entitySelectorExpression = entitySelectorExpression; } @Override public final Builder entitySelectorExpression(String entitySelectorExpression) { this.entitySelectorExpression = entitySelectorExpression; return this; } public final Integer getPeriod() { return period; } public final void setPeriod(Integer period) { this.period = period; } @Override public final Builder period(Integer period) { this.period = period; return this; } public final Boolean getForecastStatistics() { return forecastStatistics; } public final void setForecastStatistics(Boolean forecastStatistics) { this.forecastStatistics = forecastStatistics; } @Override public final Builder forecastStatistics(Boolean forecastStatistics) { this.forecastStatistics = forecastStatistics; return this; } public final String getNextToken() { return nextToken; } public final void setNextToken(String nextToken) { this.nextToken = nextToken; } @Override public final Builder nextToken(String nextToken) { this.nextToken = nextToken; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public GetTimeSeriesServiceStatisticsRequest build() { return new GetTimeSeriesServiceStatisticsRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy