# 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.
# --------------------------------------------------------------------------

from typing import Any, List, Optional, Union

from azure.core.exceptions import HttpResponseError
import msrest.serialization

from ._azure_quota_extension_api_enums import *


class CommonResourceProperties(msrest.serialization.Model):
    """Resource properties.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar id: Resource ID.
    :vartype id: str
    :ivar name: Resource name.
    :vartype name: str
    :ivar type: Resource type. Example: "Microsoft.Quota/quotas".
    :vartype type: str
    """

    _validation = {
        'id': {'readonly': True},
        'name': {'readonly': True},
        'type': {'readonly': True},
    }

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'type': {'key': 'type', 'type': 'str'},
    }

    def __init__(
        self,
        **kwargs
    ):
        super(CommonResourceProperties, self).__init__(**kwargs)
        self.id = None
        self.name = None
        self.type = None


class CreateGenericQuotaRequestParameters(msrest.serialization.Model):
    """Quota change requests information.

    :param value: Quota change requests.
    :type value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase]
    """

    _attribute_map = {
        'value': {'key': 'value', 'type': '[CurrentQuotaLimitBase]'},
    }

    def __init__(
        self,
        *,
        value: Optional[List["CurrentQuotaLimitBase"]] = None,
        **kwargs
    ):
        super(CreateGenericQuotaRequestParameters, self).__init__(**kwargs)
        self.value = value


class CurrentQuotaLimitBase(msrest.serialization.Model):
    """Quota limit.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar id: The resource ID.
    :vartype id: str
    :ivar type: The resource type.
    :vartype type: str
    :ivar name: The resource name.
    :vartype name: str
    :param properties: Quota properties for the specified resource, based on the API called, Quotas
     or Usages.
    :type properties: ~azure.mgmt.quota.models.QuotaProperties
    """

    _validation = {
        'id': {'readonly': True},
        'type': {'readonly': True},
        'name': {'readonly': True},
    }

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'type': {'key': 'type', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'properties': {'key': 'properties', 'type': 'QuotaProperties'},
    }

    def __init__(
        self,
        *,
        properties: Optional["QuotaProperties"] = None,
        **kwargs
    ):
        super(CurrentQuotaLimitBase, self).__init__(**kwargs)
        self.id = None
        self.type = None
        self.name = None
        self.properties = properties


class CurrentUsagesBase(msrest.serialization.Model):
    """Resource usage.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar id: The resource ID.
    :vartype id: str
    :ivar type: The resource type.
    :vartype type: str
    :ivar name: The resource name.
    :vartype name: str
    :param properties: Usage properties for the specified resource.
    :type properties: ~azure.mgmt.quota.models.UsagesProperties
    """

    _validation = {
        'id': {'readonly': True},
        'type': {'readonly': True},
        'name': {'readonly': True},
    }

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'type': {'key': 'type', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'properties': {'key': 'properties', 'type': 'UsagesProperties'},
    }

    def __init__(
        self,
        *,
        properties: Optional["UsagesProperties"] = None,
        **kwargs
    ):
        super(CurrentUsagesBase, self).__init__(**kwargs)
        self.id = None
        self.type = None
        self.name = None
        self.properties = properties


class ExceptionResponse(msrest.serialization.Model):
    """Error.

    :param error: API error details.
    :type error: ~azure.mgmt.quota.models.ServiceError
    """

    _attribute_map = {
        'error': {'key': 'error', 'type': 'ServiceError'},
    }

    def __init__(
        self,
        *,
        error: Optional["ServiceError"] = None,
        **kwargs
    ):
        super(ExceptionResponse, self).__init__(**kwargs)
        self.error = error


class LimitJsonObject(msrest.serialization.Model):
    """LimitJson abstract class.

    You probably want to use the sub-classes and not this class directly. Known
    sub-classes are: LimitObject.

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

    :param limit_object_type: Required. The limit object type.Constant filled by server.  Possible
     values include: "LimitValue".
    :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType
    """

    _validation = {
        'limit_object_type': {'required': True},
    }

    _attribute_map = {
        'limit_object_type': {'key': 'limitObjectType', 'type': 'str'},
    }

    _subtype_map = {
        'limit_object_type': {'LimitValue': 'LimitObject'}
    }

    def __init__(
        self,
        **kwargs
    ):
        super(LimitJsonObject, self).__init__(**kwargs)
        self.limit_object_type = None  # type: Optional[str]


class LimitObject(LimitJsonObject):
    """The resource quota limit value.

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

    :param limit_object_type: Required. The limit object type.Constant filled by server.  Possible
     values include: "LimitValue".
    :type limit_object_type: str or ~azure.mgmt.quota.models.LimitType
    :param value: Required. The quota/limit value.
    :type value: int
    :param limit_type: The quota or usages limit types. Possible values include: "Independent",
     "Shared".
    :type limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes
    """

    _validation = {
        'limit_object_type': {'required': True},
        'value': {'required': True},
    }

    _attribute_map = {
        'limit_object_type': {'key': 'limitObjectType', 'type': 'str'},
        'value': {'key': 'value', 'type': 'int'},
        'limit_type': {'key': 'limitType', 'type': 'str'},
    }

    def __init__(
        self,
        *,
        value: int,
        limit_type: Optional[Union[str, "QuotaLimitTypes"]] = None,
        **kwargs
    ):
        super(LimitObject, self).__init__(**kwargs)
        self.limit_object_type = 'LimitValue'  # type: str
        self.value = value
        self.limit_type = limit_type


class OperationDisplay(msrest.serialization.Model):
    """OperationDisplay.

    :param provider: Provider name.
    :type provider: str
    :param resource: Resource name.
    :type resource: str
    :param operation: Operation name.
    :type operation: str
    :param description: Operation description.
    :type description: str
    """

    _attribute_map = {
        'provider': {'key': 'provider', 'type': 'str'},
        'resource': {'key': 'resource', 'type': 'str'},
        'operation': {'key': 'operation', 'type': 'str'},
        'description': {'key': 'description', 'type': 'str'},
    }

    def __init__(
        self,
        *,
        provider: Optional[str] = None,
        resource: Optional[str] = None,
        operation: Optional[str] = None,
        description: Optional[str] = None,
        **kwargs
    ):
        super(OperationDisplay, self).__init__(**kwargs)
        self.provider = provider
        self.resource = resource
        self.operation = operation
        self.description = description


class OperationList(msrest.serialization.Model):
    """OperationList.

    :param value:
    :type value: list[~azure.mgmt.quota.models.OperationResponse]
    :param next_link: URL to get the next page of items.
    :type next_link: str
    """

    _attribute_map = {
        'value': {'key': 'value', 'type': '[OperationResponse]'},
        'next_link': {'key': 'nextLink', 'type': 'str'},
    }

    def __init__(
        self,
        *,
        value: Optional[List["OperationResponse"]] = None,
        next_link: Optional[str] = None,
        **kwargs
    ):
        super(OperationList, self).__init__(**kwargs)
        self.value = value