# coding=utf-8
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
# 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 datetime
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union

from .. import _serialization

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from .. import models as _models


class AccessPolicy(_serialization.Model):
    """An Access policy.

    All required parameters must be populated in order to send to Azure.

    :ivar start: the date-time the policy is active. Required.
    :vartype start: ~datetime.datetime
    :ivar expiry: the date-time the policy expires. Required.
    :vartype expiry: ~datetime.datetime
    :ivar permission: the permissions for the acl policy. Required.
    :vartype permission: str
    """

    _validation = {
        "start": {"required": True},
        "expiry": {"required": True},
        "permission": {"required": True},
    }

    _attribute_map = {
        "start": {"key": "Start", "type": "iso-8601"},
        "expiry": {"key": "Expiry", "type": "iso-8601"},
        "permission": {"key": "Permission", "type": "str"},
    }

    def __init__(self, *, start: datetime.datetime, expiry: datetime.datetime, permission: str, **kwargs: Any) -> None:
        """
        :keyword start: the date-time the policy is active. Required.
        :paramtype start: ~datetime.datetime
        :keyword expiry: the date-time the policy expires. Required.
        :paramtype expiry: ~datetime.datetime
        :keyword permission: the permissions for the acl policy. Required.
        :paramtype permission: str
        """
        super().__init__(**kwargs)
        self.start = start
        self.expiry = expiry
        self.permission = permission


class AppleBarrel(_serialization.Model):
    """A barrel of apples.

    :ivar good_apples:
    :vartype good_apples: str
    :ivar bad_apples:
    :vartype bad_apples: str
    """

    _attribute_map = {
        "good_apples": {"key": "GoodApples", "type": "[str]", "xml": {"wrapped": True, "itemsName": "Apple"}},
        "bad_apples": {"key": "BadApples", "type": "[str]", "xml": {"wrapped": True, "itemsName": "Apple"}},
    }

    def __init__(
        self, *, good_apples: Optional[List[str]] = None, bad_apples: Optional[List[str]] = None, **kwargs: Any
    ) -> None:
        """
        :keyword good_apples:
        :paramtype good_apples: str
        :keyword bad_apples:
        :paramtype bad_apples: str
        """
        super().__init__(**kwargs)
        self.good_apples = good_apples
        self.bad_apples = bad_apples


class Banana(_serialization.Model):
    """A banana.

    :ivar name:
    :vartype name: str
    :ivar flavor:
    :vartype flavor: str
    :ivar expiration: The time at which you should reconsider eating this banana.
    :vartype expiration: ~datetime.datetime
    """

    _attribute_map = {
        "name": {"key": "name", "type": "str", "xml": {"name": "name"}},
        "flavor": {"key": "flavor", "type": "str", "xml": {"name": "flavor"}},
        "expiration": {"key": "expiration", "type": "iso-8601", "xml": {"name": "expiration"}},
    }
    _xml_map = {"name": "banana"}

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        flavor: Optional[str] = None,
        expiration: Optional[datetime.datetime] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword name:
        :paramtype name: str
        :keyword flavor:
        :paramtype flavor: str
        :keyword expiration: The time at which you should reconsider eating this banana.
        :paramtype expiration: ~datetime.datetime
        """
        super().__init__(**kwargs)
        self.name = name
        self.flavor = flavor
        self.expiration = expiration


class Blob(_serialization.Model):
    """An Azure Storage blob.

    All required parameters must be populated in order to send to Azure.

    :ivar name: Required.
    :vartype name: str
    :ivar deleted: Required.
    :vartype deleted: bool
    :ivar snapshot: Required.
    :vartype snapshot: str
    :ivar properties: Properties of a blob. Required.
    :vartype properties: ~xmlserviceversiontolerant.models.BlobProperties
    :ivar metadata: Dictionary of :code:`<string>`.
    :vartype metadata: dict[str, str]
    """

    _validation = {
        "name": {"required": True},
        "deleted": {"required": True},
        "snapshot": {"required": True},
        "properties": {"required": True},
    }

    _attribute_map = {
        "name": {"key": "Name", "type": "str"},
        "deleted": {"key": "Deleted", "type": "bool"},
        "snapshot": {"key": "Snapshot", "type": "str"},
        "properties": {"key": "Properties", "type": "BlobProperties"},
        "metadata": {"key": "Metadata", "type": "{str}"},
    }
    _xml_map = {"name": "Blob"}

    def __init__(
        self,
        *,
        name: str,
        deleted: bool,
        snapshot: str,
        properties: "_models.BlobProperties",
        metadata: Optional[Dict[str, str]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword name: Required.
        :paramtype name: str
        :keyword deleted: Required.
        :paramtype deleted: bool
        :keyword snapshot: Required.
        :paramtype snapshot: str
        :keyword properties: Properties of a blob. Required.
        :paramtype properties: ~xmlserviceversiontolerant.models.BlobProperties
        :keyword metadata: Dictionary of :code:`<string>`.
        :paramtype metadata: dict[str, str]
        """
        super().__init__(**kwargs)
        self.name = name
        self.deleted = deleted
        self.snapshot = snapshot
        self.properties = properties
        self.metadata = metadata


