software.amazon.awssdk.services.mq.model.UpdateBrokerResponse Maven / Gradle / Ivy
Show all versions of mq 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.mq.model;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 UpdateBrokerResponse extends MqResponse implements
ToCopyableBuilder {
private static final SdkField AUTHENTICATION_STRATEGY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AuthenticationStrategy").getter(getter(UpdateBrokerResponse::authenticationStrategyAsString))
.setter(setter(Builder::authenticationStrategy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authenticationStrategy").build())
.build();
private static final SdkField AUTO_MINOR_VERSION_UPGRADE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutoMinorVersionUpgrade").getter(getter(UpdateBrokerResponse::autoMinorVersionUpgrade))
.setter(setter(Builder::autoMinorVersionUpgrade))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("autoMinorVersionUpgrade").build())
.build();
private static final SdkField BROKER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BrokerId").getter(getter(UpdateBrokerResponse::brokerId)).setter(setter(Builder::brokerId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("brokerId").build()).build();
private static final SdkField CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Configuration")
.getter(getter(UpdateBrokerResponse::configuration)).setter(setter(Builder::configuration))
.constructor(ConfigurationId::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("configuration").build()).build();
private static final SdkField ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EngineVersion").getter(getter(UpdateBrokerResponse::engineVersion))
.setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("engineVersion").build()).build();
private static final SdkField HOST_INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HostInstanceType").getter(getter(UpdateBrokerResponse::hostInstanceType))
.setter(setter(Builder::hostInstanceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("hostInstanceType").build()).build();
private static final SdkField LDAP_SERVER_METADATA_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("LdapServerMetadata")
.getter(getter(UpdateBrokerResponse::ldapServerMetadata)).setter(setter(Builder::ldapServerMetadata))
.constructor(LdapServerMetadataOutput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ldapServerMetadata").build())
.build();
private static final SdkField LOGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO).memberName("Logs")
.getter(getter(UpdateBrokerResponse::logs)).setter(setter(Builder::logs)).constructor(Logs::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logs").build()).build();
private static final SdkField MAINTENANCE_WINDOW_START_TIME_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("MaintenanceWindowStartTime")
.getter(getter(UpdateBrokerResponse::maintenanceWindowStartTime))
.setter(setter(Builder::maintenanceWindowStartTime))
.constructor(WeeklyStartTime::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("maintenanceWindowStartTime").build())
.build();
private static final SdkField> SECURITY_GROUPS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SecurityGroups")
.getter(getter(UpdateBrokerResponse::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 DATA_REPLICATION_METADATA_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DataReplicationMetadata")
.getter(getter(UpdateBrokerResponse::dataReplicationMetadata)).setter(setter(Builder::dataReplicationMetadata))
.constructor(DataReplicationMetadataOutput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataReplicationMetadata").build())
.build();
private static final SdkField DATA_REPLICATION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DataReplicationMode").getter(getter(UpdateBrokerResponse::dataReplicationModeAsString))
.setter(setter(Builder::dataReplicationMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataReplicationMode").build())
.build();
private static final SdkField PENDING_DATA_REPLICATION_METADATA_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("PendingDataReplicationMetadata")
.getter(getter(UpdateBrokerResponse::pendingDataReplicationMetadata))
.setter(setter(Builder::pendingDataReplicationMetadata))
.constructor(DataReplicationMetadataOutput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pendingDataReplicationMetadata")
.build()).build();
private static final SdkField PENDING_DATA_REPLICATION_MODE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("PendingDataReplicationMode")
.getter(getter(UpdateBrokerResponse::pendingDataReplicationModeAsString))
.setter(setter(Builder::pendingDataReplicationMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pendingDataReplicationMode").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AUTHENTICATION_STRATEGY_FIELD,
AUTO_MINOR_VERSION_UPGRADE_FIELD, BROKER_ID_FIELD, CONFIGURATION_FIELD, ENGINE_VERSION_FIELD,
HOST_INSTANCE_TYPE_FIELD, LDAP_SERVER_METADATA_FIELD, LOGS_FIELD, MAINTENANCE_WINDOW_START_TIME_FIELD,
SECURITY_GROUPS_FIELD, DATA_REPLICATION_METADATA_FIELD, DATA_REPLICATION_MODE_FIELD,
PENDING_DATA_REPLICATION_METADATA_FIELD, PENDING_DATA_REPLICATION_MODE_FIELD));
private final String authenticationStrategy;
private final Boolean autoMinorVersionUpgrade;
private final String brokerId;
private final ConfigurationId configuration;
private final String engineVersion;
private final String hostInstanceType;
private final LdapServerMetadataOutput ldapServerMetadata;
private final Logs logs;
private final WeeklyStartTime maintenanceWindowStartTime;
private final List securityGroups;
private final DataReplicationMetadataOutput dataReplicationMetadata;
private final String dataReplicationMode;
private final DataReplicationMetadataOutput pendingDataReplicationMetadata;
private final String pendingDataReplicationMode;
private UpdateBrokerResponse(BuilderImpl builder) {
super(builder);
this.authenticationStrategy = builder.authenticationStrategy;
this.autoMinorVersionUpgrade = builder.autoMinorVersionUpgrade;
this.brokerId = builder.brokerId;
this.configuration = builder.configuration;
this.engineVersion = builder.engineVersion;
this.hostInstanceType = builder.hostInstanceType;
this.ldapServerMetadata = builder.ldapServerMetadata;
this.logs = builder.logs;
this.maintenanceWindowStartTime = builder.maintenanceWindowStartTime;
this.securityGroups = builder.securityGroups;
this.dataReplicationMetadata = builder.dataReplicationMetadata;
this.dataReplicationMode = builder.dataReplicationMode;
this.pendingDataReplicationMetadata = builder.pendingDataReplicationMetadata;
this.pendingDataReplicationMode = builder.pendingDataReplicationMode;
}
/**
*
* Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authenticationStrategy} will return {@link AuthenticationStrategy#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #authenticationStrategyAsString}.
*
*
* @return Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
* @see AuthenticationStrategy
*/
public final AuthenticationStrategy authenticationStrategy() {
return AuthenticationStrategy.fromValue(authenticationStrategy);
}
/**
*
* Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #authenticationStrategy} will return {@link AuthenticationStrategy#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #authenticationStrategyAsString}.
*
*
* @return Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
* @see AuthenticationStrategy
*/
public final String authenticationStrategyAsString() {
return authenticationStrategy;
}
/**
*
* Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon
* MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot.
*
*
* @return Enables automatic upgrades to new patch versions for brokers as new versions are released and supported
* by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker
* reboot.
*/
public final Boolean autoMinorVersionUpgrade() {
return autoMinorVersionUpgrade;
}
/**
*
* Required. The unique ID that Amazon MQ generates for the broker.
*
*
* @return Required. The unique ID that Amazon MQ generates for the broker.
*/
public final String brokerId() {
return brokerId;
}
/**
*
* The ID of the updated configuration.
*
*
* @return The ID of the updated configuration.
*/
public final ConfigurationId configuration() {
return configuration;
}
/**
*
* The broker engine version to upgrade to. For more information, see the ActiveMQ
* version management and the RabbitMQ
* version management sections in the Amazon MQ Developer Guide.
*
*
* @return The broker engine version to upgrade to. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide.
*/
public final String engineVersion() {
return engineVersion;
}
/**
*
* The broker's host instance type to upgrade to. For a list of supported instance types, see Broker
* instance types.
*
*
* @return The broker's host instance type to upgrade to. For a list of supported instance types, see Broker instance types.
*/
public final String hostInstanceType() {
return hostInstanceType;
}
/**
*
* Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not
* apply to RabbitMQ brokers.
*
*
* @return Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker.
* Does not apply to RabbitMQ brokers.
*/
public final LdapServerMetadataOutput ldapServerMetadata() {
return ldapServerMetadata;
}
/**
*
* The list of information about logs to be enabled for the specified broker.
*
*
* @return The list of information about logs to be enabled for the specified broker.
*/
public final Logs logs() {
return logs;
}
/**
*
* The parameters that determine the WeeklyStartTime.
*
*
* @return The parameters that determine the WeeklyStartTime.
*/
public final WeeklyStartTime maintenanceWindowStartTime() {
return maintenanceWindowStartTime;
}
/**
* 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 (1 minimum, 5 maximum) that authorizes connections to brokers.
*
*
* 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 (1 minimum, 5 maximum) that authorizes connections to brokers.
*/
public final List securityGroups() {
return securityGroups;
}
/**
*
* The replication details of the data replication-enabled broker. Only returned if dataReplicationMode is set to
* CRDR.
*
*
* @return The replication details of the data replication-enabled broker. Only returned if dataReplicationMode is
* set to CRDR.
*/
public final DataReplicationMetadataOutput dataReplicationMetadata() {
return dataReplicationMetadata;
}
/**
*
* Describes whether this broker is a part of a data replication pair.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #dataReplicationMode} will return {@link DataReplicationMode#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #dataReplicationModeAsString}.
*
*
* @return Describes whether this broker is a part of a data replication pair.
* @see DataReplicationMode
*/
public final DataReplicationMode dataReplicationMode() {
return DataReplicationMode.fromValue(dataReplicationMode);
}
/**
*
* Describes whether this broker is a part of a data replication pair.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #dataReplicationMode} will return {@link DataReplicationMode#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #dataReplicationModeAsString}.
*
*
* @return Describes whether this broker is a part of a data replication pair.
* @see DataReplicationMode
*/
public final String dataReplicationModeAsString() {
return dataReplicationMode;
}
/**
*
* The pending replication details of the data replication-enabled broker. Only returned if
* pendingDataReplicationMode is set to CRDR.
*
*
* @return The pending replication details of the data replication-enabled broker. Only returned if
* pendingDataReplicationMode is set to CRDR.
*/
public final DataReplicationMetadataOutput pendingDataReplicationMetadata() {
return pendingDataReplicationMetadata;
}
/**
*
* Describes whether this broker will be a part of a data replication pair after reboot.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #pendingDataReplicationMode} will return {@link DataReplicationMode#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #pendingDataReplicationModeAsString}.
*
*
* @return Describes whether this broker will be a part of a data replication pair after reboot.
* @see DataReplicationMode
*/
public final DataReplicationMode pendingDataReplicationMode() {
return DataReplicationMode.fromValue(pendingDataReplicationMode);
}
/**
*
* Describes whether this broker will be a part of a data replication pair after reboot.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #pendingDataReplicationMode} will return {@link DataReplicationMode#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #pendingDataReplicationModeAsString}.
*
*
* @return Describes whether this broker will be a part of a data replication pair after reboot.
* @see DataReplicationMode
*/
public final String pendingDataReplicationModeAsString() {
return pendingDataReplicationMode;
}
@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(authenticationStrategyAsString());
hashCode = 31 * hashCode + Objects.hashCode(autoMinorVersionUpgrade());
hashCode = 31 * hashCode + Objects.hashCode(brokerId());
hashCode = 31 * hashCode + Objects.hashCode(configuration());
hashCode = 31 * hashCode + Objects.hashCode(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(hostInstanceType());
hashCode = 31 * hashCode + Objects.hashCode(ldapServerMetadata());
hashCode = 31 * hashCode + Objects.hashCode(logs());
hashCode = 31 * hashCode + Objects.hashCode(maintenanceWindowStartTime());
hashCode = 31 * hashCode + Objects.hashCode(hasSecurityGroups() ? securityGroups() : null);
hashCode = 31 * hashCode + Objects.hashCode(dataReplicationMetadata());
hashCode = 31 * hashCode + Objects.hashCode(dataReplicationModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(pendingDataReplicationMetadata());
hashCode = 31 * hashCode + Objects.hashCode(pendingDataReplicationModeAsString());
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 UpdateBrokerResponse)) {
return false;
}
UpdateBrokerResponse other = (UpdateBrokerResponse) obj;
return Objects.equals(authenticationStrategyAsString(), other.authenticationStrategyAsString())
&& Objects.equals(autoMinorVersionUpgrade(), other.autoMinorVersionUpgrade())
&& Objects.equals(brokerId(), other.brokerId()) && Objects.equals(configuration(), other.configuration())
&& Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(hostInstanceType(), other.hostInstanceType())
&& Objects.equals(ldapServerMetadata(), other.ldapServerMetadata()) && Objects.equals(logs(), other.logs())
&& Objects.equals(maintenanceWindowStartTime(), other.maintenanceWindowStartTime())
&& hasSecurityGroups() == other.hasSecurityGroups() && Objects.equals(securityGroups(), other.securityGroups())
&& Objects.equals(dataReplicationMetadata(), other.dataReplicationMetadata())
&& Objects.equals(dataReplicationModeAsString(), other.dataReplicationModeAsString())
&& Objects.equals(pendingDataReplicationMetadata(), other.pendingDataReplicationMetadata())
&& Objects.equals(pendingDataReplicationModeAsString(), other.pendingDataReplicationModeAsString());
}
/**
* 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("UpdateBrokerResponse").add("AuthenticationStrategy", authenticationStrategyAsString())
.add("AutoMinorVersionUpgrade", autoMinorVersionUpgrade()).add("BrokerId", brokerId())
.add("Configuration", configuration()).add("EngineVersion", engineVersion())
.add("HostInstanceType", hostInstanceType()).add("LdapServerMetadata", ldapServerMetadata()).add("Logs", logs())
.add("MaintenanceWindowStartTime", maintenanceWindowStartTime())
.add("SecurityGroups", hasSecurityGroups() ? securityGroups() : null)
.add("DataReplicationMetadata", dataReplicationMetadata())
.add("DataReplicationMode", dataReplicationModeAsString())
.add("PendingDataReplicationMetadata", pendingDataReplicationMetadata())
.add("PendingDataReplicationMode", pendingDataReplicationModeAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AuthenticationStrategy":
return Optional.ofNullable(clazz.cast(authenticationStrategyAsString()));
case "AutoMinorVersionUpgrade":
return Optional.ofNullable(clazz.cast(autoMinorVersionUpgrade()));
case "BrokerId":
return Optional.ofNullable(clazz.cast(brokerId()));
case "Configuration":
return Optional.ofNullable(clazz.cast(configuration()));
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "HostInstanceType":
return Optional.ofNullable(clazz.cast(hostInstanceType()));
case "LdapServerMetadata":
return Optional.ofNullable(clazz.cast(ldapServerMetadata()));
case "Logs":
return Optional.ofNullable(clazz.cast(logs()));
case "MaintenanceWindowStartTime":
return Optional.ofNullable(clazz.cast(maintenanceWindowStartTime()));
case "SecurityGroups":
return Optional.ofNullable(clazz.cast(securityGroups()));
case "DataReplicationMetadata":
return Optional.ofNullable(clazz.cast(dataReplicationMetadata()));
case "DataReplicationMode":
return Optional.ofNullable(clazz.cast(dataReplicationModeAsString()));
case "PendingDataReplicationMetadata":
return Optional.ofNullable(clazz.cast(pendingDataReplicationMetadata()));
case "PendingDataReplicationMode":
return Optional.ofNullable(clazz.cast(pendingDataReplicationModeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function