# 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 datetime
from typing import Dict, List, Optional, Union

import msrest.serialization

from ._attestation_management_client_enums import *


class Resource(msrest.serialization.Model):
    """Common fields that are returned in the response for all Azure Resource Manager resources.

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

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :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(Resource, self).__init__(**kwargs)
        self.id = None
        self.name = None
        self.type = None


class TrackedResource(Resource):
    """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'.

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

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

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :param tags: A set of tags. Resource tags.
    :type tags: dict[str, str]
    :param location: Required. The geo-location where the resource lives.
    :type location: str
    """

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

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

    def __init__(
        self,
        *,
        location: str,
        tags: Optional[Dict[str, str]] = None,
        **kwargs
    ):
        super(TrackedResource, self).__init__(**kwargs)
        self.tags = tags
        self.location = location


class AttestationProvider(TrackedResource):
    """Attestation service response message.

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

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

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :param tags: A set of tags. Resource tags.
    :type tags: dict[str, str]
    :param location: Required. The geo-location where the resource lives.
    :type location: str
    :ivar system_data: The system metadata relating to this resource.
    :vartype system_data: ~attestation_management_client.models.SystemData
    :param trust_model: Trust model for the attestation service instance.
    :type trust_model: str
    :param status: Status of attestation service. Possible values include: "Ready", "NotReady",
     "Error".
    :type status: str or ~attestation_management_client.models.AttestationServiceStatus
    :param attest_uri: Gets the uri of attestation service.
    :type attest_uri: str
    """

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

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'type': {'key': 'type', 'type': 'str'},
        'tags': {'key': 'tags', 'type': '{str}'},
        'location': {'key': 'location', 'type': 'str'},
        'system_data': {'key': 'systemData', 'type': 'SystemData'},
        'trust_model': {'key': 'properties.trustModel', 'type': 'str'},
        'status': {'key': 'properties.status', 'type': 'str'},
        'attest_uri': {'key': 'properties.attestUri', 'type': 'str'},
    }

    def __init__(
        self,
        *,
        location: str,
        tags: Optional[Dict[str, str]] = None,
        trust_model: Optional[str] = None,
        status: Optional[Union[str, "AttestationServiceStatus"]] = None,
        attest_uri: Optional[str] = None,
        **kwargs
    ):
        super(AttestationProvider, self).__init__(tags=tags, location=location, **kwargs)
        self.system_data = None
        self.trust_model = trust_model
        self.status = status
        self.attest_uri = attest_uri


class AttestationProviderListResult(msrest.serialization.Model):
    """Attestation Providers List.

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

    :ivar system_data: The system metadata relating to this resource.
    :vartype system_data: ~attestation_management_client.models.SystemData
    :param value: Attestation Provider array.
    :type value: list[~attestation_management_client.models.AttestationProvider]
    """

    _validation = {
        'system_data': {'readonly': True},
    }

    _attribute_map = {
        'system_data': {'key': 'systemData', 'type': 'SystemData'},
        'value': {'key': 'value', 'type': '[AttestationProvider]'},
    }

    def __init__(
        self,
        *,
        value: Optional[List["AttestationProvider"]] = None,
        **kwargs
    ):
        super(AttestationProviderListResult, self).__init__(**kwargs)
        self.system_data = None
        self.value = value


class AttestationServiceCreationParams(msrest.serialization.Model):
    """Parameters for creating an attestation service instance.

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

    :param location: Required. The supported Azure location where the attestation service instance
     should be created.
    :type location: str
    :param tags: A set of tags. The tags that will be assigned to the attestation service instance.
    :type tags: dict[str, str]
    :param keys: The value of the "keys" parameter is an array of JWK values.  By
     default, the order of the JWK values within the array does not imply
     an order of preference among them, although applications of JWK Sets
     can choose to assign a meaning to the order for their purposes, if
     desired.
    :type keys: list[~attestation_management_client.models.JsonWebKey]
    """

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

    _attribute_map = {
        'location': {'key': 'location', 'type': 'str'},
        'tags': {'key': 'tags', 'type': '{str}'},
        'keys': {'key': 'properties.policySigningCertificates.keys', 'type': '[JsonWebKey]'},
    }

    def __init__(
        self,
        *,
        location: str,
        tags: Optional[Dict[str, str]] = None,
        keys=None,
        **kwargs
    ):
        super(AttestationServiceCreationParams, self).__init__(**kwargs)
        self.location = location
        self.tags = tags
        self.keys = keys


class AttestationServicePatchParams(msrest.serialization.Model):
    """Parameters for patching an attestation service instance.

    :param tags: A set of tags. The tags that will be assigned to the attestation service instance.
    :type tags: dict[str, str]
    """

    _attribute_map = {
        'tags': {'key': 'tags', 'type': '{str}'},
    }

    def __init__(
        self,
        *,
        tags: Optional[Dict[str, str]] = None,
        **kwargs
    ):
        super(AttestationServicePatchParams, self).__init__(**kwargs)
        self.tags = tags


class CloudErrorBody(msrest.serialization.Model):
    """An error response from Attestation.

    :param code: An identifier for the error. Codes are invariant and are intended to be consumed
     programmatically.
    :type code: str
    :param message: A message describing the error, intended to be suitable for displaying in a
     user interface.
    :type message: str
    """

    _attribute_map = {
        'code': {'key': 'code', 'type': 'str'},
        'message': {'key': 'message', 'type': 'str'},
    }

    def __init__(
        self,
        *,
        code: Optional[str] = None,
        message: Optional[str] = None,
        **kwargs
    ):
        super(CloudErrorBody, self).__init__(**kwargs)
        self.code = code
        self.message = message


class JsonWebKey1(msrest.serialization.Model):
    """JsonWebKey.
    """

    _attribute_map = {
        'alg': {'key': 'alg', 'type': 'str'},
        'e': {'key': 'e', 'type': 'str'},
        'kid': {'key': 'kid', 'type': 'str'},
        'kty': {'key': 'kty', 'type': 'str'},
        'n': {'key': 'n', 'type': 'str'},
        'use': {'key': 'use', 'type': 'str'},
        'x5c': {'key': 'x5c', 'type': '[str]'}
    }

    def __init__(
        self,
        *,
        alg: str=None,
        kid: str=None,
        kty: str=None,
        use: str=None,
        e: Optional[str] = None,
        n: Optional[str] = None,
        x5c: Optional[List[str]] = None,
        **kwargs
    ):
        super(JsonWebKey1, self).__init__(**kwargs)
        self.alg = alg
        self.e = e
        self.kid = kid
        self.kty = kty
        self.n = n
        self.use = use
        self.x5c = x5c


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

    _attribute_map = {
        'alg': {'key': 'alg', 'type': 'str'},
        'kty': {'key': 'kty', 'type': 'str'},
        'use': {'key': 'use', 'type': 'str'},
        'x5c': {'key': 'x5c', 'type': '[str]'}
    }

    def __init__(
        self,
        *,
        alg: str = None,
        kty: str = None,
        use: str = None,
        x5c: Optional[List[str]] = None,
        **kwargs
    ):
        super(JsonWebKey, self).__init__(**kwargs)
        self.alg = alg
        self.kty = kty
        self.use = use
        self.x5c = x5c


class OperationList(msrest.serialization.Model):
    """List of supported operations.

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

    :ivar system_data: The system metadata relating to this resource.
    :vartype system_data: ~attestation_management_client.models.SystemData
    :param value: List of supported operations.
    :type value: list[~attestation_management_client.models.OperationsDefinition]
    """

    _validation = {
        'system_data': {'readonly': True},
    }

    _attribute_map = {
        'system_data': {'key': 'systemData', 'type': 'SystemData'},
        'value': {'key': 'value', 'type': '[OperationsDefinition]'},
    }

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


class OperationsDefinition(msrest.serialization.Model):
    """Definition object with the name and properties of an operation.

    :param name: Name of the operation.
    :type name: str
    :param display: Display object with properties of the operation.
    :type display: ~attestation_management_client.models.OperationsDisplayDefinition
    """

    _attribute_map = {
        'name': {'key': 'name', 'type': 'str'},
        'display': {'key': 'display', 'type': 'OperationsDisplayDefinition'},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display: Optional["OperationsDisplayDefinition"] = None,
        **kwargs
    ):
        super(OperationsDefinition, self).__init__(**kwargs)
        self.name = name
        self.display = display


class OperationsDisplayDefinition(msrest.serialization.Model):
    """Display object with properties of the operation.

    :param provider: Resource provider of the operation.
    :type provider: str
    :param resource: Resource for the operation.
    :type resource: str
    :param operation: Short description of the operation.
    :type operation: str
    :param description: Description of the operation.
    :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(OperationsDisplayDefinition, self).__init__(**kwargs)
        self.provider = provider
        self.resource = resource
        self.operation = operation
        self.description = description


