@@ -121,14 +121,17 @@ class BlobServiceClient(StorageAccountHostsMixin, StorageEncryptionMixin):
121
121
def __init__ (
122
122
self , account_url : str ,
123
123
credential : Optional [Union [str , Dict [str , str ], "AzureNamedKeyCredential" , "AzureSasCredential" , "TokenCredential" ]] = None , # pylint: disable=line-too-long
124
+ * ,
125
+ api_version : Optional [str ] = None ,
126
+ # TODO
124
127
** kwargs : Any
125
128
) -> None :
126
129
parsed_url , sas_token = _parse_url (account_url = account_url )
127
130
_ , sas_token = parse_query (parsed_url .query )
128
131
self ._query_str , credential = self ._format_query_string (sas_token , credential )
129
132
super (BlobServiceClient , self ).__init__ (parsed_url , service = 'blob' , credential = credential , ** kwargs )
130
133
self ._client = AzureBlobStorage (self .url , base_url = self .url , pipeline = self ._pipeline )
131
- self ._client ._config .version = get_api_version (kwargs ) # type: ignore [assignment]
134
+ self ._client ._config .version = get_api_version (api_version ) # type: ignore [assignment]
132
135
self ._configure_encryption (kwargs )
133
136
134
137
def _format_url (self , hostname ):
@@ -240,7 +243,7 @@ def get_account_information(self, **kwargs: Any) -> Dict[str, str]:
240
243
:caption: Getting account information for the blob service.
241
244
"""
242
245
try :
243
- return self ._client .service .get_account_info (cls = return_response_headers , ** kwargs ) # type: ignore
246
+ return self ._client .service .get_account_info (cls = return_response_headers , ** kwargs ) # type: ignore
244
247
except HttpResponseError as error :
245
248
process_storage_error (error )
246
249
@@ -284,7 +287,7 @@ def get_service_stats(self, **kwargs: Any) -> Dict[str, Any]:
284
287
"""
285
288
timeout = kwargs .pop ('timeout' , None )
286
289
try :
287
- stats = self ._client .service .get_statistics ( # type: ignore
290
+ stats = self ._client .service .get_statistics ( # type: ignore
288
291
timeout = timeout , use_location = LocationMode .SECONDARY , ** kwargs )
289
292
return service_stats_deserialize (stats )
290
293
except HttpResponseError as error :
@@ -391,7 +394,7 @@ def set_service_properties(
391
394
logging = analytics_logging ,
392
395
hour_metrics = hour_metrics ,
393
396
minute_metrics = minute_metrics ,
394
- cors = CorsRule ._to_generated (cors ), # pylint: disable=protected-access
397
+ cors = CorsRule ._to_generated (cors ), # pylint: disable=protected-access
395
398
default_service_version = target_version ,
396
399
delete_retention_policy = delete_retention_policy ,
397
400
static_website = static_website
@@ -648,7 +651,7 @@ def _rename_container(self, name: str, new_name: str, **kwargs: Any) -> Containe
648
651
except AttributeError :
649
652
kwargs ['source_lease_id' ] = lease
650
653
try :
651
- renamed_container ._client .container .rename (name , ** kwargs ) # pylint: disable = protected-access
654
+ renamed_container ._client .container .rename (name , ** kwargs ) # pylint: disable= protected-access
652
655
return renamed_container
653
656
except HttpResponseError as error :
654
657
process_storage_error (error )
@@ -685,7 +688,7 @@ def undelete_container(
685
688
warnings .warn ("`new_name` is no longer supported." , DeprecationWarning )
686
689
container = self .get_container_client (new_name or deleted_container_name )
687
690
try :
688
- container ._client .container .restore (deleted_container_name = deleted_container_name , # pylint: disable = protected-access
691
+ container ._client .container .restore (deleted_container_name = deleted_container_name , # pylint: disable= protected-access
689
692
deleted_container_version = deleted_container_version ,
690
693
timeout = kwargs .pop ('timeout' , None ), ** kwargs )
691
694
return container
@@ -718,8 +721,8 @@ def get_container_client(self, container: Union[ContainerProperties, str]) -> Co
718
721
else :
719
722
container_name = container
720
723
_pipeline = Pipeline (
721
- transport = TransportWrapper (self ._pipeline ._transport ), # pylint: disable = protected-access
722
- policies = self ._pipeline ._impl_policies # pylint: disable = protected-access
724
+ transport = TransportWrapper (self ._pipeline ._transport ), # pylint: disable= protected-access
725
+ policies = self ._pipeline ._impl_policies # pylint: disable= protected-access
723
726
)
724
727
return ContainerClient (
725
728
self .url , container_name = container_name ,
@@ -776,8 +779,8 @@ def get_blob_client(
776
779
else :
777
780
container_name = container
778
781
_pipeline = Pipeline (
779
- transport = TransportWrapper (self ._pipeline ._transport ), # pylint: disable = protected-access
780
- policies = self ._pipeline ._impl_policies # pylint: disable = protected-access
782
+ transport = TransportWrapper (self ._pipeline ._transport ), # pylint: disable= protected-access
783
+ policies = self ._pipeline ._impl_policies # pylint: disable= protected-access
781
784
)
782
785
return BlobClient (
783
786
self .url , container_name = container_name , blob_name = blob_name , snapshot = snapshot ,
0 commit comments