All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.iot.model.AuditSuppression Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Iot Service module holds the client classes that are used for communicating with AWS IoT Service

There is a newer version: 2.30.1
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((AuditSuppression) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** * Sets the value of the CheckName property for this object. * * @param checkName * The new value for the CheckName property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder checkName(String checkName); /** * Sets the value of the ResourceIdentifier property for this object. * * @param resourceIdentifier * The new value for the ResourceIdentifier property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceIdentifier(ResourceIdentifier resourceIdentifier); /** * Sets the value of the ResourceIdentifier property for this object. * * This is a convenience method that creates an instance of the {@link ResourceIdentifier.Builder} avoiding the * need to create one manually via {@link ResourceIdentifier#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceIdentifier.Builder#build()} is called immediately and its * result is passed to {@link #resourceIdentifier(ResourceIdentifier)}. * * @param resourceIdentifier * a consumer that will call methods on {@link ResourceIdentifier.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #resourceIdentifier(ResourceIdentifier) */ default Builder resourceIdentifier(Consumer resourceIdentifier) { return resourceIdentifier(ResourceIdentifier.builder().applyMutation(resourceIdentifier).build()); } /** *

* The expiration date (epoch timestamp in seconds) that you want the suppression to adhere to. *

* * @param expirationDate * The expiration date (epoch timestamp in seconds) that you want the suppression to adhere to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expirationDate(Instant expirationDate); /** *

* Indicates whether a suppression should exist indefinitely or not. *

* * @param suppressIndefinitely * Indicates whether a suppression should exist indefinitely or not. * @return Returns a reference to this object so that method calls can be chained together. */ Builder suppressIndefinitely(Boolean suppressIndefinitely); /** *

* The description of the audit suppression. *

* * @param description * The description of the audit suppression. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); } static final class BuilderImpl implements Builder { private String checkName; private ResourceIdentifier resourceIdentifier; private Instant expirationDate; private Boolean suppressIndefinitely; private String description; private BuilderImpl() { } private BuilderImpl(AuditSuppression model) { checkName(model.checkName); resourceIdentifier(model.resourceIdentifier); expirationDate(model.expirationDate); suppressIndefinitely(model.suppressIndefinitely); description(model.description); } public final String getCheckName() { return checkName; } public final void setCheckName(String checkName) { this.checkName = checkName; } @Override public final Builder checkName(String checkName) { this.checkName = checkName; return this; } public final ResourceIdentifier.Builder getResourceIdentifier() { return resourceIdentifier != null ? resourceIdentifier.toBuilder() : null; } public final void setResourceIdentifier(ResourceIdentifier.BuilderImpl resourceIdentifier) { this.resourceIdentifier = resourceIdentifier != null ? resourceIdentifier.build() : null; } @Override public final Builder resourceIdentifier(ResourceIdentifier resourceIdentifier) { this.resourceIdentifier = resourceIdentifier; return this; } public final Instant getExpirationDate() { return expirationDate; } public final void setExpirationDate(Instant expirationDate) { this.expirationDate = expirationDate; } @Override public final Builder expirationDate(Instant expirationDate) { this.expirationDate = expirationDate; return this; } public final Boolean getSuppressIndefinitely() { return suppressIndefinitely; } public final void setSuppressIndefinitely(Boolean suppressIndefinitely) { this.suppressIndefinitely = suppressIndefinitely; } @Override public final Builder suppressIndefinitely(Boolean suppressIndefinitely) { this.suppressIndefinitely = suppressIndefinitely; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } @Override public AuditSuppression build() { return new AuditSuppression(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy