entryscape 1.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. entryscape/__init__.py +219 -0
  2. entryscape/api/__init__.py +26 -0
  3. entryscape/api/app_token_api.py +835 -0
  4. entryscape/api/auth_api.py +965 -0
  5. entryscape/api/catalog_api.py +4473 -0
  6. entryscape/api/contact_api.py +3135 -0
  7. entryscape/api/dataservice_api.py +3135 -0
  8. entryscape/api/dataset_api.py +3804 -0
  9. entryscape/api/distribution_api.py +3135 -0
  10. entryscape/api/document_api.py +2740 -0
  11. entryscape/api/idea_api.py +2740 -0
  12. entryscape/api/job_api.py +360 -0
  13. entryscape/api/model_api.py +2446 -0
  14. entryscape/api/model_class_api.py +2611 -0
  15. entryscape/api/model_diagram_api.py +2611 -0
  16. entryscape/api/model_field_api.py +2611 -0
  17. entryscape/api/model_form_api.py +2611 -0
  18. entryscape/api/model_namespace_api.py +2611 -0
  19. entryscape/api/model_property_api.py +2611 -0
  20. entryscape/api/organization_api.py +3135 -0
  21. entryscape/api/search_api.py +1513 -0
  22. entryscape/api/showcase_api.py +2740 -0
  23. entryscape/api/suggestion_api.py +2740 -0
  24. entryscape/api/terminology_api.py +1726 -0
  25. entryscape/api/upload_api.py +814 -0
  26. entryscape/api_client.py +763 -0
  27. entryscape/api_response.py +20 -0
  28. entryscape/configuration.py +673 -0
  29. entryscape/exceptions.py +222 -0
  30. entryscape/models/__init__.py +71 -0
  31. entryscape/models/app_token.py +156 -0
  32. entryscape/models/app_token_create_request.py +98 -0
  33. entryscape/models/app_token_create_response.py +169 -0
  34. entryscape/models/app_token_status.py +35 -0
  35. entryscape/models/app_token_verify_request.py +109 -0
  36. entryscape/models/entity_list_item.py +175 -0
  37. entryscape/models/entity_list_response.py +139 -0
  38. entryscape/models/entity_reference.py +189 -0
  39. entryscape/models/entity_type.py +57 -0
  40. entryscape/models/error.py +135 -0
  41. entryscape/models/facet_field.py +115 -0
  42. entryscape/models/facet_field_values_inner.py +100 -0
  43. entryscape/models/facet_list.py +113 -0
  44. entryscape/models/facet_list_available_inner.py +107 -0
  45. entryscape/models/job_response.py +112 -0
  46. entryscape/models/job_status.py +189 -0
  47. entryscape/models/job_status_progress.py +100 -0
  48. entryscape/models/job_status_value.py +37 -0
  49. entryscape/models/job_type.py +37 -0
  50. entryscape/models/list_catalogs_entry_type_parameter.py +37 -0
  51. entryscape/models/list_catalogs_graph_type_parameter.py +44 -0
  52. entryscape/models/list_catalogs_resource_type_parameter.py +37 -0
  53. entryscape/models/login_request.py +108 -0
  54. entryscape/models/login_response.py +115 -0
  55. entryscape/models/metadata_format.py +38 -0
  56. entryscape/models/metadata_request.py +99 -0
  57. entryscape/models/parent_reference.py +130 -0
  58. entryscape/models/search_request.py +158 -0
  59. entryscape/models/search_request_filters.py +144 -0
  60. entryscape/models/search_request_filters_graph_type.py +44 -0
  61. entryscape/models/search_request_filters_resource_type.py +37 -0
  62. entryscape/models/search_request_sort.py +38 -0
  63. entryscape/models/search_request_sort_order.py +35 -0
  64. entryscape/models/search_response.py +175 -0
  65. entryscape/models/search_result.py +175 -0
  66. entryscape/models/search_result_graph_type.py +44 -0
  67. entryscape/models/search_result_resource_type.py +37 -0
  68. entryscape/models/search_sort_order_parameter.py +35 -0
  69. entryscape/models/terminology_import_mode.py +35 -0
  70. entryscape/models/validation_profile.py +36 -0
  71. entryscape/models/validation_response.py +149 -0
  72. entryscape/models/validation_result.py +162 -0
  73. entryscape/models/validation_severity.py +36 -0
  74. entryscape/models/validation_summary.py +122 -0
  75. entryscape/models/whoami_response.py +104 -0
  76. entryscape/py.typed +0 -0
  77. entryscape/rest.py +210 -0
  78. entryscape-1.3.0.dist-info/METADATA +696 -0
  79. entryscape-1.3.0.dist-info/RECORD +82 -0
  80. entryscape-1.3.0.dist-info/WHEEL +5 -0
  81. entryscape-1.3.0.dist-info/licenses/LICENSE.txt +165 -0
  82. entryscape-1.3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1513 @@
