software.amazon.awssdk.services.kafka.model.Provisioned Maven / Gradle / Ivy
Show all versions of kafka 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.kafka.model;
import java.io.Serializable;
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;
/**
*
*
* Provisioned cluster.
*
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Provisioned implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField BROKER_NODE_GROUP_INFO_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BrokerNodeGroupInfo")
.getter(getter(Provisioned::brokerNodeGroupInfo)).setter(setter(Builder::brokerNodeGroupInfo))
.constructor(BrokerNodeGroupInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("brokerNodeGroupInfo").build())
.build();
private static final SdkField CURRENT_BROKER_SOFTWARE_INFO_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CurrentBrokerSoftwareInfo")
.getter(getter(Provisioned::currentBrokerSoftwareInfo)).setter(setter(Builder::currentBrokerSoftwareInfo))
.constructor(BrokerSoftwareInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("currentBrokerSoftwareInfo").build())
.build();
private static final SdkField CLIENT_AUTHENTICATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ClientAuthentication")
.getter(getter(Provisioned::clientAuthentication)).setter(setter(Builder::clientAuthentication))
.constructor(ClientAuthentication::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientAuthentication").build())
.build();
private static final SdkField ENCRYPTION_INFO_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("EncryptionInfo")
.getter(getter(Provisioned::encryptionInfo)).setter(setter(Builder::encryptionInfo))
.constructor(EncryptionInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionInfo").build()).build();
private static final SdkField ENHANCED_MONITORING_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EnhancedMonitoring").getter(getter(Provisioned::enhancedMonitoringAsString))
.setter(setter(Builder::enhancedMonitoring))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("enhancedMonitoring").build())
.build();
private static final SdkField OPEN_MONITORING_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("OpenMonitoring")
.getter(getter(Provisioned::openMonitoring)).setter(setter(Builder::openMonitoring))
.constructor(OpenMonitoringInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("openMonitoring").build()).build();
private static final SdkField LOGGING_INFO_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("LoggingInfo").getter(getter(Provisioned::loggingInfo)).setter(setter(Builder::loggingInfo))
.constructor(LoggingInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("loggingInfo").build()).build();
private static final SdkField NUMBER_OF_BROKER_NODES_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("NumberOfBrokerNodes").getter(getter(Provisioned::numberOfBrokerNodes))
.setter(setter(Builder::numberOfBrokerNodes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("numberOfBrokerNodes").build())
.build();
private static final SdkField ZOOKEEPER_CONNECT_STRING_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ZookeeperConnectString").getter(getter(Provisioned::zookeeperConnectString))
.setter(setter(Builder::zookeeperConnectString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("zookeeperConnectString").build())
.build();
private static final SdkField ZOOKEEPER_CONNECT_STRING_TLS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ZookeeperConnectStringTls").getter(getter(Provisioned::zookeeperConnectStringTls))
.setter(setter(Builder::zookeeperConnectStringTls))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("zookeeperConnectStringTls").build())
.build();
private static final SdkField STORAGE_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StorageMode").getter(getter(Provisioned::storageModeAsString)).setter(setter(Builder::storageMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("storageMode").build()).build();
private static final SdkField CUSTOMER_ACTION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CustomerActionStatus").getter(getter(Provisioned::customerActionStatusAsString))
.setter(setter(Builder::customerActionStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("customerActionStatus").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BROKER_NODE_GROUP_INFO_FIELD,
CURRENT_BROKER_SOFTWARE_INFO_FIELD, CLIENT_AUTHENTICATION_FIELD, ENCRYPTION_INFO_FIELD, ENHANCED_MONITORING_FIELD,
OPEN_MONITORING_FIELD, LOGGING_INFO_FIELD, NUMBER_OF_BROKER_NODES_FIELD, ZOOKEEPER_CONNECT_STRING_FIELD,
ZOOKEEPER_CONNECT_STRING_TLS_FIELD, STORAGE_MODE_FIELD, CUSTOMER_ACTION_STATUS_FIELD));
private static final long serialVersionUID = 1L;
private final BrokerNodeGroupInfo brokerNodeGroupInfo;
private final BrokerSoftwareInfo currentBrokerSoftwareInfo;
private final ClientAuthentication clientAuthentication;
private final EncryptionInfo encryptionInfo;
private final String enhancedMonitoring;
private final OpenMonitoringInfo openMonitoring;
private final LoggingInfo loggingInfo;
private final Integer numberOfBrokerNodes;
private final String zookeeperConnectString;
private final String zookeeperConnectStringTls;
private final String storageMode;
private final String customerActionStatus;
private Provisioned(BuilderImpl builder) {
this.brokerNodeGroupInfo = builder.brokerNodeGroupInfo;
this.currentBrokerSoftwareInfo = builder.currentBrokerSoftwareInfo;
this.clientAuthentication = builder.clientAuthentication;
this.encryptionInfo = builder.encryptionInfo;
this.enhancedMonitoring = builder.enhancedMonitoring;
this.openMonitoring = builder.openMonitoring;
this.loggingInfo = builder.loggingInfo;
this.numberOfBrokerNodes = builder.numberOfBrokerNodes;
this.zookeeperConnectString = builder.zookeeperConnectString;
this.zookeeperConnectStringTls = builder.zookeeperConnectStringTls;
this.storageMode = builder.storageMode;
this.customerActionStatus = builder.customerActionStatus;
}
/**
*
*
* Information about the brokers.
*
*
* @return
* Information about the brokers.
*
*/
public final BrokerNodeGroupInfo brokerNodeGroupInfo() {
return brokerNodeGroupInfo;
}
/**
*
*
* Information about the Apache Kafka version deployed on the brokers.
*
*
* @return
* Information about the Apache Kafka version deployed on the brokers.
*
*/
public final BrokerSoftwareInfo currentBrokerSoftwareInfo() {
return currentBrokerSoftwareInfo;
}
/**
*
*
* Includes all client authentication information.
*
*
* @return
* Includes all client authentication information.
*
*/
public final ClientAuthentication clientAuthentication() {
return clientAuthentication;
}
/**
*
*
* Includes all encryption-related information.
*
*
* @return
* Includes all encryption-related information.
*
*/
public final EncryptionInfo encryptionInfo() {
return encryptionInfo;
}
/**
*
*
* Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER,
* PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #enhancedMonitoring} will return {@link EnhancedMonitoring#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #enhancedMonitoringAsString}.
*
*
* @return
* Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER,
* PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.
*
* @see EnhancedMonitoring
*/
public final EnhancedMonitoring enhancedMonitoring() {
return EnhancedMonitoring.fromValue(enhancedMonitoring);
}
/**
*
*
* Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER,
* PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #enhancedMonitoring} will return {@link EnhancedMonitoring#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #enhancedMonitoringAsString}.
*
*
* @return
* Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER,
* PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.
*
* @see EnhancedMonitoring
*/
public final String enhancedMonitoringAsString() {
return enhancedMonitoring;
}
/**
*
*
* The settings for open monitoring.
*
*
* @return
* The settings for open monitoring.
*
*/
public final OpenMonitoringInfo openMonitoring() {
return openMonitoring;
}
/**
*
*
* Log delivery information for the cluster.
*
*
* @return
* Log delivery information for the cluster.
*
*/
public final LoggingInfo loggingInfo() {
return loggingInfo;
}
/**
*
*
* The number of broker nodes in the cluster.
*
*
* @return
* The number of broker nodes in the cluster.
*
*/
public final Integer numberOfBrokerNodes() {
return numberOfBrokerNodes;
}
/**
*
*
* The connection string to use to connect to the Apache ZooKeeper cluster.
*
*
* @return
* The connection string to use to connect to the Apache ZooKeeper cluster.
*
*/
public final String zookeeperConnectString() {
return zookeeperConnectString;
}
/**
*
*
* The connection string to use to connect to the Apache ZooKeeper cluster on a TLS port.
*
*
* @return
* The connection string to use to connect to the Apache ZooKeeper cluster on a TLS port.
*
*/
public final String zookeeperConnectStringTls() {
return zookeeperConnectStringTls;
}
/**
*
*
* This controls storage mode for supported storage tiers.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageMode} will
* return {@link StorageMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageModeAsString}.
*
*
* @return
* This controls storage mode for supported storage tiers.
*
* @see StorageMode
*/
public final StorageMode storageMode() {
return StorageMode.fromValue(storageMode);
}
/**
*
*
* This controls storage mode for supported storage tiers.
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageMode} will
* return {@link StorageMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageModeAsString}.
*
*
* @return
* This controls storage mode for supported storage tiers.
*
* @see StorageMode
*/
public final String storageModeAsString() {
return storageMode;
}
/**
*
*
* Determines if there is an action required from the customer.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #customerActionStatus} will return {@link CustomerActionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #customerActionStatusAsString}.
*
*
* @return
* Determines if there is an action required from the customer.
*
* @see CustomerActionStatus
*/
public final CustomerActionStatus customerActionStatus() {
return CustomerActionStatus.fromValue(customerActionStatus);
}
/**
*
*
* Determines if there is an action required from the customer.
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #customerActionStatus} will return {@link CustomerActionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #customerActionStatusAsString}.
*
*
* @return
* Determines if there is an action required from the customer.
*
* @see CustomerActionStatus
*/
public final String customerActionStatusAsString() {
return customerActionStatus;
}
@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 + Objects.hashCode(brokerNodeGroupInfo());
hashCode = 31 * hashCode + Objects.hashCode(currentBrokerSoftwareInfo());
hashCode = 31 * hashCode + Objects.hashCode(clientAuthentication());
hashCode = 31 * hashCode + Objects.hashCode(encryptionInfo());
hashCode = 31 * hashCode + Objects.hashCode(enhancedMonitoringAsString());
hashCode = 31 * hashCode + Objects.hashCode(openMonitoring());
hashCode = 31 * hashCode + Objects.hashCode(loggingInfo());
hashCode = 31 * hashCode + Objects.hashCode(numberOfBrokerNodes());
hashCode = 31 * hashCode + Objects.hashCode(zookeeperConnectString());
hashCode = 31 * hashCode + Objects.hashCode(zookeeperConnectStringTls());
hashCode = 31 * hashCode + Objects.hashCode(storageModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(customerActionStatusAsString());
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 Provisioned)) {
return false;
}
Provisioned other = (Provisioned) obj;
return Objects.equals(brokerNodeGroupInfo(), other.brokerNodeGroupInfo())
&& Objects.equals(currentBrokerSoftwareInfo(), other.currentBrokerSoftwareInfo())
&& Objects.equals(clientAuthentication(), other.clientAuthentication())
&& Objects.equals(encryptionInfo(), other.encryptionInfo())
&& Objects.equals(enhancedMonitoringAsString(), other.enhancedMonitoringAsString())
&& Objects.equals(openMonitoring(), other.openMonitoring()) && Objects.equals(loggingInfo(), other.loggingInfo())
&& Objects.equals(numberOfBrokerNodes(), other.numberOfBrokerNodes())
&& Objects.equals(zookeeperConnectString(), other.zookeeperConnectString())
&& Objects.equals(zookeeperConnectStringTls(), other.zookeeperConnectStringTls())
&& Objects.equals(storageModeAsString(), other.storageModeAsString())
&& Objects.equals(customerActionStatusAsString(), other.customerActionStatusAsString());
}
/**
* 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("Provisioned").add("BrokerNodeGroupInfo", brokerNodeGroupInfo())
.add("CurrentBrokerSoftwareInfo", currentBrokerSoftwareInfo())
.add("ClientAuthentication", clientAuthentication()).add("EncryptionInfo", encryptionInfo())
.add("EnhancedMonitoring", enhancedMonitoringAsString()).add("OpenMonitoring", openMonitoring())
.add("LoggingInfo", loggingInfo()).add("NumberOfBrokerNodes", numberOfBrokerNodes())
.add("ZookeeperConnectString", zookeeperConnectString())
.add("ZookeeperConnectStringTls", zookeeperConnectStringTls()).add("StorageMode", storageModeAsString())
.add("CustomerActionStatus", customerActionStatusAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BrokerNodeGroupInfo":
return Optional.ofNullable(clazz.cast(brokerNodeGroupInfo()));
case "CurrentBrokerSoftwareInfo":
return Optional.ofNullable(clazz.cast(currentBrokerSoftwareInfo()));
case "ClientAuthentication":
return Optional.ofNullable(clazz.cast(clientAuthentication()));
case "EncryptionInfo":
return Optional.ofNullable(clazz.cast(encryptionInfo()));
case "EnhancedMonitoring":
return Optional.ofNullable(clazz.cast(enhancedMonitoringAsString()));
case "OpenMonitoring":
return Optional.ofNullable(clazz.cast(openMonitoring()));
case "LoggingInfo":
return Optional.ofNullable(clazz.cast(loggingInfo()));
case "NumberOfBrokerNodes":
return Optional.ofNullable(clazz.cast(numberOfBrokerNodes()));
case "ZookeeperConnectString":
return Optional.ofNullable(clazz.cast(zookeeperConnectString()));
case "ZookeeperConnectStringTls":
return Optional.ofNullable(clazz.cast(zookeeperConnectStringTls()));
case "StorageMode":
return Optional.ofNullable(clazz.cast(storageModeAsString()));
case "CustomerActionStatus":
return Optional.ofNullable(clazz.cast(customerActionStatusAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function