
software.amazon.awssdk.services.macie2.model.GetAutomatedDiscoveryConfigurationResponse 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.macie2.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.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 GetAutomatedDiscoveryConfigurationResponse extends Macie2Response implements
ToCopyableBuilder {
private static final SdkField CLASSIFICATION_SCOPE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("classificationScopeId")
.getter(getter(GetAutomatedDiscoveryConfigurationResponse::classificationScopeId))
.setter(setter(Builder::classificationScopeId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("classificationScopeId").build())
.build();
private static final SdkField DISABLED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("disabledAt")
.getter(getter(GetAutomatedDiscoveryConfigurationResponse::disabledAt))
.setter(setter(Builder::disabledAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("disabledAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField FIRST_ENABLED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("firstEnabledAt")
.getter(getter(GetAutomatedDiscoveryConfigurationResponse::firstEnabledAt))
.setter(setter(Builder::firstEnabledAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("firstEnabledAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField LAST_UPDATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("lastUpdatedAt")
.getter(getter(GetAutomatedDiscoveryConfigurationResponse::lastUpdatedAt))
.setter(setter(Builder::lastUpdatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField SENSITIVITY_INSPECTION_TEMPLATE_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("sensitivityInspectionTemplateId")
.getter(getter(GetAutomatedDiscoveryConfigurationResponse::sensitivityInspectionTemplateId))
.setter(setter(Builder::sensitivityInspectionTemplateId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sensitivityInspectionTemplateId")
.build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(GetAutomatedDiscoveryConfigurationResponse::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLASSIFICATION_SCOPE_ID_FIELD,
DISABLED_AT_FIELD, FIRST_ENABLED_AT_FIELD, LAST_UPDATED_AT_FIELD, SENSITIVITY_INSPECTION_TEMPLATE_ID_FIELD,
STATUS_FIELD));
private final String classificationScopeId;
private final Instant disabledAt;
private final Instant firstEnabledAt;
private final Instant lastUpdatedAt;
private final String sensitivityInspectionTemplateId;
private final String status;
private GetAutomatedDiscoveryConfigurationResponse(BuilderImpl builder) {
super(builder);
this.classificationScopeId = builder.classificationScopeId;
this.disabledAt = builder.disabledAt;
this.firstEnabledAt = builder.firstEnabledAt;
this.lastUpdatedAt = builder.lastUpdatedAt;
this.sensitivityInspectionTemplateId = builder.sensitivityInspectionTemplateId;
this.status = builder.status;
}
/**
*
* The unique identifier for the classification scope that's used when performing automated sensitive data discovery
* for the account. The classification scope specifies S3 buckets to exclude from automated sensitive data
* discovery.
*
*
* @return The unique identifier for the classification scope that's used when performing automated sensitive data
* discovery for the account. The classification scope specifies S3 buckets to exclude from automated
* sensitive data discovery.
*/
public final String classificationScopeId() {
return classificationScopeId;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, when automated sensitive data discovery was most recently
* disabled for the account. This value is null if automated sensitive data discovery wasn't enabled and
* subsequently disabled for the account.
*
*
* @return The date and time, in UTC and extended ISO 8601 format, when automated sensitive data discovery was most
* recently disabled for the account. This value is null if automated sensitive data discovery wasn't
* enabled and subsequently disabled for the account.
*/
public final Instant disabledAt() {
return disabledAt;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, when automated sensitive data discovery was initially
* enabled for the account. This value is null if automated sensitive data discovery has never been enabled for the
* account.
*
*
* @return The date and time, in UTC and extended ISO 8601 format, when automated sensitive data discovery was
* initially enabled for the account. This value is null if automated sensitive data discovery has never
* been enabled for the account.
*/
public final Instant firstEnabledAt() {
return firstEnabledAt;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, when automated sensitive data discovery was most recently
* enabled or disabled for the account.
*
*
* @return The date and time, in UTC and extended ISO 8601 format, when automated sensitive data discovery was most
* recently enabled or disabled for the account.
*/
public final Instant lastUpdatedAt() {
return lastUpdatedAt;
}
/**
*
* The unique identifier for the sensitivity inspection template that's used when performing automated sensitive
* data discovery for the account. The template specifies which allow lists, custom data identifiers, and managed
* data identifiers to use when analyzing data.
*
*
* @return The unique identifier for the sensitivity inspection template that's used when performing automated
* sensitive data discovery for the account. The template specifies which allow lists, custom data
* identifiers, and managed data identifiers to use when analyzing data.
*/
public final String sensitivityInspectionTemplateId() {
return sensitivityInspectionTemplateId;
}
/**
*
* The current status of the automated sensitive data discovery configuration for the account. Possible values are:
* ENABLED, use the specified settings to perform automated sensitive data discovery activities for the account;
* and, DISABLED, don't perform automated sensitive data discovery activities for the account.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link AutomatedDiscoveryStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The current status of the automated sensitive data discovery configuration for the account. Possible
* values are: ENABLED, use the specified settings to perform automated sensitive data discovery activities
* for the account; and, DISABLED, don't perform automated sensitive data discovery activities for the
* account.
* @see AutomatedDiscoveryStatus
*/
public final AutomatedDiscoveryStatus status() {
return AutomatedDiscoveryStatus.fromValue(status);
}
/**
*
* The current status of the automated sensitive data discovery configuration for the account. Possible values are:
* ENABLED, use the specified settings to perform automated sensitive data discovery activities for the account;
* and, DISABLED, don't perform automated sensitive data discovery activities for the account.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link AutomatedDiscoveryStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The current status of the automated sensitive data discovery configuration for the account. Possible
* values are: ENABLED, use the specified settings to perform automated sensitive data discovery activities
* for the account; and, DISABLED, don't perform automated sensitive data discovery activities for the
* account.
* @see AutomatedDiscoveryStatus
*/
public final String statusAsString() {
return status;
}
@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(classificationScopeId());
hashCode = 31 * hashCode + Objects.hashCode(disabledAt());
hashCode = 31 * hashCode + Objects.hashCode(firstEnabledAt());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedAt());
hashCode = 31 * hashCode + Objects.hashCode(sensitivityInspectionTemplateId());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
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 GetAutomatedDiscoveryConfigurationResponse)) {
return false;
}
GetAutomatedDiscoveryConfigurationResponse other = (GetAutomatedDiscoveryConfigurationResponse) obj;
return Objects.equals(classificationScopeId(), other.classificationScopeId())
&& Objects.equals(disabledAt(), other.disabledAt()) && Objects.equals(firstEnabledAt(), other.firstEnabledAt())
&& Objects.equals(lastUpdatedAt(), other.lastUpdatedAt())
&& Objects.equals(sensitivityInspectionTemplateId(), other.sensitivityInspectionTemplateId())
&& Objects.equals(statusAsString(), other.statusAsString());
}
/**
* 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("GetAutomatedDiscoveryConfigurationResponse")
.add("ClassificationScopeId", classificationScopeId()).add("DisabledAt", disabledAt())
.add("FirstEnabledAt", firstEnabledAt()).add("LastUpdatedAt", lastUpdatedAt())
.add("SensitivityInspectionTemplateId", sensitivityInspectionTemplateId()).add("Status", statusAsString())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "classificationScopeId":
return Optional.ofNullable(clazz.cast(classificationScopeId()));
case "disabledAt":
return Optional.ofNullable(clazz.cast(disabledAt()));
case "firstEnabledAt":
return Optional.ofNullable(clazz.cast(firstEnabledAt()));
case "lastUpdatedAt":
return Optional.ofNullable(clazz.cast(lastUpdatedAt()));
case "sensitivityInspectionTemplateId":
return Optional.ofNullable(clazz.cast(sensitivityInspectionTemplateId()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function