1
+ """
2
+ EntryScape API
3
+
4
+ This API provides structured access to EntryScape data following DCAT-AP standards. All entity endpoints follow a consistent pattern: - GET /{entity} - List all entities - POST /{entity} - Create a new entity (DCAT types only) - GET /{entity}/{context_id}/{entry_id} - Get entity reference info - DELETE /{entity}/{context_id}/{entry_id} - Delete an entity (DCAT types only) - GET /{entity}/{context_id}/{entry_id}/metadata - Get raw RDF metadata - PUT /{entity}/{context_id}/{entry_id}/metadata - Replace raw RDF metadata (JSON-LD, Turtle, RDF/XML, or N-Triples passthrough) ## Reading and consistency Reads of a single entity — `GET /{entity}/{context_id}/{entry_id}` and its `/metadata` — go straight to the store and always reflect the latest write. Lists and search do not. They are answered from a search index that is updated asynchronously, so for a short interval after a write: - an entry that was just created may be missing from the list it belongs to, while reading it by id already works; - an entry that was just deleted may still appear; - `results` counts what the index holds, not what the store holds. Write a client that tolerates this: after creating an entry, use the id the create returned rather than searching for what you just wrote. `results` is also an upper bound rather than an exact count when the caller cannot read every hit (see the field's own description). Separately, responses are cached for 15 minutes by default, which is a second and unrelated source of staleness. A write invalidates the cache entries it affects, but a read that lands in the indexing gap can cache a list that does not yet show it. ## Authentication Most endpoints require an authenticated session. Reading public data works without authentication, while creating, updating, and deleting entities requires a valid user session. 1. **Log in** with `POST /auth/login`, supplying an EntryStore username and password. The response returns an `auth_token`. 2. **Send the token** on subsequent requests via the `X-Auth-Token` header. This is the recommended method for SDK and programmatic access. Browser clients can instead rely on the `auth_token` cookie, which the server sets automatically on login (`SameSite=Lax; Secure`). 3. **Inspect the session** with `GET /auth/whoami`, which returns the current user or an anonymous/guest identity when no valid token is supplied. 4. **Log out** with `POST /auth/logout` to invalidate the token and clear the cookie. ### Writes and CSRF Send the token as the `X-Auth-Token` **header** and there is nothing else to do: creates, updates and deletes work as they are, which is how the SDKs and the MCP server are built. The `auth_token` cookie is different. A cookie is attached by the browser automatically, so a state-changing request authenticated by it alone is what cross-site request forgery abuses, and those requests additionally need a double-submit token: read the `XSRF-TOKEN` cookie the server sets on any response and send its value back as the `X-XSRF-TOKEN` header. Without it the request is rejected with `403` before it reaches the endpoint. A custom header cannot be forged this way — cross-origin JavaScript cannot set one without a CORS preflight, which this API grants only to configured origins — so the header is the recommended path for anything that is not a browser session. ### App Tokens An app token identifies an integration. Create one with `POST /app-token` (unauthenticated). Creation requires an email address: the token starts in the `pending` state and a 6-digit code is emailed to the owner. Confirm the code with `POST /app-token/verify` to activate the token and receive its value, which is shown only once — store it securely. `GET /app-token/{app_token_id}` then returns its details and quota usage, authenticated by the token itself via the `X-App-Token` header. **The `X-App-Token` header is accepted only by `GET /app-token/{app_token_id}`.** No other operation reads it, and the read quota is recorded but not yet enforced: reading public data needs no token of any kind, and sending an app token with a read neither grants nor meters anything. Metered public read access is the intent of the two-token model, not a description of this release — see the `security` declared on each operation for what it actually accepts. ## SDKs Generated clients for Python, TypeScript, JavaScript and C# wrap every operation below, and each operation on this page shows the SDK call beside the `curl` command. Two of them install from a public registry: ``` pip install entryscape # Python npm install @entryscape/api-client # TypeScript and JavaScript ``` `@entryscape/api-client` ships an ESM and a CommonJS build, so `import` and `require()` both work and TypeScript is not required to use it — the name describes what it is written in, not what you have to write. There is a separate generated JavaScript SDK, and it is deliberately **not** on npm; this package is the npm client for both languages. Every SDK, including the C# and JavaScript ones, is also published as a tarball. The downloads are linked in the sidebar, they are the route to take when a registry is unreachable or a build has to vendor its dependencies, and each archive carries the SDK's own README: - **Python** — `pip install entryscape`, or `python-sdk.tar.gz`. - **TypeScript and JavaScript** — `npm install @entryscape/api-client`, or `typescript-sdk.tar.gz`. - **JavaScript (the separate generated client)** — not published to a registry, by design; `javascript-sdk.tar.gz` only. - **C#** — not published to NuGet yet; `csharp-sdk.tar.gz` only. - **MCP server** — `npx -y @entryscape/mcp-server`, or `mcp-server.tar.gz`. ## MCP Server A Model Context Protocol (MCP) server is generated from this specification and published alongside the SDKs (`@entryscape/mcp-server`), exposing the API as tools for AI assistants and agents. Each operation becomes one tool named after its `operationId` — `listDatasets`, `createCatalog`, `search`, `getJobStatus`. The `auth` operations are the exception: the server reads its token once at startup, so a `login` tool could install nothing and a `logout` tool would only invalidate the token the server was started with. On connect the server also hands the assistant a short set of rules that hold across every tool: a token is bound to one EntryStore instance, the search index lags a write, uploads finish as jobs. ### Install The server is on npm, and MCP servers are normally launched straight from there, so nothing has to be installed first: ``` npx -y @entryscape/mcp-server ``` `npm install -g @entryscape/mcp-server` works too and puts an `entryscape-mcp` binary on `PATH`. It is also listed in the MCP Registry as `com.entryscape/mcp-server`, which is where clients and marketplaces look it up. Without npm, download `mcp-server.tar.gz` from the SDK downloads and unpack it. The package ships prebuilt; install its runtime dependency once: ``` mkdir entryscape-mcp && tar -xzf mcp-server.tar.gz -C entryscape-mcp cd entryscape-mcp && npm install --omit=dev ``` ### Configure The server is a stdio MCP server configured through environment variables, read once at startup: - `ENTRYSCAPE_API_URL` — base URL of the API server, path included. Required: there is no default, and the server refuses to start without it. - `ENTRYSCAPE_AUTH_TOKEN` — a session token from `POST /auth/login`, sent as the `X-Auth-Token` header. Optional: without it reads see public entries and every write is refused. A token is valid only for the EntryStore instance that issued it. - `ENTRYSCAPE_ENTRYSTORE_HOST` — the EntryStore instance the API server should use, for example `dev.entryscape.com/store/`. Unset means the API server's own default. - `ENTRYSCAPE_MCP_UPLOAD_ROOT` — the directory the upload tools may read files from. **Unset means uploads are disabled**: `addFileToDistribution`, `replaceFileInDistribution` and `importTerminology` refuse and say so. - `ENTRYSCAPE_MCP_TAGS` — comma-separated tags to serve tools for, for example `catalog,dataset,distribution,search`. Unset serves every tool. The package's `README.md` lists the remaining variables (timeouts and size caps). Register the server with any MCP-capable client by adding it to the client's `mcpServers` configuration: ```json { \"mcpServers\": { \"entryscape\": { \"command\": \"npx\", \"args\": [\"-y\", \"@entryscape/mcp-server\"], \"env\": { \"ENTRYSCAPE_API_URL\": \"https://<your EntryScape API host>\", \"ENTRYSCAPE_AUTH_TOKEN\": \"your-session-token\" } } } } ``` From an unpacked download instead, the command is `\"command\": \"node\", \"args\": [\"/path/to/entryscape-mcp/dist/bin/entryscape-mcp.js\"]`. ### Claude Code The unpacked package is also a Claude Code plugin, so one install gives the server and the skills below together. Claude Code installs plugins from marketplaces, and the package carries a one-entry marketplace pointing at itself: ``` claude plugin marketplace add /path/to/entryscape-mcp claude plugin install entryscape@entryscape --scope user ``` The plugin passes `ENTRYSCAPE_API_URL`, `ENTRYSCAPE_AUTH_TOKEN`, `ENTRYSCAPE_ENTRYSTORE_HOST`, `ENTRYSCAPE_MCP_TAGS` and `ENTRYSCAPE_MCP_UPLOAD_ROOT` through from the shell Claude Code was started in, so set them there. To try the plugin for one session without installing it, start Claude Code with `--plugin-dir /path/to/entryscape-mcp`. ### Skills `skills/` in the package holds procedures that span several tools, in the Agent Skills format (a `SKILL.md` with `name` and `description`): which tools to call in which order, what to check between calls, and where to stop. Claude Code loads them from the plugin; other clients that read the format can be pointed at the directory. The `find` skill covers discovery, facets and selective metadata reads; `publish-dataset` takes a dataset from catalog to validated distribution with its file; `edit-metadata` changes an entry that already exists without dropping the rest of its graph, models included; `migrate-from-taskrunner` moves an integration off the deprecated Taskrunner API. Every tool a skill names is checked against this specification when the package is built. ## Deprecation Policy When endpoints or features are deprecated: 1. The operation is marked with `deprecated: true` in this spec 2. The operation description documents the replacement endpoint and sunset date 3. Deprecated endpoints remain functional for at least 6 months after announcement 4. The server returns a `Sunset` header with the planned removal date 5. After the sunset date, the endpoint may be removed in a future release
5
+
6
+ The version of the OpenAPI document: 1.3.0
7
+ Contact: contact@entryscape.com
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from datetime import datetime
19
+ from pydantic import Field, StrictBool, StrictStr, field_validator
20
+ from typing import List, Optional
21
+ from typing_extensions import Annotated
22
+ from entryscape.models.facet_list import FacetList
23
+ from entryscape.models.list_catalogs_graph_type_parameter import (
24
+ ListCatalogsGraphTypeParameter,
25
+ )
26
+ from entryscape.models.list_catalogs_resource_type_parameter import (
27
+ ListCatalogsResourceTypeParameter,
28
+ )
29
+ from entryscape.models.search_request import SearchRequest
30
+ from entryscape.models.search_response import SearchResponse
31
+ from entryscape.models.search_sort_order_parameter import SearchSortOrderParameter
32
+
33
+ from entryscape.api_client import ApiClient, RequestSerialized
34
+ from entryscape.api_response import ApiResponse
35
+ from entryscape.rest import RESTResponseType
36
+
37
+
38
+ class SearchApi:
39
+ """NOTE: This class is auto generated by OpenAPI Generator
40
+ Ref: https://openapi-generator.tech
41
+
42
+ Do not edit the class manually.
43
+ """
44
+
45
+ def __init__(self, api_client=None) -> None:
46
+ if api_client is None:
47
+ api_client = ApiClient.get_default()
48
+ self.api_client = api_client
49
+
50
+ @validate_call
51
+ async def advanced_search(
52
+ self,
53
+ search_request: SearchRequest,
54
+ x_entrystore_host: Annotated[
55
+ Optional[StrictStr],
56
+ Field(
57
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
58
+ ),
59
+ ] = None,
60
+ entrystore_host: Annotated[
61
+ Optional[StrictStr],
62
+ Field(
63
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
64
+ ),
65
+ ] = None,
66
+ _request_timeout: Union[
67
+ None,
68
+ Annotated[StrictFloat, Field(gt=0)],
69
+ Tuple[
70
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
71
+ ],
72
+ ] = None,
73
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
74
+ _content_type: Optional[StrictStr] = None,
75
+ _headers: Optional[Dict[StrictStr, Any]] = None,
76
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
77
+ ) -> SearchResponse:
78
+ """Advanced search
79
+
80
+ Advanced search with structured request body. Supports complex filter combinations and all search features. Authentication is optional. Without authentication, only publicly available entries are included in results. Authenticated requests may include additional non-public entries. Answered from an asynchronously updated index: an entry created moments ago may not be found here while reading it by id already returns it.
81
+
82
+ :param search_request: (required)
83
+ :type search_request: SearchRequest
84
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
85
+ :type x_entrystore_host: str
86
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
87
+ :type entrystore_host: str
88
+ :param _request_timeout: timeout setting for this request. If one
89
+ number provided, it will be total request
90
+ timeout. It can also be a pair (tuple) of
91
+ (connection, read) timeouts.
92
+ :type _request_timeout: int, tuple(int, int), optional
93
+ :param _request_auth: set to override the auth_settings for an a single
94
+ request; this effectively ignores the
95
+ authentication in the spec for a single request.
96
+ :type _request_auth: dict, optional
97
+ :param _content_type: force content-type for the request.
98
+ :type _content_type: str, Optional
99
+ :param _headers: set to override the headers for a single
100
+ request; this effectively ignores the headers
101
+ in the spec for a single request.
102
+ :type _headers: dict, optional
103
+ :param _host_index: set to override the host_index for a single
104
+ request; this effectively ignores the host_index
105
+ in the spec for a single request.
106
+ :type _host_index: int, optional
107
+ :return: Returns the result object.
108
+ """ # noqa: E501
109
+
110
+ _param = self._advanced_search_serialize(
111
+ search_request=search_request,
112
+ x_entrystore_host=x_entrystore_host,
113
+ entrystore_host=entrystore_host,
114
+ _request_auth=_request_auth,
115
+ _content_type=_content_type,
116
+ _headers=_headers,
117
+ _host_index=_host_index,
118
+ )
119
+
120
+ _response_types_map: Dict[str, Optional[str]] = {
121
+ "200": "SearchResponse",
122
+ "400": "Error",
123
+ "401": "Error",
124
+ "500": "Error",
125
+ "503": "Error",
126
+ }
127
+ response_data = await self.api_client.call_api(
128
+ *_param, _request_timeout=_request_timeout
129
+ )
130
+ await response_data.read()
131
+ return self.api_client.response_deserialize(
132
+ response_data=response_data,
133
+ response_types_map=_response_types_map,
134
+ ).data
135
+
136
+ @validate_call
137
+ async def advanced_search_with_http_info(
138
+ self,
139
+ search_request: SearchRequest,
140
+ x_entrystore_host: Annotated[
141
+ Optional[StrictStr],
142
+ Field(
143
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
144
+ ),
145
+ ] = None,
146
+ entrystore_host: Annotated[
147
+ Optional[StrictStr],
148
+ Field(
149
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
150
+ ),
151
+ ] = None,
152
+ _request_timeout: Union[
153
+ None,
154
+ Annotated[StrictFloat, Field(gt=0)],
155
+ Tuple[
156
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
157
+ ],
158
+ ] = None,
159
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
160
+ _content_type: Optional[StrictStr] = None,
161
+ _headers: Optional[Dict[StrictStr, Any]] = None,
162
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
163
+ ) -> ApiResponse[SearchResponse]:
164
+ """Advanced search
165
+
166
+ Advanced search with structured request body. Supports complex filter combinations and all search features. Authentication is optional. Without authentication, only publicly available entries are included in results. Authenticated requests may include additional non-public entries. Answered from an asynchronously updated index: an entry created moments ago may not be found here while reading it by id already returns it.
167
+
168
+ :param search_request: (required)
169
+ :type search_request: SearchRequest
170
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
171
+ :type x_entrystore_host: str
172
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
173
+ :type entrystore_host: str
174
+ :param _request_timeout: timeout setting for this request. If one
175
+ number provided, it will be total request
176
+ timeout. It can also be a pair (tuple) of
177
+ (connection, read) timeouts.
178
+ :type _request_timeout: int, tuple(int, int), optional
179
+ :param _request_auth: set to override the auth_settings for an a single
180
+ request; this effectively ignores the
181
+ authentication in the spec for a single request.
182
+ :type _request_auth: dict, optional
183
+ :param _content_type: force content-type for the request.
184
+ :type _content_type: str, Optional
185
+ :param _headers: set to override the headers for a single
186
+ request; this effectively ignores the headers
187
+ in the spec for a single request.
188
+ :type _headers: dict, optional
189
+ :param _host_index: set to override the host_index for a single
190
+ request; this effectively ignores the host_index
191
+ in the spec for a single request.
192
+ :type _host_index: int, optional
193
+ :return: Returns the result object.
194
+ """ # noqa: E501
195
+
196
+ _param = self._advanced_search_serialize(
197
+ search_request=search_request,
198
+ x_entrystore_host=x_entrystore_host,
199
+ entrystore_host=entrystore_host,
200
+ _request_auth=_request_auth,
201
+ _content_type=_content_type,
202
+ _headers=_headers,
203
+ _host_index=_host_index,
204
+ )
205
+
206
+ _response_types_map: Dict[str, Optional[str]] = {
207
+ "200": "SearchResponse",
208
+ "400": "Error",
209
+ "401": "Error",
210
+ "500": "Error",
211
+ "503": "Error",
212
+ }
213
+ response_data = await self.api_client.call_api(
214
+ *_param, _request_timeout=_request_timeout
215
+ )
216
+ await response_data.read()
217
+ return self.api_client.response_deserialize(
218
+ response_data=response_data,
219
+ response_types_map=_response_types_map,
220
+ )
221
+
222
+ @validate_call
223
+ async def advanced_search_without_preload_content(
224
+ self,
225
+ search_request: SearchRequest,
226
+ x_entrystore_host: Annotated[
227
+ Optional[StrictStr],
228
+ Field(
229
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
230
+ ),
231
+ ] = None,
232
+ entrystore_host: Annotated[
233
+ Optional[StrictStr],
234
+ Field(
235
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
236
+ ),
237
+ ] = None,
238
+ _request_timeout: Union[
239
+ None,
240
+ Annotated[StrictFloat, Field(gt=0)],
241
+ Tuple[
242
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
243
+ ],
244
+ ] = None,
245
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
246
+ _content_type: Optional[StrictStr] = None,
247
+ _headers: Optional[Dict[StrictStr, Any]] = None,
248
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
249
+ ) -> RESTResponseType:
250
+ """Advanced search
251
+
252
+ Advanced search with structured request body. Supports complex filter combinations and all search features. Authentication is optional. Without authentication, only publicly available entries are included in results. Authenticated requests may include additional non-public entries. Answered from an asynchronously updated index: an entry created moments ago may not be found here while reading it by id already returns it.
253
+
254
+ :param search_request: (required)
255
+ :type search_request: SearchRequest
256
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
257
+ :type x_entrystore_host: str
258
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
259
+ :type entrystore_host: str
260
+ :param _request_timeout: timeout setting for this request. If one
261
+ number provided, it will be total request
262
+ timeout. It can also be a pair (tuple) of
263
+ (connection, read) timeouts.
264
+ :type _request_timeout: int, tuple(int, int), optional
265
+ :param _request_auth: set to override the auth_settings for an a single
266
+ request; this effectively ignores the
267
+ authentication in the spec for a single request.
268
+ :type _request_auth: dict, optional
269
+ :param _content_type: force content-type for the request.
270
+ :type _content_type: str, Optional
271
+ :param _headers: set to override the headers for a single
272
+ request; this effectively ignores the headers
273
+ in the spec for a single request.
274
+ :type _headers: dict, optional
275
+ :param _host_index: set to override the host_index for a single
276
+ request; this effectively ignores the host_index
277
+ in the spec for a single request.
278
+ :type _host_index: int, optional
279
+ :return: Returns the result object.
280
+ """ # noqa: E501
281
+
282
+ _param = self._advanced_search_serialize(
283
+ search_request=search_request,
284
+ x_entrystore_host=x_entrystore_host,
285
+ entrystore_host=entrystore_host,
286
+ _request_auth=_request_auth,
287
+ _content_type=_content_type,
288
+ _headers=_headers,
289
+ _host_index=_host_index,
290
+ )
291
+
292
+ _response_types_map: Dict[str, Optional[str]] = {
293
+ "200": "SearchResponse",
294
+ "400": "Error",
295
+ "401": "Error",
296
+ "500": "Error",
297
+ "503": "Error",
298
+ }
299
+ response_data = await self.api_client.call_api(
300
+ *_param, _request_timeout=_request_timeout
301
+ )
302
+ return response_data.response
303
+
304
+ def _advanced_search_serialize(
305
+ self,
306
+ search_request,
307
+ x_entrystore_host,
308
+ entrystore_host,
309
+ _request_auth,
310
+ _content_type,
311
+ _headers,
312
+ _host_index,
313
+ ) -> RequestSerialized:
314
+
315
+ _host = None
316
+
317
+ _collection_formats: Dict[str, str] = {}
318
+
319
+ _path_params: Dict[str, str] = {}
320
+ _query_params: List[Tuple[str, str]] = []
321
+ _header_params: Dict[str, Optional[str]] = _headers or {}
322
+ _form_params: List[Tuple[str, str]] = []
323
+ _files: Dict[
324
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
325
+ ] = {}
326
+ _body_params: Optional[bytes] = None
327
+
328
+ # process the path parameters
329
+ # process the query parameters
330
+ if entrystore_host is not None:
331
+
332
+ _query_params.append(("entrystore_host", entrystore_host))
333
+
334
+ # process the header parameters
335
+ if x_entrystore_host is not None:
336
+ _header_params["X-Entrystore-Host"] = x_entrystore_host
337
+ # process the form parameters
338
+ # process the body parameter
339
+ if search_request is not None:
340
+ _body_params = search_request
341
+
342
+ # set the HTTP header `Accept`
343
+ if "Accept" not in _header_params:
344
+ _header_params["Accept"] = self.api_client.select_header_accept(
345
+ ["application/json"]
346
+ )
347
+
348
+ # set the HTTP header `Content-Type`
349
+ if _content_type:
350
+ _header_params["Content-Type"] = _content_type
351
+ else:
352
+ _default_content_type = self.api_client.select_header_content_type(
353
+ ["application/json"]
354
+ )
355
+ if _default_content_type is not None:
356
+ _header_params["Content-Type"] = _default_content_type
357
+
358
+ # authentication setting
359
+ _auth_settings: List[str] = ["auth_token", "auth_header"]
360
+
361
+ return self.api_client.param_serialize(
362
+ method="POST",
363
+ resource_path="/search",
364
+ path_params=_path_params,
365
+ query_params=_query_params,
366
+ header_params=_header_params,
367
+ body=_body_params,
368
+ post_params=_form_params,
369
+ files=_files,
370
+ auth_settings=_auth_settings,
371
+ collection_formats=_collection_formats,
372
+ _host=_host,
373
+ _request_auth=_request_auth,
374
+ )
375
+
376
+ @validate_call
377
+ async def get_search_facets(
378
+ self,
379
+ x_entrystore_host: Annotated[
380
+ Optional[StrictStr],
381
+ Field(
382
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
383
+ ),
384
+ ] = None,
385
+ entrystore_host: Annotated[
386
+ Optional[StrictStr],
387
+ Field(
388
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
389
+ ),
390
+ ] = None,
391
+ _request_timeout: Union[
392
+ None,
393
+ Annotated[StrictFloat, Field(gt=0)],
394
+ Tuple[
395
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
396
+ ],
397
+ ] = None,
398
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
399
+ _content_type: Optional[StrictStr] = None,
400
+ _headers: Optional[Dict[StrictStr, Any]] = None,
401
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
402
+ ) -> FacetList:
403
+ """Get available facet fields
404
+
405
+ Returns a list of available facet fields that can be used with the search endpoints. Use these field names in the `facet` parameter of GET /search or `facets` array of POST /search. Authentication is optional.
406
+
407
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
408
+ :type x_entrystore_host: str
409
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
410
+ :type entrystore_host: str
411
+ :param _request_timeout: timeout setting for this request. If one
412
+ number provided, it will be total request
413
+ timeout. It can also be a pair (tuple) of
414
+ (connection, read) timeouts.
415
+ :type _request_timeout: int, tuple(int, int), optional
416
+ :param _request_auth: set to override the auth_settings for an a single
417
+ request; this effectively ignores the
418
+ authentication in the spec for a single request.
419
+ :type _request_auth: dict, optional
420
+ :param _content_type: force content-type for the request.
421
+ :type _content_type: str, Optional
422
+ :param _headers: set to override the headers for a single
423
+ request; this effectively ignores the headers
424
+ in the spec for a single request.
425
+ :type _headers: dict, optional
426
+ :param _host_index: set to override the host_index for a single
427
+ request; this effectively ignores the host_index
428
+ in the spec for a single request.
429
+ :type _host_index: int, optional
430
+ :return: Returns the result object.
431
+ """ # noqa: E501
432
+
433
+ _param = self._get_search_facets_serialize(
434
+ x_entrystore_host=x_entrystore_host,
435
+ entrystore_host=entrystore_host,
436
+ _request_auth=_request_auth,
437
+ _content_type=_content_type,
438
+ _headers=_headers,
439
+ _host_index=_host_index,
440
+ )
441
+
442
+ _response_types_map: Dict[str, Optional[str]] = {
443
+ "200": "FacetList",
444
+ "400": "Error",
445
+ "401": "Error",
446
+ "500": "Error",
447
+ "503": "Error",
448
+ }
449
+ response_data = await self.api_client.call_api(
450
+ *_param, _request_timeout=_request_timeout
451
+ )
452
+ await response_data.read()
453
+ return self.api_client.response_deserialize(
454
+ response_data=response_data,
455
+ response_types_map=_response_types_map,
456
+ ).data
457
+
458
+ @validate_call
459
+ async def get_search_facets_with_http_info(
460
+ self,
461
+ x_entrystore_host: Annotated[
462
+ Optional[StrictStr],
463
+ Field(
464
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
465
+ ),
466
+ ] = None,
467
+ entrystore_host: Annotated[
468
+ Optional[StrictStr],
469
+ Field(
470
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
471
+ ),
472
+ ] = None,
473
+ _request_timeout: Union[
474
+ None,
475
+ Annotated[StrictFloat, Field(gt=0)],
476
+ Tuple[
477
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
478
+ ],
479
+ ] = None,
480
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
481
+ _content_type: Optional[StrictStr] = None,
482
+ _headers: Optional[Dict[StrictStr, Any]] = None,
483
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
484
+ ) -> ApiResponse[FacetList]:
485
+ """Get available facet fields
486
+
487
+ Returns a list of available facet fields that can be used with the search endpoints. Use these field names in the `facet` parameter of GET /search or `facets` array of POST /search. Authentication is optional.
488
+
489
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
490
+ :type x_entrystore_host: str
491
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
492
+ :type entrystore_host: str
493
+ :param _request_timeout: timeout setting for this request. If one
494
+ number provided, it will be total request
495
+ timeout. It can also be a pair (tuple) of
496
+ (connection, read) timeouts.
497
+ :type _request_timeout: int, tuple(int, int), optional
498
+ :param _request_auth: set to override the auth_settings for an a single
499
+ request; this effectively ignores the
500
+ authentication in the spec for a single request.
501
+ :type _request_auth: dict, optional
502
+ :param _content_type: force content-type for the request.
503
+ :type _content_type: str, Optional
504
+ :param _headers: set to override the headers for a single
505
+ request; this effectively ignores the headers
506
+ in the spec for a single request.
507
+ :type _headers: dict, optional
508
+ :param _host_index: set to override the host_index for a single
509
+ request; this effectively ignores the host_index
510
+ in the spec for a single request.
511
+ :type _host_index: int, optional
512
+ :return: Returns the result object.
513
+ """ # noqa: E501
514
+
515
+ _param = self._get_search_facets_serialize(
516
+ x_entrystore_host=x_entrystore_host,
517
+ entrystore_host=entrystore_host,
518
+ _request_auth=_request_auth,
519
+ _content_type=_content_type,
520
+ _headers=_headers,
521
+ _host_index=_host_index,
522
+ )
523
+
524
+ _response_types_map: Dict[str, Optional[str]] = {
525
+ "200": "FacetList",
526
+ "400": "Error",
527
+ "401": "Error",
528
+ "500": "Error",
529
+ "503": "Error",
530
+ }
531
+ response_data = await self.api_client.call_api(
532
+ *_param, _request_timeout=_request_timeout
533
+ )
534
+ await response_data.read()
535
+ return self.api_client.response_deserialize(
536
+ response_data=response_data,
537
+ response_types_map=_response_types_map,
538
+ )
539
+
540
+ @validate_call
541
+ async def get_search_facets_without_preload_content(
542
+ self,
543
+ x_entrystore_host: Annotated[
544
+ Optional[StrictStr],
545
+ Field(
546
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
547
+ ),
548
+ ] = None,
549
+ entrystore_host: Annotated[
550
+ Optional[StrictStr],
551
+ Field(
552
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
553
+ ),
554
+ ] = None,
555
+ _request_timeout: Union[
556
+ None,
557
+ Annotated[StrictFloat, Field(gt=0)],
558
+ Tuple[
559
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
560
+ ],
561
+ ] = None,
562
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
563
+ _content_type: Optional[StrictStr] = None,
564
+ _headers: Optional[Dict[StrictStr, Any]] = None,
565
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
566
+ ) -> RESTResponseType:
567
+ """Get available facet fields
568
+
569
+ Returns a list of available facet fields that can be used with the search endpoints. Use these field names in the `facet` parameter of GET /search or `facets` array of POST /search. Authentication is optional.
570
+
571
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
572
+ :type x_entrystore_host: str
573
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
574
+ :type entrystore_host: str
575
+ :param _request_timeout: timeout setting for this request. If one
576
+ number provided, it will be total request
577
+ timeout. It can also be a pair (tuple) of
578
+ (connection, read) timeouts.
579
+ :type _request_timeout: int, tuple(int, int), optional
580
+ :param _request_auth: set to override the auth_settings for an a single
581
+ request; this effectively ignores the
582
+ authentication in the spec for a single request.
583
+ :type _request_auth: dict, optional
584
+ :param _content_type: force content-type for the request.
585
+ :type _content_type: str, Optional
586
+ :param _headers: set to override the headers for a single
587
+ request; this effectively ignores the headers
588
+ in the spec for a single request.
589
+ :type _headers: dict, optional
590
+ :param _host_index: set to override the host_index for a single
591
+ request; this effectively ignores the host_index
592
+ in the spec for a single request.
593
+ :type _host_index: int, optional
594
+ :return: Returns the result object.
595
+ """ # noqa: E501
596
+
597
+ _param = self._get_search_facets_serialize(
598
+ x_entrystore_host=x_entrystore_host,
599
+ entrystore_host=entrystore_host,
600
+ _request_auth=_request_auth,
601
+ _content_type=_content_type,
602
+ _headers=_headers,
603
+ _host_index=_host_index,
604
+ )
605
+
606
+ _response_types_map: Dict[str, Optional[str]] = {
607
+ "200": "FacetList",
608
+ "400": "Error",
609
+ "401": "Error",
610
+ "500": "Error",
611
+ "503": "Error",
612
+ }
613
+ response_data = await self.api_client.call_api(
614
+ *_param, _request_timeout=_request_timeout
615
+ )
616
+ return response_data.response
617
+
618
+ def _get_search_facets_serialize(
619
+ self,
620
+ x_entrystore_host,
621
+ entrystore_host,
622
+ _request_auth,
623
+ _content_type,
624
+ _headers,
625
+ _host_index,
626
+ ) -> RequestSerialized:
627
+
628
+ _host = None
629
+
630
+ _collection_formats: Dict[str, str] = {}
631
+
632
+ _path_params: Dict[str, str] = {}
633
+ _query_params: List[Tuple[str, str]] = []
634
+ _header_params: Dict[str, Optional[str]] = _headers or {}
635
+ _form_params: List[Tuple[str, str]] = []
636
+ _files: Dict[
637
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
638
+ ] = {}
639
+ _body_params: Optional[bytes] = None
640
+
641
+ # process the path parameters
642
+ # process the query parameters
643
+ if entrystore_host is not None:
644
+
645
+ _query_params.append(("entrystore_host", entrystore_host))
646
+
647
+ # process the header parameters
648
+ if x_entrystore_host is not None:
649
+ _header_params["X-Entrystore-Host"] = x_entrystore_host
650
+ # process the form parameters
651
+ # process the body parameter
652
+
653
+ # set the HTTP header `Accept`
654
+ if "Accept" not in _header_params:
655
+ _header_params["Accept"] = self.api_client.select_header_accept(
656
+ ["application/json"]
657
+ )
658
+
659
+ # authentication setting
660
+ _auth_settings: List[str] = ["auth_token", "auth_header"]
661
+
662
+ return self.api_client.param_serialize(
663
+ method="GET",
664
+ resource_path="/search/facets",
665
+ path_params=_path_params,
666
+ query_params=_query_params,
667
+ header_params=_header_params,
668
+ body=_body_params,
669
+ post_params=_form_params,
670
+ files=_files,
671
+ auth_settings=_auth_settings,
672
+ collection_formats=_collection_formats,
673
+ _host=_host,
674
+ _request_auth=_request_auth,
675
+ )
676
+
677
+ @validate_call
678
+ async def search(
679
+ self,
680
+ x_entrystore_host: Annotated[
681
+ Optional[StrictStr],
682
+ Field(
683
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
684
+ ),
685
+ ] = None,
686
+ entrystore_host: Annotated[
687
+ Optional[StrictStr],
688
+ Field(
689
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
690
+ ),
691
+ ] = None,
692
+ query: Annotated[
693
+ Optional[Annotated[str, Field(strict=True, max_length=1000)]],
694
+ Field(
695
+ description="Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own. "
696
+ ),
697
+ ] = None,
698
+ rdf_type: Annotated[
699
+ Optional[Annotated[str, Field(strict=True, max_length=2048)]],
700
+ Field(description="Only entries with this rdf:type URI"),
701
+ ] = None,
702
+ context: Annotated[
703
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]],
704
+ Field(
705
+ description="Filter by context ID. Can be specified multiple times to include entries from multiple contexts. "
706
+ ),
707
+ ] = None,
708
+ graph_type: Annotated[
709
+ Optional[ListCatalogsGraphTypeParameter],
710
+ Field(
711
+ description="Filter by graph type. Determines the nature of the resource. - `None`: No special type (regular files, web resources) - `Context`: Container for other entries - `Systemcontext`: Special system context (_contexts, _principals) - `User`: User resource - `Group`: Group resource - `List`: Ordered list of entries - `Resultlist`: Result list from search - `Graph`: RDF graph resource - `String`: String resource - `Pipeline`: Executable pipeline - `PipelineResult`: Result from pipeline execution "
712
+ ),
713
+ ] = None,
714
+ resource_type: Annotated[
715
+ Optional[ListCatalogsResourceTypeParameter],
716
+ Field(
717
+ description="Filter by resource type. Indicates digital representation availability. - `Information`: Resource has a digital representation - `Resolvable`: Resource resolves to another address - `Named`: No digital representation (abstract entity) - `Unknown`: Representation status unknown (common for harvested data) "
718
+ ),
719
+ ] = None,
720
+ public: Annotated[
721
+ Optional[StrictBool],
722
+ Field(
723
+ description="true: only publicly readable entries; false: only non-public entries"
724
+ ),
725
+ ] = None,
726
+ created_after: Annotated[
727
+ Optional[datetime], Field(description="Created at or after this instant")
728
+ ] = None,
729
+ created_before: Annotated[
730
+ Optional[datetime], Field(description="Created before this instant")
731
+ ] = None,
732
+ modified_after: Annotated[
733
+ Optional[datetime], Field(description="Modified at or after this instant")
734
+ ] = None,
735
+ modified_before: Annotated[
736
+ Optional[datetime], Field(description="Modified before this instant")
737
+ ] = None,
738
+ sort: Annotated[
739
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]],
740
+ Field(
741
+ description="Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400. "
742
+ ),
743
+ ] = None,
744
+ sort_order: Annotated[
745
+ Optional[SearchSortOrderParameter],
746
+ Field(description="Direction for `sort` clauses that do not carry one."),
747
+ ] = None,
748
+ facet: Annotated[
749
+ Optional[
750
+ Annotated[
751
+ List[
752
+ Annotated[str, Field(min_length=1, strict=True, max_length=256)]
753
+ ],
754
+ Field(max_length=50),
755
+ ]
756
+ ],
757
+ Field(
758
+ description="Fields to compute facets for (can be specified multiple times). Only the fields listed by `GET /search/facets` are accepted; any other field is rejected with 400. "
759
+ ),
760
+ ] = None,
761
+ facet_limit: Annotated[
762
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
763
+ Field(description="Maximum number of facet values per field"),
764
+ ] = None,
765
+ limit: Annotated[
766
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
767
+ Field(description="Results per page"),
768
+ ] = None,
769
+ offset: Annotated[
770
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
771
+ Field(description="Results to skip before the first one returned"),
772
+ ] = None,
773
+ cursor: Annotated[
774
+ Optional[Annotated[str, Field(strict=True, max_length=512)]],
775
+ Field(
776
+ description="Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response. "
777
+ ),
778
+ ] = None,
779
+ _request_timeout: Union[
780
+ None,
781
+ Annotated[StrictFloat, Field(gt=0)],
782
+ Tuple[
783
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
784
+ ],
785
+ ] = None,
786
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
787
+ _content_type: Optional[StrictStr] = None,
788
+ _headers: Optional[Dict[StrictStr, Any]] = None,
789
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
790
+ ) -> SearchResponse:
791
+ """Search entries
792
+
793
+ Search across all entry types using Solr-powered full-text search. Supports filtering, sorting, and faceting. Authentication is optional. Without authentication, only publicly available entries are included in results. Authenticated requests may include additional non-public entries. Answered from an asynchronously updated index: an entry created moments ago may not be found here while reading it by id already returns it.
794
+
795
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
796
+ :type x_entrystore_host: str
797
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
798
+ :type entrystore_host: str
799
+ :param query: Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own.
800
+ :type query: str
801
+ :param rdf_type: Only entries with this rdf:type URI
802
+ :type rdf_type: str
803
+ :param context: Filter by context ID. Can be specified multiple times to include entries from multiple contexts.
804
+ :type context: str
805
+ :param graph_type: Filter by graph type. Determines the nature of the resource. - `None`: No special type (regular files, web resources) - `Context`: Container for other entries - `Systemcontext`: Special system context (_contexts, _principals) - `User`: User resource - `Group`: Group resource - `List`: Ordered list of entries - `Resultlist`: Result list from search - `Graph`: RDF graph resource - `String`: String resource - `Pipeline`: Executable pipeline - `PipelineResult`: Result from pipeline execution
806
+ :type graph_type: ListCatalogsGraphTypeParameter
807
+ :param resource_type: Filter by resource type. Indicates digital representation availability. - `Information`: Resource has a digital representation - `Resolvable`: Resource resolves to another address - `Named`: No digital representation (abstract entity) - `Unknown`: Representation status unknown (common for harvested data)
808
+ :type resource_type: ListCatalogsResourceTypeParameter
809
+ :param public: true: only publicly readable entries; false: only non-public entries
810
+ :type public: bool
811
+ :param created_after: Created at or after this instant
812
+ :type created_after: datetime
813
+ :param created_before: Created before this instant
814
+ :type created_before: datetime
815
+ :param modified_after: Modified at or after this instant
816
+ :type modified_after: datetime
817
+ :param modified_before: Modified before this instant
818
+ :type modified_before: datetime
819
+ :param sort: Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400.
820
+ :type sort: str
821
+ :param sort_order: Direction for `sort` clauses that do not carry one.
822
+ :type sort_order: SearchSortOrderParameter
823
+ :param facet: Fields to compute facets for (can be specified multiple times). Only the fields listed by `GET /search/facets` are accepted; any other field is rejected with 400.
824
+ :type facet: List[str]
825
+ :param facet_limit: Maximum number of facet values per field
826
+ :type facet_limit: int
827
+ :param limit: Results per page
828
+ :type limit: int
829
+ :param offset: Results to skip before the first one returned
830
+ :type offset: int
831
+ :param cursor: Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response.
832
+ :type cursor: str
833
+ :param _request_timeout: timeout setting for this request. If one
834
+ number provided, it will be total request
835
+ timeout. It can also be a pair (tuple) of
836
+ (connection, read) timeouts.
837
+ :type _request_timeout: int, tuple(int, int), optional
838
+ :param _request_auth: set to override the auth_settings for an a single
839
+ request; this effectively ignores the
840
+ authentication in the spec for a single request.
841
+ :type _request_auth: dict, optional
842
+ :param _content_type: force content-type for the request.
843
+ :type _content_type: str, Optional
844
+ :param _headers: set to override the headers for a single
845
+ request; this effectively ignores the headers
846
+ in the spec for a single request.
847
+ :type _headers: dict, optional
848
+ :param _host_index: set to override the host_index for a single
849
+ request; this effectively ignores the host_index
850
+ in the spec for a single request.
851
+ :type _host_index: int, optional
852
+ :return: Returns the result object.
853
+ """ # noqa: E501
854
+
855
+ _param = self._search_serialize(
856
+ x_entrystore_host=x_entrystore_host,
857
+ entrystore_host=entrystore_host,
858
+ query=query,
859
+ rdf_type=rdf_type,
860
+ context=context,
861
+ graph_type=graph_type,
862
+ resource_type=resource_type,
863
+ public=public,
864
+ created_after=created_after,
865
+ created_before=created_before,
866
+ modified_after=modified_after,
867
+ modified_before=modified_before,
868
+ sort=sort,
869
+ sort_order=sort_order,
870
+ facet=facet,
871
+ facet_limit=facet_limit,
872
+ limit=limit,
873
+ offset=offset,
874
+ cursor=cursor,
875
+ _request_auth=_request_auth,
876
+ _content_type=_content_type,
877
+ _headers=_headers,
878
+ _host_index=_host_index,
879
+ )
880
+
881
+ _response_types_map: Dict[str, Optional[str]] = {
882
+ "200": "SearchResponse",
883
+ "400": "Error",
884
+ "401": "Error",
885
+ "500": "Error",
886
+ "503": "Error",
887
+ }
888
+ response_data = await self.api_client.call_api(
889
+ *_param, _request_timeout=_request_timeout
890
+ )
891
+ await response_data.read()
892
+ return self.api_client.response_deserialize(
893
+ response_data=response_data,
894
+ response_types_map=_response_types_map,
895
+ ).data
896
+
897
+ @validate_call
898
+ async def search_with_http_info(
899
+ self,
900
+ x_entrystore_host: Annotated[
901
+ Optional[StrictStr],
902
+ Field(
903
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
904
+ ),
905
+ ] = None,
906
+ entrystore_host: Annotated[
907
+ Optional[StrictStr],
908
+ Field(
909
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
910
+ ),
911
+ ] = None,
912
+ query: Annotated[
913
+ Optional[Annotated[str, Field(strict=True, max_length=1000)]],
914
+ Field(
915
+ description="Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own. "
916
+ ),
917
+ ] = None,
918
+ rdf_type: Annotated[
919
+ Optional[Annotated[str, Field(strict=True, max_length=2048)]],
920
+ Field(description="Only entries with this rdf:type URI"),
921
+ ] = None,
922
+ context: Annotated[
923
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]],
924
+ Field(
925
+ description="Filter by context ID. Can be specified multiple times to include entries from multiple contexts. "
926
+ ),
927
+ ] = None,
928
+ graph_type: Annotated[
929
+ Optional[ListCatalogsGraphTypeParameter],
930
+ Field(
931
+ description="Filter by graph type. Determines the nature of the resource. - `None`: No special type (regular files, web resources) - `Context`: Container for other entries - `Systemcontext`: Special system context (_contexts, _principals) - `User`: User resource - `Group`: Group resource - `List`: Ordered list of entries - `Resultlist`: Result list from search - `Graph`: RDF graph resource - `String`: String resource - `Pipeline`: Executable pipeline - `PipelineResult`: Result from pipeline execution "
932
+ ),
933
+ ] = None,
934
+ resource_type: Annotated[
935
+ Optional[ListCatalogsResourceTypeParameter],
936
+ Field(
937
+ description="Filter by resource type. Indicates digital representation availability. - `Information`: Resource has a digital representation - `Resolvable`: Resource resolves to another address - `Named`: No digital representation (abstract entity) - `Unknown`: Representation status unknown (common for harvested data) "
938
+ ),
939
+ ] = None,
940
+ public: Annotated[
941
+ Optional[StrictBool],
942
+ Field(
943
+ description="true: only publicly readable entries; false: only non-public entries"
944
+ ),
945
+ ] = None,
946
+ created_after: Annotated[
947
+ Optional[datetime], Field(description="Created at or after this instant")
948
+ ] = None,
949
+ created_before: Annotated[
950
+ Optional[datetime], Field(description="Created before this instant")
951
+ ] = None,
952
+ modified_after: Annotated[
953
+ Optional[datetime], Field(description="Modified at or after this instant")
954
+ ] = None,
955
+ modified_before: Annotated[
956
+ Optional[datetime], Field(description="Modified before this instant")
957
+ ] = None,
958
+ sort: Annotated[
959
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]],
960
+ Field(
961
+ description="Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400. "
962
+ ),
963
+ ] = None,
964
+ sort_order: Annotated[
965
+ Optional[SearchSortOrderParameter],
966
+ Field(description="Direction for `sort` clauses that do not carry one."),
967
+ ] = None,
968
+ facet: Annotated[
969
+ Optional[
970
+ Annotated[
971
+ List[
972
+ Annotated[str, Field(min_length=1, strict=True, max_length=256)]
973
+ ],
974
+ Field(max_length=50),
975
+ ]
976
+ ],
977
+ Field(
978
+ description="Fields to compute facets for (can be specified multiple times). Only the fields listed by `GET /search/facets` are accepted; any other field is rejected with 400. "
979
+ ),
980
+ ] = None,
981
+ facet_limit: Annotated[
982
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
983
+ Field(description="Maximum number of facet values per field"),
984
+ ] = None,
985
+ limit: Annotated[
986
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
987
+ Field(description="Results per page"),
988
+ ] = None,
989
+ offset: Annotated[
990
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
991
+ Field(description="Results to skip before the first one returned"),
992
+ ] = None,
993
+ cursor: Annotated[
994
+ Optional[Annotated[str, Field(strict=True, max_length=512)]],
995
+ Field(
996
+ description="Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response. "
997
+ ),
998
+ ] = None,
999
+ _request_timeout: Union[
1000
+ None,
1001
+ Annotated[StrictFloat, Field(gt=0)],
1002
+ Tuple[
1003
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1004
+ ],
1005
+ ] = None,
1006
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1007
+ _content_type: Optional[StrictStr] = None,
1008
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1009
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1010
+ ) -> ApiResponse[SearchResponse]:
1011
+ """Search entries
1012
+
1013
+ Search across all entry types using Solr-powered full-text search. Supports filtering, sorting, and faceting. Authentication is optional. Without authentication, only publicly available entries are included in results. Authenticated requests may include additional non-public entries. Answered from an asynchronously updated index: an entry created moments ago may not be found here while reading it by id already returns it.
1014
+
1015
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
1016
+ :type x_entrystore_host: str
1017
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
1018
+ :type entrystore_host: str
1019
+ :param query: Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own.
1020
+ :type query: str
1021
+ :param rdf_type: Only entries with this rdf:type URI
1022
+ :type rdf_type: str
1023
+ :param context: Filter by context ID. Can be specified multiple times to include entries from multiple contexts.
1024
+ :type context: str
1025
+ :param graph_type: Filter by graph type. Determines the nature of the resource. - `None`: No special type (regular files, web resources) - `Context`: Container for other entries - `Systemcontext`: Special system context (_contexts, _principals) - `User`: User resource - `Group`: Group resource - `List`: Ordered list of entries - `Resultlist`: Result list from search - `Graph`: RDF graph resource - `String`: String resource - `Pipeline`: Executable pipeline - `PipelineResult`: Result from pipeline execution
1026
+ :type graph_type: ListCatalogsGraphTypeParameter
1027
+ :param resource_type: Filter by resource type. Indicates digital representation availability. - `Information`: Resource has a digital representation - `Resolvable`: Resource resolves to another address - `Named`: No digital representation (abstract entity) - `Unknown`: Representation status unknown (common for harvested data)
1028
+ :type resource_type: ListCatalogsResourceTypeParameter
1029
+ :param public: true: only publicly readable entries; false: only non-public entries
1030
+ :type public: bool
1031
+ :param created_after: Created at or after this instant
1032
+ :type created_after: datetime
1033
+ :param created_before: Created before this instant
1034
+ :type created_before: datetime
1035
+ :param modified_after: Modified at or after this instant
1036
+ :type modified_after: datetime
1037
+ :param modified_before: Modified before this instant
1038
+ :type modified_before: datetime
1039
+ :param sort: Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400.
1040
+ :type sort: str
1041
+ :param sort_order: Direction for `sort` clauses that do not carry one.
1042
+ :type sort_order: SearchSortOrderParameter
1043
+ :param facet: Fields to compute facets for (can be specified multiple times). Only the fields listed by `GET /search/facets` are accepted; any other field is rejected with 400.
1044
+ :type facet: List[str]
1045
+ :param facet_limit: Maximum number of facet values per field
1046
+ :type facet_limit: int
1047
+ :param limit: Results per page
1048
+ :type limit: int
1049
+ :param offset: Results to skip before the first one returned
1050
+ :type offset: int
1051
+ :param cursor: Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response.
1052
+ :type cursor: str
1053
+ :param _request_timeout: timeout setting for this request. If one
1054
+ number provided, it will be total request
1055
+ timeout. It can also be a pair (tuple) of
1056
+ (connection, read) timeouts.
1057
+ :type _request_timeout: int, tuple(int, int), optional
1058
+ :param _request_auth: set to override the auth_settings for an a single
1059
+ request; this effectively ignores the
1060
+ authentication in the spec for a single request.
1061
+ :type _request_auth: dict, optional
1062
+ :param _content_type: force content-type for the request.
1063
+ :type _content_type: str, Optional
1064
+ :param _headers: set to override the headers for a single
1065
+ request; this effectively ignores the headers
1066
+ in the spec for a single request.
1067
+ :type _headers: dict, optional
1068
+ :param _host_index: set to override the host_index for a single
1069
+ request; this effectively ignores the host_index
1070
+ in the spec for a single request.
1071
+ :type _host_index: int, optional
1072
+ :return: Returns the result object.
1073
+ """ # noqa: E501
1074
+
1075
+ _param = self._search_serialize(
1076
+ x_entrystore_host=x_entrystore_host,
1077
+ entrystore_host=entrystore_host,
1078
+ query=query,
1079
+ rdf_type=rdf_type,
1080
+ context=context,
1081
+ graph_type=graph_type,
1082
+ resource_type=resource_type,
1083
+ public=public,
1084
+ created_after=created_after,
1085
+ created_before=created_before,
1086
+ modified_after=modified_after,
1087
+ modified_before=modified_before,
1088
+ sort=sort,
1089
+ sort_order=sort_order,
1090
+ facet=facet,
1091
+ facet_limit=facet_limit,
1092
+ limit=limit,
1093
+ offset=offset,
1094
+ cursor=cursor,
1095
+ _request_auth=_request_auth,
1096
+ _content_type=_content_type,
1097
+ _headers=_headers,
1098
+ _host_index=_host_index,
1099
+ )
1100
+
1101
+ _response_types_map: Dict[str, Optional[str]] = {
1102
+ "200": "SearchResponse",
1103
+ "400": "Error",
1104
+ "401": "Error",
1105
+ "500": "Error",
1106
+ "503": "Error",
1107
+ }
1108
+ response_data = await self.api_client.call_api(
1109
+ *_param, _request_timeout=_request_timeout
1110
+ )
1111
+ await response_data.read()
1112
+ return self.api_client.response_deserialize(
1113
+ response_data=response_data,
1114
+ response_types_map=_response_types_map,
1115
+ )
1116
+
1117
+ @validate_call
1118
+ async def search_without_preload_content(
1119
+ self,
1120
+ x_entrystore_host: Annotated[
1121
+ Optional[StrictStr],
1122
+ Field(
1123
+ description="Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance. "
1124
+ ),
1125
+ ] = None,
1126
+ entrystore_host: Annotated[
1127
+ Optional[StrictStr],
1128
+ Field(
1129
+ description="Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance. "
1130
+ ),
1131
+ ] = None,
1132
+ query: Annotated[
1133
+ Optional[Annotated[str, Field(strict=True, max_length=1000)]],
1134
+ Field(
1135
+ description="Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own. "
1136
+ ),
1137
+ ] = None,
1138
+ rdf_type: Annotated[
1139
+ Optional[Annotated[str, Field(strict=True, max_length=2048)]],
1140
+ Field(description="Only entries with this rdf:type URI"),
1141
+ ] = None,
1142
+ context: Annotated[
1143
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]],
1144
+ Field(
1145
+ description="Filter by context ID. Can be specified multiple times to include entries from multiple contexts. "
1146
+ ),
1147
+ ] = None,
1148
+ graph_type: Annotated[
1149
+ Optional[ListCatalogsGraphTypeParameter],
1150
+ Field(
1151
+ description="Filter by graph type. Determines the nature of the resource. - `None`: No special type (regular files, web resources) - `Context`: Container for other entries - `Systemcontext`: Special system context (_contexts, _principals) - `User`: User resource - `Group`: Group resource - `List`: Ordered list of entries - `Resultlist`: Result list from search - `Graph`: RDF graph resource - `String`: String resource - `Pipeline`: Executable pipeline - `PipelineResult`: Result from pipeline execution "
1152
+ ),
1153
+ ] = None,
1154
+ resource_type: Annotated[
1155
+ Optional[ListCatalogsResourceTypeParameter],
1156
+ Field(
1157
+ description="Filter by resource type. Indicates digital representation availability. - `Information`: Resource has a digital representation - `Resolvable`: Resource resolves to another address - `Named`: No digital representation (abstract entity) - `Unknown`: Representation status unknown (common for harvested data) "
1158
+ ),
1159
+ ] = None,
1160
+ public: Annotated[
1161
+ Optional[StrictBool],
1162
+ Field(
1163
+ description="true: only publicly readable entries; false: only non-public entries"
1164
+ ),
1165
+ ] = None,
1166
+ created_after: Annotated[
1167
+ Optional[datetime], Field(description="Created at or after this instant")
1168
+ ] = None,
1169
+ created_before: Annotated[
1170
+ Optional[datetime], Field(description="Created before this instant")
1171
+ ] = None,
1172
+ modified_after: Annotated[
1173
+ Optional[datetime], Field(description="Modified at or after this instant")
1174
+ ] = None,
1175
+ modified_before: Annotated[
1176
+ Optional[datetime], Field(description="Modified before this instant")
1177
+ ] = None,
1178
+ sort: Annotated[
1179
+ Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]],
1180
+ Field(
1181
+ description="Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400. "
1182
+ ),
1183
+ ] = None,
1184
+ sort_order: Annotated[
1185
+ Optional[SearchSortOrderParameter],
1186
+ Field(description="Direction for `sort` clauses that do not carry one."),
1187
+ ] = None,
1188
+ facet: Annotated[
1189
+ Optional[
1190
+ Annotated[
1191
+ List[
1192
+ Annotated[str, Field(min_length=1, strict=True, max_length=256)]
1193
+ ],
1194
+ Field(max_length=50),
1195
+ ]
1196
+ ],
1197
+ Field(
1198
+ description="Fields to compute facets for (can be specified multiple times). Only the fields listed by `GET /search/facets` are accepted; any other field is rejected with 400. "
1199
+ ),
1200
+ ] = None,
1201
+ facet_limit: Annotated[
1202
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1203
+ Field(description="Maximum number of facet values per field"),
1204
+ ] = None,
1205
+ limit: Annotated[
1206
+ Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1207
+ Field(description="Results per page"),
1208
+ ] = None,
1209
+ offset: Annotated[
1210
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
1211
+ Field(description="Results to skip before the first one returned"),
1212
+ ] = None,
1213
+ cursor: Annotated[
1214
+ Optional[Annotated[str, Field(strict=True, max_length=512)]],
1215
+ Field(
1216
+ description="Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response. "
1217
+ ),
1218
+ ] = None,
1219
+ _request_timeout: Union[
1220
+ None,
1221
+ Annotated[StrictFloat, Field(gt=0)],
1222
+ Tuple[
1223
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1224
+ ],
1225
+ ] = None,
1226
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1227
+ _content_type: Optional[StrictStr] = None,
1228
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1229
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1230
+ ) -> RESTResponseType:
1231
+ """Search entries
1232
+
1233
+ Search across all entry types using Solr-powered full-text search. Supports filtering, sorting, and faceting. Authentication is optional. Without authentication, only publicly available entries are included in results. Authenticated requests may include additional non-public entries. Answered from an asynchronously updated index: an entry created moments ago may not be found here while reading it by id already returns it.
1234
+
1235
+ :param x_entrystore_host: Target EntryStore instance (alternative to the entrystore_host query parameter, which wins if both are sent). The value has to be an instance this deployment has been configured to allow; any other host is refused with 400. Omit it for the deployment's default instance.
1236
+ :type x_entrystore_host: str
1237
+ :param entrystore_host: Target EntryStore instance. Overrides the X-Entrystore-Host header if both are provided. The value has to be an instance this deployment has been configured to allow; any other host is refused with 400, so a target you cannot reach is a request to the deployment's operator, not a different value to try. Omit it for the deployment's default instance.
1238
+ :type entrystore_host: str
1239
+ :param query: Free-text search. The value is split on whitespace and every term must match, either as a whole word anywhere in the entry's indexed text — title, description and tags — or as a substring of its title. The value is matched literally: characters that Solr treats as syntax are escaped rather than interpreted, so a query cannot select fields or combine clauses of its own.
1240
+ :type query: str
1241
+ :param rdf_type: Only entries with this rdf:type URI
1242
+ :type rdf_type: str
1243
+ :param context: Filter by context ID. Can be specified multiple times to include entries from multiple contexts.
1244
+ :type context: str
1245
+ :param graph_type: Filter by graph type. Determines the nature of the resource. - `None`: No special type (regular files, web resources) - `Context`: Container for other entries - `Systemcontext`: Special system context (_contexts, _principals) - `User`: User resource - `Group`: Group resource - `List`: Ordered list of entries - `Resultlist`: Result list from search - `Graph`: RDF graph resource - `String`: String resource - `Pipeline`: Executable pipeline - `PipelineResult`: Result from pipeline execution
1246
+ :type graph_type: ListCatalogsGraphTypeParameter
1247
+ :param resource_type: Filter by resource type. Indicates digital representation availability. - `Information`: Resource has a digital representation - `Resolvable`: Resource resolves to another address - `Named`: No digital representation (abstract entity) - `Unknown`: Representation status unknown (common for harvested data)
1248
+ :type resource_type: ListCatalogsResourceTypeParameter
1249
+ :param public: true: only publicly readable entries; false: only non-public entries
1250
+ :type public: bool
1251
+ :param created_after: Created at or after this instant
1252
+ :type created_after: datetime
1253
+ :param created_before: Created before this instant
1254
+ :type created_before: datetime
1255
+ :param modified_after: Modified at or after this instant
1256
+ :type modified_after: datetime
1257
+ :param modified_before: Modified before this instant
1258
+ :type modified_before: datetime
1259
+ :param sort: Sort clauses, comma-separated, highest priority first. A clause is `field+direction`, or `field` alone taking its direction from `sort_order`. The `+` may be sent literally or as `%2B`. Fields: `created`, `modified`, `score`, `title` (the English title; name another as `title.sv`). Anything else is rejected with 400.
1260
+ :type sort: str
1261
+ :param sort_order: Direction for `sort` clauses that do not carry one.
1262
+ :type sort_order: SearchSortOrderParameter
1263
+ :param facet: Fields to compute facets for (can be specified multiple times). Only the fields listed by `GET /search/facets` are accepted; any other field is rejected with 400.
1264
+ :type facet: List[str]
1265
+ :param facet_limit: Maximum number of facet values per field
1266
+ :type facet_limit: int
1267
+ :param limit: Results per page
1268
+ :type limit: int
1269
+ :param offset: Results to skip before the first one returned
1270
+ :type offset: int
1271
+ :param cursor: Opaque cursor token for cursor-based pagination. When provided, `offset` is ignored and results start after the position encoded in the cursor. Obtain the cursor value from the `next_cursor` field in a previous response.
1272
+ :type cursor: str
1273
+ :param _request_timeout: timeout setting for this request. If one
1274
+ number provided, it will be total request
1275
+ timeout. It can also be a pair (tuple) of
1276
+ (connection, read) timeouts.
1277
+ :type _request_timeout: int, tuple(int, int), optional
1278
+ :param _request_auth: set to override the auth_settings for an a single
1279
+ request; this effectively ignores the
1280
+ authentication in the spec for a single request.
1281
+ :type _request_auth: dict, optional
1282
+ :param _content_type: force content-type for the request.
1283
+ :type _content_type: str, Optional
1284
+ :param _headers: set to override the headers for a single
1285
+ request; this effectively ignores the headers
1286
+ in the spec for a single request.
1287
+ :type _headers: dict, optional
1288
+ :param _host_index: set to override the host_index for a single
1289
+ request; this effectively ignores the host_index
1290
+ in the spec for a single request.
1291
+ :type _host_index: int, optional
1292
+ :return: Returns the result object.
1293
+ """ # noqa: E501
1294
+
1295
+ _param = self._search_serialize(
1296
+ x_entrystore_host=x_entrystore_host,
1297
+ entrystore_host=entrystore_host,
1298
+ query=query,
1299
+ rdf_type=rdf_type,
1300
+ context=context,
1301
+ graph_type=graph_type,
1302
+ resource_type=resource_type,
1303
+ public=public,
1304
+ created_after=created_after,
1305
+ created_before=created_before,
1306
+ modified_after=modified_after,
1307
+ modified_before=modified_before,
1308
+ sort=sort,
1309
+ sort_order=sort_order,
1310
+ facet=facet,
1311
+ facet_limit=facet_limit,
1312
+ limit=limit,
1313
+ offset=offset,
1314
+ cursor=cursor,
1315
+ _request_auth=_request_auth,
1316
+ _content_type=_content_type,
1317
+ _headers=_headers,
1318
+ _host_index=_host_index,
1319
+ )
1320
+
1321
+ _response_types_map: Dict[str, Optional[str]] = {
1322
+ "200": "SearchResponse",
1323
+ "400": "Error",
1324
+ "401": "Error",
1325
+ "500": "Error",
1326
+ "503": "Error",
1327
+ }
1328
+ response_data = await self.api_client.call_api(
1329
+ *_param, _request_timeout=_request_timeout
1330
+ )
1331
+ return response_data.response
1332
+
1333
+ def _search_serialize(
1334
+ self,
1335
+ x_entrystore_host,
1336
+ entrystore_host,
1337
+ query,
1338
+ rdf_type,
1339
+ context,
1340
+ graph_type,
1341
+ resource_type,
1342
+ public,
1343
+ created_after,
1344
+ created_before,
1345
+ modified_after,
1346
+ modified_before,
1347
+ sort,
1348
+ sort_order,
1349
+ facet,
1350
+ facet_limit,
1351
+ limit,
1352
+ offset,
1353
+ cursor,
1354
+ _request_auth,
1355
+ _content_type,
1356
+ _headers,
1357
+ _host_index,
1358
+ ) -> RequestSerialized:
1359
+
1360
+ _host = None
1361
+
1362
+ _collection_formats: Dict[str, str] = {
1363
+ "facet": "multi",
1364
+ }
1365
+
1366
+ _path_params: Dict[str, str] = {}
1367
+ _query_params: List[Tuple[str, str]] = []
1368
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1369
+ _form_params: List[Tuple[str, str]] = []
1370
+ _files: Dict[
1371
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1372
+ ] = {}
1373
+ _body_params: Optional[bytes] = None
1374
+
1375
+ # process the path parameters
1376
+ # process the query parameters
1377
+ if entrystore_host is not None:
1378
+
1379
+ _query_params.append(("entrystore_host", entrystore_host))
1380
+
1381
+ if query is not None:
1382
+
1383
+ _query_params.append(("query", query))
1384
+
1385
+ if rdf_type is not None:
1386
+
1387
+ _query_params.append(("rdf_type", rdf_type))
1388
+
1389
+ if context is not None:
1390
+
1391
+ _query_params.append(("context", context))
1392
+
1393
+ if graph_type is not None:
1394
+
1395
+ _query_params.append(("graph_type", graph_type.value))
1396
+
1397
+ if resource_type is not None:
1398
+
1399
+ _query_params.append(("resource_type", resource_type.value))
1400
+
1401
+ if public is not None:
1402
+
1403
+ _query_params.append(("public", public))
1404
+
1405
+ if created_after is not None:
1406
+ if isinstance(created_after, datetime):
1407
+ _query_params.append(
1408
+ (
1409
+ "created_after",
1410
+ created_after.strftime(
1411
+ self.api_client.configuration.datetime_format
1412
+ ),
1413
+ )
1414
+ )
1415
+ else:
1416
+ _query_params.append(("created_after", created_after))
1417
+
1418
+ if created_before is not None:
1419
+ if isinstance(created_before, datetime):
1420
+ _query_params.append(
1421
+ (
1422
+ "created_before",
1423
+ created_before.strftime(
1424
+ self.api_client.configuration.datetime_format
1425
+ ),
1426
+ )
1427
+ )
1428
+ else:
1429
+ _query_params.append(("created_before", created_before))
1430
+
1431
+ if modified_after is not None:
1432
+ if isinstance(modified_after, datetime):
1433
+ _query_params.append(
1434
+ (
1435
+ "modified_after",
1436
+ modified_after.strftime(
1437
+ self.api_client.configuration.datetime_format
1438
+ ),
1439
+ )
1440
+ )
1441
+ else:
1442
+ _query_params.append(("modified_after", modified_after))
1443
+
1444
+ if modified_before is not None:
1445
+ if isinstance(modified_before, datetime):
1446
+ _query_params.append(
1447
+ (
1448
+ "modified_before",
1449
+ modified_before.strftime(
1450
+ self.api_client.configuration.datetime_format
1451
+ ),
1452
+ )
1453
+ )
1454
+ else:
1455
+ _query_params.append(("modified_before", modified_before))
1456
+
1457
+ if sort is not None:
1458
+
1459
+ _query_params.append(("sort", sort))
1460
+
1461
+ if sort_order is not None:
1462
+
1463
+ _query_params.append(("sort_order", sort_order.value))
1464
+
1465
+ if facet is not None:
1466
+
1467
+ _query_params.append(("facet", facet))
1468
+
1469
+ if facet_limit is not None:
1470
+
1471
+ _query_params.append(("facet_limit", facet_limit))
1472
+
1473
+ if limit is not None:
1474
+
1475
+ _query_params.append(("limit", limit))
1476
+
1477
+ if offset is not None:
1478
+
1479
+ _query_params.append(("offset", offset))
1480
+
1481
+ if cursor is not None:
1482
+
1483
+ _query_params.append(("cursor", cursor))
1484
+
1485
+ # process the header parameters
1486
+ if x_entrystore_host is not None:
1487
+ _header_params["X-Entrystore-Host"] = x_entrystore_host
1488
+ # process the form parameters
1489
+ # process the body parameter
1490
+
1491
+ # set the HTTP header `Accept`
1492
+ if "Accept" not in _header_params:
1493
+ _header_params["Accept"] = self.api_client.select_header_accept(
1494
+ ["application/json"]
1495
+ )
1496
+
1497
+ # authentication setting
1498
+ _auth_settings: List[str] = ["auth_token", "auth_header"]
1499
+
1500
+ return self.api_client.param_serialize(
1501
+ method="GET",
1502
+ resource_path="/search",
1503
+ path_params=_path_params,
1504
+ query_params=_query_params,
1505
+ header_params=_header_params,
1506
+ body=_body_params,
1507
+ post_params=_form_params,
1508
+ files=_files,
1509
+ auth_settings=_auth_settings,
1510
+ collection_formats=_collection_formats,
1511
+ _host=_host,
1512
+ _request_auth=_request_auth,
1513
+ )