Skip to content

Commit 3328587

Browse files
committed
Create a type for StorageOwnership
1 parent 8fc0571 commit 3328587

4 files changed

Lines changed: 15 additions & 12 deletions

File tree

src/apify_client/_resource_clients/dataset_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Literal
3+
from typing import TYPE_CHECKING, Any
44

55
from apify_client._docs import docs_group
66
from apify_client._models import Dataset, DatasetResponse, ListOfDatasets, ListOfDatasetsResponse
77
from apify_client._resource_clients._resource_client import ResourceClient, ResourceClientAsync
88

99
if TYPE_CHECKING:
10-
from apify_client._types import Timeout
10+
from apify_client._types import StorageOwnership, Timeout
1111

1212

1313
@docs_group('Resource clients')
@@ -36,7 +36,7 @@ def list(
3636
limit: int | None = None,
3737
offset: int | None = None,
3838
desc: bool | None = None,
39-
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = None,
39+
ownership: StorageOwnership | None = None,
4040
timeout: Timeout = 'medium',
4141
) -> ListOfDatasets:
4242
"""List the available datasets.
@@ -109,7 +109,7 @@ async def list(
109109
limit: int | None = None,
110110
offset: int | None = None,
111111
desc: bool | None = None,
112-
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = None,
112+
ownership: StorageOwnership | None = None,
113113
timeout: Timeout = 'medium',
114114
) -> ListOfDatasets:
115115
"""List the available datasets.

src/apify_client/_resource_clients/key_value_store_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Literal
3+
from typing import TYPE_CHECKING, Any
44

55
from apify_client._docs import docs_group
66
from apify_client._models import (
@@ -12,7 +12,7 @@
1212
from apify_client._resource_clients._resource_client import ResourceClient, ResourceClientAsync
1313

1414
if TYPE_CHECKING:
15-
from apify_client._types import Timeout
15+
from apify_client._types import StorageOwnership, Timeout
1616

1717

1818
@docs_group('Resource clients')
@@ -41,7 +41,7 @@ def list(
4141
limit: int | None = None,
4242
offset: int | None = None,
4343
desc: bool | None = None,
44-
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = None,
44+
ownership: StorageOwnership | None = None,
4545
timeout: Timeout = 'medium',
4646
) -> ListOfKeyValueStores:
4747
"""List the available key-value stores.
@@ -114,7 +114,7 @@ async def list(
114114
limit: int | None = None,
115115
offset: int | None = None,
116116
desc: bool | None = None,
117-
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = None,
117+
ownership: StorageOwnership | None = None,
118118
timeout: Timeout = 'medium',
119119
) -> ListOfKeyValueStores:
120120
"""List the available key-value stores.

src/apify_client/_resource_clients/request_queue_collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Literal
3+
from typing import TYPE_CHECKING, Any
44

55
from apify_client._docs import docs_group
66
from apify_client._models import (
@@ -12,7 +12,7 @@
1212
from apify_client._resource_clients._resource_client import ResourceClient, ResourceClientAsync
1313

1414
if TYPE_CHECKING:
15-
from apify_client._types import Timeout
15+
from apify_client._types import StorageOwnership, Timeout
1616

1717

1818
@docs_group('Resource clients')
@@ -41,7 +41,7 @@ def list(
4141
limit: int | None = None,
4242
offset: int | None = None,
4343
desc: bool | None = None,
44-
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = None,
44+
ownership: StorageOwnership | None = None,
4545
timeout: Timeout = 'medium',
4646
) -> ListOfRequestQueues:
4747
"""List the available request queues.
@@ -112,7 +112,7 @@ async def list(
112112
limit: int | None = None,
113113
offset: int | None = None,
114114
desc: bool | None = None,
115-
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = None,
115+
ownership: StorageOwnership | None = None,
116116
timeout: Timeout = 'medium',
117117
) -> ListOfRequestQueues:
118118
"""List the available request queues.

src/apify_client/_types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
from apify_client._models import ActorJobStatus, WebhookCreate # noqa: TC001
1111

12+
StorageOwnership = Literal['ownedByMe', 'sharedWithMe']
13+
"""Filter for storage listing methods to return only storages owned by the user or shared with the user."""
14+
1215
Timeout = timedelta | Literal['no_timeout', 'short', 'medium', 'long']
1316
"""Type for the `timeout` parameter on resource client methods.
1417

0 commit comments

Comments
 (0)