Share via


ComparisonFilter Class

Definition

A filter used to compare a specified attribute key to a given value using a defined comparison operation.

public class ComparisonFilter : Azure.AI.AgentServer.Contracts.Generated.Common.IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel<Azure.AI.AgentServer.Contracts.Generated.OpenAI.ComparisonFilter>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.AgentServer.Contracts.Generated.OpenAI.ComparisonFilter>
type ComparisonFilter = class
    interface IUtf8JsonSerializable
    interface IJsonModel<ComparisonFilter>
    interface IPersistableModel<ComparisonFilter>
Public Class ComparisonFilter
Implements IJsonModel(Of ComparisonFilter), IPersistableModel(Of ComparisonFilter), IUtf8JsonSerializable
Inheritance
ComparisonFilter
Implements

Constructors

Name Description
ComparisonFilter()

Initializes a new instance of ComparisonFilter for deserialization.

ComparisonFilter(ComparisonFilterType, String, BinaryData, IDictionary<String,BinaryData>)

Initializes a new instance of ComparisonFilter.

ComparisonFilter(ComparisonFilterType, String, BinaryData)

Initializes a new instance of ComparisonFilter.

Properties

Name Description
Key

The key to compare against the value.

Type

Specifies the comparison operator: eq, ne, gt, gte, lt, lte.

  • eq: equals
  • ne: not equal
  • gt: greater than
  • gte: greater than or equal
  • lt: less than
  • lte: less than or equal
Value

The value to compare against the attribute key; supports string, number, or boolean types.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

<remarks> Supported types:

</remarks> Examples:
  • BinaryData.FromObjectAsJson("foo"): Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""): Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }): Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"): Creates a payload of { "key": "value" }.

Methods

Name Description
DeserializeComparisonFilter(JsonElement, ModelReaderWriterOptions)
FromResponse(Response)

Deserializes the model from a raw response.

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
ToRequestContent()

Convert into a RequestContent.

Explicit Interface Implementations

Name Description
IJsonModel<ComparisonFilter>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<ComparisonFilter>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<ComparisonFilter>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<ComparisonFilter>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<ComparisonFilter>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

IUtf8JsonSerializable.Write(Utf8JsonWriter)

Applies to