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

software.amazon.awssdk.services.elasticsearch.model.CreateOutboundCrossClusterSearchConnectionResponse Maven / Gradle / Ivy

Go to download

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

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.elasticsearch.model;

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.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;

/**
 * 

* The result of a CreateOutboundCrossClusterSearchConnection request. Contains the details of the * newly created cross-cluster search connection. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CreateOutboundCrossClusterSearchConnectionResponse extends ElasticsearchResponse implements ToCopyableBuilder { private static final SdkField SOURCE_DOMAIN_INFO_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SourceDomainInfo") .getter(getter(CreateOutboundCrossClusterSearchConnectionResponse::sourceDomainInfo)) .setter(setter(Builder::sourceDomainInfo)).constructor(DomainInformation::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceDomainInfo").build()).build(); private static final SdkField DESTINATION_DOMAIN_INFO_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("DestinationDomainInfo") .getter(getter(CreateOutboundCrossClusterSearchConnectionResponse::destinationDomainInfo)) .setter(setter(Builder::destinationDomainInfo)).constructor(DomainInformation::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationDomainInfo").build()) .build(); private static final SdkField CONNECTION_ALIAS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ConnectionAlias").getter(getter(CreateOutboundCrossClusterSearchConnectionResponse::connectionAlias)) .setter(setter(Builder::connectionAlias)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConnectionAlias").build()).build(); private static final SdkField CONNECTION_STATUS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ConnectionStatus") .getter(getter(CreateOutboundCrossClusterSearchConnectionResponse::connectionStatus)) .setter(setter(Builder::connectionStatus)).constructor(OutboundCrossClusterSearchConnectionStatus::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConnectionStatus").build()).build(); private static final SdkField CROSS_CLUSTER_SEARCH_CONNECTION_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("CrossClusterSearchConnectionId") .getter(getter(CreateOutboundCrossClusterSearchConnectionResponse::crossClusterSearchConnectionId)) .setter(setter(Builder::crossClusterSearchConnectionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrossClusterSearchConnectionId") .build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SOURCE_DOMAIN_INFO_FIELD, DESTINATION_DOMAIN_INFO_FIELD, CONNECTION_ALIAS_FIELD, CONNECTION_STATUS_FIELD, CROSS_CLUSTER_SEARCH_CONNECTION_ID_FIELD)); private final DomainInformation sourceDomainInfo; private final DomainInformation destinationDomainInfo; private final String connectionAlias; private final OutboundCrossClusterSearchConnectionStatus connectionStatus; private final String crossClusterSearchConnectionId; private CreateOutboundCrossClusterSearchConnectionResponse(BuilderImpl builder) { super(builder); this.sourceDomainInfo = builder.sourceDomainInfo; this.destinationDomainInfo = builder.destinationDomainInfo; this.connectionAlias = builder.connectionAlias; this.connectionStatus = builder.connectionStatus; this.crossClusterSearchConnectionId = builder.crossClusterSearchConnectionId; } /** *

* Specifies the DomainInformation for the source Elasticsearch domain. *

* * @return Specifies the DomainInformation for the source Elasticsearch domain. */ public final DomainInformation sourceDomainInfo() { return sourceDomainInfo; } /** *

* Specifies the DomainInformation for the destination Elasticsearch domain. *

* * @return Specifies the DomainInformation for the destination Elasticsearch domain. */ public final DomainInformation destinationDomainInfo() { return destinationDomainInfo; } /** *

* Specifies the connection alias provided during the create connection request. *

* * @return Specifies the connection alias provided during the create connection request. */ public final String connectionAlias() { return connectionAlias; } /** *

* Specifies the OutboundCrossClusterSearchConnectionStatus for the newly created connection. *

* * @return Specifies the OutboundCrossClusterSearchConnectionStatus for the newly created * connection. */ public final OutboundCrossClusterSearchConnectionStatus connectionStatus() { return connectionStatus; } /** *

* Unique id for the created outbound connection, which is used for subsequent operations on connection. *

* * @return Unique id for the created outbound connection, which is used for subsequent operations on connection. */ public final String crossClusterSearchConnectionId() { return crossClusterSearchConnectionId; } @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(sourceDomainInfo()); hashCode = 31 * hashCode + Objects.hashCode(destinationDomainInfo()); hashCode = 31 * hashCode + Objects.hashCode(connectionAlias()); hashCode = 31 * hashCode + Objects.hashCode(connectionStatus()); hashCode = 31 * hashCode + Objects.hashCode(crossClusterSearchConnectionId()); 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 CreateOutboundCrossClusterSearchConnectionResponse)) { return false; } CreateOutboundCrossClusterSearchConnectionResponse other = (CreateOutboundCrossClusterSearchConnectionResponse) obj; return Objects.equals(sourceDomainInfo(), other.sourceDomainInfo()) && Objects.equals(destinationDomainInfo(), other.destinationDomainInfo()) && Objects.equals(connectionAlias(), other.connectionAlias()) && Objects.equals(connectionStatus(), other.connectionStatus()) && Objects.equals(crossClusterSearchConnectionId(), other.crossClusterSearchConnectionId()); } /** * 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("CreateOutboundCrossClusterSearchConnectionResponse").add("SourceDomainInfo", sourceDomainInfo()) .add("DestinationDomainInfo", destinationDomainInfo()).add("ConnectionAlias", connectionAlias()) .add("ConnectionStatus", connectionStatus()) .add("CrossClusterSearchConnectionId", crossClusterSearchConnectionId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "SourceDomainInfo": return Optional.ofNullable(clazz.cast(sourceDomainInfo())); case "DestinationDomainInfo": return Optional.ofNullable(clazz.cast(destinationDomainInfo())); case "ConnectionAlias": return Optional.ofNullable(clazz.cast(connectionAlias())); case "ConnectionStatus": return Optional.ofNullable(clazz.cast(connectionStatus())); case "CrossClusterSearchConnectionId": return Optional.ofNullable(clazz.cast(crossClusterSearchConnectionId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateOutboundCrossClusterSearchConnectionResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ElasticsearchResponse.Builder, SdkPojo, CopyableBuilder { /** *

* Specifies the DomainInformation for the source Elasticsearch domain. *

* * @param sourceDomainInfo * Specifies the DomainInformation for the source Elasticsearch domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceDomainInfo(DomainInformation sourceDomainInfo); /** *

* Specifies the DomainInformation for the source Elasticsearch domain. *

* This is a convenience method that creates an instance of the {@link DomainInformation.Builder} avoiding the * need to create one manually via {@link DomainInformation#builder()}. * * When the {@link Consumer} completes, {@link DomainInformation.Builder#build()} is called immediately and its * result is passed to {@link #sourceDomainInfo(DomainInformation)}. * * @param sourceDomainInfo * a consumer that will call methods on {@link DomainInformation.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sourceDomainInfo(DomainInformation) */ default Builder sourceDomainInfo(Consumer sourceDomainInfo) { return sourceDomainInfo(DomainInformation.builder().applyMutation(sourceDomainInfo).build()); } /** *

* Specifies the DomainInformation for the destination Elasticsearch domain. *

* * @param destinationDomainInfo * Specifies the DomainInformation for the destination Elasticsearch domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationDomainInfo(DomainInformation destinationDomainInfo); /** *

* Specifies the DomainInformation for the destination Elasticsearch domain. *

* This is a convenience method that creates an instance of the {@link DomainInformation.Builder} avoiding the * need to create one manually via {@link DomainInformation#builder()}. * * When the {@link Consumer} completes, {@link DomainInformation.Builder#build()} is called immediately and its * result is passed to {@link #destinationDomainInfo(DomainInformation)}. * * @param destinationDomainInfo * a consumer that will call methods on {@link DomainInformation.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #destinationDomainInfo(DomainInformation) */ default Builder destinationDomainInfo(Consumer destinationDomainInfo) { return destinationDomainInfo(DomainInformation.builder().applyMutation(destinationDomainInfo).build()); } /** *

* Specifies the connection alias provided during the create connection request. *

* * @param connectionAlias * Specifies the connection alias provided during the create connection request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectionAlias(String connectionAlias); /** *

* Specifies the OutboundCrossClusterSearchConnectionStatus for the newly created * connection. *

* * @param connectionStatus * Specifies the OutboundCrossClusterSearchConnectionStatus for the newly created * connection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectionStatus(OutboundCrossClusterSearchConnectionStatus connectionStatus); /** *

* Specifies the OutboundCrossClusterSearchConnectionStatus for the newly created * connection. *

* This is a convenience method that creates an instance of the * {@link OutboundCrossClusterSearchConnectionStatus.Builder} avoiding the need to create one manually via * {@link OutboundCrossClusterSearchConnectionStatus#builder()}. * * When the {@link Consumer} completes, {@link OutboundCrossClusterSearchConnectionStatus.Builder#build()} is * called immediately and its result is passed to * {@link #connectionStatus(OutboundCrossClusterSearchConnectionStatus)}. * * @param connectionStatus * a consumer that will call methods on {@link OutboundCrossClusterSearchConnectionStatus.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #connectionStatus(OutboundCrossClusterSearchConnectionStatus) */ default Builder connectionStatus(Consumer connectionStatus) { return connectionStatus(OutboundCrossClusterSearchConnectionStatus.builder().applyMutation(connectionStatus).build()); } /** *

* Unique id for the created outbound connection, which is used for subsequent operations on connection. *

* * @param crossClusterSearchConnectionId * Unique id for the created outbound connection, which is used for subsequent operations on connection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder crossClusterSearchConnectionId(String crossClusterSearchConnectionId); } static final class BuilderImpl extends ElasticsearchResponse.BuilderImpl implements Builder { private DomainInformation sourceDomainInfo; private DomainInformation destinationDomainInfo; private String connectionAlias; private OutboundCrossClusterSearchConnectionStatus connectionStatus; private String crossClusterSearchConnectionId; private BuilderImpl() { } private BuilderImpl(CreateOutboundCrossClusterSearchConnectionResponse model) { super(model); sourceDomainInfo(model.sourceDomainInfo); destinationDomainInfo(model.destinationDomainInfo); connectionAlias(model.connectionAlias); connectionStatus(model.connectionStatus); crossClusterSearchConnectionId(model.crossClusterSearchConnectionId); } public final DomainInformation.Builder getSourceDomainInfo() { return sourceDomainInfo != null ? sourceDomainInfo.toBuilder() : null; } public final void setSourceDomainInfo(DomainInformation.BuilderImpl sourceDomainInfo) { this.sourceDomainInfo = sourceDomainInfo != null ? sourceDomainInfo.build() : null; } @Override public final Builder sourceDomainInfo(DomainInformation sourceDomainInfo) { this.sourceDomainInfo = sourceDomainInfo; return this; } public final DomainInformation.Builder getDestinationDomainInfo() { return destinationDomainInfo != null ? destinationDomainInfo.toBuilder() : null; } public final void setDestinationDomainInfo(DomainInformation.BuilderImpl destinationDomainInfo) { this.destinationDomainInfo = destinationDomainInfo != null ? destinationDomainInfo.build() : null; } @Override public final Builder destinationDomainInfo(DomainInformation destinationDomainInfo) { this.destinationDomainInfo = destinationDomainInfo; return this; } public final String getConnectionAlias() { return connectionAlias; } public final void setConnectionAlias(String connectionAlias) { this.connectionAlias = connectionAlias; } @Override public final Builder connectionAlias(String connectionAlias) { this.connectionAlias = connectionAlias; return this; } public final OutboundCrossClusterSearchConnectionStatus.Builder getConnectionStatus() { return connectionStatus != null ? connectionStatus.toBuilder() : null; } public final void setConnectionStatus(OutboundCrossClusterSearchConnectionStatus.BuilderImpl connectionStatus) { this.connectionStatus = connectionStatus != null ? connectionStatus.build() : null; } @Override public final Builder connectionStatus(OutboundCrossClusterSearchConnectionStatus connectionStatus) { this.connectionStatus = connectionStatus; return this; } public final String getCrossClusterSearchConnectionId() { return crossClusterSearchConnectionId; } public final void setCrossClusterSearchConnectionId(String crossClusterSearchConnectionId) { this.crossClusterSearchConnectionId = crossClusterSearchConnectionId; } @Override public final Builder crossClusterSearchConnectionId(String crossClusterSearchConnectionId) { this.crossClusterSearchConnectionId = crossClusterSearchConnectionId; return this; } @Override public CreateOutboundCrossClusterSearchConnectionResponse build() { return new CreateOutboundCrossClusterSearchConnectionResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy