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

software.amazon.awssdk.services.config.model.AggregateConformancePackCompliance Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.4
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.config.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;

/**
 * 

* Provides the number of compliant and noncompliant rules within a conformance pack. Also provides the compliance * status of the conformance pack and the total rule count which includes compliant rules, noncompliant rules, and rules * that cannot be evaluated due to insufficient data. *

*

* A conformance pack is compliant if all of the rules in a conformance packs are compliant. It is noncompliant if any * of the rules are not compliant. The compliance status of a conformance pack is INSUFFICIENT_DATA only if all rules * within a conformance pack cannot be evaluated due to insufficient data. If some of the rules in a conformance pack * are compliant but the compliance status of other rules in that same conformance pack is INSUFFICIENT_DATA, the * conformance pack shows compliant. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AggregateConformancePackCompliance implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField COMPLIANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ComplianceType").getter(getter(AggregateConformancePackCompliance::complianceTypeAsString)) .setter(setter(Builder::complianceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ComplianceType").build()).build(); private static final SdkField COMPLIANT_RULE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("CompliantRuleCount").getter(getter(AggregateConformancePackCompliance::compliantRuleCount)) .setter(setter(Builder::compliantRuleCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompliantRuleCount").build()) .build(); private static final SdkField NON_COMPLIANT_RULE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("NonCompliantRuleCount").getter(getter(AggregateConformancePackCompliance::nonCompliantRuleCount)) .setter(setter(Builder::nonCompliantRuleCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NonCompliantRuleCount").build()) .build(); private static final SdkField TOTAL_RULE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("TotalRuleCount").getter(getter(AggregateConformancePackCompliance::totalRuleCount)) .setter(setter(Builder::totalRuleCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalRuleCount").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(COMPLIANCE_TYPE_FIELD, COMPLIANT_RULE_COUNT_FIELD, NON_COMPLIANT_RULE_COUNT_FIELD, TOTAL_RULE_COUNT_FIELD)); private static final long serialVersionUID = 1L; private final String complianceType; private final Integer compliantRuleCount; private final Integer nonCompliantRuleCount; private final Integer totalRuleCount; private AggregateConformancePackCompliance(BuilderImpl builder) { this.complianceType = builder.complianceType; this.compliantRuleCount = builder.compliantRuleCount; this.nonCompliantRuleCount = builder.nonCompliantRuleCount; this.totalRuleCount = builder.totalRuleCount; } /** *

* The compliance status of the conformance pack. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #complianceType} * will return {@link ConformancePackComplianceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service * is available from {@link #complianceTypeAsString}. *

* * @return The compliance status of the conformance pack. * @see ConformancePackComplianceType */ public final ConformancePackComplianceType complianceType() { return ConformancePackComplianceType.fromValue(complianceType); } /** *

* The compliance status of the conformance pack. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #complianceType} * will return {@link ConformancePackComplianceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service * is available from {@link #complianceTypeAsString}. *

* * @return The compliance status of the conformance pack. * @see ConformancePackComplianceType */ public final String complianceTypeAsString() { return complianceType; } /** *

* The number of compliant Config Rules. *

* * @return The number of compliant Config Rules. */ public final Integer compliantRuleCount() { return compliantRuleCount; } /** *

* The number of noncompliant Config Rules. *

* * @return The number of noncompliant Config Rules. */ public final Integer nonCompliantRuleCount() { return nonCompliantRuleCount; } /** *

* Total number of compliant rules, noncompliant rules, and the rules that do not have any applicable resources to * evaluate upon resulting in insufficient data. *

* * @return Total number of compliant rules, noncompliant rules, and the rules that do not have any applicable * resources to evaluate upon resulting in insufficient data. */ public final Integer totalRuleCount() { return totalRuleCount; } @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(complianceTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(compliantRuleCount()); hashCode = 31 * hashCode + Objects.hashCode(nonCompliantRuleCount()); hashCode = 31 * hashCode + Objects.hashCode(totalRuleCount()); 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 AggregateConformancePackCompliance)) { return false; } AggregateConformancePackCompliance other = (AggregateConformancePackCompliance) obj; return Objects.equals(complianceTypeAsString(), other.complianceTypeAsString()) && Objects.equals(compliantRuleCount(), other.compliantRuleCount()) && Objects.equals(nonCompliantRuleCount(), other.nonCompliantRuleCount()) && Objects.equals(totalRuleCount(), other.totalRuleCount()); } /** * 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("AggregateConformancePackCompliance").add("ComplianceType", complianceTypeAsString()) .add("CompliantRuleCount", compliantRuleCount()).add("NonCompliantRuleCount", nonCompliantRuleCount()) .add("TotalRuleCount", totalRuleCount()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ComplianceType": return Optional.ofNullable(clazz.cast(complianceTypeAsString())); case "CompliantRuleCount": return Optional.ofNullable(clazz.cast(compliantRuleCount())); case "NonCompliantRuleCount": return Optional.ofNullable(clazz.cast(nonCompliantRuleCount())); case "TotalRuleCount": return Optional.ofNullable(clazz.cast(totalRuleCount())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AggregateConformancePackCompliance) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The compliance status of the conformance pack. *

* * @param complianceType * The compliance status of the conformance pack. * @see ConformancePackComplianceType * @return Returns a reference to this object so that method calls can be chained together. * @see ConformancePackComplianceType */ Builder complianceType(String complianceType); /** *

* The compliance status of the conformance pack. *

* * @param complianceType * The compliance status of the conformance pack. * @see ConformancePackComplianceType * @return Returns a reference to this object so that method calls can be chained together. * @see ConformancePackComplianceType */ Builder complianceType(ConformancePackComplianceType complianceType); /** *

* The number of compliant Config Rules. *

* * @param compliantRuleCount * The number of compliant Config Rules. * @return Returns a reference to this object so that method calls can be chained together. */ Builder compliantRuleCount(Integer compliantRuleCount); /** *

* The number of noncompliant Config Rules. *

* * @param nonCompliantRuleCount * The number of noncompliant Config Rules. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nonCompliantRuleCount(Integer nonCompliantRuleCount); /** *

* Total number of compliant rules, noncompliant rules, and the rules that do not have any applicable resources * to evaluate upon resulting in insufficient data. *

* * @param totalRuleCount * Total number of compliant rules, noncompliant rules, and the rules that do not have any applicable * resources to evaluate upon resulting in insufficient data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalRuleCount(Integer totalRuleCount); } static final class BuilderImpl implements Builder { private String complianceType; private Integer compliantRuleCount; private Integer nonCompliantRuleCount; private Integer totalRuleCount; private BuilderImpl() { } private BuilderImpl(AggregateConformancePackCompliance model) { complianceType(model.complianceType); compliantRuleCount(model.compliantRuleCount); nonCompliantRuleCount(model.nonCompliantRuleCount); totalRuleCount(model.totalRuleCount); } public final String getComplianceType() { return complianceType; } public final void setComplianceType(String complianceType) { this.complianceType = complianceType; } @Override public final Builder complianceType(String complianceType) { this.complianceType = complianceType; return this; } @Override public final Builder complianceType(ConformancePackComplianceType complianceType) { this.complianceType(complianceType == null ? null : complianceType.toString()); return this; } public final Integer getCompliantRuleCount() { return compliantRuleCount; } public final void setCompliantRuleCount(Integer compliantRuleCount) { this.compliantRuleCount = compliantRuleCount; } @Override public final Builder compliantRuleCount(Integer compliantRuleCount) { this.compliantRuleCount = compliantRuleCount; return this; } public final Integer getNonCompliantRuleCount() { return nonCompliantRuleCount; } public final void setNonCompliantRuleCount(Integer nonCompliantRuleCount) { this.nonCompliantRuleCount = nonCompliantRuleCount; } @Override public final Builder nonCompliantRuleCount(Integer nonCompliantRuleCount) { this.nonCompliantRuleCount = nonCompliantRuleCount; return this; } public final Integer getTotalRuleCount() { return totalRuleCount; } public final void setTotalRuleCount(Integer totalRuleCount) { this.totalRuleCount = totalRuleCount; } @Override public final Builder totalRuleCount(Integer totalRuleCount) { this.totalRuleCount = totalRuleCount; return this; } @Override public AggregateConformancePackCompliance build() { return new AggregateConformancePackCompliance(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy