Class GetCodeFindingResponse

All Implemented Interfaces:
SdkPojo, ToCopyableBuilder<GetCodeFindingResponse.Builder,GetCodeFindingResponse>

@Generated("software.amazon.awssdk:codegen") public final class GetCodeFindingResponse extends ContinuumResponse implements ToCopyableBuilder<GetCodeFindingResponse.Builder,GetCodeFindingResponse>

Contains the current state and details of the requested finding. Which type-specific members are populated depends on type.

  • Method Details

    • type

      public final FindingType type()

      What kind of finding this is. Determines which of the type-specific members below are populated.

      If the service returns an enum value that is not available in the current SDK version, type will return FindingType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from typeAsString().

      Returns:
      What kind of finding this is. Determines which of the type-specific members below are populated.
      See Also:
    • typeAsString

      public final String typeAsString()

      What kind of finding this is. Determines which of the type-specific members below are populated.

      If the service returns an enum value that is not available in the current SDK version, type will return FindingType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from typeAsString().

      Returns:
      What kind of finding this is. Determines which of the type-specific members below are populated.
      See Also:
    • title

      public final String title()

      The producer's title for the finding.

      Returns:
      The producer's title for the finding.
    • severity

      public final FindingSeverityId severity()

      The finding's severity.

      If the service returns an enum value that is not available in the current SDK version, severity will return FindingSeverityId.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from severityAsString().

      Returns:
      The finding's severity.
      See Also:
    • severityAsString

      public final String severityAsString()

      The finding's severity.

      If the service returns an enum value that is not available in the current SDK version, severity will return FindingSeverityId.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from severityAsString().

      Returns:
      The finding's severity.
      See Also:
    • summary

      public final String summary()

      A one-paragraph description.

      Returns:
      A one-paragraph description.
    • detailedDescription

      public final String detailedDescription()

      The full analysis.

      Returns:
      The full analysis.
    • category

      public final String category()

      The producer's vulnerability category. Not a stable filter key across finding types -- see FindingCategory.

      Returns:
      The producer's vulnerability category. Not a stable filter key across finding types -- see FindingCategory.
    • subCategory

      public final String subCategory()

      A more specific classification within category.

      Returns:
      A more specific classification within category.
    • hasCweIds

      public final boolean hasCweIds()
      For responses, this returns true if the service returned a value for the CweIds property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • cweIds

      public final List<String> cweIds()

      CWE identifiers classifying 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 hasCweIds() method.

      Returns:
      CWE identifiers classifying the finding.
    • owaspCategory

      public final String owaspCategory()

      The OWASP Top 10 category, when the producer supplies one.

      Returns:
      The OWASP Top 10 category, when the producer supplies one.
    • mitigation

      public final String mitigation()

      How to fix the finding.

      Returns:
      How to fix the finding.
    • filePath

      public final String filePath()

      The file the finding is about.

      Returns:
      The file the finding is about.
    • lineNumber

      public final Integer lineNumber()

      The 1-indexed line the finding is about. Bounds are enforced server-side rather than by a constraint trait: a numeric constraint generates a distinct newtype per enclosing structure, so the same concept would not share a type across the create input and the read output.

      Returns:
      The 1-indexed line the finding is about. Bounds are enforced server-side rather than by a constraint trait: a numeric constraint generates a distinct newtype per enclosing structure, so the same concept would not share a type across the create input and the read output.
    • cveId

      public final String cveId()

      The CVE this finding reports, for software-composition findings. Both code types can carry one: a customer document supplies it under vulnerabilities[].cve, and Continuum's scanner reports CVEs for dependency-manifest findings.

      Returns:
      The CVE this finding reports, for software-composition findings. Both code types can carry one: a customer document supplies it under vulnerabilities[].cve, and Continuum's scanner reports CVEs for dependency-manifest findings.
    • cvssBaseScore

      public final Double cvssBaseScore()

      The CVSS base score accompanying cveId, when the producer supplies one, from 0.0 to 10.0. Not computed by Continuum. The range is enforced server-side, not by a @range trait -- the smithy-rs server SDK does not support range constraints on double shapes (smithy-rs#2007).

      Returns:
      The CVSS base score accompanying cveId, when the producer supplies one, from 0.0 to 10.0. Not computed by Continuum. The range is enforced server-side, not by a @range trait -- the smithy-rs server SDK does not support range constraints on double shapes (smithy-rs#2007).
    • hasAffectedPackages

      public final boolean hasAffectedPackages()
      For responses, this returns true if the service returned a value for the AffectedPackages property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • affectedPackages

      public final List<AffectedPackage> affectedPackages()

      Packages implicated by 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 hasAffectedPackages() method.

      Returns:
      Packages implicated by the finding.
    • vulnerableCode

      public final String vulnerableCode()

      The vulnerable code fragment.

      Returns:
      The vulnerable code fragment.
    • hasRelevantInputs

      public final boolean hasRelevantInputs()
      For responses, this returns true if the service returned a value for the RelevantInputs property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • relevantInputs

      public final List<String> relevantInputs()

      User-controlled inputs that reach the vulnerability.

      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 hasRelevantInputs() method.

      Returns:
      User-controlled inputs that reach the vulnerability.
    • hasStepsToReproduce

      public final boolean hasStepsToReproduce()
      For responses, this returns true if the service returned a value for the StepsToReproduce property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • stepsToReproduce

      public final List<String> stepsToReproduce()

      Steps to reproduce or exploit 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 hasStepsToReproduce() method.

      Returns:
      Steps to reproduce or exploit the finding.
    • validation

      public final FindingValidation validation()

      The validator's assessment. Absent when no validation ran.

      Returns:
      The validator's assessment. Absent when no validation ran.
    • endLine

      public final Integer endLine()

      The last line of the affected range, from the document's affected_code[].end_line.

      Returns:
      The last line of the affected range, from the document's affected_code[].end_line.
    • hasMitreTechniques

      public final boolean hasMitreTechniques()
      For responses, this returns true if the service returned a value for the MitreTechniques property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • mitreTechniques

      public final List<String> mitreTechniques()

      MITRE ATT&CK technique identifiers, from the document's finding_info.attacks[].technique.uid.

      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 hasMitreTechniques() method.

      Returns:
      MITRE ATT&CK technique identifiers, from the document's finding_info.attacks[].technique.uid.
    • hasRemediationReferences

      public final boolean hasRemediationReferences()
      For responses, this returns true if the service returned a value for the RemediationReferences property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • remediationReferences

      public final List<String> remediationReferences()

      Remediation references, from the document's vulnerabilities[].remediation.references.

      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 hasRemediationReferences() method.

      Returns:
      Remediation references, from the document's vulnerabilities[].remediation.references.
    • ocsfClass

      public final FindingOcsfClass ocsfClass()

      The OCSF class the document declared. Determines whether posture is populated.

      If the service returns an enum value that is not available in the current SDK version, ocsfClass will return FindingOcsfClass.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from ocsfClassAsString().

      Returns:
      The OCSF class the document declared. Determines whether posture is populated.
      See Also:
    • ocsfClassAsString

      public final String ocsfClassAsString()

      The OCSF class the document declared. Determines whether posture is populated.

      If the service returns an enum value that is not available in the current SDK version, ocsfClass will return FindingOcsfClass.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from ocsfClassAsString().

      Returns:
      The OCSF class the document declared. Determines whether posture is populated.
      See Also:
    • ocsfSchemaVersion

      public final String ocsfSchemaVersion()

      The OCSF schema version the producer wrote against (metadata.version).

      Returns:
      The OCSF schema version the producer wrote against (metadata.version).
    • productName

      public final String productName()

      The producing product and vendor (metadata.product).

      Returns:
      The producing product and vendor (metadata.product).
    • productVendorName

      public final String productVendorName()
      Returns the value of the ProductVendorName property for this object.
      Returns:
      The value of the ProductVendorName property for this object.
    • productVersion

      public final String productVersion()
      Returns the value of the ProductVersion property for this object.
      Returns:
      The value of the ProductVersion property for this object.
    • sourceStatus

      public final String sourceStatus()

      The producer's own status for the finding, and the enum value behind it. Distinct from status, which is Continuum's lifecycle state -- a producer may call a finding "New" while Continuum has it SUBMITTED.

      Returns:
      The producer's own status for the finding, and the enum value behind it. Distinct from status, which is Continuum's lifecycle state -- a producer may call a finding "New" while Continuum has it SUBMITTED.
    • sourceStatusId

      public final Integer sourceStatusId()

      The producer's numeric enum value for sourceStatus.

      Returns:
      The producer's numeric enum value for sourceStatus.
    • firstSeenAt

      public final Instant firstSeenAt()

      When the producer first observed the finding (finding_info.first_seen_time). The producer's own clock, not Continuum's.

      Returns:
      When the producer first observed the finding (finding_info.first_seen_time). The producer's own clock, not Continuum's.
    • hasFindingTypes

      public final boolean hasFindingTypes()
      For responses, this returns true if the service returned a value for the FindingTypes property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • findingTypes

      public final List<String> findingTypes()

      The producer's own classification of the finding (finding_info.types).

      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 hasFindingTypes() method.

      Returns:
      The producer's own classification of the finding (finding_info.types).
    • hasVulnerabilities

      public final boolean hasVulnerabilities()
      For responses, this returns true if the service returned a value for the Vulnerabilities property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • vulnerabilities

      public final List<FindingVulnerability> vulnerabilities()

      Every vulnerability the document reported. A document may report several; the flat cveId/ cvssBaseScore/filePath/lineNumber members above carry the first one's identity so a caller that only needs "what and where" does not have to walk this list.

      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 hasVulnerabilities() method.

      Returns:
      Every vulnerability the document reported. A document may report several; the flat cveId/ cvssBaseScore/filePath/lineNumber members above carry the first one's identity so a caller that only needs "what and where" does not have to walk this list.
    • hasResources

      public final boolean hasResources()
      For responses, this returns true if the service returned a value for the Resources property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • resources

      public final List<FindingResource> resources()

      Resources the document named (resources[]).

      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 hasResources() method.

      Returns:
      Resources the document named (resources[]).
    • posture

      public final FindingPosture posture()

      The compliance posture, for an Application Security Posture Finding. Absent for a vulnerability finding.

      Returns:
      The compliance posture, for an Application Security Posture Finding. Absent for a vulnerability finding.
    • findingId

      public final String findingId()

      The unique identifier of the finding.

      Returns:
      The unique identifier of the finding.
    • findingArn

      public final String findingArn()

      The ARN of the finding.

      Returns:
      The ARN of the finding.
    • environmentId

      public final String environmentId()

      The environment that owns the finding.

      Returns:
      The environment that owns the finding.
    • source

      public final String source()

      The system that produced the finding.

      Returns:
      The system that produced the finding.
    • sourceFindingId

      public final String sourceFindingId()

      The producer's own identifier for the finding.

      Returns:
      The producer's own identifier for the finding.
    • reportedAt

      public final Instant reportedAt()

      When the producer reported the finding -- its own clock, which is not Continuum's ingestion time. createdAt is when Continuum accepted it; these are genuinely different instants and a reader usually wants this one.

      For CreateCodeFinding, this is the submitted OCSF document's own top-level time. For findings Continuum's scanner produces, it is the finding's own creation time.

      Continuum does not validate it for plausibility: a producer's value is echoed as given, so a timestamp here asserts the unit and format, not that the instant is genuine.

      Returns:
      When the producer reported the finding -- its own clock, which is not Continuum's ingestion time. createdAt is when Continuum accepted it; these are genuinely different instants and a reader usually wants this one.

      For CreateCodeFinding, this is the submitted OCSF document's own top-level time. For findings Continuum's scanner produces, it is the finding's own creation time.

      Continuum does not validate it for plausibility: a producer's value is echoed as given, so a timestamp here asserts the unit and format, not that the instant is genuine.

    • status

      public final FindingStatus status()

      The current lifecycle status of the finding.

      If the service returns an enum value that is not available in the current SDK version, status will return FindingStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The current lifecycle status of the finding.
      See Also:
    • statusAsString

      public final String statusAsString()

      The current lifecycle status of the finding.

      If the service returns an enum value that is not available in the current SDK version, status will return FindingStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

      Returns:
      The current lifecycle status of the finding.
      See Also:
    • statusUpdatedAt

      public final Instant statusUpdatedAt()

      The timestamp when the status last transitioned.

      Returns:
      The timestamp when the status last transitioned.
    • createdAt

      public final Instant createdAt()

      The timestamp when the finding was ingested.

      Returns:
      The timestamp when the finding was ingested.
    • scanRunId

      public final String scanRunId()

      The scan that produced the finding, when it came from one. For a finding Continuum's scanner produced, this is the Continuum scan run (see GetCodeScan). For a finding submitted with CreateCodeFinding, it is the OCSF document's metadata.correlation_uid, when that value is a valid ScanRunId. Absent when the finding did not come from a scan.

      Returns:
      The scan that produced the finding, when it came from one. For a finding Continuum's scanner produced, this is the Continuum scan run (see GetCodeScan). For a finding submitted with CreateCodeFinding, it is the OCSF document's metadata.correlation_uid, when that value is a valid ScanRunId. Absent when the finding did not come from a scan.
    • statusMessage

      public final String statusMessage()

      Human-readable context about the current status.

      Returns:
      Human-readable context about the current status.
    • discardReason

      public final FindingDiscardReason discardReason()

      Why the finding was not escalated. Present only when status is DISCARDED.

      If the service returns an enum value that is not available in the current SDK version, discardReason will return FindingDiscardReason.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from discardReasonAsString().

      Returns:
      Why the finding was not escalated. Present only when status is DISCARDED.
      See Also:
    • discardReasonAsString

      public final String discardReasonAsString()

      Why the finding was not escalated. Present only when status is DISCARDED.

      If the service returns an enum value that is not available in the current SDK version, discardReason will return FindingDiscardReason.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from discardReasonAsString().

      Returns:
      Why the finding was not escalated. Present only when status is DISCARDED.
      See Also:
    • discardReasoning

      public final String discardReasoning()

      Customer-facing explanation accompanying discardReason.

      Returns:
      Customer-facing explanation accompanying discardReason.
    • duplicateOfIssueId

      public final String duplicateOfIssueId()

      The existing issue this finding duplicates. Present only for the DUPLICATE_OF_* discard reasons.

      Returns:
      The existing issue this finding duplicates. Present only for the DUPLICATE_OF_* discard reasons.
    • createdIssueId

      public final String createdIssueId()

      The issue Continuum created from this finding.

      Returns:
      The issue Continuum created from this finding.
    • completedAt

      public final Instant completedAt()

      When processing finished, whether by creating an issue or discarding. Absent while the finding is still in flight.

      Returns:
      When processing finished, whether by creating an issue or discarding. Absent while the finding is still in flight.
    • toBuilder

      public GetCodeFindingResponse.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<GetCodeFindingResponse.Builder,GetCodeFindingResponse>
      Specified by:
      toBuilder in class AwsResponse
      Returns:
      a builder for type T
    • builder

      public static GetCodeFindingResponse.Builder builder()
    • serializableBuilderClass

      public static Class<? extends GetCodeFindingResponse.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class AwsResponse
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class AwsResponse
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
      Description copied from class: SdkResponse
      Used to retrieve the value of a field from any class that extends SdkResponse. The field name specified should match the member name from the corresponding service-2.json model specified in the codegen-resources folder for a given service. The class specifies what class to cast the returned value to. If the returned value is also a modeled class, the SdkResponse.getValueForField(String, Class) method will again be available.
      Overrides:
      getValueForField in class SdkResponse
      Parameters:
      fieldName - The name of the member to be retrieved.
      clazz - The class to cast the returned object to.
      Returns:
      Optional containing the casted return value
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.