software.amazon.awssdk.services.iotsitewise.model.ListTimeSeriesRequest Maven / Gradle / Ivy
Show all versions of iotsitewise 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.iotsitewise.model;
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.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 ListTimeSeriesRequest extends IoTSiteWiseRequest implements
ToCopyableBuilder {
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("nextToken").getter(getter(ListTimeSeriesRequest::nextToken)).setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("nextToken").build()).build();
private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("maxResults").getter(getter(ListTimeSeriesRequest::maxResults)).setter(setter(Builder::maxResults))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("maxResults").build()).build();
private static final SdkField ASSET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("assetId").getter(getter(ListTimeSeriesRequest::assetId)).setter(setter(Builder::assetId))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("assetId").build()).build();
private static final SdkField ALIAS_PREFIX_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("aliasPrefix").getter(getter(ListTimeSeriesRequest::aliasPrefix)).setter(setter(Builder::aliasPrefix))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("aliasPrefix").build()).build();
private static final SdkField TIME_SERIES_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("timeSeriesType").getter(getter(ListTimeSeriesRequest::timeSeriesTypeAsString))
.setter(setter(Builder::timeSeriesType))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("timeSeriesType").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NEXT_TOKEN_FIELD,
MAX_RESULTS_FIELD, ASSET_ID_FIELD, ALIAS_PREFIX_FIELD, TIME_SERIES_TYPE_FIELD));
private final String nextToken;
private final Integer maxResults;
private final String assetId;
private final String aliasPrefix;
private final String timeSeriesType;
private ListTimeSeriesRequest(BuilderImpl builder) {
super(builder);
this.nextToken = builder.nextToken;
this.maxResults = builder.maxResults;
this.assetId = builder.assetId;
this.aliasPrefix = builder.aliasPrefix;
this.timeSeriesType = builder.timeSeriesType;
}
/**
*
* The token to be used for the next set of paginated results.
*
*
* @return The token to be used for the next set of paginated results.
*/
public final String nextToken() {
return nextToken;
}
/**
*
* The maximum number of results to return for each paginated request.
*
*
* @return The maximum number of results to return for each paginated request.
*/
public final Integer maxResults() {
return maxResults;
}
/**
*
* The ID of the asset in which the asset property was created. This can be either the actual ID in UUID format, or
* else externalId:
followed by the external ID, if it has one. For more information, see Referencing objects with external IDs in the IoT SiteWise User Guide.
*
*
* @return The ID of the asset in which the asset property was created. This can be either the actual ID in UUID
* format, or else externalId:
followed by the external ID, if it has one. For more
* information, see Referencing objects with external IDs in the IoT SiteWise User Guide.
*/
public final String assetId() {
return assetId;
}
/**
*
* The alias prefix of the time series.
*
*
* @return The alias prefix of the time series.
*/
public final String aliasPrefix() {
return aliasPrefix;
}
/**
*
* The type of the time series. The time series type can be one of the following values:
*
*
* -
*
* ASSOCIATED
– The time series is associated with an asset property.
*
*
* -
*
* DISASSOCIATED
– The time series isn't associated with any asset property.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #timeSeriesType}
* will return {@link ListTimeSeriesType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #timeSeriesTypeAsString}.
*
*
* @return The type of the time series. The time series type can be one of the following values:
*
* -
*
* ASSOCIATED
– The time series is associated with an asset property.
*
*
* -
*
* DISASSOCIATED
– The time series isn't associated with any asset property.
*
*
* @see ListTimeSeriesType
*/
public final ListTimeSeriesType timeSeriesType() {
return ListTimeSeriesType.fromValue(timeSeriesType);
}
/**
*
* The type of the time series. The time series type can be one of the following values:
*
*
* -
*
* ASSOCIATED
– The time series is associated with an asset property.
*
*
* -
*
* DISASSOCIATED
– The time series isn't associated with any asset property.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #timeSeriesType}
* will return {@link ListTimeSeriesType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #timeSeriesTypeAsString}.
*
*
* @return The type of the time series. The time series type can be one of the following values:
*
* -
*
* ASSOCIATED
– The time series is associated with an asset property.
*
*
* -
*
* DISASSOCIATED
– The time series isn't associated with any asset property.
*
*
* @see ListTimeSeriesType
*/
public final String timeSeriesTypeAsString() {
return timeSeriesType;
}
@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(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(maxResults());
hashCode = 31 * hashCode + Objects.hashCode(assetId());
hashCode = 31 * hashCode + Objects.hashCode(aliasPrefix());
hashCode = 31 * hashCode + Objects.hashCode(timeSeriesTypeAsString());
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 ListTimeSeriesRequest)) {
return false;
}
ListTimeSeriesRequest other = (ListTimeSeriesRequest) obj;
return Objects.equals(nextToken(), other.nextToken()) && Objects.equals(maxResults(), other.maxResults())
&& Objects.equals(assetId(), other.assetId()) && Objects.equals(aliasPrefix(), other.aliasPrefix())
&& Objects.equals(timeSeriesTypeAsString(), other.timeSeriesTypeAsString());
}
/**
* 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("ListTimeSeriesRequest").add("NextToken", nextToken()).add("MaxResults", maxResults())
.add("AssetId", assetId()).add("AliasPrefix", aliasPrefix()).add("TimeSeriesType", timeSeriesTypeAsString())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "nextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "maxResults":
return Optional.ofNullable(clazz.cast(maxResults()));
case "assetId":
return Optional.ofNullable(clazz.cast(assetId()));
case "aliasPrefix":
return Optional.ofNullable(clazz.cast(aliasPrefix()));
case "timeSeriesType":
return Optional.ofNullable(clazz.cast(timeSeriesTypeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function