software.amazon.awssdk.services.sagemakergeospatial.model.GetTileRequest Maven / Gradle / Ivy
Show all versions of sagemakergeospatial 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.sagemakergeospatial.model;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 GetTileRequest extends SageMakerGeospatialRequest implements
ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
.getter(getter(GetTileRequest::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("Arn").build()).build();
private static final SdkField> IMAGE_ASSETS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ImageAssets")
.getter(getter(GetTileRequest::imageAssets))
.setter(setter(Builder::imageAssets))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("ImageAssets").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField IMAGE_MASK_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ImageMask").getter(getter(GetTileRequest::imageMask)).setter(setter(Builder::imageMask))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("ImageMask").build()).build();
private static final SdkField OUTPUT_DATA_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OutputDataType").getter(getter(GetTileRequest::outputDataTypeAsString))
.setter(setter(Builder::outputDataType))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("OutputDataType").build())
.build();
private static final SdkField OUTPUT_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OutputFormat").getter(getter(GetTileRequest::outputFormat)).setter(setter(Builder::outputFormat))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("OutputFormat").build()).build();
private static final SdkField PROPERTY_FILTERS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PropertyFilters").getter(getter(GetTileRequest::propertyFilters))
.setter(setter(Builder::propertyFilters))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("PropertyFilters").build())
.build();
private static final SdkField TARGET_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Target")
.getter(getter(GetTileRequest::targetAsString)).setter(setter(Builder::target))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("Target").build()).build();
private static final SdkField TIME_RANGE_FILTER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TimeRangeFilter").getter(getter(GetTileRequest::timeRangeFilter))
.setter(setter(Builder::timeRangeFilter))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("TimeRangeFilter").build())
.build();
private static final SdkField X_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("x")
.getter(getter(GetTileRequest::x)).setter(setter(Builder::x))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("x").build()).build();
private static final SdkField Y_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("y")
.getter(getter(GetTileRequest::y)).setter(setter(Builder::y))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("y").build()).build();
private static final SdkField Z_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("z")
.getter(getter(GetTileRequest::z)).setter(setter(Builder::z))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("z").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, IMAGE_ASSETS_FIELD,
IMAGE_MASK_FIELD, OUTPUT_DATA_TYPE_FIELD, OUTPUT_FORMAT_FIELD, PROPERTY_FILTERS_FIELD, TARGET_FIELD,
TIME_RANGE_FILTER_FIELD, X_FIELD, Y_FIELD, Z_FIELD));
private final String arn;
private final List imageAssets;
private final Boolean imageMask;
private final String outputDataType;
private final String outputFormat;
private final String propertyFilters;
private final String target;
private final String timeRangeFilter;
private final Integer x;
private final Integer y;
private final Integer z;
private GetTileRequest(BuilderImpl builder) {
super(builder);
this.arn = builder.arn;
this.imageAssets = builder.imageAssets;
this.imageMask = builder.imageMask;
this.outputDataType = builder.outputDataType;
this.outputFormat = builder.outputFormat;
this.propertyFilters = builder.propertyFilters;
this.target = builder.target;
this.timeRangeFilter = builder.timeRangeFilter;
this.x = builder.x;
this.y = builder.y;
this.z = builder.z;
}
/**
*
* The Amazon Resource Name (ARN) of the tile operation.
*
*
* @return The Amazon Resource Name (ARN) of the tile operation.
*/
public final String arn() {
return arn;
}
/**
* For responses, this returns true if the service returned a value for the ImageAssets property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasImageAssets() {
return imageAssets != null && !(imageAssets instanceof SdkAutoConstructList);
}
/**
*
* The particular assets or bands to tile.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasImageAssets} method.
*
*
* @return The particular assets or bands to tile.
*/
public final List imageAssets() {
return imageAssets;
}
/**
*
* Determines whether or not to return a valid data mask.
*
*
* @return Determines whether or not to return a valid data mask.
*/
public final Boolean imageMask() {
return imageMask;
}
/**
*
* The output data type of the tile operation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #outputDataType}
* will return {@link OutputType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #outputDataTypeAsString}.
*
*
* @return The output data type of the tile operation.
* @see OutputType
*/
public final OutputType outputDataType() {
return OutputType.fromValue(outputDataType);
}
/**
*
* The output data type of the tile operation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #outputDataType}
* will return {@link OutputType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #outputDataTypeAsString}.
*
*
* @return The output data type of the tile operation.
* @see OutputType
*/
public final String outputDataTypeAsString() {
return outputDataType;
}
/**
*
* The data format of the output tile. The formats include .npy, .png and .jpg.
*
*
* @return The data format of the output tile. The formats include .npy, .png and .jpg.
*/
public final String outputFormat() {
return outputFormat;
}
/**
*
* Property filters for the imagery to tile.
*
*
* @return Property filters for the imagery to tile.
*/
public final String propertyFilters() {
return propertyFilters;
}
/**
*
* Determines what part of the Earth Observation job to tile. 'INPUT' or 'OUTPUT' are the valid options.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #target} will
* return {@link TargetOptions#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #targetAsString}.
*
*
* @return Determines what part of the Earth Observation job to tile. 'INPUT' or 'OUTPUT' are the valid options.
* @see TargetOptions
*/
public final TargetOptions target() {
return TargetOptions.fromValue(target);
}
/**
*
* Determines what part of the Earth Observation job to tile. 'INPUT' or 'OUTPUT' are the valid options.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #target} will
* return {@link TargetOptions#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #targetAsString}.
*
*
* @return Determines what part of the Earth Observation job to tile. 'INPUT' or 'OUTPUT' are the valid options.
* @see TargetOptions
*/
public final String targetAsString() {
return target;
}
/**
*
* Time range filter applied to imagery to find the images to tile.
*
*
* @return Time range filter applied to imagery to find the images to tile.
*/
public final String timeRangeFilter() {
return timeRangeFilter;
}
/**
*
* The x coordinate of the tile input.
*
*
* @return The x coordinate of the tile input.
*/
public final Integer x() {
return x;
}
/**
*
* The y coordinate of the tile input.
*
*
* @return The y coordinate of the tile input.
*/
public final Integer y() {
return y;
}
/**
*
* The z coordinate of the tile input.
*
*
* @return The z coordinate of the tile input.
*/
public final Integer z() {
return z;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(hasImageAssets() ? imageAssets() : null);
hashCode = 31 * hashCode + Objects.hashCode(imageMask());
hashCode = 31 * hashCode + Objects.hashCode(outputDataTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(outputFormat());
hashCode = 31 * hashCode + Objects.hashCode(propertyFilters());
hashCode = 31 * hashCode + Objects.hashCode(targetAsString());
hashCode = 31 * hashCode + Objects.hashCode(timeRangeFilter());
hashCode = 31 * hashCode + Objects.hashCode(x());
hashCode = 31 * hashCode + Objects.hashCode(y());
hashCode = 31 * hashCode + Objects.hashCode(z());
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 GetTileRequest)) {
return false;
}
GetTileRequest other = (GetTileRequest) obj;
return Objects.equals(arn(), other.arn()) && hasImageAssets() == other.hasImageAssets()
&& Objects.equals(imageAssets(), other.imageAssets()) && Objects.equals(imageMask(), other.imageMask())
&& Objects.equals(outputDataTypeAsString(), other.outputDataTypeAsString())
&& Objects.equals(outputFormat(), other.outputFormat())
&& Objects.equals(propertyFilters(), other.propertyFilters())
&& Objects.equals(targetAsString(), other.targetAsString())
&& Objects.equals(timeRangeFilter(), other.timeRangeFilter()) && Objects.equals(x(), other.x())
&& Objects.equals(y(), other.y()) && Objects.equals(z(), other.z());
}
/**
* 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("GetTileRequest").add("Arn", arn()).add("ImageAssets", hasImageAssets() ? imageAssets() : null)
.add("ImageMask", imageMask()).add("OutputDataType", outputDataTypeAsString())
.add("OutputFormat", outputFormat()).add("PropertyFilters", propertyFilters()).add("Target", targetAsString())
.add("TimeRangeFilter", timeRangeFilter()).add("X", x()).add("Y", y()).add("Z", z()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "ImageAssets":
return Optional.ofNullable(clazz.cast(imageAssets()));
case "ImageMask":
return Optional.ofNullable(clazz.cast(imageMask()));
case "OutputDataType":
return Optional.ofNullable(clazz.cast(outputDataTypeAsString()));
case "OutputFormat":
return Optional.ofNullable(clazz.cast(outputFormat()));
case "PropertyFilters":
return Optional.ofNullable(clazz.cast(propertyFilters()));
case "Target":
return Optional.ofNullable(clazz.cast(targetAsString()));
case "TimeRangeFilter":
return Optional.ofNullable(clazz.cast(timeRangeFilter()));
case "x":
return Optional.ofNullable(clazz.cast(x()));
case "y":
return Optional.ofNullable(clazz.cast(y()));
case "z":
return Optional.ofNullable(clazz.cast(z()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function