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

software.amazon.awssdk.services.inspector.model.Finding 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.inspector.model;

import java.io.Serializable;
import java.time.Instant;
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.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;

/**
 * 

* Contains information about an Amazon Inspector finding. This data type is used as the response element in the * DescribeFindings action. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Finding implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(Finding::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField SCHEMA_VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("schemaVersion").getter(getter(Finding::schemaVersion)).setter(setter(Builder::schemaVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schemaVersion").build()).build(); private static final SdkField SERVICE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("service") .getter(getter(Finding::service)).setter(setter(Builder::service)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("service").build()).build(); private static final SdkField SERVICE_ATTRIBUTES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("serviceAttributes") .getter(getter(Finding::serviceAttributes)).setter(setter(Builder::serviceAttributes)) .constructor(InspectorServiceAttributes::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceAttributes").build()).build(); private static final SdkField ASSET_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("assetType").getter(getter(Finding::assetTypeAsString)).setter(setter(Builder::assetType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("assetType").build()).build(); private static final SdkField ASSET_ATTRIBUTES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("assetAttributes") .getter(getter(Finding::assetAttributes)).setter(setter(Builder::assetAttributes)) .constructor(AssetAttributes::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("assetAttributes").build()).build(); private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id") .getter(getter(Finding::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build(); private static final SdkField TITLE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("title") .getter(getter(Finding::title)).setter(setter(Builder::title)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("title").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("description").getter(getter(Finding::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build(); private static final SdkField RECOMMENDATION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("recommendation").getter(getter(Finding::recommendation)).setter(setter(Builder::recommendation)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recommendation").build()).build(); private static final SdkField SEVERITY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("severity").getter(getter(Finding::severityAsString)).setter(setter(Builder::severity)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("severity").build()).build(); private static final SdkField NUMERIC_SEVERITY_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("numericSeverity").getter(getter(Finding::numericSeverity)).setter(setter(Builder::numericSeverity)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("numericSeverity").build()).build(); private static final SdkField CONFIDENCE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("confidence").getter(getter(Finding::confidence)).setter(setter(Builder::confidence)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("confidence").build()).build(); private static final SdkField INDICATOR_OF_COMPROMISE_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("indicatorOfCompromise").getter(getter(Finding::indicatorOfCompromise)) .setter(setter(Builder::indicatorOfCompromise)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("indicatorOfCompromise").build()) .build(); private static final SdkField> ATTRIBUTES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("attributes") .getter(getter(Finding::attributes)) .setter(setter(Builder::attributes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("attributes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Attribute::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> USER_ATTRIBUTES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("userAttributes") .getter(getter(Finding::userAttributes)) .setter(setter(Builder::userAttributes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("userAttributes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Attribute::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("createdAt").getter(getter(Finding::createdAt)).setter(setter(Builder::createdAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build(); private static final SdkField UPDATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("updatedAt").getter(getter(Finding::updatedAt)).setter(setter(Builder::updatedAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updatedAt").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, SCHEMA_VERSION_FIELD, SERVICE_FIELD, SERVICE_ATTRIBUTES_FIELD, ASSET_TYPE_FIELD, ASSET_ATTRIBUTES_FIELD, ID_FIELD, TITLE_FIELD, DESCRIPTION_FIELD, RECOMMENDATION_FIELD, SEVERITY_FIELD, NUMERIC_SEVERITY_FIELD, CONFIDENCE_FIELD, INDICATOR_OF_COMPROMISE_FIELD, ATTRIBUTES_FIELD, USER_ATTRIBUTES_FIELD, CREATED_AT_FIELD, UPDATED_AT_FIELD)); private static final long serialVersionUID = 1L; private final String arn; private final Integer schemaVersion; private final String service; private final InspectorServiceAttributes serviceAttributes; private final String assetType; private final AssetAttributes assetAttributes; private final String id; private final String title; private final String description; private final String recommendation; private final String severity; private final Double numericSeverity; private final Integer confidence; private final Boolean indicatorOfCompromise; private final List attributes; private final List userAttributes; private final Instant createdAt; private final Instant updatedAt; private Finding(BuilderImpl builder) { this.arn = builder.arn; this.schemaVersion = builder.schemaVersion; this.service = builder.service; this.serviceAttributes = builder.serviceAttributes; this.assetType = builder.assetType; this.assetAttributes = builder.assetAttributes; this.id = builder.id; this.title = builder.title; this.description = builder.description; this.recommendation = builder.recommendation; this.severity = builder.severity; this.numericSeverity = builder.numericSeverity; this.confidence = builder.confidence; this.indicatorOfCompromise = builder.indicatorOfCompromise; this.attributes = builder.attributes; this.userAttributes = builder.userAttributes; this.createdAt = builder.createdAt; this.updatedAt = builder.updatedAt; } /** *

* The ARN that specifies the finding. *

* * @return The ARN that specifies the finding. */ public final String arn() { return arn; } /** *

* The schema version of this data type. *

* * @return The schema version of this data type. */ public final Integer schemaVersion() { return schemaVersion; } /** *

* The data element is set to "Inspector". *

* * @return The data element is set to "Inspector". */ public final String service() { return service; } /** *

* This data type is used in the Finding data type. *

* * @return This data type is used in the Finding data type. */ public final InspectorServiceAttributes serviceAttributes() { return serviceAttributes; } /** *

* The type of the host from which the finding is generated. *

*

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

* * @return The type of the host from which the finding is generated. * @see AssetType */ public final AssetType assetType() { return AssetType.fromValue(assetType); } /** *

* The type of the host from which the finding is generated. *

*

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

* * @return The type of the host from which the finding is generated. * @see AssetType */ public final String assetTypeAsString() { return assetType; } /** *

* A collection of attributes of the host from which the finding is generated. *

* * @return A collection of attributes of the host from which the finding is generated. */ public final AssetAttributes assetAttributes() { return assetAttributes; } /** *

* The ID of the finding. *

* * @return The ID of the finding. */ public final String id() { return id; } /** *

* The name of the finding. *

* * @return The name of the finding. */ public final String title() { return title; } /** *

* The description of the finding. *

* * @return The description of the finding. */ public final String description() { return description; } /** *

* The recommendation for the finding. *

* * @return The recommendation for the finding. */ public final String recommendation() { return recommendation; } /** *

* The finding severity. Values can be set to High, Medium, Low, and Informational. *

*

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

* * @return The finding severity. Values can be set to High, Medium, Low, and Informational. * @see Severity */ public final Severity severity() { return Severity.fromValue(severity); } /** *

* The finding severity. Values can be set to High, Medium, Low, and Informational. *

*

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

* * @return The finding severity. Values can be set to High, Medium, Low, and Informational. * @see Severity */ public final String severityAsString() { return severity; } /** *

* The numeric value of the finding severity. *

* * @return The numeric value of the finding severity. */ public final Double numericSeverity() { return numericSeverity; } /** *

* This data element is currently not used. *

* * @return This data element is currently not used. */ public final Integer confidence() { return confidence; } /** *

* This data element is currently not used. *

* * @return This data element is currently not used. */ public final Boolean indicatorOfCompromise() { return indicatorOfCompromise; } /** * For responses, this returns true if the service returned a value for the Attributes 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 hasAttributes() { return attributes != null && !(attributes instanceof SdkAutoConstructList); } /** *

* The system-defined attributes for the finding. *

*

* 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 #hasAttributes} method. *

* * @return The system-defined attributes for the finding. */ public final List attributes() { return attributes; } /** * For responses, this returns true if the service returned a value for the UserAttributes 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 hasUserAttributes() { return userAttributes != null && !(userAttributes instanceof SdkAutoConstructList); } /** *

* The user-defined attributes that are assigned to the finding. *

*

* 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 #hasUserAttributes} method. *

* * @return The user-defined attributes that are assigned to the finding. */ public final List userAttributes() { return userAttributes; } /** *

* The time when the finding was generated. *

* * @return The time when the finding was generated. */ public final Instant createdAt() { return createdAt; } /** *

* The time when AddAttributesToFindings is called. *

* * @return The time when AddAttributesToFindings is called. */ public final Instant updatedAt() { return updatedAt; } @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(arn()); hashCode = 31 * hashCode + Objects.hashCode(schemaVersion()); hashCode = 31 * hashCode + Objects.hashCode(service()); hashCode = 31 * hashCode + Objects.hashCode(serviceAttributes()); hashCode = 31 * hashCode + Objects.hashCode(assetTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(assetAttributes()); hashCode = 31 * hashCode + Objects.hashCode(id()); hashCode = 31 * hashCode + Objects.hashCode(title()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(recommendation()); hashCode = 31 * hashCode + Objects.hashCode(severityAsString()); hashCode = 31 * hashCode + Objects.hashCode(numericSeverity()); hashCode = 31 * hashCode + Objects.hashCode(confidence()); hashCode = 31 * hashCode + Objects.hashCode(indicatorOfCompromise()); hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasUserAttributes() ? userAttributes() : null); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(updatedAt()); 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 Finding)) { return false; } Finding other = (Finding) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(schemaVersion(), other.schemaVersion()) && Objects.equals(service(), other.service()) && Objects.equals(serviceAttributes(), other.serviceAttributes()) && Objects.equals(assetTypeAsString(), other.assetTypeAsString()) && Objects.equals(assetAttributes(), other.assetAttributes()) && Objects.equals(id(), other.id()) && Objects.equals(title(), other.title()) && Objects.equals(description(), other.description()) && Objects.equals(recommendation(), other.recommendation()) && Objects.equals(severityAsString(), other.severityAsString()) && Objects.equals(numericSeverity(), other.numericSeverity()) && Objects.equals(confidence(), other.confidence()) && Objects.equals(indicatorOfCompromise(), other.indicatorOfCompromise()) && hasAttributes() == other.hasAttributes() && Objects.equals(attributes(), other.attributes()) && hasUserAttributes() == other.hasUserAttributes() && Objects.equals(userAttributes(), other.userAttributes()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(updatedAt(), other.updatedAt()); } /** * 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("Finding").add("Arn", arn()).add("SchemaVersion", schemaVersion()).add("Service", service()) .add("ServiceAttributes", serviceAttributes()).add("AssetType", assetTypeAsString()) .add("AssetAttributes", assetAttributes()).add("Id", id()).add("Title", title()) .add("Description", description()).add("Recommendation", recommendation()).add("Severity", severityAsString()) .add("NumericSeverity", numericSeverity()).add("Confidence", confidence()) .add("IndicatorOfCompromise", indicatorOfCompromise()).add("Attributes", hasAttributes() ? attributes() : null) .add("UserAttributes", hasUserAttributes() ? userAttributes() : null).add("CreatedAt", createdAt()) .add("UpdatedAt", updatedAt()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "schemaVersion": return Optional.ofNullable(clazz.cast(schemaVersion())); case "service": return Optional.ofNullable(clazz.cast(service())); case "serviceAttributes": return Optional.ofNullable(clazz.cast(serviceAttributes())); case "assetType": return Optional.ofNullable(clazz.cast(assetTypeAsString())); case "assetAttributes": return Optional.ofNullable(clazz.cast(assetAttributes())); case "id": return Optional.ofNullable(clazz.cast(id())); case "title": return Optional.ofNullable(clazz.cast(title())); case "description": return Optional.ofNullable(clazz.cast(description())); case "recommendation": return Optional.ofNullable(clazz.cast(recommendation())); case "severity": return Optional.ofNullable(clazz.cast(severityAsString())); case "numericSeverity": return Optional.ofNullable(clazz.cast(numericSeverity())); case "confidence": return Optional.ofNullable(clazz.cast(confidence())); case "indicatorOfCompromise": return Optional.ofNullable(clazz.cast(indicatorOfCompromise())); case "attributes": return Optional.ofNullable(clazz.cast(attributes())); case "userAttributes": return Optional.ofNullable(clazz.cast(userAttributes())); case "createdAt": return Optional.ofNullable(clazz.cast(createdAt())); case "updatedAt": return Optional.ofNullable(clazz.cast(updatedAt())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Finding) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ARN that specifies the finding. *

* * @param arn * The ARN that specifies the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The schema version of this data type. *

* * @param schemaVersion * The schema version of this data type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder schemaVersion(Integer schemaVersion); /** *

* The data element is set to "Inspector". *

* * @param service * The data element is set to "Inspector". * @return Returns a reference to this object so that method calls can be chained together. */ Builder service(String service); /** *

* This data type is used in the Finding data type. *

* * @param serviceAttributes * This data type is used in the Finding data type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceAttributes(InspectorServiceAttributes serviceAttributes); /** *

* This data type is used in the Finding data type. *

* This is a convenience method that creates an instance of the {@link InspectorServiceAttributes.Builder} * avoiding the need to create one manually via {@link InspectorServiceAttributes#builder()}. * *

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

* The type of the host from which the finding is generated. *

* * @param assetType * The type of the host from which the finding is generated. * @see AssetType * @return Returns a reference to this object so that method calls can be chained together. * @see AssetType */ Builder assetType(String assetType); /** *

* The type of the host from which the finding is generated. *

* * @param assetType * The type of the host from which the finding is generated. * @see AssetType * @return Returns a reference to this object so that method calls can be chained together. * @see AssetType */ Builder assetType(AssetType assetType); /** *

* A collection of attributes of the host from which the finding is generated. *

* * @param assetAttributes * A collection of attributes of the host from which the finding is generated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder assetAttributes(AssetAttributes assetAttributes); /** *

* A collection of attributes of the host from which the finding is generated. *

* This is a convenience method that creates an instance of the {@link AssetAttributes.Builder} avoiding the * need to create one manually via {@link AssetAttributes#builder()}. * *

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

* The ID of the finding. *

* * @param id * The ID of the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

* The name of the finding. *

* * @param title * The name of the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder title(String title); /** *

* The description of the finding. *

* * @param description * The description of the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The recommendation for the finding. *

* * @param recommendation * The recommendation for the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendation(String recommendation); /** *

* The finding severity. Values can be set to High, Medium, Low, and Informational. *

* * @param severity * The finding severity. Values can be set to High, Medium, Low, and Informational. * @see Severity * @return Returns a reference to this object so that method calls can be chained together. * @see Severity */ Builder severity(String severity); /** *

* The finding severity. Values can be set to High, Medium, Low, and Informational. *

* * @param severity * The finding severity. Values can be set to High, Medium, Low, and Informational. * @see Severity * @return Returns a reference to this object so that method calls can be chained together. * @see Severity */ Builder severity(Severity severity); /** *

* The numeric value of the finding severity. *

* * @param numericSeverity * The numeric value of the finding severity. * @return Returns a reference to this object so that method calls can be chained together. */ Builder numericSeverity(Double numericSeverity); /** *

* This data element is currently not used. *

* * @param confidence * This data element is currently not used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder confidence(Integer confidence); /** *

* This data element is currently not used. *

* * @param indicatorOfCompromise * This data element is currently not used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder indicatorOfCompromise(Boolean indicatorOfCompromise); /** *

* The system-defined attributes for the finding. *

* * @param attributes * The system-defined attributes for the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributes(Collection attributes); /** *

* The system-defined attributes for the finding. *

* * @param attributes * The system-defined attributes for the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributes(Attribute... attributes); /** *

* The system-defined attributes for the finding. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.inspector.model.Attribute.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.inspector.model.Attribute#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.inspector.model.Attribute.Builder#build()} is called immediately and * its result is passed to {@link #attributes(List)}. * * @param attributes * a consumer that will call methods on * {@link software.amazon.awssdk.services.inspector.model.Attribute.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #attributes(java.util.Collection) */ Builder attributes(Consumer... attributes); /** *

* The user-defined attributes that are assigned to the finding. *

* * @param userAttributes * The user-defined attributes that are assigned to the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userAttributes(Collection userAttributes); /** *

* The user-defined attributes that are assigned to the finding. *

* * @param userAttributes * The user-defined attributes that are assigned to the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userAttributes(Attribute... userAttributes); /** *

* The user-defined attributes that are assigned to the finding. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.inspector.model.Attribute.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.inspector.model.Attribute#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.inspector.model.Attribute.Builder#build()} is called immediately and * its result is passed to {@link #userAttributes(List)}. * * @param userAttributes * a consumer that will call methods on * {@link software.amazon.awssdk.services.inspector.model.Attribute.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #userAttributes(java.util.Collection) */ Builder userAttributes(Consumer... userAttributes); /** *

* The time when the finding was generated. *

* * @param createdAt * The time when the finding was generated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

* The time when AddAttributesToFindings is called. *

* * @param updatedAt * The time when AddAttributesToFindings is called. * @return Returns a reference to this object so that method calls can be chained together. */ Builder updatedAt(Instant updatedAt); } static final class BuilderImpl implements Builder { private String arn; private Integer schemaVersion; private String service; private InspectorServiceAttributes serviceAttributes; private String assetType; private AssetAttributes assetAttributes; private String id; private String title; private String description; private String recommendation; private String severity; private Double numericSeverity; private Integer confidence; private Boolean indicatorOfCompromise; private List attributes = DefaultSdkAutoConstructList.getInstance(); private List userAttributes = DefaultSdkAutoConstructList.getInstance(); private Instant createdAt; private Instant updatedAt; private BuilderImpl() { } private BuilderImpl(Finding model) { arn(model.arn); schemaVersion(model.schemaVersion); service(model.service); serviceAttributes(model.serviceAttributes); assetType(model.assetType); assetAttributes(model.assetAttributes); id(model.id); title(model.title); description(model.description); recommendation(model.recommendation); severity(model.severity); numericSeverity(model.numericSeverity); confidence(model.confidence); indicatorOfCompromise(model.indicatorOfCompromise); attributes(model.attributes); userAttributes(model.userAttributes); createdAt(model.createdAt); updatedAt(model.updatedAt); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final Integer getSchemaVersion() { return schemaVersion; } public final void setSchemaVersion(Integer schemaVersion) { this.schemaVersion = schemaVersion; } @Override public final Builder schemaVersion(Integer schemaVersion) { this.schemaVersion = schemaVersion; return this; } public final String getService() { return service; } public final void setService(String service) { this.service = service; } @Override public final Builder service(String service) { this.service = service; return this; } public final InspectorServiceAttributes.Builder getServiceAttributes() { return serviceAttributes != null ? serviceAttributes.toBuilder() : null; } public final void setServiceAttributes(InspectorServiceAttributes.BuilderImpl serviceAttributes) { this.serviceAttributes = serviceAttributes != null ? serviceAttributes.build() : null; } @Override public final Builder serviceAttributes(InspectorServiceAttributes serviceAttributes) { this.serviceAttributes = serviceAttributes; return this; } public final String getAssetType() { return assetType; } public final void setAssetType(String assetType) { this.assetType = assetType; } @Override public final Builder assetType(String assetType) { this.assetType = assetType; return this; } @Override public final Builder assetType(AssetType assetType) { this.assetType(assetType == null ? null : assetType.toString()); return this; } public final AssetAttributes.Builder getAssetAttributes() { return assetAttributes != null ? assetAttributes.toBuilder() : null; } public final void setAssetAttributes(AssetAttributes.BuilderImpl assetAttributes) { this.assetAttributes = assetAttributes != null ? assetAttributes.build() : null; } @Override public final Builder assetAttributes(AssetAttributes assetAttributes) { this.assetAttributes = assetAttributes; return this; } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getTitle() { return title; } public final void setTitle(String title) { this.title = title; } @Override public final Builder title(String title) { this.title = title; 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; } public final String getRecommendation() { return recommendation; } public final void setRecommendation(String recommendation) { this.recommendation = recommendation; } @Override public final Builder recommendation(String recommendation) { this.recommendation = recommendation; return this; } public final String getSeverity() { return severity; } public final void setSeverity(String severity) { this.severity = severity; } @Override public final Builder severity(String severity) { this.severity = severity; return this; } @Override public final Builder severity(Severity severity) { this.severity(severity == null ? null : severity.toString()); return this; } public final Double getNumericSeverity() { return numericSeverity; } public final void setNumericSeverity(Double numericSeverity) { this.numericSeverity = numericSeverity; } @Override public final Builder numericSeverity(Double numericSeverity) { this.numericSeverity = numericSeverity; return this; } public final Integer getConfidence() { return confidence; } public final void setConfidence(Integer confidence) { this.confidence = confidence; } @Override public final Builder confidence(Integer confidence) { this.confidence = confidence; return this; } public final Boolean getIndicatorOfCompromise() { return indicatorOfCompromise; } public final void setIndicatorOfCompromise(Boolean indicatorOfCompromise) { this.indicatorOfCompromise = indicatorOfCompromise; } @Override public final Builder indicatorOfCompromise(Boolean indicatorOfCompromise) { this.indicatorOfCompromise = indicatorOfCompromise; return this; } public final List getAttributes() { List result = AttributeListCopier.copyToBuilder(this.attributes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAttributes(Collection attributes) { this.attributes = AttributeListCopier.copyFromBuilder(attributes); } @Override public final Builder attributes(Collection attributes) { this.attributes = AttributeListCopier.copy(attributes); return this; } @Override @SafeVarargs public final Builder attributes(Attribute... attributes) { attributes(Arrays.asList(attributes)); return this; } @Override @SafeVarargs public final Builder attributes(Consumer... attributes) { attributes(Stream.of(attributes).map(c -> Attribute.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getUserAttributes() { List result = UserAttributeListCopier.copyToBuilder(this.userAttributes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setUserAttributes(Collection userAttributes) { this.userAttributes = UserAttributeListCopier.copyFromBuilder(userAttributes); } @Override public final Builder userAttributes(Collection userAttributes) { this.userAttributes = UserAttributeListCopier.copy(userAttributes); return this; } @Override @SafeVarargs public final Builder userAttributes(Attribute... userAttributes) { userAttributes(Arrays.asList(userAttributes)); return this; } @Override @SafeVarargs public final Builder userAttributes(Consumer... userAttributes) { userAttributes(Stream.of(userAttributes).map(c -> Attribute.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final Instant getUpdatedAt() { return updatedAt; } public final void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; } @Override public final Builder updatedAt(Instant updatedAt) { this.updatedAt = updatedAt; return this; } @Override public Finding build() { return new Finding(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy