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

software.amazon.awssdk.services.sagemakergeospatial.model.GetRasterDataCollectionResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Sage Maker Geospatial module holds the client classes that are used for communicating with Sage Maker Geospatial.

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.sagemakergeospatial.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 GetRasterDataCollectionResponse extends SageMakerGeospatialResponse implements
        ToCopyableBuilder {
    private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
            .getter(getter(GetRasterDataCollectionResponse::arn)).setter(setter(Builder::arn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(GetRasterDataCollectionResponse::description))
            .setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField DESCRIPTION_PAGE_URL_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DescriptionPageUrl").getter(getter(GetRasterDataCollectionResponse::descriptionPageUrl))
            .setter(setter(Builder::descriptionPageUrl))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DescriptionPageUrl").build())
            .build();

    private static final SdkField> IMAGE_SOURCE_BANDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ImageSourceBands")
            .getter(getter(GetRasterDataCollectionResponse::imageSourceBands))
            .setter(setter(Builder::imageSourceBands))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageSourceBands").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 NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
            .getter(getter(GetRasterDataCollectionResponse::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();

    private static final SdkField> SUPPORTED_FILTERS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("SupportedFilters")
            .getter(getter(GetRasterDataCollectionResponse::supportedFilters))
            .setter(setter(Builder::supportedFilters))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedFilters").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Filter::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("Tags")
            .getter(getter(GetRasterDataCollectionResponse::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
            .getter(getter(GetRasterDataCollectionResponse::typeAsString)).setter(setter(Builder::type))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, DESCRIPTION_FIELD,
            DESCRIPTION_PAGE_URL_FIELD, IMAGE_SOURCE_BANDS_FIELD, NAME_FIELD, SUPPORTED_FILTERS_FIELD, TAGS_FIELD, TYPE_FIELD));

    private final String arn;

    private final String description;

    private final String descriptionPageUrl;

    private final List imageSourceBands;

    private final String name;

    private final List supportedFilters;

    private final Map tags;

    private final String type;

    private GetRasterDataCollectionResponse(BuilderImpl builder) {
        super(builder);
        this.arn = builder.arn;
        this.description = builder.description;
        this.descriptionPageUrl = builder.descriptionPageUrl;
        this.imageSourceBands = builder.imageSourceBands;
        this.name = builder.name;
        this.supportedFilters = builder.supportedFilters;
        this.tags = builder.tags;
        this.type = builder.type;
    }

    /**
     * 

* The Amazon Resource Name (ARN) of the raster data collection. *

* * @return The Amazon Resource Name (ARN) of the raster data collection. */ public final String arn() { return arn; } /** *

* A description of the raster data collection. *

* * @return A description of the raster data collection. */ public final String description() { return description; } /** *

* The URL of the description page. *

* * @return The URL of the description page. */ public final String descriptionPageUrl() { return descriptionPageUrl; } /** * For responses, this returns true if the service returned a value for the ImageSourceBands 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 hasImageSourceBands() { return imageSourceBands != null && !(imageSourceBands instanceof SdkAutoConstructList); } /** *

* The list of image source bands in the raster data collection. *

*

* 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 #hasImageSourceBands} method. *

* * @return The list of image source bands in the raster data collection. */ public final List imageSourceBands() { return imageSourceBands; } /** *

* The name of the raster data collection. *

* * @return The name of the raster data collection. */ public final String name() { return name; } /** * For responses, this returns true if the service returned a value for the SupportedFilters 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 hasSupportedFilters() { return supportedFilters != null && !(supportedFilters instanceof SdkAutoConstructList); } /** *

* The filters supported by the raster data collection. *

*

* 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 #hasSupportedFilters} method. *

* * @return The filters supported by the raster data collection. */ public final List supportedFilters() { return supportedFilters; } /** * For responses, this returns true if the service returned a value for the Tags 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* Each tag consists of a key and a value. *

*

* 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 #hasTags} method. *

* * @return Each tag consists of a key and a value. */ public final Map tags() { return tags; } /** *

* The raster data collection type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link DataCollectionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

* * @return The raster data collection type. * @see DataCollectionType */ public final DataCollectionType type() { return DataCollectionType.fromValue(type); } /** *

* The raster data collection type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link DataCollectionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

* * @return The raster data collection type. * @see DataCollectionType */ public final String typeAsString() { return type; } @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(arn()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(descriptionPageUrl()); hashCode = 31 * hashCode + Objects.hashCode(hasImageSourceBands() ? imageSourceBands() : null); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(hasSupportedFilters() ? supportedFilters() : null); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); 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 GetRasterDataCollectionResponse)) { return false; } GetRasterDataCollectionResponse other = (GetRasterDataCollectionResponse) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(description(), other.description()) && Objects.equals(descriptionPageUrl(), other.descriptionPageUrl()) && hasImageSourceBands() == other.hasImageSourceBands() && Objects.equals(imageSourceBands(), other.imageSourceBands()) && Objects.equals(name(), other.name()) && hasSupportedFilters() == other.hasSupportedFilters() && Objects.equals(supportedFilters(), other.supportedFilters()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(typeAsString(), other.typeAsString()); } /** * 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("GetRasterDataCollectionResponse").add("Arn", arn()).add("Description", description()) .add("DescriptionPageUrl", descriptionPageUrl()) .add("ImageSourceBands", hasImageSourceBands() ? imageSourceBands() : null).add("Name", name()) .add("SupportedFilters", hasSupportedFilters() ? supportedFilters() : null) .add("Tags", hasTags() ? tags() : null).add("Type", typeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "DescriptionPageUrl": return Optional.ofNullable(clazz.cast(descriptionPageUrl())); case "ImageSourceBands": return Optional.ofNullable(clazz.cast(imageSourceBands())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "SupportedFilters": return Optional.ofNullable(clazz.cast(supportedFilters())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "Type": return Optional.ofNullable(clazz.cast(typeAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetRasterDataCollectionResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerGeospatialResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the raster data collection. *

* * @param arn * The Amazon Resource Name (ARN) of the raster data collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* A description of the raster data collection. *

* * @param description * A description of the raster data collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The URL of the description page. *

* * @param descriptionPageUrl * The URL of the description page. * @return Returns a reference to this object so that method calls can be chained together. */ Builder descriptionPageUrl(String descriptionPageUrl); /** *

* The list of image source bands in the raster data collection. *

* * @param imageSourceBands * The list of image source bands in the raster data collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder imageSourceBands(Collection imageSourceBands); /** *

* The list of image source bands in the raster data collection. *

* * @param imageSourceBands * The list of image source bands in the raster data collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder imageSourceBands(String... imageSourceBands); /** *

* The name of the raster data collection. *

* * @param name * The name of the raster data collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The filters supported by the raster data collection. *

* * @param supportedFilters * The filters supported by the raster data collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder supportedFilters(Collection supportedFilters); /** *

* The filters supported by the raster data collection. *

* * @param supportedFilters * The filters supported by the raster data collection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder supportedFilters(Filter... supportedFilters); /** *

* The filters supported by the raster data collection. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemakergeospatial.model.Filter.Builder} avoiding the need to create * one manually via {@link software.amazon.awssdk.services.sagemakergeospatial.model.Filter#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemakergeospatial.model.Filter.Builder#build()} is called * immediately and its result is passed to {@link #supportedFilters(List)}. * * @param supportedFilters * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemakergeospatial.model.Filter.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #supportedFilters(java.util.Collection) */ Builder supportedFilters(Consumer... supportedFilters); /** *

* Each tag consists of a key and a value. *

* * @param tags * Each tag consists of a key and a value. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

* The raster data collection type. *

* * @param type * The raster data collection type. * @see DataCollectionType * @return Returns a reference to this object so that method calls can be chained together. * @see DataCollectionType */ Builder type(String type); /** *

* The raster data collection type. *

* * @param type * The raster data collection type. * @see DataCollectionType * @return Returns a reference to this object so that method calls can be chained together. * @see DataCollectionType */ Builder type(DataCollectionType type); } static final class BuilderImpl extends SageMakerGeospatialResponse.BuilderImpl implements Builder { private String arn; private String description; private String descriptionPageUrl; private List imageSourceBands = DefaultSdkAutoConstructList.getInstance(); private String name; private List supportedFilters = DefaultSdkAutoConstructList.getInstance(); private Map tags = DefaultSdkAutoConstructMap.getInstance(); private String type; private BuilderImpl() { } private BuilderImpl(GetRasterDataCollectionResponse model) { super(model); arn(model.arn); description(model.description); descriptionPageUrl(model.descriptionPageUrl); imageSourceBands(model.imageSourceBands); name(model.name); supportedFilters(model.supportedFilters); tags(model.tags); type(model.type); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getDescriptionPageUrl() { return descriptionPageUrl; } public final void setDescriptionPageUrl(String descriptionPageUrl) { this.descriptionPageUrl = descriptionPageUrl; } @Override public final Builder descriptionPageUrl(String descriptionPageUrl) { this.descriptionPageUrl = descriptionPageUrl; return this; } public final Collection getImageSourceBands() { if (imageSourceBands instanceof SdkAutoConstructList) { return null; } return imageSourceBands; } public final void setImageSourceBands(Collection imageSourceBands) { this.imageSourceBands = ImageSourceBandListCopier.copy(imageSourceBands); } @Override public final Builder imageSourceBands(Collection imageSourceBands) { this.imageSourceBands = ImageSourceBandListCopier.copy(imageSourceBands); return this; } @Override @SafeVarargs public final Builder imageSourceBands(String... imageSourceBands) { imageSourceBands(Arrays.asList(imageSourceBands)); return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final List getSupportedFilters() { List result = FilterListCopier.copyToBuilder(this.supportedFilters); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSupportedFilters(Collection supportedFilters) { this.supportedFilters = FilterListCopier.copyFromBuilder(supportedFilters); } @Override public final Builder supportedFilters(Collection supportedFilters) { this.supportedFilters = FilterListCopier.copy(supportedFilters); return this; } @Override @SafeVarargs public final Builder supportedFilters(Filter... supportedFilters) { supportedFilters(Arrays.asList(supportedFilters)); return this; } @Override @SafeVarargs public final Builder supportedFilters(Consumer... supportedFilters) { supportedFilters(Stream.of(supportedFilters).map(c -> Filter.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagsCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagsCopier.copy(tags); return this; } public final String getType() { return type; } public final void setType(String type) { this.type = type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(DataCollectionType type) { this.type(type == null ? null : type.toString()); return this; } @Override public GetRasterDataCollectionResponse build() { return new GetRasterDataCollectionResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy