software.amazon.awssdk.services.iotsitewise.model.DeleteAssetModelCompositeModelRequest 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.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 extends Builder> 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