Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.marketplacedeployment.model.PutDeploymentParameterResponse Maven / Gradle / Ivy
/*
* 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.marketplacedeployment.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.Function;
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.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
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 PutDeploymentParameterResponse extends MarketplaceDeploymentResponse implements
ToCopyableBuilder {
private static final SdkField AGREEMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("agreementId").getter(getter(PutDeploymentParameterResponse::agreementId))
.setter(setter(Builder::agreementId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("agreementId").build()).build();
private static final SdkField DEPLOYMENT_PARAMETER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("deploymentParameterId").getter(getter(PutDeploymentParameterResponse::deploymentParameterId))
.setter(setter(Builder::deploymentParameterId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deploymentParameterId").build())
.build();
private static final SdkField RESOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("resourceArn").getter(getter(PutDeploymentParameterResponse::resourceArn))
.setter(setter(Builder::resourceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceArn").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("tags")
.getter(getter(PutDeploymentParameterResponse::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 List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AGREEMENT_ID_FIELD,
DEPLOYMENT_PARAMETER_ID_FIELD, RESOURCE_ARN_FIELD, TAGS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("agreementId", AGREEMENT_ID_FIELD);
put("deploymentParameterId", DEPLOYMENT_PARAMETER_ID_FIELD);
put("resourceArn", RESOURCE_ARN_FIELD);
put("tags", TAGS_FIELD);
}
});
private final String agreementId;
private final String deploymentParameterId;
private final String resourceArn;
private final Map tags;
private PutDeploymentParameterResponse(BuilderImpl builder) {
super(builder);
this.agreementId = builder.agreementId;
this.deploymentParameterId = builder.deploymentParameterId;
this.resourceArn = builder.resourceArn;
this.tags = builder.tags;
}
/**
*
* The unique identifier of the agreement.
*
*
* @return The unique identifier of the agreement.
*/
public final String agreementId() {
return agreementId;
}
/**
*
* The unique identifier of the deployment parameter.
*
*
* @return The unique identifier of the deployment parameter.
*/
public final String deploymentParameterId() {
return deploymentParameterId;
}
/**
*
* The Amazon Resource Name (ARN) associated with the deployment parameter resource you want to create or update.
*
*
* @return The Amazon Resource Name (ARN) associated with the deployment parameter resource you want to create or
* update.
*/
public final String resourceArn() {
return resourceArn;
}
/**
* 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);
}
/**
*
* A map of key-value pairs, where each pair represents a tag saved to the resource. Tags will only be applied for
* create operations, and they'll be ignored if the resource already exists.
*
*
* 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 A map of key-value pairs, where each pair represents a tag saved to the resource. Tags will only be
* applied for create operations, and they'll be ignored if the resource already exists.
*/
public final Map tags() {
return tags;
}
@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(agreementId());
hashCode = 31 * hashCode + Objects.hashCode(deploymentParameterId());
hashCode = 31 * hashCode + Objects.hashCode(resourceArn());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
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 PutDeploymentParameterResponse)) {
return false;
}
PutDeploymentParameterResponse other = (PutDeploymentParameterResponse) obj;
return Objects.equals(agreementId(), other.agreementId())
&& Objects.equals(deploymentParameterId(), other.deploymentParameterId())
&& Objects.equals(resourceArn(), other.resourceArn()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("PutDeploymentParameterResponse").add("AgreementId", agreementId())
.add("DeploymentParameterId", deploymentParameterId()).add("ResourceArn", resourceArn())
.add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "agreementId":
return Optional.ofNullable(clazz.cast(agreementId()));
case "deploymentParameterId":
return Optional.ofNullable(clazz.cast(deploymentParameterId()));
case "resourceArn":
return Optional.ofNullable(clazz.cast(resourceArn()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
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((PutDeploymentParameterResponse) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends MarketplaceDeploymentResponse.Builder, SdkPojo,
CopyableBuilder {
/**
*
* The unique identifier of the agreement.
*
*
* @param agreementId
* The unique identifier of the agreement.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder agreementId(String agreementId);
/**
*
* The unique identifier of the deployment parameter.
*
*
* @param deploymentParameterId
* The unique identifier of the deployment parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder deploymentParameterId(String deploymentParameterId);
/**
*
* The Amazon Resource Name (ARN) associated with the deployment parameter resource you want to create or
* update.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) associated with the deployment parameter resource you want to create or
* update.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceArn(String resourceArn);
/**
*
* A map of key-value pairs, where each pair represents a tag saved to the resource. Tags will only be applied
* for create operations, and they'll be ignored if the resource already exists.
*
*
* @param tags
* A map of key-value pairs, where each pair represents a tag saved to the resource. Tags will only be
* applied for create operations, and they'll be ignored if the resource already exists.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
}
static final class BuilderImpl extends MarketplaceDeploymentResponse.BuilderImpl implements Builder {
private String agreementId;
private String deploymentParameterId;
private String resourceArn;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(PutDeploymentParameterResponse model) {
super(model);
agreementId(model.agreementId);
deploymentParameterId(model.deploymentParameterId);
resourceArn(model.resourceArn);
tags(model.tags);
}
public final String getAgreementId() {
return agreementId;
}
public final void setAgreementId(String agreementId) {
this.agreementId = agreementId;
}
@Override
public final Builder agreementId(String agreementId) {
this.agreementId = agreementId;
return this;
}
public final String getDeploymentParameterId() {
return deploymentParameterId;
}
public final void setDeploymentParameterId(String deploymentParameterId) {
this.deploymentParameterId = deploymentParameterId;
}
@Override
public final Builder deploymentParameterId(String deploymentParameterId) {
this.deploymentParameterId = deploymentParameterId;
return this;
}
public final String getResourceArn() {
return resourceArn;
}
public final void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
@Override
public final Builder resourceArn(String resourceArn) {
this.resourceArn = resourceArn;
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagsMapCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagsMapCopier.copy(tags);
return this;
}
@Override
public PutDeploymentParameterResponse build() {
return new PutDeploymentParameterResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
@Override
public Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
}
}