diff --git a/impresso/api_client/api/admin/admin_find.py b/impresso/api_client/api/admin/admin_find.py index b7438a3..06e42cc 100644 --- a/impresso/api_client/api/admin/admin_find.py +++ b/impresso/api_client/api/admin/admin_find.py @@ -42,7 +42,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/admin/admin_patch.py b/impresso/api_client/api/admin/admin_patch.py index 5a98bc2..f933433 100644 --- a/impresso/api_client/api/admin/admin_patch.py +++ b/impresso/api_client/api/admin/admin_patch.py @@ -54,7 +54,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/collections/add_collectable_items_from_filters.py b/impresso/api_client/api/collections/add_collectable_items_from_filters.py index 4ea8846..d7c8d10 100644 --- a/impresso/api_client/api/collections/add_collectable_items_from_filters.py +++ b/impresso/api_client/api/collections/add_collectable_items_from_filters.py @@ -49,7 +49,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/collections/create_collection.py b/impresso/api_client/api/collections/create_collection.py index 7accadd..1eba873 100644 --- a/impresso/api_client/api/collections/create_collection.py +++ b/impresso/api_client/api/collections/create_collection.py @@ -50,7 +50,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/collections/find_collections.py b/impresso/api_client/api/collections/find_collections.py index 2d84f8b..b10c44c 100644 --- a/impresso/api_client/api/collections/find_collections.py +++ b/impresso/api_client/api/collections/find_collections.py @@ -63,7 +63,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/collections/get_collection.py b/impresso/api_client/api/collections/get_collection.py index bea6d37..f37f061 100644 --- a/impresso/api_client/api/collections/get_collection.py +++ b/impresso/api_client/api/collections/get_collection.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/collections/patch_collections_collection_id_items.py b/impresso/api_client/api/collections/patch_collections_collection_id_items.py index acdf494..cc9b28f 100644 --- a/impresso/api_client/api/collections/patch_collections_collection_id_items.py +++ b/impresso/api_client/api/collections/patch_collections_collection_id_items.py @@ -55,7 +55,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/collections/remove_collection.py b/impresso/api_client/api/collections/remove_collection.py index 3779efd..1c24689 100644 --- a/impresso/api_client/api/collections/remove_collection.py +++ b/impresso/api_client/api/collections/remove_collection.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/collections/update_collection.py b/impresso/api_client/api/collections/update_collection.py index ed7721e..68f1bd7 100644 --- a/impresso/api_client/api/collections/update_collection.py +++ b/impresso/api_client/api/collections/update_collection.py @@ -55,7 +55,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/content_items/get_content_item.py b/impresso/api_client/api/content_items/get_content_item.py index e00dec5..3bd6524 100644 --- a/impresso/api_client/api/content_items/get_content_item.py +++ b/impresso/api_client/api/content_items/get_content_item.py @@ -53,7 +53,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/data_providers/find_data_providers.py b/impresso/api_client/api/data_providers/find_data_providers.py index b83392c..3e5a0a5 100644 --- a/impresso/api_client/api/data_providers/find_data_providers.py +++ b/impresso/api_client/api/data_providers/find_data_providers.py @@ -58,7 +58,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/data_providers/get_data_provider.py b/impresso/api_client/api/data_providers/get_data_provider.py index ed31b47..7dbd93b 100644 --- a/impresso/api_client/api/data_providers/get_data_provider.py +++ b/impresso/api_client/api/data_providers/get_data_provider.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/entities/find_entities.py b/impresso/api_client/api/entities/find_entities.py index 16eb1e3..47b90c6 100644 --- a/impresso/api_client/api/entities/find_entities.py +++ b/impresso/api_client/api/entities/find_entities.py @@ -84,7 +84,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/entities/get_entity.py b/impresso/api_client/api/entities/get_entity.py index bdf3a05..c13886f 100644 --- a/impresso/api_client/api/entities/get_entity.py +++ b/impresso/api_client/api/entities/get_entity.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/experiments/find_experiments.py b/impresso/api_client/api/experiments/find_experiments.py index e0cb24d..ea4d682 100644 --- a/impresso/api_client/api/experiments/find_experiments.py +++ b/impresso/api_client/api/experiments/find_experiments.py @@ -42,7 +42,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/experiments/interact_with_experiment.py b/impresso/api_client/api/experiments/interact_with_experiment.py index d3f15d3..2fc69b8 100644 --- a/impresso/api_client/api/experiments/interact_with_experiment.py +++ b/impresso/api_client/api/experiments/interact_with_experiment.py @@ -55,7 +55,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/images/find_images.py b/impresso/api_client/api/images/find_images.py index 9699ea9..c6631ec 100644 --- a/impresso/api_client/api/images/find_images.py +++ b/impresso/api_client/api/images/find_images.py @@ -87,7 +87,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/images/get_image.py b/impresso/api_client/api/images/get_image.py index 707c1ad..4a149b9 100644 --- a/impresso/api_client/api/images/get_image.py +++ b/impresso/api_client/api/images/get_image.py @@ -53,7 +53,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/media_sources/find_media_sources.py b/impresso/api_client/api/media_sources/find_media_sources.py index d4b1e20..ee8094a 100644 --- a/impresso/api_client/api/media_sources/find_media_sources.py +++ b/impresso/api_client/api/media_sources/find_media_sources.py @@ -77,7 +77,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/media_sources/get_media_source.py b/impresso/api_client/api/media_sources/get_media_source.py index 56a392d..6ac23ff 100644 --- a/impresso/api_client/api/media_sources/get_media_source.py +++ b/impresso/api_client/api/media_sources/get_media_source.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/search/search.py b/impresso/api_client/api/search/search.py index 439a1a9..463793a 100644 --- a/impresso/api_client/api/search/search.py +++ b/impresso/api_client/api/search/search.py @@ -84,7 +84,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/search_facets/get_images_facet.py b/impresso/api_client/api/search_facets/get_images_facet.py index 83c1997..2f469a5 100644 --- a/impresso/api_client/api/search_facets/get_images_facet.py +++ b/impresso/api_client/api/search_facets/get_images_facet.py @@ -80,7 +80,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/search_facets/get_search_facet.py b/impresso/api_client/api/search_facets/get_search_facet.py index 559aabd..e12283a 100644 --- a/impresso/api_client/api/search_facets/get_search_facet.py +++ b/impresso/api_client/api/search_facets/get_search_facet.py @@ -80,7 +80,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/search_facets/get_tr_clusters_facet.py b/impresso/api_client/api/search_facets/get_tr_clusters_facet.py index 2936b58..dec8ff9 100644 --- a/impresso/api_client/api/search_facets/get_tr_clusters_facet.py +++ b/impresso/api_client/api/search_facets/get_tr_clusters_facet.py @@ -80,7 +80,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/search_facets/get_tr_passages_facet.py b/impresso/api_client/api/search_facets/get_tr_passages_facet.py index 1968a01..3eb01d1 100644 --- a/impresso/api_client/api/search_facets/get_tr_passages_facet.py +++ b/impresso/api_client/api/search_facets/get_tr_passages_facet.py @@ -80,7 +80,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/text_reuse_clusters/find_text_reuse_clusters.py b/impresso/api_client/api/text_reuse_clusters/find_text_reuse_clusters.py index f02dc6e..7e6085b 100644 --- a/impresso/api_client/api/text_reuse_clusters/find_text_reuse_clusters.py +++ b/impresso/api_client/api/text_reuse_clusters/find_text_reuse_clusters.py @@ -81,7 +81,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/text_reuse_clusters/get_text_reuse_cluster.py b/impresso/api_client/api/text_reuse_clusters/get_text_reuse_cluster.py index b5e32eb..d162561 100644 --- a/impresso/api_client/api/text_reuse_clusters/get_text_reuse_cluster.py +++ b/impresso/api_client/api/text_reuse_clusters/get_text_reuse_cluster.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/text_reuse_passages/find_text_reuse_passages.py b/impresso/api_client/api/text_reuse_passages/find_text_reuse_passages.py index 09d1b2e..32767a0 100644 --- a/impresso/api_client/api/text_reuse_passages/find_text_reuse_passages.py +++ b/impresso/api_client/api/text_reuse_passages/find_text_reuse_passages.py @@ -78,7 +78,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/text_reuse_passages/get_text_reuse_passage.py b/impresso/api_client/api/text_reuse_passages/get_text_reuse_passage.py index ece4149..c7a835a 100644 --- a/impresso/api_client/api/text_reuse_passages/get_text_reuse_passage.py +++ b/impresso/api_client/api/text_reuse_passages/get_text_reuse_passage.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/tools/perform_image_embedding.py b/impresso/api_client/api/tools/perform_image_embedding.py index c3c4154..2ef8483 100644 --- a/impresso/api_client/api/tools/perform_image_embedding.py +++ b/impresso/api_client/api/tools/perform_image_embedding.py @@ -50,7 +50,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/tools/perform_ner.py b/impresso/api_client/api/tools/perform_ner.py index 41feb50..ed1b34d 100644 --- a/impresso/api_client/api/tools/perform_ner.py +++ b/impresso/api_client/api/tools/perform_ner.py @@ -50,7 +50,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/tools/perform_text_embedding.py b/impresso/api_client/api/tools/perform_text_embedding.py index 2db05b6..2293e73 100644 --- a/impresso/api_client/api/tools/perform_text_embedding.py +++ b/impresso/api_client/api/tools/perform_text_embedding.py @@ -50,7 +50,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/tools/serialize_filters.py b/impresso/api_client/api/tools/serialize_filters.py index 7829069..3d00aa3 100644 --- a/impresso/api_client/api/tools/serialize_filters.py +++ b/impresso/api_client/api/tools/serialize_filters.py @@ -42,7 +42,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/topics/find_topics.py b/impresso/api_client/api/topics/find_topics.py index ffc016a..bb127a2 100644 --- a/impresso/api_client/api/topics/find_topics.py +++ b/impresso/api_client/api/topics/find_topics.py @@ -81,7 +81,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/topics/get_topic.py b/impresso/api_client/api/topics/get_topic.py index 9484e4d..0f9b5fb 100644 --- a/impresso/api_client/api/topics/get_topic.py +++ b/impresso/api_client/api/topics/get_topic.py @@ -44,7 +44,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/api/version/get_version_details.py b/impresso/api_client/api/version/get_version_details.py index 89e2de7..2a9874d 100644 --- a/impresso/api_client/api/version/get_version_details.py +++ b/impresso/api_client/api/version/get_version_details.py @@ -34,7 +34,7 @@ def _parse_response( response_418 = Error.from_dict(response.json()) return response_418 - if response.status_code == HTTPStatus.UNPROCESSABLE_CONTENT: + if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY: response_422 = Error.from_dict(response.json()) return response_422 diff --git a/impresso/api_client/models/__init__.py b/impresso/api_client/models/__init__.py index b7bb65e..cd6cb30 100644 --- a/impresso/api_client/models/__init__.py +++ b/impresso/api_client/models/__init__.py @@ -48,9 +48,20 @@ from .content_item_semantic_enrichments_mentions import ContentItemSemanticEnrichmentsMentions from .content_item_semantic_enrichments_named_entities import ContentItemSemanticEnrichmentsNamedEntities from .content_item_text import ContentItemText +from .content_item_text_advertisement import ContentItemTextAdvertisement +from .content_item_text_article import ContentItemTextArticle +from .content_item_text_chronicle import ContentItemTextChronicle +from .content_item_text_discussion import ContentItemTextDiscussion from .content_item_text_document_type import ContentItemTextDocumentType -from .content_item_text_item_type import ContentItemTextItemType +from .content_item_text_entretien import ContentItemTextEntretien +from .content_item_text_image import ContentItemTextImage from .content_item_text_match import ContentItemTextMatch +from .content_item_text_no_type_provided import ContentItemTextNoTypeProvided +from .content_item_text_obituary import ContentItemTextObituary +from .content_item_text_radio_broadcast import ContentItemTextRadioBroadcast +from .content_item_text_radio_broadcast_episode import ContentItemTextRadioBroadcastEpisode +from .content_item_text_table import ContentItemTextTable +from .content_item_text_weather import ContentItemTextWeather from .content_item_topic import ContentItemTopic from .data_provider import DataProvider from .data_provider_names_item import DataProviderNamesItem @@ -246,9 +257,20 @@ "ContentItemSemanticEnrichmentsMentions", "ContentItemSemanticEnrichmentsNamedEntities", "ContentItemText", + "ContentItemTextAdvertisement", + "ContentItemTextArticle", + "ContentItemTextChronicle", + "ContentItemTextDiscussion", "ContentItemTextDocumentType", - "ContentItemTextItemType", + "ContentItemTextEntretien", + "ContentItemTextImage", "ContentItemTextMatch", + "ContentItemTextNoTypeProvided", + "ContentItemTextObituary", + "ContentItemTextRadioBroadcast", + "ContentItemTextRadioBroadcastEpisode", + "ContentItemTextTable", + "ContentItemTextWeather", "ContentItemTopic", "DataProvider", "DataProviderNamesItem", diff --git a/impresso/api_client/models/content_item_text.py b/impresso/api_client/models/content_item_text.py index c3800ce..646f0de 100644 --- a/impresso/api_client/models/content_item_text.py +++ b/impresso/api_client/models/content_item_text.py @@ -2,8 +2,19 @@ from attrs import define as _attrs_define +from ..models.content_item_text_advertisement import ContentItemTextAdvertisement +from ..models.content_item_text_article import ContentItemTextArticle +from ..models.content_item_text_chronicle import ContentItemTextChronicle +from ..models.content_item_text_discussion import ContentItemTextDiscussion from ..models.content_item_text_document_type import ContentItemTextDocumentType -from ..models.content_item_text_item_type import ContentItemTextItemType +from ..models.content_item_text_entretien import ContentItemTextEntretien +from ..models.content_item_text_image import ContentItemTextImage +from ..models.content_item_text_no_type_provided import ContentItemTextNoTypeProvided +from ..models.content_item_text_obituary import ContentItemTextObituary +from ..models.content_item_text_radio_broadcast import ContentItemTextRadioBroadcast +from ..models.content_item_text_radio_broadcast_episode import ContentItemTextRadioBroadcastEpisode +from ..models.content_item_text_table import ContentItemTextTable +from ..models.content_item_text_weather import ContentItemTextWeather from ..types import UNSET, Unset if TYPE_CHECKING: @@ -20,7 +31,10 @@ class ContentItemText: Attributes: document_type (Union[Unset, ContentItemTextDocumentType]): Type of document, e.g., page (p) or content item (ci). - item_type (Union[Unset, ContentItemTextItemType]): Type of content item, e.g., article, section. + item_type (Union[ContentItemTextAdvertisement, ContentItemTextArticle, ContentItemTextChronicle, + ContentItemTextDiscussion, ContentItemTextEntretien, ContentItemTextImage, ContentItemTextNoTypeProvided, + ContentItemTextObituary, ContentItemTextRadioBroadcast, ContentItemTextRadioBroadcastEpisode, + ContentItemTextTable, ContentItemTextWeather, Unset]): Type of content item, e.g., article, section. item_type_label (Union[Unset, str]): Human-readable label for the itemType code. original_lang_code (Union[Unset, str]): Original language of the content item. lang_code (Union[Unset, str]): Computed language of the content item. @@ -32,7 +46,21 @@ class ContentItemText: """ document_type: Union[Unset, ContentItemTextDocumentType] = UNSET - item_type: Union[Unset, ContentItemTextItemType] = UNSET + item_type: Union[ + ContentItemTextAdvertisement, + ContentItemTextArticle, + ContentItemTextChronicle, + ContentItemTextDiscussion, + ContentItemTextEntretien, + ContentItemTextImage, + ContentItemTextNoTypeProvided, + ContentItemTextObituary, + ContentItemTextRadioBroadcast, + ContentItemTextRadioBroadcastEpisode, + ContentItemTextTable, + ContentItemTextWeather, + Unset, + ] = UNSET item_type_label: Union[Unset, str] = UNSET original_lang_code: Union[Unset, str] = UNSET lang_code: Union[Unset, str] = UNSET @@ -47,8 +75,32 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.document_type, Unset): document_type = self.document_type.value - item_type: Union[Unset, str] = UNSET - if not isinstance(self.item_type, Unset): + item_type: Union[Unset, str] + if isinstance(self.item_type, Unset): + item_type = UNSET + elif isinstance(self.item_type, ContentItemTextArticle): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextAdvertisement): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextImage): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextTable): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextObituary): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextWeather): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextChronicle): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextRadioBroadcast): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextRadioBroadcastEpisode): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextNoTypeProvided): + item_type = self.item_type.value + elif isinstance(self.item_type, ContentItemTextDiscussion): + item_type = self.item_type.value + else: item_type = self.item_type.value item_type_label = self.item_type_label @@ -109,12 +161,120 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: document_type = ContentItemTextDocumentType(_document_type) - _item_type = d.pop("itemType", UNSET) - item_type: Union[Unset, ContentItemTextItemType] - if isinstance(_item_type, Unset): - item_type = UNSET - else: - item_type = ContentItemTextItemType(_item_type) + def _parse_item_type( + data: object, + ) -> Union[ + ContentItemTextAdvertisement, + ContentItemTextArticle, + ContentItemTextChronicle, + ContentItemTextDiscussion, + ContentItemTextEntretien, + ContentItemTextImage, + ContentItemTextNoTypeProvided, + ContentItemTextObituary, + ContentItemTextRadioBroadcast, + ContentItemTextRadioBroadcastEpisode, + ContentItemTextTable, + ContentItemTextWeather, + Unset, + ]: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_0 = ContentItemTextArticle(data) + + return item_type_type_0 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_1 = ContentItemTextAdvertisement(data) + + return item_type_type_1 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_2 = ContentItemTextImage(data) + + return item_type_type_2 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_3 = ContentItemTextTable(data) + + return item_type_type_3 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_4 = ContentItemTextObituary(data) + + return item_type_type_4 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_5 = ContentItemTextWeather(data) + + return item_type_type_5 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_6 = ContentItemTextChronicle(data) + + return item_type_type_6 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_7 = ContentItemTextRadioBroadcast(data) + + return item_type_type_7 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_8 = ContentItemTextRadioBroadcastEpisode(data) + + return item_type_type_8 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_9 = ContentItemTextNoTypeProvided(data) + + return item_type_type_9 + except: # noqa: E722 + pass + try: + if not isinstance(data, str): + raise TypeError() + item_type_type_10 = ContentItemTextDiscussion(data) + + return item_type_type_10 + except: # noqa: E722 + pass + if not isinstance(data, str): + raise TypeError() + item_type_type_11 = ContentItemTextEntretien(data) + + return item_type_type_11 + + item_type = _parse_item_type(d.pop("itemType", UNSET)) item_type_label = d.pop("itemTypeLabel", UNSET) diff --git a/impresso/api_client/models/content_item_text_advertisement.py b/impresso/api_client/models/content_item_text_advertisement.py new file mode 100644 index 0000000..8350299 --- /dev/null +++ b/impresso/api_client/models/content_item_text_advertisement.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextAdvertisement(str, Enum): + AD = "ad" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextAdvertisementLiteral = Literal["ad",] diff --git a/impresso/api_client/models/content_item_text_article.py b/impresso/api_client/models/content_item_text_article.py new file mode 100644 index 0000000..889c7da --- /dev/null +++ b/impresso/api_client/models/content_item_text_article.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextArticle(str, Enum): + AR = "ar" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextArticleLiteral = Literal["ar",] diff --git a/impresso/api_client/models/content_item_text_chronicle.py b/impresso/api_client/models/content_item_text_chronicle.py new file mode 100644 index 0000000..2b64108 --- /dev/null +++ b/impresso/api_client/models/content_item_text_chronicle.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextChronicle(str, Enum): + CH = "ch" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextChronicleLiteral = Literal["ch",] diff --git a/impresso/api_client/models/content_item_text_discussion.py b/impresso/api_client/models/content_item_text_discussion.py new file mode 100644 index 0000000..aebce31 --- /dev/null +++ b/impresso/api_client/models/content_item_text_discussion.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextDiscussion(str, Enum): + DSC = "dsc" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextDiscussionLiteral = Literal["dsc",] diff --git a/impresso/api_client/models/content_item_text_entretien.py b/impresso/api_client/models/content_item_text_entretien.py new file mode 100644 index 0000000..512bfb2 --- /dev/null +++ b/impresso/api_client/models/content_item_text_entretien.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextEntretien(str, Enum): + ENT = "ent" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextEntretienLiteral = Literal["ent",] diff --git a/impresso/api_client/models/content_item_text_image.py b/impresso/api_client/models/content_item_text_image.py new file mode 100644 index 0000000..33cc2a9 --- /dev/null +++ b/impresso/api_client/models/content_item_text_image.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextImage(str, Enum): + IMG = "img" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextImageLiteral = Literal["img",] diff --git a/impresso/api_client/models/content_item_text_item_type.py b/impresso/api_client/models/content_item_text_item_type.py deleted file mode 100644 index 49526b2..0000000 --- a/impresso/api_client/models/content_item_text_item_type.py +++ /dev/null @@ -1,56 +0,0 @@ -from enum import Enum -from typing import Literal - - -class ContentItemTextItemType(str, Enum): - AD = "ad" - ADVERTISEMENT = "advertisement" - AR = "ar" - ARTICLE = "article" - CH = "ch" - CHAPTER = "chapter" - CHRONICLE = "chronicle" - DEATH_NOTICE = "death_notice" - DISCUSSION = "discussion" - DSC = "dsc" - ENT = "ent" - ENTERTAINMENT = "entertainment" - NO_TYPE = "no-type" - OB = "ob" - PAGE = "page" - RADIO_BROADCAST_EPISODE = "radio_broadcast_episode" - RADIO_BULLETIN = "radio_bulletin" - RB = "rb" - RBE = "rbe" - TB = "tb" - UNSEGMENTED = "unsegmented" - W = "w" - - def __str__(self) -> str: - return str(self.value) - - -ContentItemTextItemTypeLiteral = Literal[ - "ad", - "advertisement", - "ar", - "article", - "ch", - "chapter", - "chronicle", - "death_notice", - "discussion", - "dsc", - "ent", - "entertainment", - "no-type", - "ob", - "page", - "radio_broadcast_episode", - "radio_bulletin", - "rb", - "rbe", - "tb", - "unsegmented", - "w", -] diff --git a/impresso/api_client/models/content_item_text_no_type_provided.py b/impresso/api_client/models/content_item_text_no_type_provided.py new file mode 100644 index 0000000..3e4ca47 --- /dev/null +++ b/impresso/api_client/models/content_item_text_no_type_provided.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextNoTypeProvided(str, Enum): + NO_TYPE = "no-type" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextNoTypeProvidedLiteral = Literal["no-type",] diff --git a/impresso/api_client/models/content_item_text_obituary.py b/impresso/api_client/models/content_item_text_obituary.py new file mode 100644 index 0000000..600aab3 --- /dev/null +++ b/impresso/api_client/models/content_item_text_obituary.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextObituary(str, Enum): + OB = "ob" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextObituaryLiteral = Literal["ob",] diff --git a/impresso/api_client/models/content_item_text_radio_broadcast.py b/impresso/api_client/models/content_item_text_radio_broadcast.py new file mode 100644 index 0000000..17df3e3 --- /dev/null +++ b/impresso/api_client/models/content_item_text_radio_broadcast.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextRadioBroadcast(str, Enum): + RB = "rb" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextRadioBroadcastLiteral = Literal["rb",] diff --git a/impresso/api_client/models/content_item_text_radio_broadcast_episode.py b/impresso/api_client/models/content_item_text_radio_broadcast_episode.py new file mode 100644 index 0000000..5604357 --- /dev/null +++ b/impresso/api_client/models/content_item_text_radio_broadcast_episode.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextRadioBroadcastEpisode(str, Enum): + RBE = "rbe" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextRadioBroadcastEpisodeLiteral = Literal["rbe",] diff --git a/impresso/api_client/models/content_item_text_table.py b/impresso/api_client/models/content_item_text_table.py new file mode 100644 index 0000000..cffb564 --- /dev/null +++ b/impresso/api_client/models/content_item_text_table.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextTable(str, Enum): + TB = "tb" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextTableLiteral = Literal["tb",] diff --git a/impresso/api_client/models/content_item_text_weather.py b/impresso/api_client/models/content_item_text_weather.py new file mode 100644 index 0000000..08c6525 --- /dev/null +++ b/impresso/api_client/models/content_item_text_weather.py @@ -0,0 +1,12 @@ +from enum import Enum +from typing import Literal + + +class ContentItemTextWeather(str, Enum): + W = "w" + + def __str__(self) -> str: + return str(self.value) + + +ContentItemTextWeatherLiteral = Literal["w",] diff --git a/impresso/api_client/models/image.py b/impresso/api_client/models/image.py index c1938f2..ee47809 100644 --- a/impresso/api_client/models/image.py +++ b/impresso/api_client/models/image.py @@ -7,6 +7,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.content_item_access_rights import ContentItemAccessRights from ..models.image_image_types import ImageImageTypes from ..models.image_media_source_ref import ImageMediaSourceRef @@ -24,6 +25,7 @@ class Image: preview_url (str): The URL of the image preview media_source_ref (ImageMediaSourceRef): The media source of the image date (datetime.date): The date of the image or the date of the issue that the image belongs to. + access (ContentItemAccessRights): Access rights information caption (Union[Unset, str]): Image caption content_item_id (Union[Unset, str]): The unique identifier of the content item that the image belongs to. page_numbers (Union[Unset, List[int]]): The page numbers of the issue that the image belongs to. @@ -37,6 +39,7 @@ class Image: preview_url: str media_source_ref: "ImageMediaSourceRef" date: datetime.date + access: "ContentItemAccessRights" caption: Union[Unset, str] = UNSET content_item_id: Union[Unset, str] = UNSET page_numbers: Union[Unset, List[int]] = UNSET @@ -54,6 +57,8 @@ def to_dict(self) -> Dict[str, Any]: date = self.date.isoformat() + access = self.access.to_dict() + caption = self.caption content_item_id = self.content_item_id @@ -78,6 +83,7 @@ def to_dict(self) -> Dict[str, Any]: "previewUrl": preview_url, "mediaSourceRef": media_source_ref, "date": date, + "access": access, } ) if caption is not UNSET: @@ -95,6 +101,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.content_item_access_rights import ContentItemAccessRights from ..models.image_image_types import ImageImageTypes from ..models.image_media_source_ref import ImageMediaSourceRef @@ -109,6 +116,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: date = isoparse(d.pop("date")).date() + access = ContentItemAccessRights.from_dict(d.pop("access")) + caption = d.pop("caption", UNSET) content_item_id = d.pop("contentItemId", UNSET) @@ -130,6 +139,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: preview_url=preview_url, media_source_ref=media_source_ref, date=date, + access=access, caption=caption, content_item_id=content_item_id, page_numbers=page_numbers, diff --git a/impresso/api_models.py b/impresso/api_models.py index 3ffae28..584ac0e 100644 --- a/impresso/api_models.py +++ b/impresso/api_models.py @@ -163,51 +163,6 @@ class MediaSourceRef(BaseModel): ] -class Image(BaseModel): - model_config = ConfigDict( - extra='forbid', - ) - id: Annotated[str, Field(description='The unique identifier of the image')] - caption: Annotated[Optional[str], Field(None, description='Image caption')] - issueId: Annotated[ - str, - Field( - description='The unique identifier of the issue that the image belongs to.' - ), - ] - contentItemId: Annotated[ - Optional[str], - Field( - None, - description='The unique identifier of the content item that the image belongs to.', - ), - ] - previewUrl: Annotated[AnyUrl, Field(description='The URL of the image preview')] - pageNumbers: Annotated[ - Optional[Sequence[int]], - Field( - None, description='The page numbers of the issue that the image belongs to.' - ), - ] - imageTypes: Optional[ImageTypes] = None - mediaSourceRef: Annotated[ - MediaSourceRef, Field(description='The media source of the image') - ] - date: Annotated[ - date, - Field( - description='The date of the image or the date of the issue that the image belongs to.' - ), - ] - embeddings: Annotated[ - Optional[Sequence[str]], - Field( - None, - description='Precomputed embeddings for the image in the format: :.', - ), - ] - - class Offset(BaseModel): model_config = ConfigDict( extra='forbid', @@ -1420,6 +1375,52 @@ class EntityDetails(BaseModel): wikidataDetails: Optional[Union[WikidataPerson, WikidataLocation]] = None +class Image(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + id: Annotated[str, Field(description='The unique identifier of the image')] + caption: Annotated[Optional[str], Field(None, description='Image caption')] + issueId: Annotated[ + str, + Field( + description='The unique identifier of the issue that the image belongs to.' + ), + ] + contentItemId: Annotated[ + Optional[str], + Field( + None, + description='The unique identifier of the content item that the image belongs to.', + ), + ] + previewUrl: Annotated[AnyUrl, Field(description='The URL of the image preview')] + pageNumbers: Annotated[ + Optional[Sequence[int]], + Field( + None, description='The page numbers of the issue that the image belongs to.' + ), + ] + imageTypes: Optional[ImageTypes] = None + mediaSourceRef: Annotated[ + MediaSourceRef, Field(description='The media source of the image') + ] + date: Annotated[ + date, + Field( + description='The date of the image or the date of the issue that the image belongs to.' + ), + ] + embeddings: Annotated[ + Optional[Sequence[str]], + Field( + None, + description='Precomputed embeddings for the image in the format: :.', + ), + ] + access: ContentItemAccessRights + + class Topic(BaseModel): model_config = ConfigDict( extra='forbid', @@ -1547,29 +1548,19 @@ class ContentItemText(BaseModel): ] itemType: Annotated[ Optional[ - Literal[ - 'ar', - 'article', - 'ad', - 'advertisement', - 'page', - 'tb', - 'ob', - 'w', - 'ch', - 'chapter', - 'death_notice', - 'chronicle', - 'unsegmented', - 'radio_broadcast_episode', - 'radio_bulletin', - 'rbe', - 'rb', - 'dsc', - 'discussion', - 'ent', - 'entertainment', - 'no-type', + Union[ + Literal['ar'], + Literal['ad'], + Literal['img'], + Literal['tb'], + Literal['ob'], + Literal['w'], + Literal['ch'], + Literal['rb'], + Literal['rbe'], + Literal['no-type'], + Literal['dsc'], + Literal['ent'], ] ], Field(None, description='Type of content item, e.g., article, section.'), diff --git a/pyproject.toml b/pyproject.toml index 51bfa7b..1baa9ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ name = "impresso" packages = [{ include = "impresso", from = "." }] readme = "README.md" repository = "https://github.com/impresso/impresso-py" -version = "0.9.20" +version = "0.9.21" [tool.poetry.urls] Endpoint = "https://impresso-project.ch/public-api/v1"