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

software.amazon.awssdk.services.sagemakergeospatial.model.RasterDataCollectionMetadata 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.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 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;

/**
 * 

* Response object containing details for a specific RasterDataCollection. *

*/ @Generated("software.amazon.awssdk:codegen") public final class RasterDataCollectionMetadata implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn") .getter(getter(RasterDataCollectionMetadata::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(RasterDataCollectionMetadata::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(RasterDataCollectionMetadata::descriptionPageUrl)) .setter(setter(Builder::descriptionPageUrl)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DescriptionPageUrl").build()) .build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(RasterDataCollectionMetadata::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(RasterDataCollectionMetadata::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(RasterDataCollectionMetadata::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(RasterDataCollectionMetadata::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, NAME_FIELD, SUPPORTED_FILTERS_FIELD, TAGS_FIELD, TYPE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String arn; private final String description; private final String descriptionPageUrl; private final String name; private final List supportedFilters; private final Map tags; private final String type; private RasterDataCollectionMetadata(BuilderImpl builder) { this.arn = builder.arn; this.description = builder.description; this.descriptionPageUrl = builder.descriptionPageUrl; 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 description URL of the raster data collection. *

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

* 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 list of 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 list of 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 type of raster data collection. *

*

* 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 type of raster data collection. * @see DataCollectionType */ public final DataCollectionType type() { return DataCollectionType.fromValue(type); } /** *

* The type of raster data collection. *

*

* 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 type of raster data collection. * @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 + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(descriptionPageUrl()); 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 equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof RasterDataCollectionMetadata)) { return false; } RasterDataCollectionMetadata other = (RasterDataCollectionMetadata) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(description(), other.description()) && Objects.equals(descriptionPageUrl(), other.descriptionPageUrl()) && 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("RasterDataCollectionMetadata").add("Arn", arn()).add("Description", description()) .add("DescriptionPageUrl", descriptionPageUrl()).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 "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; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("Arn", ARN_FIELD); map.put("Description", DESCRIPTION_FIELD); map.put("DescriptionPageUrl", DESCRIPTION_PAGE_URL_FIELD); map.put("Name", NAME_FIELD); map.put("SupportedFilters", SUPPORTED_FILTERS_FIELD); map.put("Tags", TAGS_FIELD); map.put("Type", TYPE_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((RasterDataCollectionMetadata) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends 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 description URL of the raster data collection. *

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

* 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 list of filters supported by the raster data collection. *

* * @param supportedFilters * The list of 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 list of filters supported by the raster data collection. *

* * @param supportedFilters * The list of 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 list of 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 type of raster data collection. *

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

* The type of raster data collection. *

* * @param type * The type of raster data collection. * @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 implements Builder { private String arn; private String description; private String descriptionPageUrl; private String name; private List supportedFilters = DefaultSdkAutoConstructList.getInstance(); private Map tags = DefaultSdkAutoConstructMap.getInstance(); private String type; private BuilderImpl() { } private BuilderImpl(RasterDataCollectionMetadata model) { arn(model.arn); description(model.description); descriptionPageUrl(model.descriptionPageUrl); 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 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 RasterDataCollectionMetadata build() { return new RasterDataCollectionMetadata(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy