Skip to content

Commit

Permalink
Some new features in 7.11/7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Jan 18, 2024
1 parent 60d7ceb commit 556e729
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/npoapi/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
LinkType,
LinkTypeEnum,
Page as PagePage,
PageIdMatch,
PageType,
PageTypeEnum,
PageWorkflow,
Expand All @@ -328,6 +329,9 @@
ParagraphUpdateType,
PortalUpdateType,
RelationUpdateType as PageupdateRelationUpdateType,
SaveResult,
SaveResultList,
SaveResults,
)
from npoapi.data.profile import (
Profile,
Expand Down Expand Up @@ -675,6 +679,7 @@
"LinkType",
"LinkTypeEnum",
"PagePage",
"PageIdMatch",
"PageType",
"PageTypeEnum",
"PageWorkflow",
Expand All @@ -693,6 +698,9 @@
"ParagraphUpdateType",
"PortalUpdateType",
"PageupdateRelationUpdateType",
"SaveResult",
"SaveResultList",
"SaveResults",
"Profile",
"ProfileDefinitionType",
"ProfileType",
Expand Down
76 changes: 73 additions & 3 deletions src/npoapi/data/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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"

Expand Down
7 changes: 7 additions & 0 deletions src/npoapi/data/mediaupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down
6 changes: 6 additions & 0 deletions src/npoapi/data/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
114 changes: 113 additions & 1 deletion src/npoapi/data/pageupdate.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -209,13 +293,41 @@ 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:
name = "image"
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:
Expand Down

0 comments on commit 556e729

Please sign in to comment.