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.
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.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
transport | Transport | yes | Transport 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | String | yes | Name 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | String | yes | Name of the contract, such as tool-manifest; an unknown name raises IllegalArgumentException. | |
document | Object | yes | Value 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.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
manifest | Object | yes | Manifest 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | String | yes | Name of the contract, for example agent-manifest. | |
body | Object | yes | Any 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).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | String | yes | Name of the contract, for example agent-manifest. | |
body | Object | yes | Any JSON document to validate. | |
options | RequestOptions | yes | Per 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).