diff --git a/scaleway-async/scaleway_async/search/v1alpha1/__init__.py b/scaleway-async/scaleway_async/search/v1alpha1/__init__.py index 8f075978d..9c5f058f8 100644 --- a/scaleway-async/scaleway_async/search/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/search/v1alpha1/__init__.py @@ -4,6 +4,7 @@ from .types import ObsDatasourceInfoDataType from .types import ObsExporterInfoDestinationType from .types import ResourceType +from .types import SearchResourcesRequestOrderBy from .types import BrmServerInfo from .types import ObsDatasourceInfo from .types import ObsExporterInfo @@ -21,6 +22,7 @@ "ObsDatasourceInfoDataType", "ObsExporterInfoDestinationType", "ResourceType", + "SearchResourcesRequestOrderBy", "BrmServerInfo", "ObsDatasourceInfo", "ObsExporterInfo", diff --git a/scaleway-async/scaleway_async/search/v1alpha1/api.py b/scaleway-async/scaleway_async/search/v1alpha1/api.py index 4a8d6d4e1..d4eab0f65 100644 --- a/scaleway-async/scaleway_async/search/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/search/v1alpha1/api.py @@ -8,6 +8,7 @@ from .types import ( Locality, ResourceType, + SearchResourcesRequestOrderBy, SearchResourcesResponse, ) from .marshalling import ( @@ -30,6 +31,9 @@ async def search_resources( created_before: Optional[datetime] = None, modified_after: Optional[datetime] = None, modified_before: Optional[datetime] = None, + page_token: Optional[str] = None, + page_size: Optional[int] = None, + order_by: Optional[SearchResourcesRequestOrderBy] = None, ) -> SearchResourcesResponse: """ Search API. @@ -42,6 +46,9 @@ async def search_resources( :param created_before: Filter resources created before this timestamp. :param modified_after: Filter resources modified after this timestamp. :param modified_before: Filter resources modified before this timestamp. + :param page_token: Leave empty or omit to fetch the first page. + :param page_size: Number of resources to retrieve per page. + :param order_by: Sort order in the response. :return: :class:`SearchResourcesResponse ` Usage: @@ -61,8 +68,11 @@ async def search_resources( "localities": localities, "modified_after": modified_after, "modified_before": modified_before, + "order_by": order_by, "organization_id": organization_id or self.client.default_organization_id, + "page_size": page_size or self.client.default_page_size, + "page_token": page_token, "project_ids": project_ids, "query": query, "types": types, diff --git a/scaleway-async/scaleway_async/search/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/search/v1alpha1/marshalling.py index 1c65ea2fb..7ed08f3ac 100644 --- a/scaleway-async/scaleway_async/search/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/search/v1alpha1/marshalling.py @@ -263,4 +263,10 @@ def unmarshal_SearchResourcesResponse(data: Any) -> SearchResourcesResponse: else: args["resources"] = [] + field = data.get("next_page_token", None) + if field is not None: + args["next_page_token"] = field + else: + args["next_page_token"] = None + return SearchResourcesResponse(**args) diff --git a/scaleway-async/scaleway_async/search/v1alpha1/types.py b/scaleway-async/scaleway_async/search/v1alpha1/types.py index c0eb0155e..e5454771e 100644 --- a/scaleway-async/scaleway_async/search/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/search/v1alpha1/types.py @@ -128,6 +128,20 @@ def __str__(self) -> str: return str(self.value) +class SearchResourcesRequestOrderBy(str, Enum, metaclass=StrEnumMeta): + CREATED_AT_ASC = "created_at_asc" + CREATED_AT_DESC = "created_at_desc" + MODIFIED_AT_ASC = "modified_at_asc" + MODIFIED_AT_DESC = "modified_at_desc" + NAME_ASC = "name_asc" + NAME_DESC = "name_desc" + TYPE_ASC = "type_asc" + TYPE_DESC = "type_desc" + + def __str__(self) -> str: + return str(self.value) + + @dataclass class BrmServerInfo: ip: str @@ -269,6 +283,23 @@ class SearchResourcesRequest: Filter resources modified before this timestamp. """ + page_token: Optional[str] = None + """ + Leave empty or omit to fetch the first page. + """ + + page_size: Optional[int] = 0 + """ + Number of resources to retrieve per page. + """ + + order_by: Optional[SearchResourcesRequestOrderBy] = ( + SearchResourcesRequestOrderBy.CREATED_AT_ASC + ) + """ + Sort order in the response. + """ + @dataclass class SearchResourcesResponse: @@ -276,3 +307,8 @@ class SearchResourcesResponse: """ Top resources found. """ + + next_page_token: str + """ + If this string is empty, it means there are no more pages available. + """ diff --git a/scaleway/scaleway/search/v1alpha1/__init__.py b/scaleway/scaleway/search/v1alpha1/__init__.py index 8f075978d..9c5f058f8 100644 --- a/scaleway/scaleway/search/v1alpha1/__init__.py +++ b/scaleway/scaleway/search/v1alpha1/__init__.py @@ -4,6 +4,7 @@ from .types import ObsDatasourceInfoDataType from .types import ObsExporterInfoDestinationType from .types import ResourceType +from .types import SearchResourcesRequestOrderBy from .types import BrmServerInfo from .types import ObsDatasourceInfo from .types import ObsExporterInfo @@ -21,6 +22,7 @@ "ObsDatasourceInfoDataType", "ObsExporterInfoDestinationType", "ResourceType", + "SearchResourcesRequestOrderBy", "BrmServerInfo", "ObsDatasourceInfo", "ObsExporterInfo", diff --git a/scaleway/scaleway/search/v1alpha1/api.py b/scaleway/scaleway/search/v1alpha1/api.py index 24c9cdb7b..c4cdd14c7 100644 --- a/scaleway/scaleway/search/v1alpha1/api.py +++ b/scaleway/scaleway/search/v1alpha1/api.py @@ -8,6 +8,7 @@ from .types import ( Locality, ResourceType, + SearchResourcesRequestOrderBy, SearchResourcesResponse, ) from .marshalling import ( @@ -30,6 +31,9 @@ def search_resources( created_before: Optional[datetime] = None, modified_after: Optional[datetime] = None, modified_before: Optional[datetime] = None, + page_token: Optional[str] = None, + page_size: Optional[int] = None, + order_by: Optional[SearchResourcesRequestOrderBy] = None, ) -> SearchResourcesResponse: """ Search API. @@ -42,6 +46,9 @@ def search_resources( :param created_before: Filter resources created before this timestamp. :param modified_after: Filter resources modified after this timestamp. :param modified_before: Filter resources modified before this timestamp. + :param page_token: Leave empty or omit to fetch the first page. + :param page_size: Number of resources to retrieve per page. + :param order_by: Sort order in the response. :return: :class:`SearchResourcesResponse ` Usage: @@ -61,8 +68,11 @@ def search_resources( "localities": localities, "modified_after": modified_after, "modified_before": modified_before, + "order_by": order_by, "organization_id": organization_id or self.client.default_organization_id, + "page_size": page_size or self.client.default_page_size, + "page_token": page_token, "project_ids": project_ids, "query": query, "types": types, diff --git a/scaleway/scaleway/search/v1alpha1/marshalling.py b/scaleway/scaleway/search/v1alpha1/marshalling.py index 1c65ea2fb..7ed08f3ac 100644 --- a/scaleway/scaleway/search/v1alpha1/marshalling.py +++ b/scaleway/scaleway/search/v1alpha1/marshalling.py @@ -263,4 +263,10 @@ def unmarshal_SearchResourcesResponse(data: Any) -> SearchResourcesResponse: else: args["resources"] = [] + field = data.get("next_page_token", None) + if field is not None: + args["next_page_token"] = field + else: + args["next_page_token"] = None + return SearchResourcesResponse(**args) diff --git a/scaleway/scaleway/search/v1alpha1/types.py b/scaleway/scaleway/search/v1alpha1/types.py index c0eb0155e..e5454771e 100644 --- a/scaleway/scaleway/search/v1alpha1/types.py +++ b/scaleway/scaleway/search/v1alpha1/types.py @@ -128,6 +128,20 @@ def __str__(self) -> str: return str(self.value) +class SearchResourcesRequestOrderBy(str, Enum, metaclass=StrEnumMeta): + CREATED_AT_ASC = "created_at_asc" + CREATED_AT_DESC = "created_at_desc" + MODIFIED_AT_ASC = "modified_at_asc" + MODIFIED_AT_DESC = "modified_at_desc" + NAME_ASC = "name_asc" + NAME_DESC = "name_desc" + TYPE_ASC = "type_asc" + TYPE_DESC = "type_desc" + + def __str__(self) -> str: + return str(self.value) + + @dataclass class BrmServerInfo: ip: str @@ -269,6 +283,23 @@ class SearchResourcesRequest: Filter resources modified before this timestamp. """ + page_token: Optional[str] = None + """ + Leave empty or omit to fetch the first page. + """ + + page_size: Optional[int] = 0 + """ + Number of resources to retrieve per page. + """ + + order_by: Optional[SearchResourcesRequestOrderBy] = ( + SearchResourcesRequestOrderBy.CREATED_AT_ASC + ) + """ + Sort order in the response. + """ + @dataclass class SearchResourcesResponse: @@ -276,3 +307,8 @@ class SearchResourcesResponse: """ Top resources found. """ + + next_page_token: str + """ + If this string is empty, it means there are no more pages available. + """