Skip to main content

io.enterpriseai.resources.ContractsClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/ContractsClient.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class ContractsClient​

Technical contracts (JSON Schemas) and server side validation.

Constructor ContractsClient​

ContractsClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

ContractsClient.get​

JsonNode get(String name)

Get a contract. Returns the JSON Schema of the contract as published. Open to any authenticated caller. An unknown name answers 404 unknown_contract.

Route: /v1/contracts/{name} (GET).

NameTypeDefaultRequiredDescription
nameStringyesName of the contract, for example agent-manifest.

Returns: JsonNode. Decoded JSON answer of the operation "Get a contract".

Raises: the typed errors of the transport (Errors).

ContractsClient.list​

JsonNode list()

List the contracts. Lists the published contracts with their name, title, kind, type, file, schema id and description. Open to any authenticated caller. next_cursor is always null.

Route: /v1/contracts (GET).

This element takes no parameter.

Returns: JsonNode. Decoded JSON answer of the operation "List the contracts".

Raises: the typed errors of the transport (Errors).

ContractsClient.validate​

ValidationResult validate(String name, Object document)

Local validation against the embedded contracts/v1 copy (no network call).

NameTypeDefaultRequiredDescription
nameStringyesName of the contract, such as tool-manifest; an unknown name raises IllegalArgumentException.
documentObjectyesValue to validate: a JsonNode, a Map or a record converted to JSON.

Returns: ValidationResult. A ValidationResult: Result of a contract validation.

ContractsClient.validateManifest​

ValidationResult validateManifest(Object manifest)

Local validation of a manifest, the contract is chosen from kind.

NameTypeDefaultRequiredDescription
manifestObjectyesManifest to validate; its kind picks the contract, an unknown kind gives an invalid result for the unknown contract.

Returns: ValidationResult. A ValidationResult: Result of a contract validation.

ContractsClient.validateRemote​

JsonNode validateRemote(String name, Object body)

Validate a document against a contract. Validates the body against the contract, formats included, without storing anything. The answer gives contract, valid and errors, each with the JSON path of the faulty value and a message. Open to any authenticated caller. An unknown contract answers 404 unknown_contract.

Route: /v1/contracts/{name}/validate (POST).

NameTypeDefaultRequiredDescription
nameStringyesName of the contract, for example agent-manifest.
bodyObjectyesAny JSON document to validate.

Returns: JsonNode. Decoded JSON answer of the operation "Validate a document against a contract".

Raises: the typed errors of the transport (Errors).

ContractsClient.validateRemote​

JsonNode validateRemote(String name, Object body, RequestOptions options)

Validate a document against a contract. Validates the body against the contract, formats included, without storing anything. The answer gives contract, valid and errors, each with the JSON path of the faulty value and a message. Open to any authenticated caller. An unknown contract answers 404 unknown_contract.

Route: /v1/contracts/{name}/validate (POST).

NameTypeDefaultRequiredDescription
nameStringyesName of the contract, for example agent-manifest.
bodyObjectyesAny JSON document to validate.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Validate a document against a contract".

Raises: the typed errors of the transport (Errors).