Import Models#
This documentation auto-generates details about the Pydantic models defined in
app/domain/imports/models/models.py
.
Models used by the Import domain.
- class app.domain.imports.models.models.CollisionStrategy(*values)[source]#
The strategy to use when an identifier collision is detected.
Identifier collisions are detected on
identifier_type
andidentifier
(andother_identifier_name
where relevant) already present in the database.Enhancement collisions are detected on an entry with matching
enhancement_type
andsource
already being present on the collided reference.discard: Do nothing with the incoming reference.
fail: Do nothing with the incoming reference and mark it as failed. This allows the importing process to “follow up” on the failure.
merge_aggressive: Prioritize the incoming reference’s identifiers and enhancements in the merge.
merge_defensive: Prioritize the existing reference’s identifiers and enhancements in the merge.
append: Performs an aggressive merge of identifiers, and an append of enhancements.
overwrite: Performs an aggressive merge of identifiers, and an overwrite of enhancements (deleting existing and recreating what is imported). This should be used sparingly and carefully.
- pydantic model app.domain.imports.models.models.ImportBatch[source]#
Core import batch model with database and internal attributes included.
Show Entity Relationship Diagram
Show JSON schema
{ "$defs": { "CollisionStrategy": { "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n enhancements (deleting existing and recreating what is imported). This should\n be used sparingly and carefully.", "enum": [ "discard", "fail", "merge_aggressive", "merge_defensive", "append", "overwrite" ], "title": "CollisionStrategy", "type": "string" }, "ImportBatch": { "description": "Core import batch model with database and internal attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "collision_strategy": { "$ref": "#/$defs/CollisionStrategy", "default": "fail", "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n " }, "storage_url": { "description": "\nThe URL at which the set of references for this batch are stored.\n ", "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Storage Url", "type": "string" }, "callback_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n ", "title": "Callback Url" }, "status": { "$ref": "#/$defs/ImportBatchStatus", "default": "created", "description": "The status of the batch." }, "import_record_id": { "description": "The ID of the parent import record.", "format": "uuid", "title": "Import Record Id", "type": "string" }, "import_record": { "anyOf": [ { "$ref": "#/$defs/ImportRecord" }, { "type": "null" } ], "default": null, "description": "The parent import record." }, "import_results": { "anyOf": [ { "items": { "$ref": "#/$defs/ImportResult" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The results from processing the batch.", "title": "Import Results" } }, "required": [ "storage_url", "import_record_id" ], "title": "ImportBatch", "type": "object" }, "ImportBatchStatus": { "description": "Describes the status of an import batch.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `failed`: Processing has failed.\n- `retrying`: Processing has failed, but is being retried.\n- `indexing`: The imports have been saved and are being indexed.\n- `indexing_failed`: The imports have been saved but were not indexed.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "retrying", "failed", "indexing", "indexing_failed", "completed", "cancelled" ], "title": "ImportBatchStatus", "type": "string" }, "ImportRecord": { "description": "Core import record model with database and internal attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "search_string": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The search string used to produce this import", "title": "Search String" }, "searched_at": { "description": "\nThe timestamp (including timezone) at which the search which produced\nthis import was conducted. If no timezone is included, the timestamp\nis assumed to be in UTC.\n ", "format": "date-time", "title": "Searched At", "type": "string" }, "processor_name": { "description": "The name of the processor that is importing the data.", "title": "Processor Name", "type": "string" }, "processor_version": { "description": "The version of the processor that is importing the data.", "title": "Processor Version", "type": "string" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\nAny additional notes regarding the import (eg. reason for importing, known\nissues).\n ", "title": "Notes" }, "expected_reference_count": { "description": "\nThe number of references expected to be included in this import.\n-1 is accepted if the number is unknown.\n", "minimum": -1, "title": "Expected Reference Count", "type": "integer" }, "source_name": { "description": "The source of the reference being imported (eg. Open Alex)", "title": "Source Name", "type": "string" }, "status": { "$ref": "#/$defs/ImportRecordStatus", "default": "created", "description": "The status of the upload." }, "batches": { "anyOf": [ { "items": { "$ref": "#/$defs/ImportBatch" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The batches associated with this import.", "title": "Batches" } }, "required": [ "processor_name", "processor_version", "expected_reference_count", "source_name" ], "title": "ImportRecord", "type": "object" }, "ImportRecordStatus": { "description": "Describes the status of an import record.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "completed", "cancelled" ], "title": "ImportRecordStatus", "type": "string" }, "ImportResult": { "description": "Core import result model with database attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "import_batch_id": { "description": "The ID of the parent import batch.", "format": "uuid", "title": "Import Batch Id", "type": "string" }, "status": { "$ref": "#/$defs/ImportResultStatus", "default": "created", "description": "The status of the result." }, "import_batch": { "anyOf": [ { "$ref": "#/$defs/ImportBatch" }, { "type": "null" } ], "default": null, "description": "The parent import batch." }, "reference_id": { "anyOf": [ { "format": "uuid", "type": "string" }, { "type": "null" } ], "default": null, "description": "The ID of the created reference.", "title": "Reference Id" }, "failure_details": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Details of any failure that occurred during processing.", "title": "Failure Details" } }, "required": [ "import_batch_id" ], "title": "ImportResult", "type": "object" }, "ImportResultStatus": { "description": "Describes the status of an import result.\n\n- `created`: Created, but no processing has started.\n- `started`: The reference is currently being processed.\n- `completed`: The reference has been created.\n- `partially_failed`: The reference was created but one or more enhancements or\n identifiers failed to be added. See the result's `failure_details` field for\n more information.\n- `failed`: The reference failed to be created. See the result's `failure_details`\n field for more information.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "completed", "cancelled", "partially_failed", "failed" ], "title": "ImportResultStatus", "type": "string" } }, "$ref": "#/$defs/ImportBatch" }
- Config:
from_attributes: bool = True
- Fields:
- field callback_url: HttpUrl | None = None[source]#
The URL to which the processor should send a callback when the batch has been processed.
- field collision_strategy: CollisionStrategy = CollisionStrategy.FAIL[source]#
The strategy to use for each reference when an identifier collision occurs. Default is fail, which allows the importing process to “follow up” on the collision.
- field import_record: ImportRecord | None = None[source]#
The parent import record.
- field import_results: list[ImportResult] | None = None[source]#
The results from processing the batch.
- field status: ImportBatchStatus = ImportBatchStatus.CREATED[source]#
The status of the batch.
- field storage_url: HttpUrl [Required][source]#
The URL at which the set of references for this batch are stored.
- async classmethod from_sdk(data: ImportBatchIn, import_record_id: UUID) Self [source]#
Create an ImportBatch from the SDK input model.
- check_serializability() None [source]#
Check that incoming SDK model is json-serializable.
This should be called during all domain model conversions.
- Raises:
ValidationError: If the model is not json-serializable.
- async to_sdk() ImportBatchRead [source]#
Convert the ImportBatch to the SDK model.
- async to_sdk_summary() ImportBatchSummary [source]#
Convert the ImportBatch to the SDK summary model.
- class app.domain.imports.models.models.ImportBatchStatus(*values)[source]#
Describes the status of an import batch.
created: Created, but no processing has started.
started: Processing has started on the batch.
failed: Processing has failed.
retrying: Processing has failed, but is being retried.
indexing: The imports have been saved and are being indexed.
indexing_failed: The imports have been saved but were not indexed.
completed: Processing has been completed.
cancelled: Processing was cancelled by calling the API.
- pydantic model app.domain.imports.models.models.ImportRecord[source]#
Core import record model with database and internal attributes included.
Show Entity Relationship Diagram
Show JSON schema
{ "$defs": { "CollisionStrategy": { "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n enhancements (deleting existing and recreating what is imported). This should\n be used sparingly and carefully.", "enum": [ "discard", "fail", "merge_aggressive", "merge_defensive", "append", "overwrite" ], "title": "CollisionStrategy", "type": "string" }, "ImportBatch": { "description": "Core import batch model with database and internal attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "collision_strategy": { "$ref": "#/$defs/CollisionStrategy", "default": "fail", "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n " }, "storage_url": { "description": "\nThe URL at which the set of references for this batch are stored.\n ", "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Storage Url", "type": "string" }, "callback_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n ", "title": "Callback Url" }, "status": { "$ref": "#/$defs/ImportBatchStatus", "default": "created", "description": "The status of the batch." }, "import_record_id": { "description": "The ID of the parent import record.", "format": "uuid", "title": "Import Record Id", "type": "string" }, "import_record": { "anyOf": [ { "$ref": "#/$defs/ImportRecord" }, { "type": "null" } ], "default": null, "description": "The parent import record." }, "import_results": { "anyOf": [ { "items": { "$ref": "#/$defs/ImportResult" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The results from processing the batch.", "title": "Import Results" } }, "required": [ "storage_url", "import_record_id" ], "title": "ImportBatch", "type": "object" }, "ImportBatchStatus": { "description": "Describes the status of an import batch.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `failed`: Processing has failed.\n- `retrying`: Processing has failed, but is being retried.\n- `indexing`: The imports have been saved and are being indexed.\n- `indexing_failed`: The imports have been saved but were not indexed.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "retrying", "failed", "indexing", "indexing_failed", "completed", "cancelled" ], "title": "ImportBatchStatus", "type": "string" }, "ImportRecord": { "description": "Core import record model with database and internal attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "search_string": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The search string used to produce this import", "title": "Search String" }, "searched_at": { "description": "\nThe timestamp (including timezone) at which the search which produced\nthis import was conducted. If no timezone is included, the timestamp\nis assumed to be in UTC.\n ", "format": "date-time", "title": "Searched At", "type": "string" }, "processor_name": { "description": "The name of the processor that is importing the data.", "title": "Processor Name", "type": "string" }, "processor_version": { "description": "The version of the processor that is importing the data.", "title": "Processor Version", "type": "string" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\nAny additional notes regarding the import (eg. reason for importing, known\nissues).\n ", "title": "Notes" }, "expected_reference_count": { "description": "\nThe number of references expected to be included in this import.\n-1 is accepted if the number is unknown.\n", "minimum": -1, "title": "Expected Reference Count", "type": "integer" }, "source_name": { "description": "The source of the reference being imported (eg. Open Alex)", "title": "Source Name", "type": "string" }, "status": { "$ref": "#/$defs/ImportRecordStatus", "default": "created", "description": "The status of the upload." }, "batches": { "anyOf": [ { "items": { "$ref": "#/$defs/ImportBatch" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The batches associated with this import.", "title": "Batches" } }, "required": [ "processor_name", "processor_version", "expected_reference_count", "source_name" ], "title": "ImportRecord", "type": "object" }, "ImportRecordStatus": { "description": "Describes the status of an import record.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "completed", "cancelled" ], "title": "ImportRecordStatus", "type": "string" }, "ImportResult": { "description": "Core import result model with database attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "import_batch_id": { "description": "The ID of the parent import batch.", "format": "uuid", "title": "Import Batch Id", "type": "string" }, "status": { "$ref": "#/$defs/ImportResultStatus", "default": "created", "description": "The status of the result." }, "import_batch": { "anyOf": [ { "$ref": "#/$defs/ImportBatch" }, { "type": "null" } ], "default": null, "description": "The parent import batch." }, "reference_id": { "anyOf": [ { "format": "uuid", "type": "string" }, { "type": "null" } ], "default": null, "description": "The ID of the created reference.", "title": "Reference Id" }, "failure_details": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Details of any failure that occurred during processing.", "title": "Failure Details" } }, "required": [ "import_batch_id" ], "title": "ImportResult", "type": "object" }, "ImportResultStatus": { "description": "Describes the status of an import result.\n\n- `created`: Created, but no processing has started.\n- `started`: The reference is currently being processed.\n- `completed`: The reference has been created.\n- `partially_failed`: The reference was created but one or more enhancements or\n identifiers failed to be added. See the result's `failure_details` field for\n more information.\n- `failed`: The reference failed to be created. See the result's `failure_details`\n field for more information.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "completed", "cancelled", "partially_failed", "failed" ], "title": "ImportResultStatus", "type": "string" } }, "$ref": "#/$defs/ImportRecord" }
- Config:
from_attributes: bool = True
- Fields:
- field batches: list[ImportBatch] | None = None[source]#
The batches associated with this import.
- field expected_reference_count: int [Required][source]#
The number of references expected to be included in this import. -1 is accepted if the number is unknown.
- Constraints:
ge = -1
- field notes: str | None = None[source]#
Any additional notes regarding the import (eg. reason for importing, known issues).
- field processor_version: str [Required][source]#
The version of the processor that is importing the data.
- field searched_at: PastDatetime [Optional][source]#
The timestamp (including timezone) at which the search which produced this import was conducted. If no timezone is included, the timestamp is assumed to be in UTC.
- field source_name: str [Required][source]#
The source of the reference being imported (eg. Open Alex)
- field status: ImportRecordStatus = ImportRecordStatus.CREATED[source]#
The status of the upload.
- async classmethod from_sdk(data: ImportRecordIn) Self [source]#
Create an ImportRecord from the SDK input model.
- check_serializability() None [source]#
Check that incoming SDK model is json-serializable.
This should be called during all domain model conversions.
- Raises:
ValidationError: If the model is not json-serializable.
- async to_sdk() ImportRecordRead [source]#
Convert the ImportRecord to the SDK model.
- class app.domain.imports.models.models.ImportRecordStatus(*values)[source]#
Describes the status of an import record.
created: Created, but no processing has started.
started: Processing has started on the batch.
completed: Processing has been completed.
cancelled: Processing was cancelled by calling the API.
- pydantic model app.domain.imports.models.models.ImportResult[source]#
Core import result model with database attributes included.
Show Entity Relationship Diagram
Show JSON schema
{ "$defs": { "CollisionStrategy": { "description": "The strategy to use when an identifier collision is detected.\n\nIdentifier collisions are detected on ``identifier_type`` and ``identifier``\n(and ``other_identifier_name`` where relevant) already present in the database.\n\nEnhancement collisions are detected on an entry with matching ``enhancement_type``\nand ``source`` already being present on the collided reference.\n\n- `discard`: Do nothing with the incoming reference.\n- `fail`: Do nothing with the incoming reference and mark it as failed. This\n allows the importing process to \"follow up\" on the failure.\n- `merge_aggressive`: Prioritize the incoming reference's identifiers and\n enhancements in the merge.\n- `merge_defensive`: Prioritize the existing reference's identifiers and\n enhancements in the merge.\n- `append`: Performs an aggressive merge of identifiers, and an append of\n enhancements.\n- `overwrite`: Performs an aggressive merge of identifiers, and an overwrite of\n enhancements (deleting existing and recreating what is imported). This should\n be used sparingly and carefully.", "enum": [ "discard", "fail", "merge_aggressive", "merge_defensive", "append", "overwrite" ], "title": "CollisionStrategy", "type": "string" }, "ImportBatch": { "description": "Core import batch model with database and internal attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "collision_strategy": { "$ref": "#/$defs/CollisionStrategy", "default": "fail", "description": "\nThe strategy to use for each reference when an identifier collision occurs.\nDefault is `fail`, which allows the importing process to \"follow up\" on the collision.\n " }, "storage_url": { "description": "\nThe URL at which the set of references for this batch are stored.\n ", "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Storage Url", "type": "string" }, "callback_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "\nThe URL to which the processor should send a callback when the batch has been processed.\n ", "title": "Callback Url" }, "status": { "$ref": "#/$defs/ImportBatchStatus", "default": "created", "description": "The status of the batch." }, "import_record_id": { "description": "The ID of the parent import record.", "format": "uuid", "title": "Import Record Id", "type": "string" }, "import_record": { "anyOf": [ { "$ref": "#/$defs/ImportRecord" }, { "type": "null" } ], "default": null, "description": "The parent import record." }, "import_results": { "anyOf": [ { "items": { "$ref": "#/$defs/ImportResult" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The results from processing the batch.", "title": "Import Results" } }, "required": [ "storage_url", "import_record_id" ], "title": "ImportBatch", "type": "object" }, "ImportBatchStatus": { "description": "Describes the status of an import batch.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `failed`: Processing has failed.\n- `retrying`: Processing has failed, but is being retried.\n- `indexing`: The imports have been saved and are being indexed.\n- `indexing_failed`: The imports have been saved but were not indexed.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "retrying", "failed", "indexing", "indexing_failed", "completed", "cancelled" ], "title": "ImportBatchStatus", "type": "string" }, "ImportRecord": { "description": "Core import record model with database and internal attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "search_string": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The search string used to produce this import", "title": "Search String" }, "searched_at": { "description": "\nThe timestamp (including timezone) at which the search which produced\nthis import was conducted. If no timezone is included, the timestamp\nis assumed to be in UTC.\n ", "format": "date-time", "title": "Searched At", "type": "string" }, "processor_name": { "description": "The name of the processor that is importing the data.", "title": "Processor Name", "type": "string" }, "processor_version": { "description": "The version of the processor that is importing the data.", "title": "Processor Version", "type": "string" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "\nAny additional notes regarding the import (eg. reason for importing, known\nissues).\n ", "title": "Notes" }, "expected_reference_count": { "description": "\nThe number of references expected to be included in this import.\n-1 is accepted if the number is unknown.\n", "minimum": -1, "title": "Expected Reference Count", "type": "integer" }, "source_name": { "description": "The source of the reference being imported (eg. Open Alex)", "title": "Source Name", "type": "string" }, "status": { "$ref": "#/$defs/ImportRecordStatus", "default": "created", "description": "The status of the upload." }, "batches": { "anyOf": [ { "items": { "$ref": "#/$defs/ImportBatch" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The batches associated with this import.", "title": "Batches" } }, "required": [ "processor_name", "processor_version", "expected_reference_count", "source_name" ], "title": "ImportRecord", "type": "object" }, "ImportRecordStatus": { "description": "Describes the status of an import record.\n\n- `created`: Created, but no processing has started.\n- `started`: Processing has started on the batch.\n- `completed`: Processing has been completed.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "completed", "cancelled" ], "title": "ImportRecordStatus", "type": "string" }, "ImportResult": { "description": "Core import result model with database attributes included.", "properties": { "id": { "description": "The autogenerated database ID.", "format": "uuid", "title": "Id", "type": "string" }, "import_batch_id": { "description": "The ID of the parent import batch.", "format": "uuid", "title": "Import Batch Id", "type": "string" }, "status": { "$ref": "#/$defs/ImportResultStatus", "default": "created", "description": "The status of the result." }, "import_batch": { "anyOf": [ { "$ref": "#/$defs/ImportBatch" }, { "type": "null" } ], "default": null, "description": "The parent import batch." }, "reference_id": { "anyOf": [ { "format": "uuid", "type": "string" }, { "type": "null" } ], "default": null, "description": "The ID of the created reference.", "title": "Reference Id" }, "failure_details": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Details of any failure that occurred during processing.", "title": "Failure Details" } }, "required": [ "import_batch_id" ], "title": "ImportResult", "type": "object" }, "ImportResultStatus": { "description": "Describes the status of an import result.\n\n- `created`: Created, but no processing has started.\n- `started`: The reference is currently being processed.\n- `completed`: The reference has been created.\n- `partially_failed`: The reference was created but one or more enhancements or\n identifiers failed to be added. See the result's `failure_details` field for\n more information.\n- `failed`: The reference failed to be created. See the result's `failure_details`\n field for more information.\n- `cancelled`: Processing was cancelled by calling the API.", "enum": [ "created", "started", "completed", "cancelled", "partially_failed", "failed" ], "title": "ImportResultStatus", "type": "string" } }, "$ref": "#/$defs/ImportResult" }
- Config:
from_attributes: bool = True
- Fields:
- field failure_details: str | None = None[source]#
Details of any failure that occurred during processing.
- field import_batch: ImportBatch | None = None[source]#
The parent import batch.
- field status: ImportResultStatus = ImportResultStatus.CREATED[source]#
The status of the result.
- check_serializability() None [source]#
Check that incoming SDK model is json-serializable.
This should be called during all domain model conversions.
- Raises:
ValidationError: If the model is not json-serializable.
- async to_sdk() ImportResultRead [source]#
Convert the ImportResult to the SDK model.
- class app.domain.imports.models.models.ImportResultStatus(*values)[source]#
Describes the status of an import result.
created: Created, but no processing has started.
started: The reference is currently being processed.
completed: The reference has been created.
partially_failed: The reference was created but one or more enhancements or identifiers failed to be added. See the result’s failure_details field for more information.
failed: The reference failed to be created. See the result’s failure_details field for more information.
cancelled: Processing was cancelled by calling the API.