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

software.amazon.awssdk.services.iotsitewise.model.DeleteAssetModelCompositeModelRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Io T Site Wise module holds the client classes that are used for communicating with Io T Site Wise.

The 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.iotsitewise.model;

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.DefaultValueTrait;
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 DeleteAssetModelCompositeModelRequest extends IoTSiteWiseRequest implements
        ToCopyableBuilder {
    private static final SdkField ASSET_MODEL_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("assetModelId").getter(getter(DeleteAssetModelCompositeModelRequest::assetModelId))
            .setter(setter(Builder::assetModelId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("assetModelId").build()).build();

    private static final SdkField ASSET_MODEL_COMPOSITE_MODEL_ID_FIELD = SdkField
            . builder(MarshallingType.STRING).memberName("assetModelCompositeModelId")
            .getter(getter(DeleteAssetModelCompositeModelRequest::assetModelCompositeModelId))
            .setter(setter(Builder::assetModelCompositeModelId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("assetModelCompositeModelId").build())
            .build();

    private static final SdkField CLIENT_TOKEN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("clientToken")
            .getter(getter(DeleteAssetModelCompositeModelRequest::clientToken))
            .setter(setter(Builder::clientToken))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("clientToken").build(),
                    DefaultValueTrait.idempotencyToken()).build();

    private static final SdkField IF_MATCH_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ifMatch").getter(getter(DeleteAssetModelCompositeModelRequest::ifMatch))
            .setter(setter(Builder::ifMatch))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("If-Match").build()).build();

    private static final SdkField IF_NONE_MATCH_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ifNoneMatch").getter(getter(DeleteAssetModelCompositeModelRequest::ifNoneMatch))
            .setter(setter(Builder::ifNoneMatch))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("If-None-Match").build()).build();

    private static final SdkField MATCH_FOR_VERSION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("matchForVersionType").getter(getter(DeleteAssetModelCompositeModelRequest::matchForVersionTypeAsString))
            .setter(setter(Builder::matchForVersionType))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Match-For-Version-Type").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ASSET_MODEL_ID_FIELD,
            ASSET_MODEL_COMPOSITE_MODEL_ID_FIELD, CLIENT_TOKEN_FIELD, IF_MATCH_FIELD, IF_NONE_MATCH_FIELD,
            MATCH_FOR_VERSION_TYPE_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("assetModelId", ASSET_MODEL_ID_FIELD);
                    put("assetModelCompositeModelId", ASSET_MODEL_COMPOSITE_MODEL_ID_FIELD);
                    put("clientToken", CLIENT_TOKEN_FIELD);
                    put("If-Match", IF_MATCH_FIELD);
                    put("If-None-Match", IF_NONE_MATCH_FIELD);
                    put("Match-For-Version-Type", MATCH_FOR_VERSION_TYPE_FIELD);
                }
            });

    private final String assetModelId;

    private final String assetModelCompositeModelId;

    private final String clientToken;

    private final String ifMatch;

    private final String ifNoneMatch;

    private final String matchForVersionType;

    private DeleteAssetModelCompositeModelRequest(BuilderImpl builder) {
        super(builder);
        this.assetModelId = builder.assetModelId;
        this.assetModelCompositeModelId = builder.assetModelCompositeModelId;
        this.clientToken = builder.clientToken;
        this.ifMatch = builder.ifMatch;
        this.ifNoneMatch = builder.ifNoneMatch;
        this.matchForVersionType = builder.matchForVersionType;
    }

    /**
     * 

* The ID of the asset model, in UUID format. *

* * @return The ID of the asset model, in UUID format. */ public final String assetModelId() { return assetModelId; } /** *

* The ID of a composite model on this asset model. *

* * @return The ID of a composite model on this asset model. */ public final String assetModelCompositeModelId() { return assetModelCompositeModelId; } /** *

* A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse * this client token if a new idempotent request is required. *

* * @return A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't * reuse this client token if a new idempotent request is required. */ public final String clientToken() { return clientToken; } /** *

* The expected current entity tag (ETag) for the asset model’s latest or active version (specified using * matchForVersionType). The delete request is rejected if the tag does not match the latest or active * version's current entity tag. See Optimistic locking * for asset model writes in the IoT SiteWise User Guide. *

* * @return The expected current entity tag (ETag) for the asset model’s latest or active version (specified using * matchForVersionType). The delete request is rejected if the tag does not match the latest or * active version's current entity tag. See Optimistic * locking for asset model writes in the IoT SiteWise User Guide. */ public final String ifMatch() { return ifMatch; } /** *

* Accepts * to reject the delete request if an active version (specified using * matchForVersionType as ACTIVE) already exists for the asset model. *

* * @return Accepts * to reject the delete request if an active version (specified using * matchForVersionType as ACTIVE) already exists for the asset model. */ public final String ifNoneMatch() { return ifNoneMatch; } /** *

* Specifies the asset model version type (LATEST or ACTIVE) used in conjunction with * If-Match or If-None-Match headers to determine the target ETag for the delete * operation. *

*

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

* * @return Specifies the asset model version type (LATEST or ACTIVE) used in conjunction * with If-Match or If-None-Match headers to determine the target ETag for the * delete operation. * @see AssetModelVersionType */ public final AssetModelVersionType matchForVersionType() { return AssetModelVersionType.fromValue(matchForVersionType); } /** *

* Specifies the asset model version type (LATEST or ACTIVE) used in conjunction with * If-Match or If-None-Match headers to determine the target ETag for the delete * operation. *

*

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

* * @return Specifies the asset model version type (LATEST or ACTIVE) used in conjunction * with If-Match or If-None-Match headers to determine the target ETag for the * delete operation. * @see AssetModelVersionType */ public final String matchForVersionTypeAsString() { return matchForVersionType; } @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(assetModelId()); hashCode = 31 * hashCode + Objects.hashCode(assetModelCompositeModelId()); hashCode = 31 * hashCode + Objects.hashCode(clientToken()); hashCode = 31 * hashCode + Objects.hashCode(ifMatch()); hashCode = 31 * hashCode + Objects.hashCode(ifNoneMatch()); hashCode = 31 * hashCode + Objects.hashCode(matchForVersionTypeAsString()); 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 DeleteAssetModelCompositeModelRequest)) { return false; } DeleteAssetModelCompositeModelRequest other = (DeleteAssetModelCompositeModelRequest) obj; return Objects.equals(assetModelId(), other.assetModelId()) && Objects.equals(assetModelCompositeModelId(), other.assetModelCompositeModelId()) && Objects.equals(clientToken(), other.clientToken()) && Objects.equals(ifMatch(), other.ifMatch()) && Objects.equals(ifNoneMatch(), other.ifNoneMatch()) && Objects.equals(matchForVersionTypeAsString(), other.matchForVersionTypeAsString()); } /** * 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("DeleteAssetModelCompositeModelRequest").add("AssetModelId", assetModelId()) .add("AssetModelCompositeModelId", assetModelCompositeModelId()).add("ClientToken", clientToken()) .add("IfMatch", ifMatch()).add("IfNoneMatch", ifNoneMatch()) .add("MatchForVersionType", matchForVersionTypeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "assetModelId": return Optional.ofNullable(clazz.cast(assetModelId())); case "assetModelCompositeModelId": return Optional.ofNullable(clazz.cast(assetModelCompositeModelId())); case "clientToken": return Optional.ofNullable(clazz.cast(clientToken())); case "ifMatch": return Optional.ofNullable(clazz.cast(ifMatch())); case "ifNoneMatch": return Optional.ofNullable(clazz.cast(ifNoneMatch())); case "matchForVersionType": return Optional.ofNullable(clazz.cast(matchForVersionTypeAsString())); 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((DeleteAssetModelCompositeModelRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends IoTSiteWiseRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the asset model, in UUID format. *

* * @param assetModelId * The ID of the asset model, in UUID format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder assetModelId(String assetModelId); /** *

* The ID of a composite model on this asset model. *

* * @param assetModelCompositeModelId * The ID of a composite model on this asset model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder assetModelCompositeModelId(String assetModelCompositeModelId); /** *

* A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse * this client token if a new idempotent request is required. *

* * @param clientToken * A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. * Don't reuse this client token if a new idempotent request is required. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientToken(String clientToken); /** *

* The expected current entity tag (ETag) for the asset model’s latest or active version (specified using * matchForVersionType). The delete request is rejected if the tag does not match the latest or * active version's current entity tag. See Optimistic * locking for asset model writes in the IoT SiteWise User Guide. *

* * @param ifMatch * The expected current entity tag (ETag) for the asset model’s latest or active version (specified using * matchForVersionType). The delete request is rejected if the tag does not match the latest * or active version's current entity tag. See Optimistic * locking for asset model writes in the IoT SiteWise User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ifMatch(String ifMatch); /** *

* Accepts * to reject the delete request if an active version (specified using * matchForVersionType as ACTIVE) already exists for the asset model. *

* * @param ifNoneMatch * Accepts * to reject the delete request if an active version (specified using * matchForVersionType as ACTIVE) already exists for the asset model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ifNoneMatch(String ifNoneMatch); /** *

* Specifies the asset model version type (LATEST or ACTIVE) used in conjunction with * If-Match or If-None-Match headers to determine the target ETag for the delete * operation. *

* * @param matchForVersionType * Specifies the asset model version type (LATEST or ACTIVE) used in * conjunction with If-Match or If-None-Match headers to determine the target * ETag for the delete operation. * @see AssetModelVersionType * @return Returns a reference to this object so that method calls can be chained together. * @see AssetModelVersionType */ Builder matchForVersionType(String matchForVersionType); /** *

* Specifies the asset model version type (LATEST or ACTIVE) used in conjunction with * If-Match or If-None-Match headers to determine the target ETag for the delete * operation. *

* * @param matchForVersionType * Specifies the asset model version type (LATEST or ACTIVE) used in * conjunction with If-Match or If-None-Match headers to determine the target * ETag for the delete operation. * @see AssetModelVersionType * @return Returns a reference to this object so that method calls can be chained together. * @see AssetModelVersionType */ Builder matchForVersionType(AssetModelVersionType matchForVersionType); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends IoTSiteWiseRequest.BuilderImpl implements Builder { private String assetModelId; private String assetModelCompositeModelId; private String clientToken; private String ifMatch; private String ifNoneMatch; private String matchForVersionType; private BuilderImpl() { } private BuilderImpl(DeleteAssetModelCompositeModelRequest model) { super(model); assetModelId(model.assetModelId); assetModelCompositeModelId(model.assetModelCompositeModelId); clientToken(model.clientToken); ifMatch(model.ifMatch); ifNoneMatch(model.ifNoneMatch); matchForVersionType(model.matchForVersionType); } public final String getAssetModelId() { return assetModelId; } public final void setAssetModelId(String assetModelId) { this.assetModelId = assetModelId; } @Override public final Builder assetModelId(String assetModelId) { this.assetModelId = assetModelId; return this; } public final String getAssetModelCompositeModelId() { return assetModelCompositeModelId; } public final void setAssetModelCompositeModelId(String assetModelCompositeModelId) { this.assetModelCompositeModelId = assetModelCompositeModelId; } @Override public final Builder assetModelCompositeModelId(String assetModelCompositeModelId) { this.assetModelCompositeModelId = assetModelCompositeModelId; return this; } public final String getClientToken() { return clientToken; } public final void setClientToken(String clientToken) { this.clientToken = clientToken; } @Override public final Builder clientToken(String clientToken) { this.clientToken = clientToken; return this; } public final String getIfMatch() { return ifMatch; } public final void setIfMatch(String ifMatch) { this.ifMatch = ifMatch; } @Override public final Builder ifMatch(String ifMatch) { this.ifMatch = ifMatch; return this; } public final String getIfNoneMatch() { return ifNoneMatch; } public final void setIfNoneMatch(String ifNoneMatch) { this.ifNoneMatch = ifNoneMatch; } @Override public final Builder ifNoneMatch(String ifNoneMatch) { this.ifNoneMatch = ifNoneMatch; return this; } public final String getMatchForVersionType() { return matchForVersionType; } public final void setMatchForVersionType(String matchForVersionType) { this.matchForVersionType = matchForVersionType; } @Override public final Builder matchForVersionType(String matchForVersionType) { this.matchForVersionType = matchForVersionType; return this; } @Override public final Builder matchForVersionType(AssetModelVersionType matchForVersionType) { this.matchForVersionType(matchForVersionType == null ? null : matchForVersionType.toString()); 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 DeleteAssetModelCompositeModelRequest build() { return new DeleteAssetModelCompositeModelRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy