Record Class ApiCaptureGenerationRequest
java.lang.Object
java.lang.Record
com.shaft.capture.generate.api.ApiCaptureGenerationRequest
- Record Components:
sessionPath- path to the recordedCaptureSessionJSON fileoutputDirectory- project root the generated source/test-data/report are written underpackageName- generated class packageclassName- generated class name; blank derives one deterministically from the session IDstyle- how transactions are grouped into test methodsvalidationDepth- how thoroughly each response is validatedcompile- whether to compile the generated sourcereplay- whether to replay the compiled class (ignored unlesscompileis 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 overwrittenopenApiSpecPath- optional path to an OpenAPI (JSON or YAML) spec to cross-report recorded endpoints against;nullskips coverage reporting entirelyenrichmentMode- optional AI naming-enrichment phase for theApiCodegenStyle.HYBRID_UI_APIscenario method/class name;NONE(the default) never calls AI, and generation always produces a valid deterministic name without itenrichmentPreviewPath- preview path to write (PREVIEW) or read (APPLY)enrichmentApproved- whether a reviewed preview may be applied; required whenenrichmentModeisAPPLYaiApprovalPolicy- explicit evidence and processing-location approval for preview generation;ApprovalPolicy.denyAll()by default, so AI naming never runs unless the caller explicitly approves itexcludedTransactionIds- recorded transaction IDs (seeCaptureEvent.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 atApiValidationDepth.BUSINESSeven when the leaf is classifiedVOLATILEorCORRELATED; aSENSITIVEor 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 Summary
ConstructorsConstructorDescriptionApiCaptureGenerationRequest(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.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.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.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.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 aApiCaptureGenerationRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaiApprovalPolicyrecord component.Returns the value of theclassNamerecord component.booleancompile()Returns the value of thecompilerecord component.booleanReturns the value of theenrichmentApprovedrecord component.Returns the value of theenrichmentModerecord component.Returns the value of theenrichmentPreviewPathrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexcludedTransactionIdsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theopenApiSpecPathrecord component.Returns the value of theoutputDirectoryrecord component.booleanReturns the value of theoverwriterecord component.Returns the value of thepackageNamerecord component.Returns the value of thepinnedJsonPathsrecord component.booleanreplay()Returns the value of thereplayrecord component.Returns the value of thesessionPathrecord component.style()Returns the value of thestylerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalidationDepthrecord component.
-
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 aApiCaptureGenerationRequestrecord class.- Parameters:
sessionPath- the value for thesessionPathrecord componentoutputDirectory- the value for theoutputDirectoryrecord componentpackageName- the value for thepackageNamerecord componentclassName- the value for theclassNamerecord componentstyle- the value for thestylerecord componentvalidationDepth- the value for thevalidationDepthrecord componentcompile- the value for thecompilerecord componentreplay- the value for thereplayrecord componentoverwrite- the value for theoverwriterecord componentopenApiSpecPath- the value for theopenApiSpecPathrecord componentenrichmentMode- the value for theenrichmentModerecord componentenrichmentPreviewPath- the value for theenrichmentPreviewPathrecord componentenrichmentApproved- the value for theenrichmentApprovedrecord componentaiApprovalPolicy- the value for theaiApprovalPolicyrecord componentexcludedTransactionIds- the value for theexcludedTransactionIdsrecord componentpinnedJsonPaths- the value for thepinnedJsonPathsrecord 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 recordedCaptureSessionJSON fileoutputDirectory- project root the generated source/test-data/report are written underpackageName- generated class packageclassName- generated class name; blank derives one deterministically from the session IDstyle- how transactions are grouped into test methodsvalidationDepth- how thoroughly each response is validatedcompile- whether to compile the generated sourcereplay- whether to replay the compiled classoverwrite- whether existing output files may be overwrittenopenApiSpecPath- optional path to an OpenAPI spec to cross-report recorded endpoints againstenrichmentMode- optional AI naming-enrichment phaseenrichmentPreviewPath- preview path to write or readenrichmentApproved- whether a reviewed preview may be appliedaiApprovalPolicy- explicit evidence and processing-location approval for preview generationexcludedTransactionIds- 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 recordedCaptureSessionJSON fileoutputDirectory- project root the generated source/test-data/report are written underpackageName- generated class packageclassName- generated class name; blank derives one deterministically from the session IDstyle- how transactions are grouped into test methodsvalidationDepth- how thoroughly each response is validatedcompile- whether to compile the generated sourcereplay- whether to replay the compiled classoverwrite- whether existing output files may be overwrittenopenApiSpecPath- optional path to an OpenAPI spec to cross-report recorded endpoints againstenrichmentMode- optional AI naming-enrichment phaseenrichmentPreviewPath- preview path to write or readenrichmentApproved- whether a reviewed preview may be appliedaiApprovalPolicy- 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 recordedCaptureSessionJSON fileoutputDirectory- project root the generated source/test-data/report are written underpackageName- generated class packageclassName- generated class name; blank derives one deterministically from the session IDstyle- how transactions are grouped into test methodsvalidationDepth- how thoroughly each response is validatedcompile- whether to compile the generated sourcereplay- whether to replay the compiled classoverwrite- whether existing output files may be overwrittenopenApiSpecPath- 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 recordedCaptureSessionJSON fileoutputDirectory- project root the generated source/test-data/report are written underpackageName- generated class packageclassName- generated class name; blank derives one deterministically from the session IDstyle- how transactions are grouped into test methodsvalidationDepth- how thoroughly each response is validatedcompile- whether to compile the generated sourcereplay- whether to replay the compiled classoverwrite- whether existing output files may be overwritten
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
sessionPath
Returns the value of thesessionPathrecord component.- Returns:
- the value of the
sessionPathrecord component
-
outputDirectory
Returns the value of theoutputDirectoryrecord component.- Returns:
- the value of the
outputDirectoryrecord component
-
packageName
Returns the value of thepackageNamerecord component.- Returns:
- the value of the
packageNamerecord component
-
className
-
style
-
validationDepth
Returns the value of thevalidationDepthrecord component.- Returns:
- the value of the
validationDepthrecord component
-
compile
-
replay
-
overwrite
-
openApiSpecPath
Returns the value of theopenApiSpecPathrecord component.- Returns:
- the value of the
openApiSpecPathrecord component
-
enrichmentMode
Returns the value of theenrichmentModerecord component.- Returns:
- the value of the
enrichmentModerecord component
-
enrichmentPreviewPath
Returns the value of theenrichmentPreviewPathrecord component.- Returns:
- the value of the
enrichmentPreviewPathrecord component
-
enrichmentApproved
public boolean enrichmentApproved()Returns the value of theenrichmentApprovedrecord component.- Returns:
- the value of the
enrichmentApprovedrecord component
-
aiApprovalPolicy
Returns the value of theaiApprovalPolicyrecord component.- Returns:
- the value of the
aiApprovalPolicyrecord component
-
excludedTransactionIds
Returns the value of theexcludedTransactionIdsrecord component.- Returns:
- the value of the
excludedTransactionIdsrecord component
-
pinnedJsonPaths
Returns the value of thepinnedJsonPathsrecord component.- Returns:
- the value of the
pinnedJsonPathsrecord component
-