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

software.amazon.awssdk.services.kafka.model.VpcConnectionInfoServerless Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Kafka module holds the client classes that are used for communicating with Kafka.

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

import java.io.Serializable;
import java.time.Instant;
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.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.TimestampFormatTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * Description of the VPC connection.
 */
@Generated("software.amazon.awssdk:codegen")
public final class VpcConnectionInfoServerless implements SdkPojo, Serializable,
        ToCopyableBuilder {
    private static final SdkField CREATION_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("CreationTime")
            .getter(getter(VpcConnectionInfoServerless::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 OWNER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Owner")
            .getter(getter(VpcConnectionInfoServerless::owner)).setter(setter(Builder::owner))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("owner").build()).build();

    private static final SdkField USER_IDENTITY_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("UserIdentity").getter(getter(VpcConnectionInfoServerless::userIdentity))
            .setter(setter(Builder::userIdentity)).constructor(UserIdentity::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("userIdentity").build()).build();

    private static final SdkField VPC_CONNECTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("VpcConnectionArn").getter(getter(VpcConnectionInfoServerless::vpcConnectionArn))
            .setter(setter(Builder::vpcConnectionArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vpcConnectionArn").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATION_TIME_FIELD,
            OWNER_FIELD, USER_IDENTITY_FIELD, VPC_CONNECTION_ARN_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("creationTime", CREATION_TIME_FIELD);
                    put("owner", OWNER_FIELD);
                    put("userIdentity", USER_IDENTITY_FIELD);
                    put("vpcConnectionArn", VPC_CONNECTION_ARN_FIELD);
                }
            });

    private static final long serialVersionUID = 1L;

    private final Instant creationTime;

    private final String owner;

    private final UserIdentity userIdentity;

    private final String vpcConnectionArn;

    private VpcConnectionInfoServerless(BuilderImpl builder) {
        this.creationTime = builder.creationTime;
        this.owner = builder.owner;
        this.userIdentity = builder.userIdentity;
        this.vpcConnectionArn = builder.vpcConnectionArn;
    }

    /**
     *
     * 

* The time when Amazon MSK creates the VPC Connnection. *

* * @return

* The time when Amazon MSK creates the VPC Connnection. *

*/ public final Instant creationTime() { return creationTime; } /** * *

* The owner of the VPC Connection. *

* * @return

* The owner of the VPC Connection. *

*/ public final String owner() { return owner; } /** * *

* Description of the requester that calls the API operation. *

* * @return

* Description of the requester that calls the API operation. *

*/ public final UserIdentity userIdentity() { return userIdentity; } /** * *

* The Amazon Resource Name (ARN) of the VPC connection. *

* * @return

* The Amazon Resource Name (ARN) of the VPC connection. *

*/ public final String vpcConnectionArn() { return vpcConnectionArn; } @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 + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(owner()); hashCode = 31 * hashCode + Objects.hashCode(userIdentity()); hashCode = 31 * hashCode + Objects.hashCode(vpcConnectionArn()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof VpcConnectionInfoServerless)) { return false; } VpcConnectionInfoServerless other = (VpcConnectionInfoServerless) obj; return Objects.equals(creationTime(), other.creationTime()) && Objects.equals(owner(), other.owner()) && Objects.equals(userIdentity(), other.userIdentity()) && Objects.equals(vpcConnectionArn(), other.vpcConnectionArn()); } /** * 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("VpcConnectionInfoServerless").add("CreationTime", creationTime()).add("Owner", owner()) .add("UserIdentity", userIdentity()).add("VpcConnectionArn", vpcConnectionArn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "Owner": return Optional.ofNullable(clazz.cast(owner())); case "UserIdentity": return Optional.ofNullable(clazz.cast(userIdentity())); case "VpcConnectionArn": return Optional.ofNullable(clazz.cast(vpcConnectionArn())); 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((VpcConnectionInfoServerless) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** * *

* The time when Amazon MSK creates the VPC Connnection. *

* * @param creationTime *

* The time when Amazon MSK creates the VPC Connnection. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** * *

* The owner of the VPC Connection. *

* * @param owner *

* The owner of the VPC Connection. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder owner(String owner); /** * *

* Description of the requester that calls the API operation. *

* * @param userIdentity *

* Description of the requester that calls the API operation. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder userIdentity(UserIdentity userIdentity); /** * *

* Description of the requester that calls the API operation. *

* This is a convenience method that creates an instance of the {@link UserIdentity.Builder} avoiding the need * to create one manually via {@link UserIdentity#builder()}. * *

* When the {@link Consumer} completes, {@link UserIdentity.Builder#build()} is called immediately and its * result is passed to {@link #userIdentity(UserIdentity)}. * * @param userIdentity * a consumer that will call methods on {@link UserIdentity.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #userIdentity(UserIdentity) */ default Builder userIdentity(Consumer userIdentity) { return userIdentity(UserIdentity.builder().applyMutation(userIdentity).build()); } /** * *

* The Amazon Resource Name (ARN) of the VPC connection. *

* * @param vpcConnectionArn *

* The Amazon Resource Name (ARN) of the VPC connection. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcConnectionArn(String vpcConnectionArn); } static final class BuilderImpl implements Builder { private Instant creationTime; private String owner; private UserIdentity userIdentity; private String vpcConnectionArn; private BuilderImpl() { } private BuilderImpl(VpcConnectionInfoServerless model) { creationTime(model.creationTime); owner(model.owner); userIdentity(model.userIdentity); vpcConnectionArn(model.vpcConnectionArn); } 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 String getOwner() { return owner; } public final void setOwner(String owner) { this.owner = owner; } @Override public final Builder owner(String owner) { this.owner = owner; return this; } public final UserIdentity.Builder getUserIdentity() { return userIdentity != null ? userIdentity.toBuilder() : null; } public final void setUserIdentity(UserIdentity.BuilderImpl userIdentity) { this.userIdentity = userIdentity != null ? userIdentity.build() : null; } @Override public final Builder userIdentity(UserIdentity userIdentity) { this.userIdentity = userIdentity; return this; } 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; } @Override public VpcConnectionInfoServerless build() { return new VpcConnectionInfoServerless(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy