Skip to content
Tracon

StructuredResponseValidationResult

Namespace Tracon · Assembly Tracon.Abstractions.dll

The outcome of a structured response validation check.

public sealed record StructuredResponseValidationResult : IEquatable<StructuredResponseValidationResult>

objectStructuredResponseValidationResult

IEquatable<StructuredResponseValidationResult>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Gets whether the response is valid.

public bool IsValid { get; }

bool

Gets the reason written to the run record when the response is rejected. null when StructuredResponseValidationResult.IsValid is true.

public string? Reason { get; }

string?

This text becomes part of a persistent run event and, through the run’s error message, can reach an external response. It must never carry the response text itself — a rejected response’s record is permanent, and the reason is meant to say why the response was rejected, not repeat what it said.

A result accepting the response.

public static StructuredResponseValidationResult Valid { get; }

StructuredResponseValidationResult

public override bool Equals(object? obj)

obj object?

bool

Equals(StructuredResponseValidationResult?)

Section titled “ Equals(StructuredResponseValidationResult?)”
public bool Equals(StructuredResponseValidationResult? other)

other StructuredResponseValidationResult?

bool

public override int GetHashCode()

int

Creates a result that rejects the response.

public static StructuredResponseValidationResult Invalid(string reason)

reason string

The reason written to the run record. Must not carry the response text.

StructuredResponseValidationResult

A rejecting result.

ArgumentException

reason is empty or whitespace.

public override string ToString()

string

operator ==(StructuredResponseValidationResult?, StructuredResponseValidationResult?)

Section titled “ operator ==(StructuredResponseValidationResult?, StructuredResponseValidationResult?)”
public static bool operator ==(StructuredResponseValidationResult? left, StructuredResponseValidationResult? right)

left StructuredResponseValidationResult?

right StructuredResponseValidationResult?

bool

operator !=(StructuredResponseValidationResult?, StructuredResponseValidationResult?)

Section titled “ operator !=(StructuredResponseValidationResult?, StructuredResponseValidationResult?)”
public static bool operator !=(StructuredResponseValidationResult? left, StructuredResponseValidationResult? right)

left StructuredResponseValidationResult?

right StructuredResponseValidationResult?

bool