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

software.amazon.awssdk.services.elasticbeanstalk.model.SwapEnvironmentCnamEsRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Elastic Beanstalk module holds the client classes that are used for communicating with AWS Elastic Beanstalk Service

There is a newer version: 2.30.1
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.elasticbeanstalk.model;

import java.beans.Transient;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Swaps the CNAMEs of two environments. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SwapEnvironmentCnamEsRequest extends ElasticBeanstalkRequest implements ToCopyableBuilder { private static final SdkField SOURCE_ENVIRONMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceEnvironmentId").getter(getter(SwapEnvironmentCnamEsRequest::sourceEnvironmentId)) .setter(setter(Builder::sourceEnvironmentId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceEnvironmentId").build()) .build(); private static final SdkField SOURCE_ENVIRONMENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceEnvironmentName").getter(getter(SwapEnvironmentCnamEsRequest::sourceEnvironmentName)) .setter(setter(Builder::sourceEnvironmentName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceEnvironmentName").build()) .build(); private static final SdkField DESTINATION_ENVIRONMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DestinationEnvironmentId").getter(getter(SwapEnvironmentCnamEsRequest::destinationEnvironmentId)) .setter(setter(Builder::destinationEnvironmentId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationEnvironmentId").build()) .build(); private static final SdkField DESTINATION_ENVIRONMENT_NAME_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("DestinationEnvironmentName") .getter(getter(SwapEnvironmentCnamEsRequest::destinationEnvironmentName)) .setter(setter(Builder::destinationEnvironmentName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationEnvironmentName").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SOURCE_ENVIRONMENT_ID_FIELD, SOURCE_ENVIRONMENT_NAME_FIELD, DESTINATION_ENVIRONMENT_ID_FIELD, DESTINATION_ENVIRONMENT_NAME_FIELD)); private final String sourceEnvironmentId; private final String sourceEnvironmentName; private final String destinationEnvironmentId; private final String destinationEnvironmentName; private SwapEnvironmentCnamEsRequest(BuilderImpl builder) { super(builder); this.sourceEnvironmentId = builder.sourceEnvironmentId; this.sourceEnvironmentName = builder.sourceEnvironmentName; this.destinationEnvironmentId = builder.destinationEnvironmentId; this.destinationEnvironmentName = builder.destinationEnvironmentName; } /** *

* The ID of the source environment. *

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentId, you must specify the DestinationEnvironmentId. *

* * @return The ID of the source environment.

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentId, you must specify the DestinationEnvironmentId. */ public final String sourceEnvironmentId() { return sourceEnvironmentId; } /** *

* The name of the source environment. *

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentName, you must specify the DestinationEnvironmentName. *

* * @return The name of the source environment.

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentName, you must specify the DestinationEnvironmentName. */ public final String sourceEnvironmentName() { return sourceEnvironmentName; } /** *

* The ID of the destination environment. *

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentId with the DestinationEnvironmentId. *

* * @return The ID of the destination environment.

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentId with the DestinationEnvironmentId. */ public final String destinationEnvironmentId() { return destinationEnvironmentId; } /** *

* The name of the destination environment. *

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentName with the DestinationEnvironmentName. *

* * @return The name of the destination environment.

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentName with the DestinationEnvironmentName. */ public final String destinationEnvironmentName() { return destinationEnvironmentName; } @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(sourceEnvironmentId()); hashCode = 31 * hashCode + Objects.hashCode(sourceEnvironmentName()); hashCode = 31 * hashCode + Objects.hashCode(destinationEnvironmentId()); hashCode = 31 * hashCode + Objects.hashCode(destinationEnvironmentName()); 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 SwapEnvironmentCnamEsRequest)) { return false; } SwapEnvironmentCnamEsRequest other = (SwapEnvironmentCnamEsRequest) obj; return Objects.equals(sourceEnvironmentId(), other.sourceEnvironmentId()) && Objects.equals(sourceEnvironmentName(), other.sourceEnvironmentName()) && Objects.equals(destinationEnvironmentId(), other.destinationEnvironmentId()) && Objects.equals(destinationEnvironmentName(), other.destinationEnvironmentName()); } /** * 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("SwapEnvironmentCnamEsRequest").add("SourceEnvironmentId", sourceEnvironmentId()) .add("SourceEnvironmentName", sourceEnvironmentName()) .add("DestinationEnvironmentId", destinationEnvironmentId()) .add("DestinationEnvironmentName", destinationEnvironmentName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "SourceEnvironmentId": return Optional.ofNullable(clazz.cast(sourceEnvironmentId())); case "SourceEnvironmentName": return Optional.ofNullable(clazz.cast(sourceEnvironmentName())); case "DestinationEnvironmentId": return Optional.ofNullable(clazz.cast(destinationEnvironmentId())); case "DestinationEnvironmentName": return Optional.ofNullable(clazz.cast(destinationEnvironmentName())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SwapEnvironmentCnamEsRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ElasticBeanstalkRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the source environment. *

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentId, you must specify the DestinationEnvironmentId. *

* * @param sourceEnvironmentId * The ID of the source environment.

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentId, you must specify the DestinationEnvironmentId. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceEnvironmentId(String sourceEnvironmentId); /** *

* The name of the source environment. *

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentName, you must specify the DestinationEnvironmentName. *

* * @param sourceEnvironmentName * The name of the source environment.

*

* Condition: You must specify at least the SourceEnvironmentID or the * SourceEnvironmentName. You may also specify both. If you specify the * SourceEnvironmentName, you must specify the DestinationEnvironmentName. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceEnvironmentName(String sourceEnvironmentName); /** *

* The ID of the destination environment. *

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentId with the DestinationEnvironmentId. *

* * @param destinationEnvironmentId * The ID of the destination environment.

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentId with the DestinationEnvironmentId. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationEnvironmentId(String destinationEnvironmentId); /** *

* The name of the destination environment. *

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentName with the DestinationEnvironmentName. *

* * @param destinationEnvironmentName * The name of the destination environment.

*

* Condition: You must specify at least the DestinationEnvironmentID or the * DestinationEnvironmentName. You may also specify both. You must specify the * SourceEnvironmentName with the DestinationEnvironmentName. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationEnvironmentName(String destinationEnvironmentName); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ElasticBeanstalkRequest.BuilderImpl implements Builder { private String sourceEnvironmentId; private String sourceEnvironmentName; private String destinationEnvironmentId; private String destinationEnvironmentName; private BuilderImpl() { } private BuilderImpl(SwapEnvironmentCnamEsRequest model) { super(model); sourceEnvironmentId(model.sourceEnvironmentId); sourceEnvironmentName(model.sourceEnvironmentName); destinationEnvironmentId(model.destinationEnvironmentId); destinationEnvironmentName(model.destinationEnvironmentName); } public final String getSourceEnvironmentId() { return sourceEnvironmentId; } public final void setSourceEnvironmentId(String sourceEnvironmentId) { this.sourceEnvironmentId = sourceEnvironmentId; } @Override @Transient public final Builder sourceEnvironmentId(String sourceEnvironmentId) { this.sourceEnvironmentId = sourceEnvironmentId; return this; } public final String getSourceEnvironmentName() { return sourceEnvironmentName; } public final void setSourceEnvironmentName(String sourceEnvironmentName) { this.sourceEnvironmentName = sourceEnvironmentName; } @Override @Transient public final Builder sourceEnvironmentName(String sourceEnvironmentName) { this.sourceEnvironmentName = sourceEnvironmentName; return this; } public final String getDestinationEnvironmentId() { return destinationEnvironmentId; } public final void setDestinationEnvironmentId(String destinationEnvironmentId) { this.destinationEnvironmentId = destinationEnvironmentId; } @Override @Transient public final Builder destinationEnvironmentId(String destinationEnvironmentId) { this.destinationEnvironmentId = destinationEnvironmentId; return this; } public final String getDestinationEnvironmentName() { return destinationEnvironmentName; } public final void setDestinationEnvironmentName(String destinationEnvironmentName) { this.destinationEnvironmentName = destinationEnvironmentName; } @Override @Transient public final Builder destinationEnvironmentName(String destinationEnvironmentName) { this.destinationEnvironmentName = destinationEnvironmentName; 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 SwapEnvironmentCnamEsRequest build() { return new SwapEnvironmentCnamEsRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy