|
9 | 9 | Any, Dict, Optional, Union,
|
10 | 10 | TYPE_CHECKING
|
11 | 11 | )
|
| 12 | +from typing_extensions import Self |
12 | 13 |
|
13 | 14 | from azure.core.paging import ItemPaged
|
14 | 15 | from azure.core.tracing.decorator import distributed_trace
|
15 |
| -from azure.storage.blob import BlobServiceClient # pylint: disable=no-name-in-module |
| 16 | +from azure.storage.blob._blob_service_client import BlobServiceClient |
16 | 17 | from azure.storage.blob._shared.base_client import parse_connection_str
|
17 | 18 | from ._models import ChangeFeedPaged
|
18 | 19 |
|
19 | 20 | if TYPE_CHECKING:
|
20 | 21 | from azure.core.credentials import AzureNamedKeyCredential, AzureSasCredential, TokenCredential
|
21 | 22 |
|
22 | 23 |
|
23 |
| -class ChangeFeedClient(object): |
| 24 | +class ChangeFeedClient: |
24 | 25 | """A client to interact with a specific account change feed.
|
25 | 26 |
|
26 | 27 | :param str account_url:
|
@@ -60,18 +61,18 @@ class ChangeFeedClient(object):
|
60 | 61 | :caption: Creating the ChangeFeedClient from a URL to a public blob (no auth needed).
|
61 | 62 | """
|
62 | 63 | def __init__(
|
63 |
| - self, account_url: str, |
64 |
| - credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long |
65 |
| - **kwargs: Any |
66 |
| - ) -> None: |
| 64 | + self, account_url: str, |
| 65 | + credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long |
| 66 | + **kwargs: Any |
| 67 | + ) -> None: |
67 | 68 | self._blob_service_client = BlobServiceClient(account_url, credential, **kwargs)
|
68 | 69 |
|
69 | 70 | @classmethod
|
70 | 71 | def from_connection_string(
|
71 |
| - cls, conn_str: str, |
72 |
| - credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long |
73 |
| - **kwargs: Any |
74 |
| - ) -> "ChangeFeedClient": |
| 72 | + cls, conn_str: str, |
| 73 | + credential: Optional[Union[str, Dict[str, str], "AzureNamedKeyCredential", "AzureSasCredential", "TokenCredential"]] = None, # pylint: disable=line-too-long |
| 74 | + **kwargs: Any |
| 75 | + ) -> Self: |
75 | 76 | """Create ChangeFeedClient from a Connection String.
|
76 | 77 |
|
77 | 78 | :param str conn_str:
|
@@ -99,7 +100,7 @@ def from_connection_string(
|
99 | 100 | return cls(account_url, credential=credential, **kwargs)
|
100 | 101 |
|
101 | 102 | @distributed_trace
|
102 |
| - def list_changes(self, **kwargs: Any) -> ItemPaged[Dict]: |
| 103 | + def list_changes(self, **kwargs: Any) -> ItemPaged[Dict[str, Any]]: |
103 | 104 | """Returns a generator to list the change feed events.
|
104 | 105 | The generator will lazily follow the continuation tokens returned by
|
105 | 106 | the service.
|
@@ -135,4 +136,5 @@ def list_changes(self, **kwargs: Any) -> ItemPaged[Dict]:
|
135 | 136 | container_client,
|
136 | 137 | results_per_page=results_per_page,
|
137 | 138 | page_iterator_class=ChangeFeedPaged,
|
138 |
| - **kwargs) |
| 139 | + **kwargs |
| 140 | + ) |
0 commit comments