software.amazon.awssdk.services.kafkaconnect.model.DescribeCustomPluginResponse Maven / Gradle / Ivy
Show all versions of kafkaconnect Show documentation
/*
* 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 extends Builder> 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