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

software.amazon.awssdk.services.kafkaconnect.model.DescribeCustomPluginResponse Maven / Gradle / Ivy

Go to download

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

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

import java.time.Instant;
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.core.traits.TimestampFormatTrait;
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 DescribeCustomPluginResponse extends KafkaConnectResponse implements
        ToCopyableBuilder {
    private static final SdkField CREATION_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("creationTime")
            .getter(getter(DescribeCustomPluginResponse::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 CUSTOM_PLUGIN_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("customPluginArn").getter(getter(DescribeCustomPluginResponse::customPluginArn))
            .setter(setter(Builder::customPluginArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("customPluginArn").build()).build();

    private static final SdkField CUSTOM_PLUGIN_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("customPluginState").getter(getter(DescribeCustomPluginResponse::customPluginStateAsString))
            .setter(setter(Builder::customPluginState))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("customPluginState").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("description").getter(getter(DescribeCustomPluginResponse::description))
            .setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField LATEST_REVISION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("latestRevision")
            .getter(getter(DescribeCustomPluginResponse::latestRevision)).setter(setter(Builder::latestRevision))
            .constructor(CustomPluginRevisionSummary::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("latestRevision").build()).build();

    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(DescribeCustomPluginResponse::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField STATE_DESCRIPTION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("stateDescription")
            .getter(getter(DescribeCustomPluginResponse::stateDescription)).setter(setter(Builder::stateDescription))
            .constructor(StateDescription::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stateDescription").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATION_TIME_FIELD,
            CUSTOM_PLUGIN_ARN_FIELD, CUSTOM_PLUGIN_STATE_FIELD, DESCRIPTION_FIELD, LATEST_REVISION_FIELD, NAME_FIELD,
            STATE_DESCRIPTION_FIELD));

    private final Instant creationTime;

    private final String customPluginArn;

    private final String customPluginState;

    private final String description;

    private final CustomPluginRevisionSummary latestRevision;

    private final String name;

    private final StateDescription stateDescription;

    private DescribeCustomPluginResponse(BuilderImpl builder) {
        super(builder);
        this.creationTime = builder.creationTime;
        this.customPluginArn = builder.customPluginArn;
        this.customPluginState = builder.customPluginState;
        this.description = builder.description;
        this.latestRevision = builder.latestRevision;
        this.name = builder.name;
        this.stateDescription = builder.stateDescription;
    }

    /**
     * 

* The time that the custom plugin was created. *

* * @return The time that the custom plugin was created. */ public final Instant creationTime() { return creationTime; } /** *

* The Amazon Resource Name (ARN) of the custom plugin. *

* * @return The Amazon Resource Name (ARN) of the custom plugin. */ public final String customPluginArn() { return customPluginArn; } /** *

* The state of the custom plugin. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #customPluginState} * will return {@link CustomPluginState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #customPluginStateAsString}. *

* * @return The state of the custom plugin. * @see CustomPluginState */ public final CustomPluginState customPluginState() { return CustomPluginState.fromValue(customPluginState); } /** *

* The state of the custom plugin. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #customPluginState} * will return {@link CustomPluginState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #customPluginStateAsString}. *

* * @return The state of the custom plugin. * @see CustomPluginState */ public final String customPluginStateAsString() { return customPluginState; } /** *

* The description of the custom plugin. *

* * @return The description of the custom plugin. */ public final String description() { return description; } /** *

* The latest successfully created revision of the custom plugin. If there are no successfully created revisions, * this field will be absent. *

* * @return The latest successfully created revision of the custom plugin. If there are no successfully created * revisions, this field will be absent. */ public final CustomPluginRevisionSummary latestRevision() { return latestRevision; } /** *

* The name of the custom plugin. *

* * @return The name of the custom plugin. */ public final String name() { return name; } /** *

* Details about the state of a custom plugin. *

* * @return Details about the state of a custom plugin. */ public final StateDescription stateDescription() { return stateDescription; } @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(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(customPluginArn()); hashCode = 31 * hashCode + Objects.hashCode(customPluginStateAsString()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(latestRevision()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(stateDescription()); 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 DescribeCustomPluginResponse)) { return false; } DescribeCustomPluginResponse other = (DescribeCustomPluginResponse) obj; return Objects.equals(creationTime(), other.creationTime()) && Objects.equals(customPluginArn(), other.customPluginArn()) && Objects.equals(customPluginStateAsString(), other.customPluginStateAsString()) && Objects.equals(description(), other.description()) && Objects.equals(latestRevision(), other.latestRevision()) && Objects.equals(name(), other.name()) && Objects.equals(stateDescription(), other.stateDescription()); } /** * 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("DescribeCustomPluginResponse").add("CreationTime", creationTime()) .add("CustomPluginArn", customPluginArn()).add("CustomPluginState", customPluginStateAsString()) .add("Description", description()).add("LatestRevision", latestRevision()).add("Name", name()) .add("StateDescription", stateDescription()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "creationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "customPluginArn": return Optional.ofNullable(clazz.cast(customPluginArn())); case "customPluginState": return Optional.ofNullable(clazz.cast(customPluginStateAsString())); case "description": return Optional.ofNullable(clazz.cast(description())); case "latestRevision": return Optional.ofNullable(clazz.cast(latestRevision())); case "name": return Optional.ofNullable(clazz.cast(name())); case "stateDescription": return Optional.ofNullable(clazz.cast(stateDescription())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeCustomPluginResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends KafkaConnectResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The time that the custom plugin was created. *

* * @param creationTime * The time that the custom plugin was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* The Amazon Resource Name (ARN) of the custom plugin. *

* * @param customPluginArn * The Amazon Resource Name (ARN) of the custom plugin. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customPluginArn(String customPluginArn); /** *

* The state of the custom plugin. *

* * @param customPluginState * The state of the custom plugin. * @see CustomPluginState * @return Returns a reference to this object so that method calls can be chained together. * @see CustomPluginState */ Builder customPluginState(String customPluginState); /** *

* The state of the custom plugin. *

* * @param customPluginState * The state of the custom plugin. * @see CustomPluginState * @return Returns a reference to this object so that method calls can be chained together. * @see CustomPluginState */ Builder customPluginState(CustomPluginState customPluginState); /** *

* The description of the custom plugin. *

* * @param description * The description of the custom plugin. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The latest successfully created revision of the custom plugin. If there are no successfully created * revisions, this field will be absent. *

* * @param latestRevision * The latest successfully created revision of the custom plugin. If there are no successfully created * revisions, this field will be absent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder latestRevision(CustomPluginRevisionSummary latestRevision); /** *

* The latest successfully created revision of the custom plugin. If there are no successfully created * revisions, this field will be absent. *

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

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

* The name of the custom plugin. *

* * @param name * The name of the custom plugin. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* Details about the state of a custom plugin. *

* * @param stateDescription * Details about the state of a custom plugin. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stateDescription(StateDescription stateDescription); /** *

* Details about the state of a custom plugin. *

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

* When the {@link Consumer} completes, {@link StateDescription.Builder#build()} is called immediately and its * result is passed to {@link #stateDescription(StateDescription)}. * * @param stateDescription * a consumer that will call methods on {@link StateDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #stateDescription(StateDescription) */ default Builder stateDescription(Consumer stateDescription) { return stateDescription(StateDescription.builder().applyMutation(stateDescription).build()); } } static final class BuilderImpl extends KafkaConnectResponse.BuilderImpl implements Builder { private Instant creationTime; private String customPluginArn; private String customPluginState; private String description; private CustomPluginRevisionSummary latestRevision; private String name; private StateDescription stateDescription; private BuilderImpl() { } private BuilderImpl(DescribeCustomPluginResponse model) { super(model); creationTime(model.creationTime); customPluginArn(model.customPluginArn); customPluginState(model.customPluginState); description(model.description); latestRevision(model.latestRevision); name(model.name); stateDescription(model.stateDescription); } 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 getCustomPluginArn() { return customPluginArn; } public final void setCustomPluginArn(String customPluginArn) { this.customPluginArn = customPluginArn; } @Override public final Builder customPluginArn(String customPluginArn) { this.customPluginArn = customPluginArn; return this; } public final String getCustomPluginState() { return customPluginState; } public final void setCustomPluginState(String customPluginState) { this.customPluginState = customPluginState; } @Override public final Builder customPluginState(String customPluginState) { this.customPluginState = customPluginState; return this; } @Override public final Builder customPluginState(CustomPluginState customPluginState) { this.customPluginState(customPluginState == null ? null : customPluginState.toString()); return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final CustomPluginRevisionSummary.Builder getLatestRevision() { return latestRevision != null ? latestRevision.toBuilder() : null; } public final void setLatestRevision(CustomPluginRevisionSummary.BuilderImpl latestRevision) { this.latestRevision = latestRevision != null ? latestRevision.build() : null; } @Override public final Builder latestRevision(CustomPluginRevisionSummary latestRevision) { this.latestRevision = latestRevision; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final StateDescription.Builder getStateDescription() { return stateDescription != null ? stateDescription.toBuilder() : null; } public final void setStateDescription(StateDescription.BuilderImpl stateDescription) { this.stateDescription = stateDescription != null ? stateDescription.build() : null; } @Override public final Builder stateDescription(StateDescription stateDescription) { this.stateDescription = stateDescription; return this; } @Override public DescribeCustomPluginResponse build() { return new DescribeCustomPluginResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy