Skip to content

Commit

Permalink
[1.1.0] Add file share v2022_11_02 (#59)
Browse files Browse the repository at this point in the history
* add file share v2022_11_02

* remove file share v2021_06_08

* upgrade version
  • Loading branch information
evelyn-ys authored Apr 13, 2023
1 parent 27bdc3a commit ce47473
Show file tree
Hide file tree
Showing 67 changed files with 3,539 additions and 3,673 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Handles multi-API versions of Azure Storage Data Plane originally from https://g

Change Log
----------
1.1.0
++++++
* fileshare: Support v2022-11-02(12.12.0b1) and remove v2021-06-08

1.0.0
++++++
* storageV1:
Expand Down
1,517 changes: 0 additions & 1,517 deletions azure/multiapi/storagev2/fileshare/v2021_06_08/_generated/models/_models.py

This file was deleted.

542 changes: 0 additions & 542 deletions azure/multiapi/storagev2/fileshare/v2021_06_08/_shared/encryption.py

This file was deleted.

20 changes: 0 additions & 20 deletions azure/multiapi/storagev2/fileshare/v2021_06_08/_shared/parser.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import warnings

from ._version import VERSION
from ._file_client import ShareFileClient
Expand Down Expand Up @@ -35,10 +36,7 @@
ContentSettings,
NTFSAttributes)
from ._generated.models import (
HandleItem,
ShareAccessTier
)
from ._generated.models import (
ShareAccessTier,
ShareRootSquash
)

Expand Down Expand Up @@ -74,9 +72,26 @@
'ContentSettings',
'Handle',
'NTFSAttributes',
'HandleItem',
'ShareRootSquash',
'generate_account_sas',
'generate_share_sas',
'generate_file_sas'
]


def __getattr__(name):
"""
This function is added to deal with HandleItem which is a generated model that
was mistakenly added to the module exports. It has been removed import and __all__
to prevent it from showing in intellisense/docs but we handle it here to prevent
breaking any existing code which may have imported it.
"""
if name == 'HandleItem':
from ._generated.models import HandleItem
warnings.warn(
"HandleItem is deprecated and should not be used. Use Handle instead.",
DeprecationWarning
)
return HandleItem

raise AttributeError(f"module 'azure.storage.fileshare' has no attribute {name}")

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class StorageStreamDownloader(object): # pylint: disable=too-many-instance-attr
The properties of the file being downloaded. If only a range of the data is being
downloaded, this will be reflected in the properties.
:ivar int size:
The size of the total data in the stream. This will be the byte range if speficied,
The size of the total data in the stream. This will be the byte range if specified,
otherwise the total size of the file.
"""

Expand Down Expand Up @@ -311,7 +311,7 @@ def _initial_request(self):
# Parse the total file size and adjust the download size if ranges
# were specified
self._file_size = parse_length_from_content_range(response.properties.content_range)
if not self._file_size:
if self._file_size is None:
raise ValueError("Required Content-Range response header is missing or malformed.")

if self._end_range is not None:
Expand All @@ -323,7 +323,7 @@ def _initial_request(self):
self.size = self._file_size

except HttpResponseError as error:
if self._start_range is None and error.response.status_code == 416:
if self._start_range is None and error.response and error.response.status_code == 416:
# Get range will fail on an empty file. If the user did not
# request a range, do a regular get request in order to get
# any properties.
Expand Down Expand Up @@ -398,10 +398,12 @@ def readall(self):
return data

def content_as_bytes(self, max_concurrency=1):
"""Download the contents of this file.
"""DEPRECATED: Download the contents of this file.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:rtype: bytes
Expand All @@ -414,10 +416,12 @@ def content_as_bytes(self, max_concurrency=1):
return self.readall()

def content_as_text(self, max_concurrency=1, encoding="UTF-8"):
"""Download the contents of this file, and decode as text.
"""DEPRECATED: Download the contents of this file, and decode as text.
This operation is blocking until all data is downloaded.
This method is deprecated, use func:`readall` instead.
:keyword int max_concurrency:
The number of parallel connections with which to download.
:param str encoding:
Expand Down Expand Up @@ -495,7 +499,9 @@ def readinto(self, stream):
return self.size

def download_to_stream(self, stream, max_concurrency=1):
"""Download the contents of this file to a stream.
"""DEPRECATED: Download the contents of this file to a stream.
This method is deprecated, use func:`readinto` instead.
:param stream:
The stream to download to. This can be an open file-handle,
Expand Down
Loading

0 comments on commit ce47473

Please sign in to comment.