diff --git a/notion_client/api_endpoints.py b/notion_client/api_endpoints.py index b01c2006..f39b93d0 100644 --- a/notion_client/api_endpoints.py +++ b/notion_client/api_endpoints.py @@ -170,7 +170,26 @@ def update(self, database_id: str, **kwargs: Any) -> SyncAsync[Any]: ) +class PagesPropertiesEndpoint(Endpoint): + def retrieve(self, page_id: str, property_id: str, **kwargs: Any) -> SyncAsync[Any]: + """Retrieve a `property_item` object for a given `page_id` and `property_id`. + + Depending on the property type, the object returned will either be a value or a + paginated list of property item values. + """ + return self.parent.request( + path=f"pages/{page_id}/properties/{property_id}", + method="GET", + auth=kwargs.get("auth"), + query=pick(kwargs, "start_cursor", "page_size"), + ) + + class PagesEndpoint(Endpoint): + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.properties = PagesPropertiesEndpoint(*args, **kwargs) + def create(self, **kwargs: Any) -> SyncAsync[Any]: """Create a new page in the specified database or as a child of an existing page.