Record Class ApiCaptureGenerationRequest

java.lang.Object
java.lang.Record
com.shaft.capture.generate.api.ApiCaptureGenerationRequest
Record Components:
sessionPath - path to the recorded CaptureSession JSON file
outputDirectory - project root the generated source/test-data/report are written under
packageName - generated class package
className - generated class name; blank derives one deterministically from the session ID
style - how transactions are grouped into test methods
validationDepth - how thoroughly each response is validated
compile - whether to compile the generated source
replay - whether to replay the compiled class (ignored unless compile is also true; off by default at the caller level since replaying non-idempotent HTTP methods against a live service is unsafe to do automatically)
overwrite - whether existing output files may be overwritten
openApiSpecPath - optional path to an OpenAPI (JSON or YAML) spec to cross-report recorded endpoints against; null skips coverage reporting entirely
enrichmentMode - optional AI naming-enrichment phase for the ApiCodegenStyle.HYBRID_UI_API scenario method/class name; NONE (the default) never calls AI, and generation always produces a valid deterministic name without it
enrichmentPreviewPath - preview path to write (PREVIEW) or read (APPLY)
enrichmentApproved - whether a reviewed preview may be applied; required when enrichmentMode is APPLY
aiApprovalPolicy - explicit evidence and processing-location approval for preview generation; ApprovalPolicy.denyAll() by default, so AI naming never runs unless the caller explicitly approves it
excludedTransactionIds - recorded transaction IDs (see CaptureEvent.NetworkEvent#transactionId()) to omit from the generated test entirely, driven by a caller-side transaction include/exclude selection; empty includes every renderable transaction (the default)
pinnedJsonPaths - response JSON paths (e.g. $.status) to force-assert as a business assertion at ApiValidationDepth.BUSINESS even when the leaf is classified VOLATILE or CORRELATED; a SENSITIVE or blank-value leaf is never asserted regardless of pinning (empty by default)

public record ApiCaptureGenerationRequest(Path sessionPath, Path outputDirectory, String packageName, String className, ApiCodegenStyle style, ApiValidationDepth validationDepth, boolean compile, boolean replay, boolean overwrite, Path openApiSpecPath, CaptureGenerationRequest.EnrichmentMode enrichmentMode, Path enrichmentPreviewPath, boolean enrichmentApproved, ApprovalPolicy aiApprovalPolicy, List<String> excludedTransactionIds, List<String> pinnedJsonPaths) extends Record
Options for generating a SHAFT.API test class from a recorded session.
  • Constructor Details

    • ApiCaptureGenerationRequest

      public ApiCaptureGenerationRequest(Path sessionPath, Path outputDirectory, String packageName, String className, ApiCodegenStyle style, ApiValidationDepth validationDepth, boolean compile, boolean replay, boolean overwrite, Path openApiSpecPath, CaptureGenerationRequest.EnrichmentMode enrichmentMode, Path enrichmentPreviewPath, boolean enrichmentApproved, ApprovalPolicy aiApprovalPolicy, List<String> excludedTransactionIds, List<String> pinnedJsonPaths)
      Creates an instance of a ApiCaptureGenerationRequest record class.
      Parameters:
      sessionPath - the value for the sessionPath record component
      outputDirectory - the value for the outputDirectory record component
      packageName - the value for the packageName record component
      className - the value for the className record component
      style - the value for the style record component
      validationDepth - the value for the validationDepth record component
      compile - the value for the compile record component
      replay - the value for the replay record component
      overwrite - the value for the overwrite record component
      openApiSpecPath - the value for the openApiSpecPath record component
      enrichmentMode - the value for the enrichmentMode record component
      enrichmentPreviewPath - the value for the enrichmentPreviewPath record component
      enrichmentApproved - the value for the enrichmentApproved record component
      aiApprovalPolicy - the value for the aiApprovalPolicy record component
      excludedTransactionIds - the value for the excludedTransactionIds record component
      pinnedJsonPaths - the value for the pinnedJsonPaths record component
    • ApiCaptureGenerationRequest

      public ApiCaptureGenerationRequest(Path sessionPath, Path outputDirectory, String packageName, String className, ApiCodegenStyle style, ApiValidationDepth validationDepth, boolean compile, boolean replay, boolean overwrite, Path openApiSpecPath, CaptureGenerationRequest.EnrichmentMode enrichmentMode, Path enrichmentPreviewPath, boolean enrichmentApproved, ApprovalPolicy aiApprovalPolicy, List<String> excludedTransactionIds)
      Compatibility constructor for callers compiled before pinned business-assertion JSON paths were added.
      Parameters:
      sessionPath - path to the recorded CaptureSession JSON file
      outputDirectory - project root the generated source/test-data/report are written under
      packageName - generated class package
      className - generated class name; blank derives one deterministically from the session ID
      style - how transactions are grouped into test methods
      validationDepth - how thoroughly each response is validated
      compile - whether to compile the generated source
      replay - whether to replay the compiled class
      overwrite - whether existing output files may be overwritten
      openApiSpecPath - optional path to an OpenAPI spec to cross-report recorded endpoints against
      enrichmentMode - optional AI naming-enrichment phase
      enrichmentPreviewPath - preview path to write or read
      enrichmentApproved - whether a reviewed preview may be applied
      aiApprovalPolicy - explicit evidence and processing-location approval for preview generation
      excludedTransactionIds - recorded transaction IDs to omit from the generated test entirely
    • ApiCaptureGenerationRequest

      public ApiCaptureGenerationRequest(Path sessionPath, Path outputDirectory, String packageName, String className, ApiCodegenStyle style, ApiValidationDepth validationDepth, boolean compile, boolean replay, boolean overwrite, Path openApiSpecPath, CaptureGenerationRequest.EnrichmentMode enrichmentMode, Path enrichmentPreviewPath, boolean enrichmentApproved, ApprovalPolicy aiApprovalPolicy)
      Compatibility constructor for callers compiled before the transaction include/exclude filter was added.
      Parameters:
      sessionPath - path to the recorded CaptureSession JSON file
      outputDirectory - project root the generated source/test-data/report are written under
      packageName - generated class package
      className - generated class name; blank derives one deterministically from the session ID
      style - how transactions are grouped into test methods
      validationDepth - how thoroughly each response is validated
      compile - whether to compile the generated source
      replay - whether to replay the compiled class
      overwrite - whether existing output files may be overwritten
      openApiSpecPath - optional path to an OpenAPI spec to cross-report recorded endpoints against
      enrichmentMode - optional AI naming-enrichment phase
      enrichmentPreviewPath - preview path to write or read
      enrichmentApproved - whether a reviewed preview may be applied
      aiApprovalPolicy - explicit evidence and processing-location approval for preview generation
    • ApiCaptureGenerationRequest

      public ApiCaptureGenerationRequest(Path sessionPath, Path outputDirectory, String packageName, String className, ApiCodegenStyle style, ApiValidationDepth validationDepth, boolean compile, boolean replay, boolean overwrite, Path openApiSpecPath)
      Compatibility constructor for callers compiled before AI naming enrichment was added.
      Parameters:
      sessionPath - path to the recorded CaptureSession JSON file
      outputDirectory - project root the generated source/test-data/report are written under
      packageName - generated class package
      className - generated class name; blank derives one deterministically from the session ID
      style - how transactions are grouped into test methods
      validationDepth - how thoroughly each response is validated
      compile - whether to compile the generated source
      replay - whether to replay the compiled class
      overwrite - whether existing output files may be overwritten
      openApiSpecPath - optional path to an OpenAPI spec to cross-report recorded endpoints against
    • ApiCaptureGenerationRequest

      public ApiCaptureGenerationRequest(Path sessionPath, Path outputDirectory, String packageName, String className, ApiCodegenStyle style, ApiValidationDepth validationDepth, boolean compile, boolean replay, boolean overwrite)
      Compatibility constructor for callers compiled before OpenAPI coverage reporting was added.
      Parameters:
      sessionPath - path to the recorded CaptureSession JSON file
      outputDirectory - project root the generated source/test-data/report are written under
      packageName - generated class package
      className - generated class name; blank derives one deterministically from the session ID
      style - how transactions are grouped into test methods
      validationDepth - how thoroughly each response is validated
      compile - whether to compile the generated source
      replay - whether to replay the compiled class
      overwrite - whether existing output files may be overwritten
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sessionPath

      public Path sessionPath()
      Returns the value of the sessionPath record component.
      Returns:
      the value of the sessionPath record component
    • outputDirectory

      public Path outputDirectory()
      Returns the value of the outputDirectory record component.
      Returns:
      the value of the outputDirectory record component
    • packageName

      public String packageName()
      Returns the value of the packageName record component.
      Returns:
      the value of the packageName record component
    • className

      public String className()
      Returns the value of the className record component.
      Returns:
      the value of the className record component
    • style

      public ApiCodegenStyle style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • validationDepth

      public ApiValidationDepth validationDepth()
      Returns the value of the validationDepth record component.
      Returns:
      the value of the validationDepth record component
    • compile

      public boolean compile()
      Returns the value of the compile record component.
      Returns:
      the value of the compile record component
    • replay

      public boolean replay()
      Returns the value of the replay record component.
      Returns:
      the value of the replay record component
    • overwrite

      public boolean overwrite()
      Returns the value of the overwrite record component.
      Returns:
      the value of the overwrite record component
    • openApiSpecPath

      public Path openApiSpecPath()
      Returns the value of the openApiSpecPath record component.
      Returns:
      the value of the openApiSpecPath record component
    • enrichmentMode

      public CaptureGenerationRequest.EnrichmentMode enrichmentMode()
      Returns the value of the enrichmentMode record component.
      Returns:
      the value of the enrichmentMode record component
    • enrichmentPreviewPath

      public Path enrichmentPreviewPath()
      Returns the value of the enrichmentPreviewPath record component.
      Returns:
      the value of the enrichmentPreviewPath record component
    • enrichmentApproved

      public boolean enrichmentApproved()
      Returns the value of the enrichmentApproved record component.
      Returns:
      the value of the enrichmentApproved record component
    • aiApprovalPolicy

      public ApprovalPolicy aiApprovalPolicy()
      Returns the value of the aiApprovalPolicy record component.
      Returns:
      the value of the aiApprovalPolicy record component
    • excludedTransactionIds

      public List<String> excludedTransactionIds()
      Returns the value of the excludedTransactionIds record component.
      Returns:
      the value of the excludedTransactionIds record component
    • pinnedJsonPaths

      public List<String> pinnedJsonPaths()
      Returns the value of the pinnedJsonPaths record component.
      Returns:
      the value of the pinnedJsonPaths record component