Table of Contents

Class AuditResidueBuilder

Namespace
AsiBackbone.Core.Audit
Assembly
AsiBackbone.Core.dll

Provides a fluent construction path for complex AuditResidue values.

public sealed class AuditResidueBuilder
Inheritance
AuditResidueBuilder
Inherited Members

Remarks

The builder is intended for ergonomic object creation in host code, samples, and tests. It preserves the immutable AuditResidue value model by producing a new residue when Build() is called.

Methods

AddMetadata(string, string)

Adds or replaces one metadata value.

public AuditResidueBuilder AddMetadata(string key, string value)

Parameters

key string
value string

Returns

AuditResidueBuilder

AddReasonCode(string)

Adds one reason code to the builder.

public AuditResidueBuilder AddReasonCode(string value)

Parameters

value string

Returns

AuditResidueBuilder

Build()

Builds an immutable audit residue value.

public AuditResidue Build()

Returns

AuditResidue

Create(IAsiBackboneActorContext, string, string)

Creates a builder for a host-defined audit outcome.

public static AuditResidueBuilder Create(IAsiBackboneActorContext actor, string operationName, string outcome)

Parameters

actor IAsiBackboneActorContext
operationName string
outcome string

Returns

AuditResidueBuilder

FromConstraint(IAsiBackboneActorContext, string, ConstraintEvaluationResult)

Creates a builder initialized from a constraint evaluation result.

public static AuditResidueBuilder FromConstraint(IAsiBackboneActorContext actor, string operationName, ConstraintEvaluationResult constraintResult)

Parameters

actor IAsiBackboneActorContext
operationName string
constraintResult ConstraintEvaluationResult

Returns

AuditResidueBuilder

FromDecision(IAsiBackboneActorContext, string, GovernanceDecision)

Creates a builder initialized from a governance decision.

public static AuditResidueBuilder FromDecision(IAsiBackboneActorContext actor, string operationName, GovernanceDecision decision)

Parameters

actor IAsiBackboneActorContext
operationName string
decision GovernanceDecision

Returns

AuditResidueBuilder

WithAuditResidueId(string?)

Sets the stable audit residue identifier.

public AuditResidueBuilder WithAuditResidueId(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithConstraintCount(int?)

Sets the evaluated constraint count.

public AuditResidueBuilder WithConstraintCount(int? value)

Parameters

value int?

Returns

AuditResidueBuilder

WithConstraintSetHash(string?)

Sets the evaluated constraint-set hash.

public AuditResidueBuilder WithConstraintSetHash(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithCorrelationId(string?)

Sets the correlation identifier.

public AuditResidueBuilder WithCorrelationId(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithDecisionLatencyMs(long?)

Sets the decision latency in milliseconds.

public AuditResidueBuilder WithDecisionLatencyMs(long? value)

Parameters

value long?

Returns

AuditResidueBuilder

WithDecisionStage(string?)

Sets the provider-neutral decision stage.

public AuditResidueBuilder WithDecisionStage(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithEmitterProvider(string?)

Sets the provider-neutral emitter provider name.

public AuditResidueBuilder WithEmitterProvider(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithEmitterStatus(string?)

Sets the provider-neutral emitter status.

public AuditResidueBuilder WithEmitterStatus(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithEventId(string?)

Sets the audit event identifier.

public AuditResidueBuilder WithEventId(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithGatewayExecutionId(string?)

Sets the gateway execution identifier.

public AuditResidueBuilder WithGatewayExecutionId(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithMetadata(IReadOnlyDictionary<string, string>?)

Replaces the metadata collection.

public AuditResidueBuilder WithMetadata(IReadOnlyDictionary<string, string>? values)

Parameters

values IReadOnlyDictionary<string, string>

Returns

AuditResidueBuilder

WithOccurredUtc(DateTimeOffset?)

Sets the event occurrence timestamp.

public AuditResidueBuilder WithOccurredUtc(DateTimeOffset? value)

Parameters

value DateTimeOffset?

Returns

AuditResidueBuilder

WithOrganizationHash(string?)

Sets the privacy-preserving organization hash.

public AuditResidueBuilder WithOrganizationHash(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithOutboxSequence(long?)

Sets the outbox sequence.

public AuditResidueBuilder WithOutboxSequence(long? value)

Parameters

value long?

Returns

AuditResidueBuilder

WithParentSpanId(string?)

Sets the parent span identifier.

public AuditResidueBuilder WithParentSpanId(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithPolicyHash(string?)

Sets the policy hash.

public AuditResidueBuilder WithPolicyHash(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithPolicyScope(string?)

Sets the host-defined policy scope.

public AuditResidueBuilder WithPolicyScope(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithPolicyVersion(string?)

Sets the policy version.

public AuditResidueBuilder WithPolicyVersion(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithReasonCodes(IEnumerable<string>?)

Replaces the reason-code collection.

public AuditResidueBuilder WithReasonCodes(IEnumerable<string>? values)

Parameters

values IEnumerable<string>

Returns

AuditResidueBuilder

WithRiskScore(double?)

Sets the host-defined risk score.

public AuditResidueBuilder WithRiskScore(double? value)

Parameters

value double?

Returns

AuditResidueBuilder

WithSchemaVersion(string?)

Sets the audit residue schema version.

public AuditResidueBuilder WithSchemaVersion(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithSpanId(string?)

Sets the span identifier.

public AuditResidueBuilder WithSpanId(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithTenantHash(string?)

Sets the privacy-preserving tenant hash.

public AuditResidueBuilder WithTenantHash(string? value)

Parameters

value string

Returns

AuditResidueBuilder

WithTraceId(string?)

Sets the trace identifier.

public AuditResidueBuilder WithTraceId(string? value)

Parameters

value string

Returns

AuditResidueBuilder