software.amazon.awssdk.services.iot.model.AuditSuppression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iot Show documentation
Show all versions of iot Show documentation
The AWS Java SDK for AWS Iot Service module holds the client classes that are used for communicating
with AWS IoT Service
/*
* 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.iot.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
/**
*
* Filters out specific findings of a Device Defender audit.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AuditSuppression implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CHECK_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("checkName").getter(getter(AuditSuppression::checkName)).setter(setter(Builder::checkName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("checkName").build()).build();
private static final SdkField RESOURCE_IDENTIFIER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("resourceIdentifier")
.getter(getter(AuditSuppression::resourceIdentifier)).setter(setter(Builder::resourceIdentifier))
.constructor(ResourceIdentifier::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceIdentifier").build())
.build();
private static final SdkField EXPIRATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("expirationDate").getter(getter(AuditSuppression::expirationDate))
.setter(setter(Builder::expirationDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("expirationDate").build()).build();
private static final SdkField SUPPRESS_INDEFINITELY_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("suppressIndefinitely").getter(getter(AuditSuppression::suppressIndefinitely))
.setter(setter(Builder::suppressIndefinitely))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("suppressIndefinitely").build())
.build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(AuditSuppression::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CHECK_NAME_FIELD,
RESOURCE_IDENTIFIER_FIELD, EXPIRATION_DATE_FIELD, SUPPRESS_INDEFINITELY_FIELD, DESCRIPTION_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String checkName;
private final ResourceIdentifier resourceIdentifier;
private final Instant expirationDate;
private final Boolean suppressIndefinitely;
private final String description;
private AuditSuppression(BuilderImpl builder) {
this.checkName = builder.checkName;
this.resourceIdentifier = builder.resourceIdentifier;
this.expirationDate = builder.expirationDate;
this.suppressIndefinitely = builder.suppressIndefinitely;
this.description = builder.description;
}
/**
* Returns the value of the CheckName property for this object.
*
* @return The value of the CheckName property for this object.
*/
public final String checkName() {
return checkName;
}
/**
* Returns the value of the ResourceIdentifier property for this object.
*
* @return The value of the ResourceIdentifier property for this object.
*/
public final ResourceIdentifier resourceIdentifier() {
return resourceIdentifier;
}
/**
*
* The expiration date (epoch timestamp in seconds) that you want the suppression to adhere to.
*
*
* @return The expiration date (epoch timestamp in seconds) that you want the suppression to adhere to.
*/
public final Instant expirationDate() {
return expirationDate;
}
/**
*
* Indicates whether a suppression should exist indefinitely or not.
*
*
* @return Indicates whether a suppression should exist indefinitely or not.
*/
public final Boolean suppressIndefinitely() {
return suppressIndefinitely;
}
/**
*
* The description of the audit suppression.
*
*
* @return The description of the audit suppression.
*/
public final String description() {
return description;
}
@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(checkName());
hashCode = 31 * hashCode + Objects.hashCode(resourceIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(expirationDate());
hashCode = 31 * hashCode + Objects.hashCode(suppressIndefinitely());
hashCode = 31 * hashCode + Objects.hashCode(description());
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 AuditSuppression)) {
return false;
}
AuditSuppression other = (AuditSuppression) obj;
return Objects.equals(checkName(), other.checkName()) && Objects.equals(resourceIdentifier(), other.resourceIdentifier())
&& Objects.equals(expirationDate(), other.expirationDate())
&& Objects.equals(suppressIndefinitely(), other.suppressIndefinitely())
&& Objects.equals(description(), other.description());
}
/**
* 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("AuditSuppression").add("CheckName", checkName()).add("ResourceIdentifier", resourceIdentifier())
.add("ExpirationDate", expirationDate()).add("SuppressIndefinitely", suppressIndefinitely())
.add("Description", description()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "checkName":
return Optional.ofNullable(clazz.cast(checkName()));
case "resourceIdentifier":
return Optional.ofNullable(clazz.cast(resourceIdentifier()));
case "expirationDate":
return Optional.ofNullable(clazz.cast(expirationDate()));
case "suppressIndefinitely":
return Optional.ofNullable(clazz.cast(suppressIndefinitely()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("checkName", CHECK_NAME_FIELD);
map.put("resourceIdentifier", RESOURCE_IDENTIFIER_FIELD);
map.put("expirationDate", EXPIRATION_DATE_FIELD);
map.put("suppressIndefinitely", SUPPRESS_INDEFINITELY_FIELD);
map.put("description", DESCRIPTION_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy