text: from __future__ import annotations
  from typing import Optional, TYPE_CHECKING
  
  from spark_auto_mapper_fhir.fhir_types.list import FhirList
  from spark_auto_mapper_fhir.fhir_types.string import FhirString
  from spark_auto_mapper_fhir.extensions.extension_base import ExtensionBase
  from spark_auto_mapper_fhir.resources.resource import Resource
  
  from spark_auto_mapper_fhir.base_types.fhir_backbone_element_base import (
      FhirBackboneElementBase,
  )
  
  if TYPE_CHECKING:
      pass
      # id_ (string)
      # extension (Extension)
      # modifierExtension (Extension)
      # what (Reference)
      from spark_auto_mapper_fhir.complex_types.reference import Reference
  
      # Imports for References for what
      # type_ (Coding)
      from spark_auto_mapper_fhir.complex_types.coding import Coding
  
      # End Import for References for type_
      # Import for CodeableConcept for type_
      from spark_auto_mapper_fhir.value_sets.audit_event_entity_type import (
          AuditEventEntityTypeCode,
      )
  
      # End Import for CodeableConcept for type_
      # role (Coding)
      # End Import for References for role
      # Import for CodeableConcept for role
      from spark_auto_mapper_fhir.value_sets.audit_event_entity_role import (
          AuditEventEntityRoleCode,
      )
  
      # End Import for CodeableConcept for role
      # lifecycle (Coding)
      # End Import for References for lifecycle
      # Import for CodeableConcept for lifecycle
      from spark_auto_mapper_fhir.value_sets.object_lifecycle_events import (
          ObjectLifecycleEventsCode,
      )
  
      # End Import for CodeableConcept for lifecycle
      # securityLabel (Coding)
      # End Import for References for securityLabel
      # Import for CodeableConcept for securityLabel
      from spark_auto_mapper_fhir.value_sets.all_security_labels import (
          AllSecurityLabelsCode,
      )
  
      # End Import for CodeableConcept for securityLabel
      # name (string)
      # description (string)
      # query (base64Binary)
      from spark_auto_mapper_fhir.fhir_types.base64_binary import FhirBase64Binary
  
      # detail (AuditEvent.Detail)
      from spark_auto_mapper_fhir.backbone_elements.audit_event_detail import (
          AuditEventDetail,
      )
  
  
  # This file is auto-generated by generate_classes so do not edit manually
  # noinspection PyPep8Naming
  class AuditEventEntity(FhirBackboneElementBase):
      """
      AuditEvent.Entity
          A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.
      """
  
      # noinspection PyPep8Naming
      def __init__(
          self,
          *,
          id_: Optional[FhirString] = None,
          extension: Optional[FhirList[ExtensionBase]] = None,
          modifierExtension: Optional[FhirList[ExtensionBase]] = None,
          what: Optional[Reference[Resource]] = None,
          type_: Optional[Coding[AuditEventEntityTypeCode]] = None,
          role: Optional[Coding[AuditEventEntityRoleCode]] = None,
          lifecycle: Optional[Coding[ObjectLifecycleEventsCode]] = None,
          securityLabel: Optional[FhirList[Coding[AllSecurityLabelsCode]]] = None,
          name: Optional[FhirString] = None,
          description: Optional[FhirString] = None,
          query: Optional[FhirBase64Binary] = None,
          detail: Optional[FhirList[AuditEventDetail]] = None,
      ) -> None:
          """
              A record of an event made for purposes of maintaining a security log. Typical
          uses include detection of intrusion attempts and monitoring for inappropriate
          usage.
  
              :param id_: None
              :param extension: May be used to represent additional information that is not part of the basic
          definition of the element. To make the use of extensions safe and manageable,
          there is a strict set of governance  applied to the definition and use of
          extensions. Though any implementer can define an extension, there is a set of
          requirements that SHALL be met as part of the definition of the extension.
              :param modifierExtension: May be used to represent additional information that is not part of the basic
          definition of the element and that modifies the understanding of the element
          in which it is contained and/or the understanding of the containing element's
          descendants. Usually modifier elements provide negation or qualification. To
          make the use of extensions safe and manageable, there is a strict set of
          governance applied to the definition and use of extensions. Though any
          implementer can define an extension, there is a set of requirements that SHALL
          be met as part of the definition of the extension. Applications processing a
          resource are required to check for modifier extensions.
  
          Modifier extensions SHALL NOT change the meaning of any elements on Resource
          or DomainResource (including cannot change the meaning of modifierExtension
          itself).
              :param what: Identifies a specific instance of the entity. The reference should be version
          specific.
              :param type_: The type of the object that was involved in this audit event.
              :param role: Code representing the role the entity played in the event being audited.
              :param lifecycle: Identifier for the data life-cycle stage for the entity.
              :param securityLabel: Security labels for the identified entity.
              :param name: A name of the entity in the audit event.
              :param description: Text that describes the entity in more detail.
              :param query: The query parameters for a query-type entities.
              :param detail: Tagged value pairs for conveying additional information about the entity.
          """
          super().__init__(
              id_=id_,
              extension=extension,
              modifierExtension=modifierExtension,
              what=what,
              type_=type_,
              role=role,
              lifecycle=lifecycle,
              securityLabel=securityLabel,
              name=name,
              description=description,
              query=query,
              detail=detail,
          )
  