class SystemData(msrest.serialization.Model):
    """Metadata pertaining to creation and last modification of the resource.

    :param created_by: The identity that created the resource.
    :type created_by: str
    :param created_by_type: The type of identity that created the resource. Possible values
     include: "User", "Application", "ManagedIdentity", "Key".
    :type created_by_type: str or ~attestation_management_client.models.CreatedByType
    :param created_at: The timestamp of resource creation (UTC).
    :type created_at: ~datetime.datetime
    :param last_modified_by: The identity that last modified the resource.
    :type last_modified_by: str
    :param last_modified_by_type: The type of identity that last modified the resource. Possible
     values include: "User", "Application", "ManagedIdentity", "Key".
    :type last_modified_by_type: str or ~attestation_management_client.models.CreatedByType
    :param last_modified_at: The type of identity that last modified the resource.
    :type last_modified_at: ~datetime.datetime
    """

    _attribute_map = {
        'created_by': {'key': 'createdBy', 'type': 'str'},
        'created_by_type': {'key': 'createdByType', 'type': 'str'},
        'created_at': {'key': 'createdAt', 'type': 'iso-8601'},
        'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'},
        'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'},
        'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'},
    }

    def __init__(
        self,
        *,
        created_by: Optional[str] = None,
        created_by_type: Optional[Union[str, "CreatedByType"]] = None,
        created_at: Optional[datetime.datetime] = None,
        last_modified_by: Optional[str] = None,
        last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None,
        last_modified_at: Optional[datetime.datetime] = None,
        **kwargs
    ):
        super(SystemData, self).__init__(**kwargs)
        self.created_by = created_by
        self.created_by_type = created_by_type
        self.created_at = created_at
        self.last_modified_by = last_modified_by
        self.last_modified_by_type = last_modified_by_type
        self.last_modified_at = last_modified_at
