Skip to main content

io.enterpriseai.resources.MediaClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/MediaClient.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 MediaClient​

Media upload, scan and storage.

Constructor MediaClient​

MediaClient(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.

MediaClient.delete​

void delete(String id)

Delete a media. Deletes the media and its stored content. Allowed for its creator, tenant_admin or security_officer (403 forbidden). A media under legal hold answers 409 legal_hold. Audited as media.delete.

Route: /v1/media/{media_id} (DELETE).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the media.

Returns: void.

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

MediaClient.get​

JsonNode get(String id)

Get a media. Returns the Multimodal Contract document of the media. With include_content=true the answer is {media, content_base64} with the decrypted content; this needs a clearance at least equal to the media classification (403 policy_denied) and is audited as media.read.

Route: /v1/media/{media_id} (GET).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the media.

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

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

MediaClient.get​

JsonNode get(String id, Map<String, ?> query)

Get a media. Returns the Multimodal Contract document of the media. With include_content=true the answer is {media, content_base64} with the decrypted content; this needs a clearance at least equal to the media classification (403 policy_denied) and is audited as media.read.

Route: /v1/media/{media_id} (GET).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the media.
queryMap<String, ?>yesQuery string parameters of the route.

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

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

MediaClient.list​

io.enterpriseai.Page<JsonNode> list(Map<String, ?> query)

List the media. Tenant media (Multimodal Contract documents), keyset paginated with cursor, filtered by media_type and classification (400 invalid_request for an unknown value).

Route: /v1/media (GET).

NameTypeDefaultRequiredDescription
queryMap<String, ?>yesQuery string parameters of the route.

Returns: io.enterpriseai.Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

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

MediaClient.upload​

JsonNode upload(Object body)

Upload a media. Stores a media (201) from JSON {content_base64, mime_type, filename?, operation?, dlp_mode?, retention_days?, classification?} or multipart/form-data with a file part and the same fields. Any tenant principal may call it. Steps: 1. Size checked against the platform maximum (50 MiB unless configured; 413 media_too_large). 2. File scan by ClamAV and YARA-X (422 file_blocked, 503 file_scan_unavailable). 3. Text extraction and DLP with dlp_mode (default detect; block answers 422 dlp_blocked when personal data is found); the classification is raised accordingly. 4. The content is encrypted with a tenant key and stored. Returns the Multimodal Contract document.

Route: /v1/media (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesThe file (JSON with base64 content, or multipart with a file part) and its options: operation the media is meant for, dlp_mode (detect, mask, tokenize, block), retention_days (0 or more), classification.

Returns: JsonNode. Decoded JSON answer of the operation "Upload a media".

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

MediaClient.upload​

JsonNode upload(Object body, RequestOptions options)

Upload a media. Stores a media (201) from JSON {content_base64, mime_type, filename?, operation?, dlp_mode?, retention_days?, classification?} or multipart/form-data with a file part and the same fields. Any tenant principal may call it. Steps: 1. Size checked against the platform maximum (50 MiB unless configured; 413 media_too_large). 2. File scan by ClamAV and YARA-X (422 file_blocked, 503 file_scan_unavailable). 3. Text extraction and DLP with dlp_mode (default detect; block answers 422 dlp_blocked when personal data is found); the classification is raised accordingly. 4. The content is encrypted with a tenant key and stored. Returns the Multimodal Contract document.

Route: /v1/media (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesThe file (JSON with base64 content, or multipart with a file part) and its options: operation the media is meant for, dlp_mode (detect, mask, tokenize, block), retention_days (0 or more), classification.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Upload a media".

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