Skip to content

Commit 4e51ac6

Browse files
[Storage] Fix metadata typehint in file-share (#35505)
1 parent 34795f5 commit 4e51ac6

File tree

8 files changed

+35
-22
lines changed

8 files changed

+35
-22
lines changed

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_directory_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,9 @@ def create_directory(self, **kwargs):
348348
This parameter was introduced in API version '2021-06-08'.
349349
350350
:paramtype file_change_time: str or ~datetime.datetime
351-
:keyword dict[str, str] metadata:
351+
:keyword metadata:
352352
Name-value pairs associated with the directory as metadata.
353+
:paramtype metadata: Optional[dict[str, str]]
353354
:keyword int timeout:
354355
Sets the server-side timeout for the operation in seconds. For more details see
355356
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -858,8 +859,9 @@ def create_subdirectory(
858859
859860
:param str directory_name:
860861
The name of the subdirectory.
861-
:keyword dict[str, str] metadata:
862+
:keyword metadata:
862863
Name-value pairs associated with the subdirectory as metadata.
864+
:paramtype metadata: Optional[dict[str, str]]
863865
:keyword int timeout:
864866
Sets the server-side timeout for the operation in seconds. For more details see
865867
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -932,8 +934,9 @@ def upload_file(
932934
:type data: Union[bytes, str, Iterable[AnyStr], IO[AnyStr]]
933935
:param int length:
934936
Length of the file in bytes. Specify its maximum size, up to 1 TiB.
935-
:keyword dict[str, str] metadata:
937+
:keyword metadata:
936938
Name-value pairs associated with the file as metadata.
939+
:paramtype metadata: Optional[dict[str, str]]
937940
:keyword ~azure.storage.fileshare.ContentSettings content_settings:
938941
ContentSettings object used to set file properties. Used to set content type, encoding,
939942
language, disposition, md5, and cache control.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,9 @@ def create_file( # type: ignore
435435
:keyword ~azure.storage.fileshare.ContentSettings content_settings:
436436
ContentSettings object used to set file properties. Used to set content type, encoding,
437437
language, disposition, md5, and cache control.
438-
:keyword dict[str, str] metadata:
438+
:keyword metadata:
439439
Name-value pairs associated with the file as metadata.
440+
:paramtype metadata: Optional[dict[str, str]]
440441
:keyword lease:
441442
Required if the file has an active lease. Value can be a ShareLeaseClient object
442443
or the lease ID as a string.
@@ -547,8 +548,9 @@ def upload_file(
547548
This parameter was introduced in API version '2021-06-08'.
548549
549550
:paramtype file_change_time: str or ~datetime.datetime
550-
:keyword dict[str, str] metadata:
551+
:keyword metadata:
551552
Name-value pairs associated with the file as metadata.
553+
:paramtype metadata: Optional[dict[str, str]]
552554
:keyword ~azure.storage.fileshare.ContentSettings content_settings:
553555
ContentSettings object used to set file properties. Used to set content type, encoding,
554556
language, disposition, md5, and cache control.
@@ -718,7 +720,7 @@ def start_copy_from_url(self, source_url, **kwargs):
718720
719721
:keyword metadata:
720722
Name-value pairs associated with the file as metadata.
721-
:paramtype metadata: dict[str, str]
723+
:paramtype metadata: Optional[dict[str, str]]
722724
:keyword lease:
723725
Required if the file has an active lease. Value can be a ShareLeaseClient object
724726
or the lease ID as a string.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def create_share(self, **kwargs):
351351
352352
:keyword metadata:
353353
Name-value pairs associated with the share as metadata.
354-
:paramtype metadata: dict[str, str]
354+
:paramtype metadata: Optional[dict[str, str]]
355355
:keyword int quota:
356356
The quota to be allotted.
357357
:keyword access_tier:
@@ -431,7 +431,7 @@ def create_snapshot( # type: ignore
431431
432432
:keyword metadata:
433433
Name-value pairs associated with the share as metadata.
434-
:paramtype metadata: dict[str, str]
434+
:paramtype metadata: Optional[dict[str, str]]
435435
:keyword int timeout:
436436
Sets the server-side timeout for the operation in seconds. For more details see
437437
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -682,7 +682,7 @@ def set_share_metadata(self, metadata, **kwargs):
682682
683683
:param metadata:
684684
Name-value pairs associated with the share as metadata.
685-
:type metadata: dict[str, Any]
685+
:type metadata: dict[str, str]
686686
:keyword int timeout:
687687
Sets the server-side timeout for the operation in seconds. For more details see
688688
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -982,7 +982,7 @@ def create_directory(self, directory_name, **kwargs):
982982
The name of the directory.
983983
:keyword metadata:
984984
Name-value pairs associated with the directory as metadata.
985-
:paramtype metadata: dict[str, str]
985+
:paramtype metadata: Optional[dict[str, str]]
986986
:keyword int timeout:
987987
Sets the server-side timeout for the operation in seconds. For more details see
988988
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_service_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,10 @@ def create_share(
344344
which to interact with the newly created share.
345345
346346
:param str share_name: The name of the share to create.
347-
:keyword dict[str, str] metadata:
347+
:keyword metadata:
348348
A dict with name_value pairs to associate with the
349349
share as metadata. Example:{'Category':'test'}
350+
:paramtype metadata: Optional[dict[str, str]]
350351
:keyword int quota:
351352
Quota in bytes.
352353
:keyword int timeout:

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_directory_client_async.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ async def create_directory(self, **kwargs):
221221
This parameter was introduced in API version '2021-06-08'.
222222
223223
:paramtype file_change_time: str or ~datetime.datetime
224-
:keyword dict[str, str] metadata:
224+
:keyword metadata:
225225
Name-value pairs associated with the directory as metadata.
226+
:paramtype metadata: Optional[dict[str, str]]
226227
:keyword int timeout:
227228
Sets the server-side timeout for the operation in seconds. For more details see
228229
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -731,8 +732,9 @@ async def create_subdirectory(
731732
732733
:param str directory_name:
733734
The name of the subdirectory.
734-
:keyword dict[str, str] metadata:
735+
:keyword metadata:
735736
Name-value pairs associated with the subdirectory as metadata.
737+
:paramtype metadata: Optional[dict[str, str]]
736738
:keyword int timeout:
737739
Sets the server-side timeout for the operation in seconds. For more details see
738740
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -805,8 +807,9 @@ async def upload_file(
805807
:type data: Union[bytes, str, Iterable[AnyStr], AsyncIterable[AnyStr], IO[AnyStr]]
806808
:param int length:
807809
Length of the file in bytes. Specify its maximum size, up to 1 TiB.
808-
:keyword dict[str, str] metadata:
810+
:keyword metadata:
809811
Name-value pairs associated with the file as metadata.
812+
:paramtype metadata: Optional[dict[str, str]]
810813
:keyword ~azure.storage.fileshare.ContentSettings content_settings:
811814
ContentSettings object used to set file properties. Used to set content type, encoding,
812815
language, disposition, md5, and cache control.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ async def create_file( # type: ignore
291291
:keyword ~azure.storage.fileshare.ContentSettings content_settings:
292292
ContentSettings object used to set file properties. Used to set content type, encoding,
293293
language, disposition, md5, and cache control.
294-
:keyword dict[str, str] metadata:
294+
:keyword metadata:
295295
Name-value pairs associated with the file as metadata.
296+
:paramtype metadata: Optional[dict[str, str]]
296297
:keyword lease:
297298
Required if the file has an active lease. Value can be a ShareLeaseClient object
298299
or the lease ID as a string.
@@ -404,8 +405,9 @@ async def upload_file(
404405
This parameter was introduced in API version '2021-06-08'.
405406
406407
:paramtype file_change_time: str or ~datetime.datetime
407-
:keyword dict[str, str] metadata:
408+
:keyword metadata:
408409
Name-value pairs associated with the file as metadata.
410+
:paramtype metadata: Optional[dict[str, str]]
409411
:keyword ~azure.storage.fileshare.ContentSettings content_settings:
410412
ContentSettings object used to set file properties. Used to set content type, encoding,
411413
language, disposition, md5, and cache control.
@@ -578,7 +580,7 @@ async def start_copy_from_url(self, source_url, **kwargs):
578580
579581
:keyword metadata:
580582
Name-value pairs associated with the file as metadata.
581-
:paramtype metadata: dict[str, str]
583+
:paramtype metadata: Optional[dict[str, str]]
582584
:keyword lease:
583585
Required if the file has an active lease. Value can be a ShareLeaseClient object
584586
or the lease ID as a string.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ async def create_share(self, **kwargs):
209209
210210
:keyword metadata:
211211
Name-value pairs associated with the share as metadata.
212-
:paramtype metadata: dict[str, str]
212+
:paramtype metadata: Optional[dict[str, str]]
213213
:keyword int quota:
214214
The quota to be allotted.
215215
:keyword access_tier:
@@ -289,7 +289,7 @@ async def create_snapshot( # type: ignore
289289
290290
:keyword metadata:
291291
Name-value pairs associated with the share as metadata.
292-
:paramtype metadata: dict[str, str]
292+
:paramtype metadata: Optional[dict[str, str]]
293293
:keyword int timeout:
294294
Sets the server-side timeout for the operation in seconds. For more details see
295295
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -539,7 +539,7 @@ async def set_share_metadata(self, metadata, **kwargs):
539539
540540
:param metadata:
541541
Name-value pairs associated with the share as metadata.
542-
:type metadata: dict[str, Any]
542+
:type metadata: dict[str, str]
543543
:keyword int timeout:
544544
Sets the server-side timeout for the operation in seconds. For more details see
545545
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
@@ -826,8 +826,9 @@ async def create_directory(self, directory_name, **kwargs):
826826
827827
:param str directory_name:
828828
The name of the directory.
829-
:keyword dict[str, str] metadata:
829+
:keyword metadata:
830830
Name-value pairs associated with the directory as metadata.
831+
:paramtype metadata: Optional[dict[str, str]]
831832
:keyword int timeout:
832833
Sets the server-side timeout for the operation in seconds. For more details see
833834
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.

sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_service_client_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,10 @@ async def create_share(
283283
which to interact with the newly created share.
284284
285285
:param str share_name: The name of the share to create.
286-
:keyword dict[str, str] metadata:
286+
:keyword metadata:
287287
A dict with name_value pairs to associate with the
288288
share as metadata. Example:{'Category':'test'}
289+
:paramtype metadata: Optional[dict[str, str]]
289290
:keyword int quota:
290291
Quota in bytes.
291292
:keyword int timeout:

0 commit comments

Comments
 (0)