software.amazon.awssdk.services.auditmanager.model.UpdateSettingsRequest Maven / Gradle / Ivy
Show all versions of auditmanager 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.auditmanager.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 java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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 UpdateSettingsRequest extends AuditManagerRequest implements
ToCopyableBuilder {
private static final SdkField SNS_TOPIC_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("snsTopic").getter(getter(UpdateSettingsRequest::snsTopic)).setter(setter(Builder::snsTopic))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("snsTopic").build()).build();
private static final SdkField DEFAULT_ASSESSMENT_REPORTS_DESTINATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("defaultAssessmentReportsDestination")
.getter(getter(UpdateSettingsRequest::defaultAssessmentReportsDestination))
.setter(setter(Builder::defaultAssessmentReportsDestination))
.constructor(AssessmentReportsDestination::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("defaultAssessmentReportsDestination").build()).build();
private static final SdkField> DEFAULT_PROCESS_OWNERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("defaultProcessOwners")
.getter(getter(UpdateSettingsRequest::defaultProcessOwners))
.setter(setter(Builder::defaultProcessOwners))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("defaultProcessOwners").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Role::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField KMS_KEY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("kmsKey")
.getter(getter(UpdateSettingsRequest::kmsKey)).setter(setter(Builder::kmsKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKey").build()).build();
private static final SdkField EVIDENCE_FINDER_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("evidenceFinderEnabled").getter(getter(UpdateSettingsRequest::evidenceFinderEnabled))
.setter(setter(Builder::evidenceFinderEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("evidenceFinderEnabled").build())
.build();
private static final SdkField DEREGISTRATION_POLICY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("deregistrationPolicy")
.getter(getter(UpdateSettingsRequest::deregistrationPolicy)).setter(setter(Builder::deregistrationPolicy))
.constructor(DeregistrationPolicy::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deregistrationPolicy").build())
.build();
private static final SdkField DEFAULT_EXPORT_DESTINATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("defaultExportDestination")
.getter(getter(UpdateSettingsRequest::defaultExportDestination)).setter(setter(Builder::defaultExportDestination))
.constructor(DefaultExportDestination::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("defaultExportDestination").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SNS_TOPIC_FIELD,
DEFAULT_ASSESSMENT_REPORTS_DESTINATION_FIELD, DEFAULT_PROCESS_OWNERS_FIELD, KMS_KEY_FIELD,
EVIDENCE_FINDER_ENABLED_FIELD, DEREGISTRATION_POLICY_FIELD, DEFAULT_EXPORT_DESTINATION_FIELD));
private final String snsTopic;
private final AssessmentReportsDestination defaultAssessmentReportsDestination;
private final List defaultProcessOwners;
private final String kmsKey;
private final Boolean evidenceFinderEnabled;
private final DeregistrationPolicy deregistrationPolicy;
private final DefaultExportDestination defaultExportDestination;
private UpdateSettingsRequest(BuilderImpl builder) {
super(builder);
this.snsTopic = builder.snsTopic;
this.defaultAssessmentReportsDestination = builder.defaultAssessmentReportsDestination;
this.defaultProcessOwners = builder.defaultProcessOwners;
this.kmsKey = builder.kmsKey;
this.evidenceFinderEnabled = builder.evidenceFinderEnabled;
this.deregistrationPolicy = builder.deregistrationPolicy;
this.defaultExportDestination = builder.defaultExportDestination;
}
/**
*
* The Amazon Simple Notification Service (Amazon SNS) topic that Audit Manager sends notifications to.
*
*
* @return The Amazon Simple Notification Service (Amazon SNS) topic that Audit Manager sends notifications to.
*/
public final String snsTopic() {
return snsTopic;
}
/**
*
* The default S3 destination bucket for storing assessment reports.
*
*
* @return The default S3 destination bucket for storing assessment reports.
*/
public final AssessmentReportsDestination defaultAssessmentReportsDestination() {
return defaultAssessmentReportsDestination;
}
/**
* For responses, this returns true if the service returned a value for the DefaultProcessOwners 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 hasDefaultProcessOwners() {
return defaultProcessOwners != null && !(defaultProcessOwners instanceof SdkAutoConstructList);
}
/**
*
* A list of the default audit owners.
*
*
* 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 #hasDefaultProcessOwners} method.
*
*
* @return A list of the default audit owners.
*/
public final List defaultProcessOwners() {
return defaultProcessOwners;
}
/**
*
* The KMS key details.
*
*
* @return The KMS key details.
*/
public final String kmsKey() {
return kmsKey;
}
/**
*
* Specifies whether the evidence finder feature is enabled. Change this attribute to enable or disable evidence
* finder.
*
*
*
* When you use this attribute to disable evidence finder, Audit Manager deletes the event data store that’s used to
* query your evidence data. As a result, you can’t re-enable evidence finder and use the feature again. Your only
* alternative is to deregister
* and then re-register
* Audit Manager.
*
*
*
* @return Specifies whether the evidence finder feature is enabled. Change this attribute to enable or disable
* evidence finder.
*
* When you use this attribute to disable evidence finder, Audit Manager deletes the event data store that’s
* used to query your evidence data. As a result, you can’t re-enable evidence finder and use the feature
* again. Your only alternative is to deregister and then re-register Audit Manager.
*
*/
public final Boolean evidenceFinderEnabled() {
return evidenceFinderEnabled;
}
/**
*
* The deregistration policy for your Audit Manager data. You can use this attribute to determine how your data is
* handled when you deregister Audit Manager.
*
*
* @return The deregistration policy for your Audit Manager data. You can use this attribute to determine how your
* data is handled when you deregister Audit Manager.
*/
public final DeregistrationPolicy deregistrationPolicy() {
return deregistrationPolicy;
}
/**
*
* The default S3 destination bucket for storing evidence finder exports.
*
*
* @return The default S3 destination bucket for storing evidence finder exports.
*/
public final DefaultExportDestination defaultExportDestination() {
return defaultExportDestination;
}
@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(snsTopic());
hashCode = 31 * hashCode + Objects.hashCode(defaultAssessmentReportsDestination());
hashCode = 31 * hashCode + Objects.hashCode(hasDefaultProcessOwners() ? defaultProcessOwners() : null);
hashCode = 31 * hashCode + Objects.hashCode(kmsKey());
hashCode = 31 * hashCode + Objects.hashCode(evidenceFinderEnabled());
hashCode = 31 * hashCode + Objects.hashCode(deregistrationPolicy());
hashCode = 31 * hashCode + Objects.hashCode(defaultExportDestination());
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 UpdateSettingsRequest)) {
return false;
}
UpdateSettingsRequest other = (UpdateSettingsRequest) obj;
return Objects.equals(snsTopic(), other.snsTopic())
&& Objects.equals(defaultAssessmentReportsDestination(), other.defaultAssessmentReportsDestination())
&& hasDefaultProcessOwners() == other.hasDefaultProcessOwners()
&& Objects.equals(defaultProcessOwners(), other.defaultProcessOwners())
&& Objects.equals(kmsKey(), other.kmsKey())
&& Objects.equals(evidenceFinderEnabled(), other.evidenceFinderEnabled())
&& Objects.equals(deregistrationPolicy(), other.deregistrationPolicy())
&& Objects.equals(defaultExportDestination(), other.defaultExportDestination());
}
/**
* 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("UpdateSettingsRequest")
.add("SnsTopic", snsTopic())
.add("DefaultAssessmentReportsDestination",
defaultAssessmentReportsDestination() == null ? null : "*** Sensitive Data Redacted ***")
.add("DefaultProcessOwners", defaultProcessOwners() == null ? null : "*** Sensitive Data Redacted ***")
.add("KmsKey", kmsKey()).add("EvidenceFinderEnabled", evidenceFinderEnabled())
.add("DeregistrationPolicy", deregistrationPolicy()).add("DefaultExportDestination", defaultExportDestination())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "snsTopic":
return Optional.ofNullable(clazz.cast(snsTopic()));
case "defaultAssessmentReportsDestination":
return Optional.ofNullable(clazz.cast(defaultAssessmentReportsDestination()));
case "defaultProcessOwners":
return Optional.ofNullable(clazz.cast(defaultProcessOwners()));
case "kmsKey":
return Optional.ofNullable(clazz.cast(kmsKey()));
case "evidenceFinderEnabled":
return Optional.ofNullable(clazz.cast(evidenceFinderEnabled()));
case "deregistrationPolicy":
return Optional.ofNullable(clazz.cast(deregistrationPolicy()));
case "defaultExportDestination":
return Optional.ofNullable(clazz.cast(defaultExportDestination()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function