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.kafka.model.DescribeVpcConnectionResponse Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Kafka module holds the client classes that are used for
communicating with Kafka.
/*
* 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.kafka.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 DescribeVpcConnectionResponse extends KafkaResponse implements
ToCopyableBuilder {
private static final SdkField VPC_CONNECTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VpcConnectionArn").getter(getter(DescribeVpcConnectionResponse::vpcConnectionArn))
.setter(setter(Builder::vpcConnectionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vpcConnectionArn").build()).build();
private static final SdkField TARGET_CLUSTER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetClusterArn").getter(getter(DescribeVpcConnectionResponse::targetClusterArn))
.setter(setter(Builder::targetClusterArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetClusterArn").build()).build();
private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State")
.getter(getter(DescribeVpcConnectionResponse::stateAsString)).setter(setter(Builder::state))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("state").build()).build();
private static final SdkField AUTHENTICATION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Authentication").getter(getter(DescribeVpcConnectionResponse::authentication))
.setter(setter(Builder::authentication))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authentication").build()).build();
private static final SdkField VPC_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("VpcId")
.getter(getter(DescribeVpcConnectionResponse::vpcId)).setter(setter(Builder::vpcId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vpcId").build()).build();
private static final SdkField> SUBNETS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Subnets")
.getter(getter(DescribeVpcConnectionResponse::subnets))
.setter(setter(Builder::subnets))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("subnets").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> SECURITY_GROUPS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SecurityGroups")
.getter(getter(DescribeVpcConnectionResponse::securityGroups))
.setter(setter(Builder::securityGroups))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("securityGroups").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("CreationTime")
.getter(getter(DescribeVpcConnectionResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Tags")
.getter(getter(DescribeVpcConnectionResponse::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(VPC_CONNECTION_ARN_FIELD,
TARGET_CLUSTER_ARN_FIELD, STATE_FIELD, AUTHENTICATION_FIELD, VPC_ID_FIELD, SUBNETS_FIELD, SECURITY_GROUPS_FIELD,
CREATION_TIME_FIELD, TAGS_FIELD));
private final String vpcConnectionArn;
private final String targetClusterArn;
private final String state;
private final String authentication;
private final String vpcId;
private final List subnets;
private final List securityGroups;
private final Instant creationTime;
private final Map tags;
private DescribeVpcConnectionResponse(BuilderImpl builder) {
super(builder);
this.vpcConnectionArn = builder.vpcConnectionArn;
this.targetClusterArn = builder.targetClusterArn;
this.state = builder.state;
this.authentication = builder.authentication;
this.vpcId = builder.vpcId;
this.subnets = builder.subnets;
this.securityGroups = builder.securityGroups;
this.creationTime = builder.creationTime;
this.tags = builder.tags;
}
/**
*
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*
* @return
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*/
public final String vpcConnectionArn() {
return vpcConnectionArn;
}
/**
*
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*
* @return
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*/
public final String targetClusterArn() {
return targetClusterArn;
}
/**
*
*
* The state of VPC connection.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return
* {@link VpcConnectionState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stateAsString}.
*
*
* @return
* The state of VPC connection.
*
* @see VpcConnectionState
*/
public final VpcConnectionState state() {
return VpcConnectionState.fromValue(state);
}
/**
*
*
* The state of VPC connection.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return
* {@link VpcConnectionState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stateAsString}.
*
*
* @return
* The state of VPC connection.
*
* @see VpcConnectionState
*/
public final String stateAsString() {
return state;
}
/**
*
*
* The authentication type of VPC connection.
*
*
* @return
* The authentication type of VPC connection.
*
*/
public final String authentication() {
return authentication;
}
/**
*
*
* The VPC Id for the VPC connection.
*
*
* @return
* The VPC Id for the VPC connection.
*
*/
public final String vpcId() {
return vpcId;
}
/**
* For responses, this returns true if the service returned a value for the Subnets 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 hasSubnets() {
return subnets != null && !(subnets instanceof SdkAutoConstructList);
}
/**
*
*
* The list of subnets for the VPC connection.
*
*
*
* 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 #hasSubnets} method.
*
*
* @return
* The list of subnets for the VPC connection.
*
*/
public final List subnets() {
return subnets;
}
/**
* For responses, this returns true if the service returned a value for the SecurityGroups 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 hasSecurityGroups() {
return securityGroups != null && !(securityGroups instanceof SdkAutoConstructList);
}
/**
*
*
* The list of security groups for the VPC connection.
*
*
*
* 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 #hasSecurityGroups} method.
*
*
* @return
* The list of security groups for the VPC connection.
*
*/
public final List securityGroups() {
return securityGroups;
}
/**
*
*
* The creation time of the VPC connection.
*
*
* @return
* The creation time of the VPC connection.
*
*/
public final Instant creationTime() {
return creationTime;
}
/**
* 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 tags for the VPC connection.
*
*
*
* 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 tags for the VPC connection.
*
*/
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(vpcConnectionArn());
hashCode = 31 * hashCode + Objects.hashCode(targetClusterArn());
hashCode = 31 * hashCode + Objects.hashCode(stateAsString());
hashCode = 31 * hashCode + Objects.hashCode(authentication());
hashCode = 31 * hashCode + Objects.hashCode(vpcId());
hashCode = 31 * hashCode + Objects.hashCode(hasSubnets() ? subnets() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSecurityGroups() ? securityGroups() : null);
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
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 DescribeVpcConnectionResponse)) {
return false;
}
DescribeVpcConnectionResponse other = (DescribeVpcConnectionResponse) obj;
return Objects.equals(vpcConnectionArn(), other.vpcConnectionArn())
&& Objects.equals(targetClusterArn(), other.targetClusterArn())
&& Objects.equals(stateAsString(), other.stateAsString())
&& Objects.equals(authentication(), other.authentication()) && Objects.equals(vpcId(), other.vpcId())
&& hasSubnets() == other.hasSubnets() && Objects.equals(subnets(), other.subnets())
&& hasSecurityGroups() == other.hasSecurityGroups() && Objects.equals(securityGroups(), other.securityGroups())
&& Objects.equals(creationTime(), other.creationTime()) && 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("DescribeVpcConnectionResponse").add("VpcConnectionArn", vpcConnectionArn())
.add("TargetClusterArn", targetClusterArn()).add("State", stateAsString())
.add("Authentication", authentication()).add("VpcId", vpcId()).add("Subnets", hasSubnets() ? subnets() : null)
.add("SecurityGroups", hasSecurityGroups() ? securityGroups() : null).add("CreationTime", creationTime())
.add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "VpcConnectionArn":
return Optional.ofNullable(clazz.cast(vpcConnectionArn()));
case "TargetClusterArn":
return Optional.ofNullable(clazz.cast(targetClusterArn()));
case "State":
return Optional.ofNullable(clazz.cast(stateAsString()));
case "Authentication":
return Optional.ofNullable(clazz.cast(authentication()));
case "VpcId":
return Optional.ofNullable(clazz.cast(vpcId()));
case "Subnets":
return Optional.ofNullable(clazz.cast(subnets()));
case "SecurityGroups":
return Optional.ofNullable(clazz.cast(securityGroups()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((DescribeVpcConnectionResponse) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends KafkaResponse.Builder, SdkPojo, CopyableBuilder {
/**
*
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*
* @param vpcConnectionArn
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vpcConnectionArn(String vpcConnectionArn);
/**
*
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*
* @param targetClusterArn
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder targetClusterArn(String targetClusterArn);
/**
*
*
* The state of VPC connection.
*
*
* @param state
*
* The state of VPC connection.
*
* @see VpcConnectionState
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpcConnectionState
*/
Builder state(String state);
/**
*
*
* The state of VPC connection.
*
*
* @param state
*
* The state of VPC connection.
*
* @see VpcConnectionState
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpcConnectionState
*/
Builder state(VpcConnectionState state);
/**
*
*
* The authentication type of VPC connection.
*
*
* @param authentication
*
* The authentication type of VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder authentication(String authentication);
/**
*
*
* The VPC Id for the VPC connection.
*
*
* @param vpcId
*
* The VPC Id for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vpcId(String vpcId);
/**
*
*
* The list of subnets for the VPC connection.
*
*
* @param subnets
*
* The list of subnets for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subnets(Collection subnets);
/**
*
*
* The list of subnets for the VPC connection.
*
*
* @param subnets
*
* The list of subnets for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subnets(String... subnets);
/**
*
*
* The list of security groups for the VPC connection.
*
*
* @param securityGroups
*
* The list of security groups for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder securityGroups(Collection securityGroups);
/**
*
*
* The list of security groups for the VPC connection.
*
*
* @param securityGroups
*
* The list of security groups for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder securityGroups(String... securityGroups);
/**
*
*
* The creation time of the VPC connection.
*
*
* @param creationTime
*
* The creation time of the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder creationTime(Instant creationTime);
/**
*
*
* A map of tags for the VPC connection.
*
*
* @param tags
*
* A map of tags for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
}
static final class BuilderImpl extends KafkaResponse.BuilderImpl implements Builder {
private String vpcConnectionArn;
private String targetClusterArn;
private String state;
private String authentication;
private String vpcId;
private List subnets = DefaultSdkAutoConstructList.getInstance();
private List securityGroups = DefaultSdkAutoConstructList.getInstance();
private Instant creationTime;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(DescribeVpcConnectionResponse model) {
super(model);
vpcConnectionArn(model.vpcConnectionArn);
targetClusterArn(model.targetClusterArn);
state(model.state);
authentication(model.authentication);
vpcId(model.vpcId);
subnets(model.subnets);
securityGroups(model.securityGroups);
creationTime(model.creationTime);
tags(model.tags);
}
public final String getVpcConnectionArn() {
return vpcConnectionArn;
}
public final void setVpcConnectionArn(String vpcConnectionArn) {
this.vpcConnectionArn = vpcConnectionArn;
}
@Override
public final Builder vpcConnectionArn(String vpcConnectionArn) {
this.vpcConnectionArn = vpcConnectionArn;
return this;
}
public final String getTargetClusterArn() {
return targetClusterArn;
}
public final void setTargetClusterArn(String targetClusterArn) {
this.targetClusterArn = targetClusterArn;
}
@Override
public final Builder targetClusterArn(String targetClusterArn) {
this.targetClusterArn = targetClusterArn;
return this;
}
public final String getState() {
return state;
}
public final void setState(String state) {
this.state = state;
}
@Override
public final Builder state(String state) {
this.state = state;
return this;
}
@Override
public final Builder state(VpcConnectionState state) {
this.state(state == null ? null : state.toString());
return this;
}
public final String getAuthentication() {
return authentication;
}
public final void setAuthentication(String authentication) {
this.authentication = authentication;
}
@Override
public final Builder authentication(String authentication) {
this.authentication = authentication;
return this;
}
public final String getVpcId() {
return vpcId;
}
public final void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
@Override
public final Builder vpcId(String vpcId) {
this.vpcId = vpcId;
return this;
}
public final Collection getSubnets() {
if (subnets instanceof SdkAutoConstructList) {
return null;
}
return subnets;
}
public final void setSubnets(Collection subnets) {
this.subnets = ___listOf__stringCopier.copy(subnets);
}
@Override
public final Builder subnets(Collection subnets) {
this.subnets = ___listOf__stringCopier.copy(subnets);
return this;
}
@Override
@SafeVarargs
public final Builder subnets(String... subnets) {
subnets(Arrays.asList(subnets));
return this;
}
public final Collection getSecurityGroups() {
if (securityGroups instanceof SdkAutoConstructList) {
return null;
}
return securityGroups;
}
public final void setSecurityGroups(Collection securityGroups) {
this.securityGroups = ___listOf__stringCopier.copy(securityGroups);
}
@Override
public final Builder securityGroups(Collection securityGroups) {
this.securityGroups = ___listOf__stringCopier.copy(securityGroups);
return this;
}
@Override
@SafeVarargs
public final Builder securityGroups(String... securityGroups) {
securityGroups(Arrays.asList(securityGroups));
return this;
}
public final Instant getCreationTime() {
return creationTime;
}
public final void setCreationTime(Instant creationTime) {
this.creationTime = creationTime;
}
@Override
public final Builder creationTime(Instant creationTime) {
this.creationTime = creationTime;
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = ___mapOf__stringCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = ___mapOf__stringCopier.copy(tags);
return this;
}
@Override
public DescribeVpcConnectionResponse build() {
return new DescribeVpcConnectionResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}