Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -14,6 +14,7 @@
from ._generated.models import Metrics as GeneratedMetrics
from ._generated.models import RetentionPolicy as GeneratedRetentionPolicy
from ._generated.models import CorsRule as GeneratedCorsRule
from ._generated.models import ProtocolSettings as GeneratedProtocolSettings
from ._generated.models import AccessPolicy as GenAccessPolicy
from ._generated.models import DirectoryItem

Expand Down Expand Up @@ -134,6 +135,16 @@ def _from_generated(cls, generated):
)


class ProtocolProperties(GeneratedProtocolSettings):
def __init__(self, smb_settings=None):
self.smb_settings = smb_settings

@classmethod
def _from_generated(cls, generated):
return cls(
smb_settings=generated.smb_settings)


class AccessPolicy(GenAccessPolicy):
"""Access Policy class used by the set and get acl methods in each service.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ShareProperties,
Metrics,
CorsRule,
ProtocolProperties
)


Expand Down Expand Up @@ -169,6 +170,7 @@ def set_service_properties(
self, hour_metrics=None, # type: Optional[Metrics]
minute_metrics=None, # type: Optional[Metrics]
cors=None, # type: Optional[List[CorsRule]]
protocol_settings=None, # type: Optional[ProtocolProperties],
**kwargs
):
# type: (...) -> None
Expand All @@ -189,6 +191,9 @@ def set_service_properties(
list. If an empty list is specified, all CORS rules will be deleted,
and CORS will be disabled for the service.
:type cors: list(:class:`~azure.storage.fileshare.CorsRule`)
:param protocol_settings:
Sets protocol settings
:type protocol_settings: ~azure.storage.fileshare.ProtocolProperties
:keyword int timeout:
The timeout parameter is expressed in seconds.
:rtype: None
Expand All @@ -206,7 +211,8 @@ def set_service_properties(
props = StorageServiceProperties(
hour_metrics=hour_metrics,
minute_metrics=minute_metrics,
cors=cors
cors=cors,
protocol_settings=protocol_settings
)
try:
self._client.service.set_properties(props, timeout=timeout, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
ShareProperties,
Metrics,
CorsRule,
ProtocolProperties,
)


Expand Down Expand Up @@ -124,6 +125,7 @@ async def set_service_properties(
self, hour_metrics=None, # type: Optional[Metrics]
minute_metrics=None, # type: Optional[Metrics]
cors=None, # type: Optional[List[CorsRule]]
protocol_settings=None, # type: Optional[ProtocolProperties],
**kwargs
):
# type: (...) -> None
Expand All @@ -144,6 +146,9 @@ async def set_service_properties(
list. If an empty list is specified, all CORS rules will be deleted,
and CORS will be disabled for the service.
:type cors: list(:class:`~azure.storage.fileshare.CorsRule`)
:param protocol_settings:
Sets protocol settings
:type protocol_settings: ~azure.storage.fileshare.ProtocolProperties
:keyword int timeout:
The timeout parameter is expressed in seconds.
:rtype: None
Expand All @@ -161,7 +166,8 @@ async def set_service_properties(
props = StorageServiceProperties(
hour_metrics=hour_metrics,
minute_metrics=minute_metrics,
cors=cors
cors=cors,
protocol_settings=protocol_settings
)
try:
await self._client.service.set_properties(props, timeout=timeout, **kwargs)
Expand Down