
software.amazon.awssdk.services.guardduty.model.OrganizationAdditionalConfigurationResult Maven / Gradle / Ivy
/*
* 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.guardduty.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.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;
/**
*
* A list of additional configuration which will be configured for the organization.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OrganizationAdditionalConfigurationResult implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(OrganizationAdditionalConfigurationResult::nameAsString)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField AUTO_ENABLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AutoEnable").getter(getter(OrganizationAdditionalConfigurationResult::autoEnableAsString))
.setter(setter(Builder::autoEnable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("autoEnable").build()).build();
private static final List> SDK_FIELDS = Collections
.unmodifiableList(Arrays.asList(NAME_FIELD, AUTO_ENABLE_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final String autoEnable;
private OrganizationAdditionalConfigurationResult(BuilderImpl builder) {
this.name = builder.name;
this.autoEnable = builder.autoEnable;
}
/**
*
* The name of the additional configuration that is configured for the member accounts within the organization.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #name} will return
* {@link OrgFeatureAdditionalConfiguration#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #nameAsString}.
*
*
* @return The name of the additional configuration that is configured for the member accounts within the
* organization.
* @see OrgFeatureAdditionalConfiguration
*/
public final OrgFeatureAdditionalConfiguration name() {
return OrgFeatureAdditionalConfiguration.fromValue(name);
}
/**
*
* The name of the additional configuration that is configured for the member accounts within the organization.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #name} will return
* {@link OrgFeatureAdditionalConfiguration#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #nameAsString}.
*
*
* @return The name of the additional configuration that is configured for the member accounts within the
* organization.
* @see OrgFeatureAdditionalConfiguration
*/
public final String nameAsString() {
return name;
}
/**
*
* Describes how The status of the additional configuration that are configured for the member accounts within the
* organization.
*
*
* If you set AutoEnable
to NEW
, a feature will be configured for only the new accounts
* when they join the organization.
*
*
* If you set AutoEnable
to NONE
, no feature will be configured for the accounts when they
* join the organization.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #autoEnable} will
* return {@link OrgFeatureStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #autoEnableAsString}.
*
*
* @return Describes how The status of the additional configuration that are configured for the member accounts
* within the organization.
*
* If you set AutoEnable
to NEW
, a feature will be configured for only the new
* accounts when they join the organization.
*
*
* If you set AutoEnable
to NONE
, no feature will be configured for the accounts
* when they join the organization.
* @see OrgFeatureStatus
*/
public final OrgFeatureStatus autoEnable() {
return OrgFeatureStatus.fromValue(autoEnable);
}
/**
*
* Describes how The status of the additional configuration that are configured for the member accounts within the
* organization.
*
*
* If you set AutoEnable
to NEW
, a feature will be configured for only the new accounts
* when they join the organization.
*
*
* If you set AutoEnable
to NONE
, no feature will be configured for the accounts when they
* join the organization.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #autoEnable} will
* return {@link OrgFeatureStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #autoEnableAsString}.
*
*
* @return Describes how The status of the additional configuration that are configured for the member accounts
* within the organization.
*
* If you set AutoEnable
to NEW
, a feature will be configured for only the new
* accounts when they join the organization.
*
*
* If you set AutoEnable
to NONE
, no feature will be configured for the accounts
* when they join the organization.
* @see OrgFeatureStatus
*/
public final String autoEnableAsString() {
return autoEnable;
}
@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(nameAsString());
hashCode = 31 * hashCode + Objects.hashCode(autoEnableAsString());
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 OrganizationAdditionalConfigurationResult)) {
return false;
}
OrganizationAdditionalConfigurationResult other = (OrganizationAdditionalConfigurationResult) obj;
return Objects.equals(nameAsString(), other.nameAsString())
&& Objects.equals(autoEnableAsString(), other.autoEnableAsString());
}
/**
* 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("OrganizationAdditionalConfigurationResult").add("Name", nameAsString())
.add("AutoEnable", autoEnableAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(nameAsString()));
case "AutoEnable":
return Optional.ofNullable(clazz.cast(autoEnableAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* If you set AutoEnable
to NEW
, a feature will be configured for only the new
* accounts when they join the organization.
*
*
* If you set AutoEnable
to NONE
, no feature will be configured for the
* accounts when they join the organization.
* @see OrgFeatureStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see OrgFeatureStatus
*/
Builder autoEnable(String autoEnable);
/**
*
* Describes how The status of the additional configuration that are configured for the member accounts within
* the organization.
*
*
* If you set AutoEnable
to NEW
, a feature will be configured for only the new
* accounts when they join the organization.
*
*
* If you set AutoEnable
to NONE
, no feature will be configured for the accounts when
* they join the organization.
*
*
* @param autoEnable
* Describes how The status of the additional configuration that are configured for the member accounts
* within the organization.
*
* If you set AutoEnable
to NEW
, a feature will be configured for only the new
* accounts when they join the organization.
*
*
* If you set AutoEnable
to NONE
, no feature will be configured for the
* accounts when they join the organization.
* @see OrgFeatureStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see OrgFeatureStatus
*/
Builder autoEnable(OrgFeatureStatus autoEnable);
}
static final class BuilderImpl implements Builder {
private String name;
private String autoEnable;
private BuilderImpl() {
}
private BuilderImpl(OrganizationAdditionalConfigurationResult model) {
name(model.name);
autoEnable(model.autoEnable);
}
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;
}
@Override
public final Builder name(OrgFeatureAdditionalConfiguration name) {
this.name(name == null ? null : name.toString());
return this;
}
public final String getAutoEnable() {
return autoEnable;
}
public final void setAutoEnable(String autoEnable) {
this.autoEnable = autoEnable;
}
@Override
public final Builder autoEnable(String autoEnable) {
this.autoEnable = autoEnable;
return this;
}
@Override
public final Builder autoEnable(OrgFeatureStatus autoEnable) {
this.autoEnable(autoEnable == null ? null : autoEnable.toString());
return this;
}
@Override
public OrganizationAdditionalConfigurationResult build() {
return new OrganizationAdditionalConfigurationResult(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}