responses¶
EntryInfoResponse
¶
Bases: Success
Source code in optimade/models/responses.py
58 59 60 61 62 |
|
data: Annotated[EntryInfoResource, StrictField(description='OPTIMADE information for an entry endpoint.')]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[Resource] | None, StrictField(description='A list of unique included resources', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
EntryResponseMany
¶
Bases: Success
Source code in optimade/models/responses.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
data: Annotated[list[EntryResource] | list[dict[str, Any]], StrictField(description='List of unique OPTIMADE entry resource objects.', uniqueItems=True, union_mode=left_to_right)]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[EntryResource] | list[dict[str, Any]] | None, StrictField(description='A list of unique included OPTIMADE entry resources.', uniqueItems=True, union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
EntryResponseOne
¶
Bases: Success
Source code in optimade/models/responses.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
data: Annotated[EntryResource | dict[str, Any] | None, StrictField(description='The single entry resource returned by this query.', union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[EntryResource] | list[dict[str, Any]] | None, StrictField(description='A list of unique included OPTIMADE entry resources.', uniqueItems=True, union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
ErrorResponse
¶
Bases: Response
errors MUST be present and data MUST be skipped
Source code in optimade/models/responses.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
data: Annotated[None | Resource | list[Resource] | None, StrictField(description='Outputted Data', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
errors: Annotated[list[OptimadeError], StrictField(description='A list of OPTIMADE-specific JSON API error objects, where the field detail MUST be present.', uniqueItems=True)]
instance-attribute
¶
included: Annotated[list[Resource] | None, StrictField(description='A list of unique included resources', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information.')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
data_must_be_skipped()
¶
Source code in optimade/models/responses.py
45 46 47 48 49 |
|
either_data_meta_or_errors_must_be_set()
¶
Source code in optimade/models/jsonapi.py
403 404 405 406 407 408 409 410 411 412 |
|
IndexInfoResponse
¶
Bases: Success
Source code in optimade/models/responses.py
52 53 54 55 |
|
data: Annotated[IndexInfoResource, StrictField(description='Index meta-database /info data.')]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[Resource] | None, StrictField(description='A list of unique included resources', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
InfoResponse
¶
Bases: Success
Source code in optimade/models/responses.py
65 66 67 68 |
|
data: Annotated[BaseInfoResource, StrictField(description='The implementations /info data.')]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[Resource] | None, StrictField(description='A list of unique included resources', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
LinksResponse
¶
Bases: EntryResponseMany
Source code in optimade/models/responses.py
108 109 110 111 112 113 114 115 116 |
|
data: Annotated[list[LinksResource] | list[dict[str, Any]], StrictField(description='List of unique OPTIMADE links resource objects.', uniqueItems=True, union_mode=left_to_right)]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[EntryResource] | list[dict[str, Any]] | None, StrictField(description='A list of unique included OPTIMADE entry resources.', uniqueItems=True, union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
ReferenceResponseMany
¶
Bases: EntryResponseMany
Source code in optimade/models/responses.py
150 151 152 153 154 155 156 157 158 |
|
data: Annotated[list[ReferenceResource] | list[dict[str, Any]], StrictField(description='List of unique OPTIMADE references entry resource objects.', uniqueItems=True, union_mode=left_to_right)]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[EntryResource] | list[dict[str, Any]] | None, StrictField(description='A list of unique included OPTIMADE entry resources.', uniqueItems=True, union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
ReferenceResponseOne
¶
Bases: EntryResponseOne
Source code in optimade/models/responses.py
140 141 142 143 144 145 146 147 |
|
data: Annotated[ReferenceResource | dict[str, Any] | None, StrictField(description='A single references entry resource.', union_mode=left_to_right)]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[EntryResource] | list[dict[str, Any]] | None, StrictField(description='A list of unique included OPTIMADE entry resources.', uniqueItems=True, union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
StructureResponseMany
¶
Bases: EntryResponseMany
Source code in optimade/models/responses.py
129 130 131 132 133 134 135 136 137 |
|
data: Annotated[list[StructureResource] | list[dict[str, Any]], StrictField(description='List of unique OPTIMADE structures entry resource objects.', uniqueItems=True, union_mode=left_to_right)]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[EntryResource] | list[dict[str, Any]] | None, StrictField(description='A list of unique included OPTIMADE entry resources.', uniqueItems=True, union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
StructureResponseOne
¶
Bases: EntryResponseOne
Source code in optimade/models/responses.py
119 120 121 122 123 124 125 126 |
|
data: Annotated[StructureResource | dict[str, Any] | None, StrictField(description='A single structures entry resource.', union_mode=left_to_right)]
instance-attribute
¶
errors: Annotated[list[Error] | None, StrictField(description='A list of unique errors', uniqueItems=True)] = None
class-attribute
instance-attribute
¶
included: Annotated[list[EntryResource] | list[dict[str, Any]] | None, StrictField(description='A list of unique included OPTIMADE entry resources.', uniqueItems=True, union_mode=left_to_right)] = None
class-attribute
instance-attribute
¶
jsonapi: Annotated[JsonApi | None, StrictField(description='Information about the JSON API used')] = None
class-attribute
instance-attribute
¶
links: Annotated[ToplevelLinks | None, StrictField(description='Links associated with the primary data or errors')] = None
class-attribute
instance-attribute
¶
meta: Annotated[ResponseMeta, StrictField(description='A meta object containing non-standard information')]
instance-attribute
¶
model_config = ConfigDict(json_encoders={datetime: lambda v: v.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')})
class-attribute
instance-attribute
¶
The specification mandates that datetimes must be encoded following RFC3339, which does not support fractional seconds, thus they must be stripped in the response. This can cause issues when the underlying database contains fields that do include microseconds, as filters may return unexpected results.
either_data_meta_or_errors_must_be_set()
¶
Overwriting the existing validation function, since 'errors' MUST NOT be set.
Source code in optimade/models/optimade_json.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|