Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
Any, Dict, Optional, Union,
TYPE_CHECKING
)
from typing_extensions import Self

from azure.core.paging import ItemPaged
from azure.core.tracing.decorator import distributed_trace
from azure.storage.blob import BlobServiceClient # pylint: disable=no-name-in-module
from azure.storage.blob._blob_service_client import BlobServiceClient
from azure.storage.blob._shared.base_client import parse_connection_str
from ._models import ChangeFeedPaged

if TYPE_CHECKING:
from azure.core.credentials import AzureNamedKeyCredential, AzureSasCredential, TokenCredential


class ChangeFeedClient(object):
class ChangeFeedClient:
"""A client to interact with a specific account change feed.

:param str account_url:
Expand Down Expand Up @@ -60,18 +61,18 @@ class ChangeFeedClient(object):
:caption: Creating the ChangeFeedClient from a URL to a public blob (no auth needed).
"""
def __init__(
self, account_url: str,
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
**kwargs: Any
) -> None:
self, account_url: str,
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
**kwargs: Any
) -> None:
self._blob_service_client = BlobServiceClient(account_url, credential, **kwargs)

@classmethod
def from_connection_string(
cls, conn_str: str,
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
**kwargs: Any
) -> "ChangeFeedClient":
cls, conn_str: str,
credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long
**kwargs: Any
) -> Self:
"""Create ChangeFeedClient from a Connection String.

:param str conn_str:
Expand Down Expand Up @@ -99,7 +100,7 @@ def from_connection_string(
return cls(account_url, credential=credential, **kwargs)

@distributed_trace
def list_changes(self, **kwargs: Any) -> ItemPaged[Dict]:
def list_changes(self, **kwargs: Any) -> ItemPaged[Dict[str, Any]]:
"""Returns a generator to list the change feed events.
The generator will lazily follow the continuation tokens returned by
the service.
Expand Down Expand Up @@ -135,4 +136,5 @@ def list_changes(self, **kwargs: Any) -> ItemPaged[Dict]:
container_client,
results_per_page=results_per_page,
page_iterator_class=ChangeFeedPaged,
**kwargs)
**kwargs
)
Loading