class BlobPrefix(_serialization.Model):
    """BlobPrefix.

    All required parameters must be populated in order to send to Azure.

    :ivar name: Required.
    :vartype name: str
    """

    _validation = {
        "name": {"required": True},
    }

    _attribute_map = {
        "name": {"key": "Name", "type": "str"},
    }

    def __init__(self, *, name: str, **kwargs: Any) -> None:
        """
        :keyword name: Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.name = name


class BlobProperties(_serialization.Model):  # pylint: disable=too-many-instance-attributes
    """Properties of a blob.

    All required parameters must be populated in order to send to Azure.

    :ivar last_modified: Required.
    :vartype last_modified: ~datetime.datetime
    :ivar etag: Required.
    :vartype etag: str
    :ivar content_length: Size in bytes.
    :vartype content_length: int
    :ivar content_type:
    :vartype content_type: str
    :ivar content_encoding:
    :vartype content_encoding: str
    :ivar content_language:
    :vartype content_language: str
    :ivar content_md5:
    :vartype content_md5: str
    :ivar content_disposition:
    :vartype content_disposition: str
    :ivar cache_control:
    :vartype cache_control: str
    :ivar blob_sequence_number:
    :vartype blob_sequence_number: int
    :ivar blob_type: Known values are: "BlockBlob", "PageBlob", and "AppendBlob".
    :vartype blob_type: str or ~xmlserviceversiontolerant.models.BlobType
    :ivar lease_status: Known values are: "locked" and "unlocked".
    :vartype lease_status: str or ~xmlserviceversiontolerant.models.LeaseStatusType
    :ivar lease_state: Known values are: "available", "leased", "expired", "breaking", and
     "broken".
    :vartype lease_state: str or ~xmlserviceversiontolerant.models.LeaseStateType
    :ivar lease_duration: Known values are: "infinite" and "fixed".
    :vartype lease_duration: str or ~xmlserviceversiontolerant.models.LeaseDurationType
    :ivar copy_id:
    :vartype copy_id: str
    :ivar copy_status: Known values are: "pending", "success", "aborted", and "failed".
    :vartype copy_status: str or ~xmlserviceversiontolerant.models.CopyStatusType
    :ivar copy_source:
    :vartype copy_source: str
    :ivar copy_progress:
    :vartype copy_progress: str
    :ivar copy_completion_time:
    :vartype copy_completion_time: ~datetime.datetime
    :ivar copy_status_description:
    :vartype copy_status_description: str
    :ivar server_encrypted:
    :vartype server_encrypted: bool
    :ivar incremental_copy:
    :vartype incremental_copy: bool
    :ivar destination_snapshot:
    :vartype destination_snapshot: str
    :ivar deleted_time:
    :vartype deleted_time: ~datetime.datetime
    :ivar remaining_retention_days:
    :vartype remaining_retention_days: int
    :ivar access_tier: Known values are: "P4", "P6", "P10", "P20", "P30", "P40", "P50", "Hot",
     "Cool", and "Archive".
    :vartype access_tier: str or ~xmlserviceversiontolerant.models.AccessTier
    :ivar access_tier_inferred:
    :vartype access_tier_inferred: bool
    :ivar archive_status: Known values are: "rehydrate-pending-to-hot" and
     "rehydrate-pending-to-cool".
    :vartype archive_status: str or ~xmlserviceversiontolerant.models.ArchiveStatus
    """

    _validation = {
        "last_modified": {"required": True},
        "etag": {"required": True},
    }

    _attribute_map = {
        "last_modified": {"key": "Last-Modified", "type": "rfc-1123"},
        "etag": {"key": "Etag", "type": "str"},
        "content_length": {"key": "Content-Length", "type": "int"},
        "content_type": {"key": "Content-Type", "type": "str"},
        "content_encoding": {"key": "Content-Encoding", "type": "str"},
        "content_language": {"key": "Content-Language", "type": "str"},
        "content_md5": {"key": "Content-MD5", "type": "str"},
        "content_disposition": {"key": "Content-Disposition", "type": "str"},
        "cache_control": {"key": "Cache-Control", "type": "str"},
        "blob_sequence_number": {"key": "x-ms-blob-sequence-number", "type": "int"},
        "blob_type": {"key": "BlobType", "type": "str"},
        "lease_status": {"key": "LeaseStatus", "type": "str"},
        "lease_state": {"key": "LeaseState", "type": "str"},
        "lease_duration": {"key": "LeaseDuration", "type": "str"},
        "copy_id": {"key": "CopyId", "type": "str"},
        "copy_status": {"key": "CopyStatus", "type": "str"},
        "copy_source": {"key": "CopySource", "type": "str"},
        "copy_progress": {"key": "CopyProgress", "type": "str"},
        "copy_completion_time": {"key": "CopyCompletionTime", "type": "rfc-1123"},
        "copy_status_description": {"key": "CopyStatusDescription", "type": "str"},
        "server_encrypted": {"key": "ServerEncrypted", "type": "bool"},
        "incremental_copy": {"key": "IncrementalCopy", "type": "bool"},
        "destination_snapshot": {"key": "DestinationSnapshot", "type": "str"},
        "deleted_time": {"key": "DeletedTime", "type": "rfc-1123"},
        "remaining_retention_days": {"key": "RemainingRetentionDays", "type": "int"},
        "access_tier": {"key": "AccessTier", "type": "str"},
        "access_tier_inferred": {"key": "AccessTierInferred", "type": "bool"},
        "archive_status": {"key": "ArchiveStatus", "type": "str"},
    }

    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        last_modified: datetime.datetime,
        etag: str,
        content_length: Optional[int] = None,
        content_type: Optional[str] = None,
        content_encoding: Optional[str] = None,
        content_language: Optional[str] = None,
        content_md5: Optional[str] = None,
        content_disposition: Optional[str] = None,
        cache_control: Optional[str] = None,
        blob_sequence_number: Optional[int] = None,
        blob_type: Optional[Union[str, "_models.BlobType"]] = None,
        lease_status: Optional[Union[str, "_models.LeaseStatusType"]] = None,
        lease_state: Optional[Union[str, "_models.LeaseStateType"]] = None,
        lease_duration: Optional[Union[str, "_models.LeaseDurationType"]] = None,
        copy_id: Optional[str] = None,
        copy_status: Optional[Union[str, "_models.CopyStatusType"]] = None,
        copy_source: Optional[str] = None,
        copy_progress: Optional[str] = None,
        copy_completion_time: Optional[datetime.datetime] = None,
        copy_status_description: Optional[str] = None,
        server_encrypted: Optional[bool] = None,
        incremental_copy: Optional[bool] = None,
        destination_snapshot: Optional[str] = None,
        deleted_time: Optional[datetime.datetime] = None,
        remaining_retention_days: Optional[int] = None,
        access_tier: Optional[Union[str, "_models.AccessTier"]] = None,
        access_tier_inferred: Optional[bool] = None,
        archive_status: Optional[Union[str, "_models.ArchiveStatus"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword last_modified: Required.
        :paramtype last_modified: ~datetime.datetime
        :keyword etag: Required.
        :paramtype etag: str
        :keyword content_length: Size in bytes.
        :paramtype content_length: int
        :keyword content_type:
        :paramtype content_type: str
        :keyword content_encoding:
        :paramtype content_encoding: str
        :keyword content_language:
        :paramtype content_language: str
        :keyword content_md5:
        :paramtype content_md5: str
        :keyword content_disposition:
        :paramtype content_disposition: str
        :keyword cache_control:
        :paramtype cache_control: str
        :keyword blob_sequence_number:
        :paramtype blob_sequence_number: int
        :keyword blob_type: Known values are: "BlockBlob", "PageBlob", and "AppendBlob".
        :paramtype blob_type: str or ~xmlserviceversiontolerant.models.BlobType
        :keyword lease_status: Known values are: "locked" and "unlocked".
        :paramtype lease_status: str or ~xmlserviceversiontolerant.models.LeaseStatusType
        :keyword lease_state: Known values are: "available", "leased", "expired", "breaking", and
         "broken".
        :paramtype lease_state: str or ~xmlserviceversiontolerant.models.LeaseStateType
        :keyword lease_duration: Known values are: "infinite" and "fixed".
        :paramtype lease_duration: str or ~xmlserviceversiontolerant.models.LeaseDurationType
        :keyword copy_id:
        :paramtype copy_id: str
        :keyword copy_status: Known values are: "pending", "success", "aborted", and "failed".
        :paramtype copy_status: str or ~xmlserviceversiontolerant.models.CopyStatusType
        :keyword copy_source:
        :paramtype copy_source: str
        :keyword copy_progress:
        :paramtype copy_progress: str
        :keyword copy_completion_time:
        :paramtype copy_completion_time: ~datetime.datetime
        :keyword copy_status_description:
        :paramtype copy_status_description: str
        :keyword server_encrypted:
        :paramtype server_encrypted: bool
        :keyword incremental_copy:
        :paramtype incremental_copy: bool
        :keyword destination_snapshot:
        :paramtype destination_snapshot: str
        :keyword deleted_time:
        :paramtype deleted_time: ~datetime.datetime
        :keyword remaining_retention_days:
        :paramtype remaining_retention_days: int
        :keyword access_tier: Known values are: "P4", "P6", "P10", "P20", "P30", "P40", "P50", "Hot",
         "Cool", and "Archive".
        :paramtype access_tier: str or ~xmlserviceversiontolerant.models.AccessTier
        :keyword access_tier_inferred:
        :paramtype access_tier_inferred: bool
        :keyword archive_status: Known values are: "rehydrate-pending-to-hot" and
         "rehydrate-pending-to-cool".
        :paramtype archive_status: str or ~xmlserviceversiontolerant.models.ArchiveStatus
        """
        super().__init__(**kwargs)
        self.last_modified = last_modified
        self.etag = etag
        self.content_length = content_length
        self.content_type = content_type
        self.content_encoding = content_encoding
        self.content_language = content_language
        self.content_md5 = content_md5
        self.content_disposition = content_disposition
        self.cache_control = cache_control
        self.blob_sequence_number = blob_sequence_number
        self.blob_type = blob_type
        self.lease_status = lease_status
        self.lease_state = lease_state
        self.lease_duration = lease_duration
        self.copy_id = copy_id
        self.copy_status = copy_status
        self.copy_source = copy_source
        self.copy_progress = copy_progress
        self.copy_completion_time = copy_completion_time
        self.copy_status_description = copy_status_description
        self.server_encrypted = server_encrypted
        self.incremental_copy = incremental_copy
        self.destination_snapshot = destination_snapshot
        self.deleted_time = deleted_time
        self.remaining_retention_days = remaining_retention_days
        self.access_tier = access_tier
        self.access_tier_inferred = access_tier_inferred
        self.archive_status = archive_status


