Document Models

Document models for the ACPortal API.

class ab.api.models.documents.DocumentListParams(*, jobDisplayId=None)[source]

Bases: RequestModel

Query parameters for GET /documents/list.

Parameters:

jobDisplayId (str | None)

job_display_id: str | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.documents.Document(*, id=None, path=None, thumbnailPath=None, description=None, typeName=None, typeId=None, fileName=None, shared=None, tags=None, jobItems=None, **extra_data)[source]

Bases: ResponseModel, IdentifiedModel

Document record — GET /documents/list and embedded in Job response.

Live API field names differ from swagger: path not docPath, typeName not docType, shared not sharingLevel.

Parameters:
  • id (str | int | None)

  • path (str | None)

  • thumbnailPath (str | None)

  • description (str | None)

  • typeName (str | None)

  • typeId (int | None)

  • fileName (str | None)

  • shared (int | None)

  • tags (List | None)

  • jobItems (List | None)

  • extra_data (Any)

path: str | None
thumbnail_path: str | None
description: str | None
type_name: str | None
type_id: int | None
file_name: str | None
shared: int | None
tags: List | None
job_items: List | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.documents.DocumentUpdateRequest(*, docType=None, sharingLevel=None)[source]

Bases: RequestModel

Body for PUT /documents/update/{docId}.

Parameters:
  • docType (int | None)

  • sharingLevel (int | None)

doc_type: int | None
sharing_level: int | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.documents.DocumentUploadRequest(*, JobDisplayId, DocumentType, DocumentTypeDescription=None, Shared=0, Tags=None, JobItems=None, RfqId=None)[source]

Bases: RequestModel

Multipart form fields for POST /documents.

The file itself is sent as a separate file multipart part — this model carries only the accompanying form fields. Aliases are PascalCase to match the swagger multipart contract exactly (JobDisplayId, DocumentType, Shared, JobItems …), which differs from the camelCase convention used elsewhere, so each alias is declared explicitly.

An item photo is just this request with document_type=DocumentType.ITEM_PHOTO and job_items set to the target item UUID(s); the upload_item_photo() helper fills those in for you.

Parameters:
  • JobDisplayId (str)

  • DocumentType (DocumentType | int)

  • DocumentTypeDescription (str | None)

  • Shared (int)

  • Tags (List[str] | None)

  • JobItems (List[str] | None)

  • RfqId (int | None)

job_display_id: str
document_type: DocumentType | int
document_type_description: str | None
shared: int
tags: List[str] | None
job_items: List[str] | None
rfq_id: int | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.documents.UploadedFile(*, id=None, fileName=None, fileSize=None, documentType=None, itemId=None, thumbnailUrl=None, **extra_data)[source]

Bases: ResponseModel

A single file entry within a DocumentUploadResponse.

The upload response shape is not described in swagger; fields mirror the document records the live API has been observed to return and are all optional so deserialization stays resilient (ResponseModel allows and warns on unknown fields).

Parameters:
  • id (int | None)

  • fileName (str | None)

  • fileSize (int | None)

  • documentType (str | None)

  • itemId (int | None)

  • thumbnailUrl (str | None)

  • extra_data (Any)

id: int | None
file_name: str | None
file_size: int | None
document_type: str | None
item_id: int | None
thumbnail_url: str | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ab.api.models.documents.DocumentUploadResponse(*, success=None, message=None, uploadedFiles=None, id=None, fileName=None, **extra_data)[source]

Bases: ResponseModel

Response body for POST /documents.

Provisional shape (no swagger schema / live capture yet); all fields are optional and ResponseModel tolerates drift, so this never breaks deserialization even if the server adds or renames fields.

Parameters:
success: bool | None
message: str | None
uploaded_files: List[UploadedFile] | None
id: int | None
file_name: str | None
model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].