From 556e7292a2a98d5ac7830407dee2fb26aa1bfee8 Mon Sep 17 00:00:00 2001 From: Michiel Meeuwissen Date: Thu, 18 Jan 2024 13:50:53 +0100 Subject: [PATCH] Some new features in 7.11/7.10 --- src/npoapi/data/__init__.py | 8 +++ src/npoapi/data/api.py | 76 +++++++++++++++++++++- src/npoapi/data/mediaupdate.py | 7 ++ src/npoapi/data/page.py | 6 ++ src/npoapi/data/pageupdate.py | 114 ++++++++++++++++++++++++++++++++- 5 files changed, 207 insertions(+), 4 deletions(-) diff --git a/src/npoapi/data/__init__.py b/src/npoapi/data/__init__.py index 61e8a4e..2f8748d 100644 --- a/src/npoapi/data/__init__.py +++ b/src/npoapi/data/__init__.py @@ -308,6 +308,7 @@ LinkType, LinkTypeEnum, Page as PagePage, + PageIdMatch, PageType, PageTypeEnum, PageWorkflow, @@ -328,6 +329,9 @@ ParagraphUpdateType, PortalUpdateType, RelationUpdateType as PageupdateRelationUpdateType, + SaveResult, + SaveResultList, + SaveResults, ) from npoapi.data.profile import ( Profile, @@ -675,6 +679,7 @@ "LinkType", "LinkTypeEnum", "PagePage", + "PageIdMatch", "PageType", "PageTypeEnum", "PageWorkflow", @@ -693,6 +698,9 @@ "ParagraphUpdateType", "PortalUpdateType", "PageupdateRelationUpdateType", + "SaveResult", + "SaveResultList", + "SaveResults", "Profile", "ProfileDefinitionType", "ProfileType", diff --git a/src/npoapi/data/api.py b/src/npoapi/data/api.py index 9090681..16ecd1d 100644 --- a/src/npoapi/data/api.py +++ b/src/npoapi/data/api.py @@ -468,6 +468,14 @@ class Meta: @dataclass(slots=True) class ExtendedMatcherType: + """ + :ivar value: + :ivar fuzziness: + :ivar matchType: + :ivar caseSensitive: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "extendedMatcherType" @@ -756,7 +764,7 @@ class SimpleMatcherType: :ivar semantic: Whether the search must happen via the semantic vectorization. This is beta feature, which may not be enabled. :ivar matchType: - :ivar match: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. """ class Meta: @@ -883,6 +891,14 @@ class Meta: @dataclass(slots=True) class TitleSearchType: + """ + :ivar value: + :ivar owner: + :ivar typeValue: + :ivar matchType: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "titleSearchType" @@ -1435,6 +1451,14 @@ class Meta: @dataclass(slots=True) class MediaRelationSearchType: + """ + :ivar types: + :ivar broadcasters: + :ivar values: + :ivar uriRefs: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "mediaRelationSearchType" @@ -1483,6 +1507,12 @@ class Meta: @dataclass(slots=True) class MemberRefSearchType: + """ + :ivar mediaIds: + :ivar types: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "memberRefSearchType" @@ -1589,6 +1619,14 @@ class Meta: @dataclass(slots=True) class PageRelationSearchType: + """ + :ivar types: + :ivar broadcasters: + :ivar values: + :ivar uriRefs: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "pageRelationSearchType" @@ -1630,6 +1668,14 @@ class Meta: @dataclass(slots=True) class SubtitlesSearchType: + """ + :ivar text: + :ivar mids: + :ivar types: + :ivar languages: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "subtitlesSearchType" @@ -1678,6 +1724,11 @@ class Meta: @dataclass(slots=True) class TermSearchType: + """ + :ivar ids: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "termSearchType" @@ -1822,7 +1873,7 @@ class MediaSearchType: :ivar text: :ivar mediaIds: The MID must match one of the mediaIds :ivar types: The media type must match one of these. - :ivar avTypes: + :ivar avTypes: To filter on av type (AUDIO/VIDEO) :ivar sortDates: :ivar publishDates: :ivar creationDates: @@ -1841,7 +1892,7 @@ class MediaSearchType: :ivar contentRatings: :ivar titles: :ivar geoLocations: - :ivar match: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. """ class Meta: @@ -2021,6 +2072,25 @@ class Meta: @dataclass(slots=True) class PagesSearchType: + """ + :ivar text: + :ivar broadcasters: + :ivar types: + :ivar portals: + :ivar sections: + :ivar genres: + :ivar tags: + :ivar keywords: + :ivar sortDates: + :ivar lastModifiedDates: + :ivar creationDates: + :ivar publishDates: + :ivar relations: + :ivar links: + :ivar referrals: + :ivar match: The match type. If not specified, the default is MUST. But it can also be SHOULD or NOT. + """ + class Meta: name = "pagesSearchType" diff --git a/src/npoapi/data/mediaupdate.py b/src/npoapi/data/mediaupdate.py index 8aaa081..dc3346e 100644 --- a/src/npoapi/data/mediaupdate.py +++ b/src/npoapi/data/mediaupdate.py @@ -395,6 +395,13 @@ class Meta: "namespace": "urn:vpro:media:update:2009", }, ) + version: Optional[str] = field( + default=None, + metadata={ + "type": "Element", + "namespace": "urn:vpro:media:update:2009", + }, + ) statusCode: Optional[int] = field( default=None, metadata={ diff --git a/src/npoapi/data/page.py b/src/npoapi/data/page.py index 02872d9..00bcdbe 100644 --- a/src/npoapi/data/page.py +++ b/src/npoapi/data/page.py @@ -46,6 +46,12 @@ class LinkTypeEnum(Enum): TOP_STORY = "TOP_STORY" +class PageIdMatch(Enum): + URL = "URL" + CRID = "CRID" + BOTH = "BOTH" + + class PageTypeEnum(Enum): ARTICLE = "ARTICLE" SPECIAL = "SPECIAL" diff --git a/src/npoapi/data/pageupdate.py b/src/npoapi/data/pageupdate.py index eafd4ef..e737e6f 100644 --- a/src/npoapi/data/pageupdate.py +++ b/src/npoapi/data/pageupdate.py @@ -1,8 +1,9 @@ from dataclasses import dataclass, field from typing import List, Optional -from xsdata.models.datatype import XmlDateTime +from xsdata.models.datatype import XmlDateTime, XmlDuration from npoapi.data.page import ( LinkTypeEnum, + PageIdMatch, PageTypeEnum, PageWorkflow, SectionType, @@ -90,6 +91,89 @@ class Meta: ) +@dataclass(slots=True) +class SaveResult: + class Meta: + name = "saveResult" + namespace = "urn:vpro:pages:update:2013" + + replaces: List[str] = field( + default_factory=list, + metadata={ + "type": "Element", + }, + ) + message: Optional[str] = field( + default=None, + metadata={ + "type": "Element", + }, + ) + success: Optional[bool] = field( + default=None, + metadata={ + "type": "Attribute", + "required": True, + }, + ) + creationDate: Optional[str] = field( + default=None, + metadata={ + "type": "Attribute", + }, + ) + + +@dataclass(slots=True) +class DeleteResult1: + class Meta: + name = "deleteResult" + + value: str = field( + default="", + metadata={ + "required": True, + }, + ) + count: Optional[int] = field( + default=None, + metadata={ + "type": "Attribute", + }, + ) + notallowedCount: Optional[int] = field( + default=None, + metadata={ + "type": "Attribute", + }, + ) + alreadyDeletedCount: Optional[int] = field( + default=None, + metadata={ + "type": "Attribute", + }, + ) + success: Optional[bool] = field( + default=None, + metadata={ + "type": "Attribute", + "required": True, + }, + ) + duration: Optional[XmlDuration] = field( + default=None, + metadata={ + "type": "Attribute", + }, + ) + match: Optional[PageIdMatch] = field( + default=None, + metadata={ + "type": "Attribute", + }, + ) + + @dataclass(slots=True) class ImageUpdateType: class Meta: @@ -209,6 +293,27 @@ class Meta: ) +@dataclass(slots=True) +class SaveResultList: + class Meta: + name = "saveResultList" + + saveResult: List[SaveResult] = field( + default_factory=list, + metadata={ + "type": "Element", + "namespace": "urn:vpro:pages:update:2013", + }, + ) + + +@dataclass(slots=True) +class Deleteresult(DeleteResult1): + class Meta: + name = "deleteresult" + namespace = "urn:vpro:pages:update:2013" + + @dataclass(slots=True) class Image(ImageUpdateType): class Meta: @@ -216,6 +321,13 @@ class Meta: namespace = "urn:vpro:pages:update:2013" +@dataclass(slots=True) +class SaveResults(SaveResultList): + class Meta: + name = "saveResults" + namespace = "urn:vpro:pages:update:2013" + + @dataclass(slots=True) class ParagraphUpdateType: class Meta: