Skip to content
Merged
Prev Previous commit
Next Next commit
Generated from ee55d36d740bf9dfd5dcf1b5c451c6258098febf
Merge branch 'newkindFileaad' of https://github.com/blueww/azure-rest-api-specs into newkindFileaad
  • Loading branch information
AutorestCI committed Sep 12, 2018
commit 5130427a0416f4c08843a703588912b916bb1a68
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,13 @@ def usages(self):
"""Instance depends on the API version:

* 2018-03-01-preview: :class:`UsagesOperations<azure.mgmt.storage.v2018_03_01_preview.operations.UsagesOperations>`
* 2018-07-01: :class:`UsagesOperations<azure.mgmt.storage.v2018_07_01.operations.UsagesOperations>`
"""
api_version = self._get_api_version('usages')
if api_version == '2018-03-01-preview':
from .v2018_03_01_preview.operations import UsagesOperations as OperationClass
elif api_version == '2018-07-01':
from .v2018_07_01.operations import UsagesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ class StorageAccount(TrackedResource):
:vartype access_tier: str or
~azure.mgmt.storage.v2018_07_01.models.AccessTier
:param enable_azure_files_aad_integration: Enables Azure Files AAD
Integration for SMB if sets to true. Default value: False .
Integration for SMB if sets to true.
:type enable_azure_files_aad_integration: bool
:param enable_https_traffic_only: Allows https traffic only to storage
service if sets to true. Default value: False .
service if sets to true.
:type enable_https_traffic_only: bool
:ivar network_rule_set: Network rule set
:vartype network_rule_set:
~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet
:param is_hns_enabled: Account HierarchicalNamespace enabled if sets to
true. Default value: False .
true.
:type is_hns_enabled: bool
"""

Expand Down Expand Up @@ -173,7 +173,7 @@ def __init__(self, **kwargs):
self.secondary_endpoints = None
self.encryption = None
self.access_tier = None
self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', False)
self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False)
self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None)
self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None)
self.network_rule_set = None
self.is_hns_enabled = kwargs.get('is_hns_enabled', False)
self.is_hns_enabled = kwargs.get('is_hns_enabled', None)
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class StorageAccountCreateParameters(Model):
Integration for SMB if sets to true.
:type enable_azure_files_aad_integration: bool
:param enable_https_traffic_only: Allows https traffic only to storage
service if sets to true. Default value: False .
service if sets to true.
:type enable_https_traffic_only: bool
:param is_hns_enabled: Account HierarchicalNamespace enabled if sets to
true. Default value: False .
true.
:type is_hns_enabled: bool
"""

Expand Down Expand Up @@ -98,5 +98,5 @@ def __init__(self, **kwargs):
self.network_rule_set = kwargs.get('network_rule_set', None)
self.access_tier = kwargs.get('access_tier', None)
self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None)
self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False)
self.is_hns_enabled = kwargs.get('is_hns_enabled', False)
self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None)
self.is_hns_enabled = kwargs.get('is_hns_enabled', None)
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class StorageAccountCreateParameters(Model):
Integration for SMB if sets to true.
:type enable_azure_files_aad_integration: bool
:param enable_https_traffic_only: Allows https traffic only to storage
service if sets to true. Default value: False .
service if sets to true.
:type enable_https_traffic_only: bool
:param is_hns_enabled: Account HierarchicalNamespace enabled if sets to
true. Default value: False .
true.
:type is_hns_enabled: bool
"""

Expand All @@ -86,7 +86,7 @@ class StorageAccountCreateParameters(Model):
'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'},
}

def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None:
def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None:
super(StorageAccountCreateParameters, self).__init__(**kwargs)
self.sku = sku
self.kind = kind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ class StorageAccount(TrackedResource):
:vartype access_tier: str or
~azure.mgmt.storage.v2018_07_01.models.AccessTier
:param enable_azure_files_aad_integration: Enables Azure Files AAD
Integration for SMB if sets to true. Default value: False .
Integration for SMB if sets to true.
:type enable_azure_files_aad_integration: bool
:param enable_https_traffic_only: Allows https traffic only to storage
service if sets to true. Default value: False .
service if sets to true.
:type enable_https_traffic_only: bool
:ivar network_rule_set: Network rule set
:vartype network_rule_set:
~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet
:param is_hns_enabled: Account HierarchicalNamespace enabled if sets to
true. Default value: False .
true.
:type is_hns_enabled: bool
"""

Expand Down Expand Up @@ -156,7 +156,7 @@ class StorageAccount(TrackedResource):
'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'},
}

def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=False, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None:
def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None:
super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs)
self.sku = None
self.kind = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class StorageAccountUpdateParameters(Model):
Integration for SMB if sets to true.
:type enable_azure_files_aad_integration: bool
:param enable_https_traffic_only: Allows https traffic only to storage
service if sets to true. Default value: False .
service if sets to true.
:type enable_https_traffic_only: bool
:param network_rule_set: Network rule set
:type network_rule_set:
Expand Down Expand Up @@ -78,6 +78,6 @@ def __init__(self, **kwargs):
self.encryption = kwargs.get('encryption', None)
self.access_tier = kwargs.get('access_tier', None)
self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None)
self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False)
self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None)
self.network_rule_set = kwargs.get('network_rule_set', None)
self.kind = kwargs.get('kind', None)
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class StorageAccountUpdateParameters(Model):
Integration for SMB if sets to true.
:type enable_azure_files_aad_integration: bool
:param enable_https_traffic_only: Allows https traffic only to storage
service if sets to true. Default value: False .
service if sets to true.
:type enable_https_traffic_only: bool
:param network_rule_set: Network rule set
:type network_rule_set:
Expand All @@ -69,7 +69,7 @@ class StorageAccountUpdateParameters(Model):
'kind': {'key': 'kind', 'type': 'Kind'},
}

def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None:
def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, network_rule_set=None, kind=None, **kwargs) -> None:
super(StorageAccountUpdateParameters, self).__init__(**kwargs)
self.sku = sku
self.tags = tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
from .operations import Operations
from .skus_operations import SkusOperations
from .storage_accounts_operations import StorageAccountsOperations
from .usages_operations import UsagesOperations
from .usage_operations import UsageOperations
from .blob_containers_operations import BlobContainersOperations

__all__ = [
'Operations',
'SkusOperations',
'StorageAccountsOperations',
'UsagesOperations',
'UsageOperations',
'BlobContainersOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -37,71 +37,6 @@ def __init__(self, client, config, serializer, deserializer):

self.config = config

def list(
self, custom_headers=None, raw=False, **operation_config):
"""Gets the current usage count and the limit for the resources under the
subscription.

:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of Usage
:rtype:
~azure.mgmt.storage.v2018_07_01.models.UsagePaged[~azure.mgmt.storage.v2018_07_01.models.Usage]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = self.list.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1)

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

return response

# Deserialize response
deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies)

if raw:
header_dict = {}
client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'}

def list_by_location(
self, location, custom_headers=None, raw=False, **operation_config):
"""Gets the current usage count and the limit for the resources of the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models


class UsagesOperations(object):
"""UsagesOperations operations.

:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The API version to use for this operation. Constant value: "2018-07-01".
"""

models = models

def __init__(self, client, config, serializer, deserializer):

self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-07-01"

self.config = config

def list(
self, custom_headers=None, raw=False, **operation_config):
"""Gets the current usage count and the limit for the resources under the
subscription.

:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of Usage
:rtype:
~azure.mgmt.storage.v2018_07_01.models.UsagePaged[~azure.mgmt.storage.v2018_07_01.models.Usage]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = self.list.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1)

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

return response

# Deserialize response
deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies)

if raw:
header_dict = {}
client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .operations.operations import Operations
from .operations.skus_operations import SkusOperations
from .operations.storage_accounts_operations import StorageAccountsOperations
from .operations.usages_operations import UsagesOperations
from .operations.usage_operations import UsageOperations
from .operations.blob_containers_operations import BlobContainersOperations
from . import models
Expand Down Expand Up @@ -65,6 +66,8 @@ class StorageManagementClient(SDKClient):
:vartype skus: azure.mgmt.storage.v2018_07_01.operations.SkusOperations
:ivar storage_accounts: StorageAccounts operations
:vartype storage_accounts: azure.mgmt.storage.v2018_07_01.operations.StorageAccountsOperations
:ivar usages: Usages operations
:vartype usages: azure.mgmt.storage.v2018_07_01.operations.UsagesOperations
:ivar usage: Usage operations
:vartype usage: azure.mgmt.storage.v2018_07_01.operations.UsageOperations
:ivar blob_containers: BlobContainers operations
Expand Down Expand Up @@ -95,6 +98,8 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.storage_accounts = StorageAccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.usages = UsagesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.usage = UsageOperations(
self._client, self.config, self._serialize, self._deserialize)
self.blob_containers = BlobContainersOperations(
Expand Down