Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions src/apify_client/_resource_clients/actor_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ class ActorCollectionClient(ResourceClient):
method on the `ApifyClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'acts')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'acts',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

def list(
self,
Expand Down Expand Up @@ -152,9 +159,16 @@ class ActorCollectionClientAsync(ResourceClientAsync):
method on the `ApifyClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'acts')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'acts',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

async def list(
self,
Expand Down
30 changes: 24 additions & 6 deletions src/apify_client/_resource_clients/actor_env_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ class ActorEnvVarClient(ResourceClient):
via an appropriate method on the `ActorVersionClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'env-vars')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_id: str,
resource_path: str = 'env-vars',
**kwargs: Any,
) -> None:
super().__init__(
resource_id=resource_id,
resource_path=resource_path,
**kwargs,
)

def get(self) -> EnvVar | None:
"""Return information about the Actor environment variable.
Expand Down Expand Up @@ -91,9 +100,18 @@ class ActorEnvVarClientAsync(ResourceClientAsync):
via an appropriate method on the `ActorVersionClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'env-vars')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_id: str,
resource_path: str = 'env-vars',
**kwargs: Any,
) -> None:
super().__init__(
resource_id=resource_id,
resource_path=resource_path,
**kwargs,
)

async def get(self) -> EnvVar | None:
"""Return information about the Actor environment variable.
Expand Down
26 changes: 20 additions & 6 deletions src/apify_client/_resource_clients/actor_env_var_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ class ActorEnvVarCollectionClient(ResourceClient):
appropriate method on the `ActorVersionClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'env-vars')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'env-vars',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

def list(self) -> ListOfEnvVars:
"""List the available Actor environment variables.
Expand Down Expand Up @@ -69,9 +76,16 @@ class ActorEnvVarCollectionClientAsync(ResourceClientAsync):
appropriate method on the `ActorVersionClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'env-vars')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'env-vars',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

async def list(self) -> ListOfEnvVars:
"""List the available Actor environment variables.
Expand Down
26 changes: 20 additions & 6 deletions src/apify_client/_resource_clients/actor_version_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ class ActorVersionCollectionClient(ResourceClient):
on the `ActorClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'versions')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'versions',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

def list(self) -> ListOfVersions:
"""List the available Actor versions.
Expand Down Expand Up @@ -99,9 +106,16 @@ class ActorVersionCollectionClientAsync(ResourceClientAsync):
on the `ActorClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'versions')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'versions',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

async def list(self) -> ListOfVersions:
"""List the available Actor versions.
Expand Down
26 changes: 20 additions & 6 deletions src/apify_client/_resource_clients/build_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ class BuildCollectionClient(ResourceClient):
`ApifyClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'actor-builds')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'actor-builds',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

def list(
self,
Expand Down Expand Up @@ -54,9 +61,16 @@ class BuildCollectionClientAsync(ResourceClientAsync):
`ApifyClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'actor-builds')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'actor-builds',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

async def list(
self,
Expand Down
30 changes: 24 additions & 6 deletions src/apify_client/_resource_clients/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,18 @@ class DatasetClient(ResourceClient):
via an appropriate method on the `ApifyClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'datasets')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_id: str | None = None,
resource_path: str = 'datasets',
**kwargs: Any,
) -> None:
super().__init__(
resource_id=resource_id,
resource_path=resource_path,
**kwargs,
)

def get(self) -> Dataset | None:
"""Retrieve the dataset.
Expand Down Expand Up @@ -687,9 +696,18 @@ class DatasetClientAsync(ResourceClientAsync):
via an appropriate method on the `ApifyClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'datasets')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_id: str | None = None,
resource_path: str = 'datasets',
**kwargs: Any,
) -> None:
super().__init__(
resource_id=resource_id,
resource_path=resource_path,
**kwargs,
)

async def get(self) -> Dataset | None:
"""Retrieve the dataset.
Expand Down
26 changes: 20 additions & 6 deletions src/apify_client/_resource_clients/dataset_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ class DatasetCollectionClient(ResourceClient):
appropriate method on the `ApifyClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'datasets')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'datasets',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

def list(
self,
Expand Down Expand Up @@ -68,9 +75,16 @@ class DatasetCollectionClientAsync(ResourceClientAsync):
appropriate method on the `ApifyClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'datasets')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'datasets',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

async def list(
self,
Expand Down
30 changes: 24 additions & 6 deletions src/apify_client/_resource_clients/key_value_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,18 @@ class KeyValueStoreClient(ResourceClient):
instance via an appropriate method on the `ApifyClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'key-value-stores')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_id: str | None = None,
resource_path: str = 'key-value-stores',
**kwargs: Any,
) -> None:
super().__init__(
resource_id=resource_id,
resource_path=resource_path,
**kwargs,
)

def get(self) -> KeyValueStore | None:
"""Retrieve the key-value store.
Expand Down Expand Up @@ -461,9 +470,18 @@ class KeyValueStoreClientAsync(ResourceClientAsync):
instance via an appropriate method on the `ApifyClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'key-value-stores')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_id: str | None = None,
resource_path: str = 'key-value-stores',
**kwargs: Any,
) -> None:
super().__init__(
resource_id=resource_id,
resource_path=resource_path,
**kwargs,
)

async def get(self) -> KeyValueStore | None:
"""Retrieve the key-value store.
Expand Down
26 changes: 20 additions & 6 deletions src/apify_client/_resource_clients/key_value_store_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ class KeyValueStoreCollectionClient(ResourceClient):
via an appropriate method on the `ApifyClient` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'key-value-stores')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'key-value-stores',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

def list(
self,
Expand Down Expand Up @@ -78,9 +85,16 @@ class KeyValueStoreCollectionClientAsync(ResourceClientAsync):
via an appropriate method on the `ApifyClientAsync` class.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
resource_path = kwargs.pop('resource_path', 'key-value-stores')
super().__init__(*args, resource_path=resource_path, **kwargs)
def __init__(
self,
*,
resource_path: str = 'key-value-stores',
**kwargs: Any,
) -> None:
super().__init__(
resource_path=resource_path,
**kwargs,
)

async def list(
self,
Expand Down
Loading