class Blobs(_serialization.Model):
    """Blobs.

    :ivar blob_prefix:
    :vartype blob_prefix: list[~xmlserviceversiontolerant.models.BlobPrefix]
    :ivar blob:
    :vartype blob: ~xmlserviceversiontolerant.models.Blob
    """

    _attribute_map = {
        "blob_prefix": {"key": "BlobPrefix", "type": "[BlobPrefix]"},
        "blob": {"key": "Blob", "type": "[Blob]", "xml": {"itemsName": "Blob"}},
    }

    def __init__(
        self,
        *,
        blob_prefix: Optional[List["_models.BlobPrefix"]] = None,
        blob: Optional[List["_models.Blob"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword blob_prefix:
        :paramtype blob_prefix: list[~xmlserviceversiontolerant.models.BlobPrefix]
        :keyword blob:
        :paramtype blob: ~xmlserviceversiontolerant.models.Blob
        """
        super().__init__(**kwargs)
        self.blob_prefix = blob_prefix
        self.blob = blob


class ComplexTypeNoMeta(_serialization.Model):
    """I am a complex type with no XML node.

    :ivar id: The id of the res.
    :vartype id: str
    """

    _attribute_map = {
        "id": {"key": "ID", "type": "str"},
    }

    def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None:  # pylint: disable=redefined-builtin
        """
        :keyword id: The id of the res.
        :paramtype id: str
        """
        super().__init__(**kwargs)
        self.id = id


class ComplexTypeWithMeta(_serialization.Model):
    """I am a complex type with XML node.

    :ivar id: The id of the res.
    :vartype id: str
    """

    _attribute_map = {
        "id": {"key": "ID", "type": "str"},
    }
    _xml_map = {"name": "XMLComplexTypeWithMeta"}

    def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None:  # pylint: disable=redefined-builtin
        """
        :keyword id: The id of the res.
        :paramtype id: str
        """
        super().__init__(**kwargs)
        self.id = id


class Container(_serialization.Model):
    """An Azure Storage container.

    All required parameters must be populated in order to send to Azure.

    :ivar name: Required.
    :vartype name: str
    :ivar properties: Properties of a container. Required.
    :vartype properties: ~xmlserviceversiontolerant.models.ContainerProperties
    :ivar metadata: Dictionary of :code:`<string>`.
    :vartype metadata: dict[str, str]
    """

    _validation = {
        "name": {"required": True},
        "properties": {"required": True},
    }

    _attribute_map = {
        "name": {"key": "Name", "type": "str"},
        "properties": {"key": "Properties", "type": "ContainerProperties"},
        "metadata": {"key": "Metadata", "type": "{str}"},
    }

    def __init__(
        self,
        *,
        name: str,
        properties: "_models.ContainerProperties",
        metadata: Optional[Dict[str, str]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword name: Required.
        :paramtype name: str
        :keyword properties: Properties of a container. Required.
        :paramtype properties: ~xmlserviceversiontolerant.models.ContainerProperties
        :keyword metadata: Dictionary of :code:`<string>`.
        :paramtype metadata: dict[str, str]
        """
        super().__init__(**kwargs)
        self.name = name
        self.properties = properties
        self.metadata = metadata


class ContainerProperties(_serialization.Model):
    """Properties of a container.

    All required parameters must be populated in order to send to Azure.

    :ivar last_modified: Required.
    :vartype last_modified: ~datetime.datetime
    :ivar etag: Required.
    :vartype etag: str
    :ivar lease_status: Known values are: "locked" and "unlocked".
    :vartype lease_status: str or ~xmlserviceversiontolerant.models.LeaseStatusType
    :ivar lease_state: Known values are: "available", "leased", "expired", "breaking", and
     "broken".
    :vartype lease_state: str or ~xmlserviceversiontolerant.models.LeaseStateType
    :ivar lease_duration: Known values are: "infinite" and "fixed".
    :vartype lease_duration: str or ~xmlserviceversiontolerant.models.LeaseDurationType
    :ivar public_access: Known values are: "container" and "blob".
    :vartype public_access: str or ~xmlserviceversiontolerant.models.PublicAccessType
    """

    _validation = {
        "last_modified": {"required": True},
        "etag": {"required": True},
    }

    _attribute_map = {
        "last_modified": {"key": "Last-Modified", "type": "rfc-1123"},
        "etag": {"key": "Etag", "type": "str"},
        "lease_status": {"key": "LeaseStatus", "type": "str"},
        "lease_state": {"key": "LeaseState", "type": "str"},
        "lease_duration": {"key": "LeaseDuration", "type": "str"},
        "public_access": {"key": "PublicAccess", "type": "str"},
    }

    def __init__(
        self,
        *,
        last_modified: datetime.datetime,
        etag: str,
        lease_status: Optional[Union[str, "_models.LeaseStatusType"]] = None,
        lease_state: Optional[Union[str, "_models.LeaseStateType"]] = None,
        lease_duration: Optional[Union[str, "_models.LeaseDurationType"]] = None,
        public_access: Optional[Union[str, "_models.PublicAccessType"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword last_modified: Required.
        :paramtype last_modified: ~datetime.datetime
        :keyword etag: Required.
        :paramtype etag: str
        :keyword lease_status: Known values are: "locked" and "unlocked".
        :paramtype lease_status: str or ~xmlserviceversiontolerant.models.LeaseStatusType
        :keyword lease_state: Known values are: "available", "leased", "expired", "breaking", and
         "broken".
        :paramtype lease_state: str or ~xmlserviceversiontolerant.models.LeaseStateType
        :keyword lease_duration: Known values are: "infinite" and "fixed".
        :paramtype lease_duration: str or ~xmlserviceversiontolerant.models.LeaseDurationType
        :keyword public_access: Known values are: "container" and "blob".
        :paramtype public_access: str or ~xmlserviceversiontolerant.models.PublicAccessType
        """
        super().__init__(**kwargs)
        self.last_modified = last_modified
        self.etag = etag
        self.lease_status = lease_status
        self.lease_state = lease_state
        self.lease_duration = lease_duration
        self.public_access = public_access


class CorsRule(_serialization.Model):
    """CORS is an HTTP feature that enables a web application running under one domain to access
    resources in another domain. Web browsers implement a security restriction known as same-origin
    policy that prevents a web page from calling APIs in a different domain; CORS provides a secure
    way to allow one domain (the origin domain) to call APIs in another domain.

    All required parameters must be populated in order to send to Azure.

    :ivar allowed_origins: The origin domains that are permitted to make a request against the
     storage service via CORS. The origin domain is the domain from which the request originates.
     Note that the origin must be an exact case-sensitive match with the origin that the user age
     sends to the service. You can also use the wildcard character '*' to allow all origin domains
     to make requests via CORS. Required.
    :vartype allowed_origins: str
    :ivar allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a
     CORS request. (comma separated). Required.
    :vartype allowed_methods: str
    :ivar allowed_headers: the request headers that the origin domain may specify on the CORS
     request. Required.
    :vartype allowed_headers: str
    :ivar exposed_headers: The response headers that may be sent in the response to the CORS
     request and exposed by the browser to the request issuer. Required.
    :vartype exposed_headers: str
    :ivar max_age_in_seconds: The maximum amount time that a browser should cache the preflight
     OPTIONS request. Required.
    :vartype max_age_in_seconds: int
    """

    _validation = {
        "allowed_origins": {"required": True},
        "allowed_methods": {"required": True},
        "allowed_headers": {"required": True},
        "exposed_headers": {"required": True},
        "max_age_in_seconds": {"required": True, "minimum": 0},
    }

    _attribute_map = {
        "allowed_origins": {"key": "AllowedOrigins", "type": "str"},
        "allowed_methods": {"key": "AllowedMethods", "type": "str"},
        "allowed_headers": {"key": "AllowedHeaders", "type": "str"},
        "exposed_headers": {"key": "ExposedHeaders", "type": "str"},
        "max_age_in_seconds": {"key": "MaxAgeInSeconds", "type": "int"},
    }
    _xml_map = {"name": "CorsRule"}

    def __init__(
        self,
        *,
        allowed_origins: str,
        allowed_methods: str,
        allowed_headers: str,
        exposed_headers: str,
        max_age_in_seconds: int,
        **kwargs: Any
    ) -> None:
        """
        :keyword allowed_origins: The origin domains that are permitted to make a request against the
         storage service via CORS. The origin domain is the domain from which the request originates.
         Note that the origin must be an exact case-sensitive match with the origin that the user age
         sends to the service. You can also use the wildcard character '*' to allow all origin domains
         to make requests via CORS. Required.
        :paramtype allowed_origins: str
        :keyword allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a
         CORS request. (comma separated). Required.
        :paramtype allowed_methods: str
        :keyword allowed_headers: the request headers that the origin domain may specify on the CORS
         request. Required.
        :paramtype allowed_headers: str
        :keyword exposed_headers: The response headers that may be sent in the response to the CORS
         request and exposed by the browser to the request issuer. Required.
        :paramtype exposed_headers: str
        :keyword max_age_in_seconds: The maximum amount time that a browser should cache the preflight
         OPTIONS request. Required.
        :paramtype max_age_in_seconds: int
        """
        super().__init__(**kwargs)
        self.allowed_origins = allowed_origins
        self.allowed_methods = allowed_methods
        self.allowed_headers = allowed_headers
        self.exposed_headers = exposed_headers
        self.max_age_in_seconds = max_age_in_seconds


class Error(_serialization.Model):
    """Error.

    :ivar status:
    :vartype status: int
    :ivar message:
    :vartype message: str
    """

    _attribute_map = {
        "status": {"key": "status", "type": "int"},
        "message": {"key": "message", "type": "str"},
    }

    def __init__(self, *, status: Optional[int] = None, message: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword status:
        :paramtype status: int
        :keyword message:
        :paramtype message: str
        """
        super().__init__(**kwargs)
        self.status = status
        self.message = message


class JSONInput(_serialization.Model):
    """JSONInput.

    :ivar id:
    :vartype id: int
    """

    _attribute_map = {
        "id": {"key": "id", "type": "int"},
    }

    def __init__(self, *, id: Optional[int] = None, **kwargs: Any) -> None:  # pylint: disable=redefined-builtin
        """
        :keyword id:
        :paramtype id: int
        """
        super().__init__(**kwargs)
        self.id = id


class JSONOutput(_serialization.Model):
    """JSONOutput.

    :ivar id:
    :vartype id: int
    """

    _attribute_map = {
        "id": {"key": "id", "type": "int"},
    }

    def __init__(self, *, id: Optional[int] = None, **kwargs: Any) -> None:  # pylint: disable=redefined-builtin
        """
        :keyword id:
        :paramtype id: int
        """
        super().__init__(**kwargs)
        self.id = id


class ListBlobsResponse(_serialization.Model):
    """An enumeration of blobs.

    All required parameters must be populated in order to send to Azure.

    :ivar service_endpoint:
    :vartype service_endpoint: str
    :ivar container_name: Required.
    :vartype container_name: str
    :ivar prefix: Required.
    :vartype prefix: str
    :ivar marker: Required.
    :vartype marker: str
    :ivar max_results: Required.
    :vartype max_results: int
    :ivar delimiter: Required.
    :vartype delimiter: str
    :ivar blobs: Required.
    :vartype blobs: ~xmlserviceversiontolerant.models.Blobs
    :ivar next_marker: Required.
    :vartype next_marker: str
    """

    _validation = {
        "container_name": {"required": True},
        "prefix": {"required": True},
        "marker": {"required": True},
        "max_results": {"required": True},
        "delimiter": {"required": True},
        "blobs": {"required": True},
        "next_marker": {"required": True},
    }

    _attribute_map = {
        "service_endpoint": {"key": "ServiceEndpoint", "type": "str", "xml": {"attr": True}},
        "container_name": {"key": "ContainerName", "type": "str", "xml": {"attr": True}},
        "prefix": {"key": "Prefix", "type": "str"},
        "marker": {"key": "Marker", "type": "str"},
        "max_results": {"key": "MaxResults", "type": "int"},
        "delimiter": {"key": "Delimiter", "type": "str"},
        "blobs": {"key": "Blobs", "type": "Blobs"},
        "next_marker": {"key": "NextMarker", "type": "str"},
    }
    _xml_map = {"name": "EnumerationResults"}

    def __init__(
        self,
        *,
        container_name: str,
        prefix: str,
        marker: str,
        max_results: int,
        delimiter: str,
        blobs: "_models.Blobs",
        next_marker: str,
        service_endpoint: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword service_endpoint:
        :paramtype service_endpoint: str
        :keyword container_name: Required.
        :paramtype container_name: str
        :keyword prefix: Required.
        :paramtype prefix: str
        :keyword marker: Required.
        :paramtype marker: str
        :keyword max_results: Required.
        :paramtype max_results: int
        :keyword delimiter: Required.
        :paramtype delimiter: str
        :keyword blobs: Required.
        :paramtype blobs: ~xmlserviceversiontolerant.models.Blobs
        :keyword next_marker: Required.
        :paramtype next_marker: str
        """
        super().__init__(**kwargs)
        self.service_endpoint = service_endpoint
        self.container_name = container_name
        self.prefix = prefix
        self.marker = marker
        self.max_results = max_results
        self.delimiter = delimiter
        self.blobs = blobs
        self.next_marker = next_marker


class ListContainersResponse(_serialization.Model):
    """An enumeration of containers.

    All required parameters must be populated in order to send to Azure.

    :ivar service_endpoint: Required.
    :vartype service_endpoint: str
    :ivar prefix: Required.
    :vartype prefix: str
    :ivar marker:
    :vartype marker: str
    :ivar max_results: Required.
    :vartype max_results: int
    :ivar containers:
    :vartype containers: list[~xmlserviceversiontolerant.models.Container]
    :ivar next_marker: Required.
    :vartype next_marker: str
    """

    _validation = {
        "service_endpoint": {"required": True},
        "prefix": {"required": True},
        "max_results": {"required": True},
        "next_marker": {"required": True},
    }

    _attribute_map = {
        "service_endpoint": {"key": "ServiceEndpoint", "type": "str", "xml": {"attr": True}},
        "prefix": {"key": "Prefix", "type": "str"},
        "marker": {"key": "Marker", "type": "str"},
        "max_results": {"key": "MaxResults", "type": "int"},
        "containers": {"key": "Containers", "type": "[Container]", "xml": {"wrapped": True}},
        "next_marker": {"key": "NextMarker", "type": "str"},
    }
    _xml_map = {"name": "EnumerationResults"}

    def __init__(
        self,
        *,
        service_endpoint: str,
        prefix: str,
        max_results: int,
        next_marker: str,
        marker: Optional[str] = None,
        containers: Optional[List["_models.Container"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword service_endpoint: Required.
        :paramtype service_endpoint: str
        :keyword prefix: Required.
        :paramtype prefix: str
        :keyword marker:
        :paramtype marker: str
        :keyword max_results: Required.
        :paramtype max_results: int
        :keyword containers:
        :paramtype containers: list[~xmlserviceversiontolerant.models.Container]
        :keyword next_marker: Required.
        :paramtype next_marker: str
        """
        super().__init__(**kwargs)
        self.service_endpoint = service_endpoint
        self.prefix = prefix
        self.marker = marker
        self.max_results = max_results
        self.containers = containers
        self.next_marker = next_marker


class Logging(_serialization.Model):
    """Azure Analytics Logging settings.

    All required parameters must be populated in order to send to Azure.

    :ivar version: The version of Storage Analytics to configure. Required.
    :vartype version: str
    :ivar delete: Indicates whether all delete requests should be logged. Required.
    :vartype delete: bool
    :ivar read: Indicates whether all read requests should be logged. Required.
    :vartype read: bool
    :ivar write: Indicates whether all write requests should be logged. Required.
    :vartype write: bool
    :ivar retention_policy: the retention policy. Required.
    :vartype retention_policy: ~xmlserviceversiontolerant.models.RetentionPolicy
    """

    _validation = {
        "version": {"required": True},
        "delete": {"required": True},
        "read": {"required": True},
        "write": {"required": True},
        "retention_policy": {"required": True},
    }

    _attribute_map = {
        "version": {"key": "Version", "type": "str"},
        "delete": {"key": "Delete", "type": "bool"},
        "read": {"key": "Read", "type": "bool"},
        "write": {"key": "Write", "type": "bool"},
        "retention_policy": {"key": "RetentionPolicy", "type": "RetentionPolicy"},
    }

    def __init__(
        self,
        *,
        version: str,
        delete: bool,
        read: bool,
        write: bool,
        retention_policy: "_models.RetentionPolicy",
        **kwargs: Any
    ) -> None:
        """
        :keyword version: The version of Storage Analytics to configure. Required.
        :paramtype version: str
        :keyword delete: Indicates whether all delete requests should be logged. Required.
        :paramtype delete: bool
        :keyword read: Indicates whether all read requests should be logged. Required.
        :paramtype read: bool
        :keyword write: Indicates whether all write requests should be logged. Required.
        :paramtype write: bool
        :keyword retention_policy: the retention policy. Required.
        :paramtype retention_policy: ~xmlserviceversiontolerant.models.RetentionPolicy
        """
        super().__init__(**kwargs)
        self.version = version
        self.delete = delete
        self.read = read
        self.write = write
        self.retention_policy = retention_policy


class Metrics(_serialization.Model):
    """Metrics.

    All required parameters must be populated in order to send to Azure.

    :ivar version: The version of Storage Analytics to configure.
    :vartype version: str
    :ivar enabled: Indicates whether metrics are enabled for the Blob service. Required.
    :vartype enabled: bool
    :ivar include_apis: Indicates whether metrics should generate summary statistics for called API
     operations.
    :vartype include_apis: bool
    :ivar retention_policy: the retention policy.
    :vartype retention_policy: ~xmlserviceversiontolerant.models.RetentionPolicy
    """

    _validation = {
        "enabled": {"required": True},
    }

    _attribute_map = {
        "version": {"key": "Version", "type": "str"},
        "enabled": {"key": "Enabled", "type": "bool"},
        "include_apis": {"key": "IncludeAPIs", "type": "bool"},
        "retention_policy": {"key": "RetentionPolicy", "type": "RetentionPolicy"},
    }

    def __init__(
        self,
        *,
        enabled: bool,
        version: Optional[str] = None,
        include_apis: Optional[bool] = None,
        retention_policy: Optional["_models.RetentionPolicy"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword version: The version of Storage Analytics to configure.
        :paramtype version: str
        :keyword enabled: Indicates whether metrics are enabled for the Blob service. Required.
        :paramtype enabled: bool
        :keyword include_apis: Indicates whether metrics should generate summary statistics for called
         API operations.
        :paramtype include_apis: bool
        :keyword retention_policy: the retention policy.
        :paramtype retention_policy: ~xmlserviceversiontolerant.models.RetentionPolicy
        """
        super().__init__(**kwargs)
        self.version = version
        self.enabled = enabled
        self.include_apis = include_apis
        self.retention_policy = retention_policy


class ModelWithByteProperty(_serialization.Model):
    """ModelWithByteProperty.

    :ivar bytes:
    :vartype bytes: bytes
    """

    _attribute_map = {
        "bytes": {"key": "Bytes", "type": "bytearray"},
    }

    def __init__(self, *, bytes: Optional[bytes] = None, **kwargs: Any) -> None:
        """
        :keyword bytes:
        :paramtype bytes: bytes
        """
        super().__init__(**kwargs)
        self.bytes = bytes


class ModelWithUrlProperty(_serialization.Model):
    """ModelWithUrlProperty.

    :ivar url:
    :vartype url: str
    """

    _attribute_map = {
        "url": {"key": "Url", "type": "str"},
    }

    def __init__(self, *, url: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword url:
        :paramtype url: str
        """
        super().__init__(**kwargs)
        self.url = url


class ObjectWithXMsTextProperty(_serialization.Model):
    """Contans property.

    :ivar language: Returned value should be 'english'.
    :vartype language: str
    :ivar content: Returned value should be 'I am text'.
    :vartype content: str
    """

    _attribute_map = {
        "language": {"key": "language", "type": "str", "xml": {"name": "language", "attr": True}},
        "content": {"key": "content", "type": "str", "xml": {"text": True}},
    }
    _xml_map = {"name": "Data"}

    def __init__(self, *, language: Optional[str] = None, content: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword language: Returned value should be 'english'.
        :paramtype language: str
        :keyword content: Returned value should be 'I am text'.
        :paramtype content: str
        """
        super().__init__(**kwargs)
        self.language = language
        self.content = content


class RetentionPolicy(_serialization.Model):
    """the retention policy.

    All required parameters must be populated in order to send to Azure.

    :ivar enabled: Indicates whether a retention policy is enabled for the storage service.
     Required.
    :vartype enabled: bool
    :ivar days: Indicates the number of days that metrics or logging or soft-deleted data should be
     retained. All data older than this value will be deleted.
    :vartype days: int
    """

    _validation = {
        "enabled": {"required": True},
        "days": {"minimum": 1},
    }

    _attribute_map = {
        "enabled": {"key": "Enabled", "type": "bool"},
        "days": {"key": "Days", "type": "int"},
    }

    def __init__(self, *, enabled: bool, days: Optional[int] = None, **kwargs: Any) -> None:
        """
        :keyword enabled: Indicates whether a retention policy is enabled for the storage service.
         Required.
        :paramtype enabled: bool
        :keyword days: Indicates the number of days that metrics or logging or soft-deleted data should
         be retained. All data older than this value will be deleted.
        :paramtype days: int
        """
        super().__init__(**kwargs)
        self.enabled = enabled
        self.days = days


class RootWithRefAndMeta(_serialization.Model):
    """I am root, and I ref a model WITH meta.

    :ivar ref_to_model: XML will use XMLComplexTypeWithMeta.
    :vartype ref_to_model: ~xmlserviceversiontolerant.models.ComplexTypeWithMeta
    :ivar something: Something else (just to avoid flattening).
    :vartype something: str
    """

    _attribute_map = {
        "ref_to_model": {"key": "RefToModel", "type": "ComplexTypeWithMeta"},
        "something": {"key": "Something", "type": "str"},
    }

    def __init__(
        self,
        *,
        ref_to_model: Optional["_models.ComplexTypeWithMeta"] = None,
        something: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword ref_to_model: XML will use XMLComplexTypeWithMeta.
        :paramtype ref_to_model: ~xmlserviceversiontolerant.models.ComplexTypeWithMeta
        :keyword something: Something else (just to avoid flattening).
        :paramtype something: str
        """
        super().__init__(**kwargs)
        self.ref_to_model = ref_to_model
        self.something = something


class RootWithRefAndNoMeta(_serialization.Model):
    """I am root, and I ref a model with no meta.

    :ivar ref_to_model: XML will use RefToModel.
    :vartype ref_to_model: ~xmlserviceversiontolerant.models.ComplexTypeNoMeta
    :ivar something: Something else (just to avoid flattening).
    :vartype something: str
    """

    _attribute_map = {
        "ref_to_model": {"key": "RefToModel", "type": "ComplexTypeNoMeta"},
        "something": {"key": "Something", "type": "str"},
    }

    def __init__(
        self,
        *,
        ref_to_model: Optional["_models.ComplexTypeNoMeta"] = None,
        something: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword ref_to_model: XML will use RefToModel.
        :paramtype ref_to_model: ~xmlserviceversiontolerant.models.ComplexTypeNoMeta
        :keyword something: Something else (just to avoid flattening).
        :paramtype something: str
        """
        super().__init__(**kwargs)
        self.ref_to_model = ref_to_model
        self.something = something


class SignedIdentifier(_serialization.Model):
    """signed identifier.

    All required parameters must be populated in order to send to Azure.

    :ivar id: a unique id. Required.
    :vartype id: str
    :ivar access_policy: The access policy. Required.
    :vartype access_policy: ~xmlserviceversiontolerant.models.AccessPolicy
    """

    _validation = {
        "id": {"required": True},
        "access_policy": {"required": True},
    }

    _attribute_map = {
        "id": {"key": "Id", "type": "str"},
        "access_policy": {"key": "AccessPolicy", "type": "AccessPolicy"},
    }
    _xml_map = {"name": "SignedIdentifier"}

    def __init__(
        self, *, id: str, access_policy: "_models.AccessPolicy", **kwargs: Any  # pylint: disable=redefined-builtin
    ) -> None:
        """
        :keyword id: a unique id. Required.
        :paramtype id: str
        :keyword access_policy: The access policy. Required.
        :paramtype access_policy: ~xmlserviceversiontolerant.models.AccessPolicy
        """
        super().__init__(**kwargs)
        self.id = id
        self.access_policy = access_policy


class Slide(_serialization.Model):
    """A slide in a slideshow.

    :ivar type:
    :vartype type: str
    :ivar title:
    :vartype title: str
    :ivar items:
    :vartype items: str
    """

    _attribute_map = {
        "type": {"key": "type", "type": "str", "xml": {"attr": True}},
        "title": {"key": "title", "type": "str"},
        "items": {"key": "items", "type": "[str]", "xml": {"itemsName": "item"}},
    }
    _xml_map = {"name": "slide"}

    def __init__(
        self,
        *,
        type: Optional[str] = None,
        title: Optional[str] = None,
        items: Optional[List[str]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword type:
        :paramtype type: str
        :keyword title:
        :paramtype title: str
        :keyword items:
        :paramtype items: str
        """
        super().__init__(**kwargs)
        self.type = type
        self.title = title
        self.items = items


class Slideshow(_serialization.Model):
    """Data about a slideshow.

    :ivar title:
    :vartype title: str
    :ivar date:
    :vartype date: str
    :ivar author:
    :vartype author: str
    :ivar slides:
    :vartype slides: ~xmlserviceversiontolerant.models.Slide
    """

    _attribute_map = {
        "title": {"key": "title", "type": "str", "xml": {"attr": True}},
        "date": {"key": "date", "type": "str", "xml": {"attr": True}},
        "author": {"key": "author", "type": "str", "xml": {"attr": True}},
        "slides": {"key": "slides", "type": "[Slide]", "xml": {"itemsName": "slide"}},
    }
    _xml_map = {"name": "slideshow"}

    def __init__(
        self,
        *,
        title: Optional[str] = None,
        date: Optional[str] = None,
        author: Optional[str] = None,
        slides: Optional[List["_models.Slide"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword title:
        :paramtype title: str
        :keyword date:
        :paramtype date: str
        :keyword author:
        :paramtype author: str
        :keyword slides:
        :paramtype slides: ~xmlserviceversiontolerant.models.Slide
        """
        super().__init__(**kwargs)
        self.title = title
        self.date = date
        self.author = author
        self.slides = slides


class StorageServiceProperties(_serialization.Model):
    """Storage Service Properties.

    :ivar logging: Azure Analytics Logging settings.
    :vartype logging: ~xmlserviceversiontolerant.models.Logging
    :ivar hour_metrics: A summary of request statistics grouped by API in hourly aggregates for
     blobs.
    :vartype hour_metrics: ~xmlserviceversiontolerant.models.Metrics
    :ivar minute_metrics: a summary of request statistics grouped by API in minute aggregates for
     blobs.
    :vartype minute_metrics: ~xmlserviceversiontolerant.models.Metrics
    :ivar cors: The set of CORS rules.
    :vartype cors: ~xmlserviceversiontolerant.models.CorsRule
    :ivar default_service_version: The default version to use for requests to the Blob service if
     an incoming request's version is not specified. Possible values include version 2008-10-27 and
     all more recent versions.
    :vartype default_service_version: str
    :ivar delete_retention_policy: The Delete Retention Policy for the service.
    :vartype delete_retention_policy: ~xmlserviceversiontolerant.models.RetentionPolicy
    """

    _attribute_map = {
        "logging": {"key": "Logging", "type": "Logging"},
        "hour_metrics": {"key": "HourMetrics", "type": "Metrics"},
        "minute_metrics": {"key": "MinuteMetrics", "type": "Metrics"},
        "cors": {"key": "Cors", "type": "[CorsRule]", "xml": {"wrapped": True, "itemsName": "CorsRule"}},
        "default_service_version": {"key": "DefaultServiceVersion", "type": "str"},
        "delete_retention_policy": {"key": "DeleteRetentionPolicy", "type": "RetentionPolicy"},
    }

    def __init__(
        self,
        *,
        logging: Optional["_models.Logging"] = None,
        hour_metrics: Optional["_models.Metrics"] = None,
        minute_metrics: Optional["_models.Metrics"] = None,
        cors: Optional[List["_models.CorsRule"]] = None,
        default_service_version: Optional[str] = None,
        delete_retention_policy: Optional["_models.RetentionPolicy"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword logging: Azure Analytics Logging settings.
        :paramtype logging: ~xmlserviceversiontolerant.models.Logging
        :keyword hour_metrics: A summary of request statistics grouped by API in hourly aggregates for
         blobs.
        :paramtype hour_metrics: ~xmlserviceversiontolerant.models.Metrics
        :keyword minute_metrics: a summary of request statistics grouped by API in minute aggregates
         for blobs.
        :paramtype minute_metrics: ~xmlserviceversiontolerant.models.Metrics
        :keyword cors: The set of CORS rules.
        :paramtype cors: ~xmlserviceversiontolerant.models.CorsRule
        :keyword default_service_version: The default version to use for requests to the Blob service
         if an incoming request's version is not specified. Possible values include version 2008-10-27
         and all more recent versions.
        :paramtype default_service_version: str
        :keyword delete_retention_policy: The Delete Retention Policy for the service.
        :paramtype delete_retention_policy: ~xmlserviceversiontolerant.models.RetentionPolicy
        """
        super().__init__(**kwargs)
        self.logging = logging
        self.hour_metrics = hour_metrics
        self.minute_metrics = minute_metrics
        self.cors = cors
        self.default_service_version = default_service_version
        self.delete_retention_policy = delete_retention_policy
