@staticmethod
def get_schema(max_nesting_depth: Optional[int]=6, nesting_depth: int=0, nesting_list: List[str]=[], max_recursion_limit: Optional[int]=2, include_extension: Optional[bool]=False, extension_fields: Optional[List[str]]=['valueBoolean', 'valueCode', 'valueDate', 'valueDateTime', 'valueDecimal', 'valueId', 'valueInteger', 'valuePositiveInt', 'valueString', 'valueTime', 'valueUnsignedInt', 'valueUri', 'valueQuantity'], extension_depth: int=0, max_extension_depth: Optional[int]=2) -> Union[(StructType, DataType)]:
    '\n        A record of an event made for purposes of maintaining a security log. Typical\n        uses include detection of intrusion attempts and monitoring for inappropriate\n        usage.\n\n\n        id: unique id for the element within a resource (for internal references). This\n            may be any string value that does not contain spaces.\n\n        extension: May be used to represent additional information that is not part of the basic\n            definition of the element. In order to make the use of extensions safe and\n            manageable, there is a strict set of governance  applied to the definition and\n            use of extensions. Though any implementer is allowed to define an extension,\n            there is a set of requirements that SHALL be met as part of the definition of\n            the extension.\n\n        identifier: Identifies a specific instance of the entity. The reference should always be\n            version specific.\n\n        reference: Identifies a specific instance of the entity. The reference should be version\n            specific.\n\n        type: The type of the object that was involved in this audit event.\n\n        role: Code representing the role the entity played in the event being audited.\n\n        lifecycle: Identifier for the data life-cycle stage for the entity.\n\n        securityLabel: Security labels for the identified entity.\n\n        name: A name of the entity in the audit event.\n\n        description: Text that describes the entity in more detail.\n\n        query: The query parameters for a query-type entities.\n\n        detail: Tagged value pairs for conveying additional information about the entity.\n\n        '
    from spark_fhir_schemas.stu3.complex_types.extension import ExtensionSchema
    from spark_fhir_schemas.stu3.complex_types.identifier import IdentifierSchema
    from spark_fhir_schemas.stu3.complex_types.reference import ReferenceSchema
    from spark_fhir_schemas.stu3.complex_types.coding import CodingSchema
    from spark_fhir_schemas.stu3.complex_types.auditevent_detail import AuditEvent_DetailSchema
    if ((max_recursion_limit and (nesting_list.count('AuditEvent_Entity') >= max_recursion_limit)) or (max_nesting_depth and (nesting_depth >= max_nesting_depth))):
        return StructType([StructField('id', StringType(), True)])
    my_nesting_list: List[str] = (nesting_list + ['AuditEvent_Entity'])
    schema = StructType([StructField('id', StringType(), True), StructField('extension', ArrayType(ExtensionSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth)), True), StructField('identifier', IdentifierSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('reference', ReferenceSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('type', CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('role', CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('lifecycle', CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('securityLabel', ArrayType(CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth)), True), StructField('name', StringType(), True), StructField('description', StringType(), True), StructField('query', StringType(), True), StructField('detail', ArrayType(AuditEvent_DetailSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth)), True)])
    if (not include_extension):
        schema.fields = [(c if (c.name != 'extension') else StructField('extension', StringType(), True)) for c in schema.fields]
    return schema
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.


id: unique id for the element within a resource (for internal references). This
    may be any string value that does not contain spaces.

extension: May be used to represent additional information that is not part of the basic
    definition of the element. In order 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 is allowed to define an extension,
    there is a set of requirements that SHALL be met as part of the definition of
    the extension.

identifier: Identifies a specific instance of the entity. The reference should always be
    version specific.

reference: Identifies a specific instance of the entity. The reference should be version
    specific.

type: The type of the object that was involved in this audit event.

role: Code representing the role the entity played in the event being audited.

lifecycle: Identifier for the data life-cycle stage for the entity.

securityLabel: Security labels for the identified entity.

name: A name of the entity in the audit event.

description: Text that describes the entity in more detail.

query: The query parameters for a query-type entities.

detail: Tagged value pairs for conveying additional information about the entity.
@staticmethod
def get_schema(max_nesting_depth: Optional[int]=6, nesting_depth: int=0, nesting_list: List[str]=[], max_recursion_limit: Optional[int]=2, include_extension: Optional[bool]=False, extension_fields: Optional[List[str]]=['valueBoolean', 'valueCode', 'valueDate', 'valueDateTime', 'valueDecimal', 'valueId', 'valueInteger', 'valuePositiveInt', 'valueString', 'valueTime', 'valueUnsignedInt', 'valueUri', 'valueQuantity'], extension_depth: int=0, max_extension_depth: Optional[int]=2) -> Union[(StructType, DataType)]:
    '\n        A record of an event made for purposes of maintaining a security log. Typical\n        uses include detection of intrusion attempts and monitoring for inappropriate\n        usage.\n\n\n        id: unique id for the element within a resource (for internal references). This\n            may be any string value that does not contain spaces.\n\n        extension: May be used to represent additional information that is not part of the basic\n            definition of the element. In order to make the use of extensions safe and\n            manageable, there is a strict set of governance  applied to the definition and\n            use of extensions. Though any implementer is allowed to define an extension,\n            there is a set of requirements that SHALL be met as part of the definition of\n            the extension.\n\n        identifier: Identifies a specific instance of the entity. The reference should always be\n            version specific.\n\n        reference: Identifies a specific instance of the entity. The reference should be version\n            specific.\n\n        type: The type of the object that was involved in this audit event.\n\n        role: Code representing the role the entity played in the event being audited.\n\n        lifecycle: Identifier for the data life-cycle stage for the entity.\n\n        securityLabel: Security labels for the identified entity.\n\n        name: A name of the entity in the audit event.\n\n        description: Text that describes the entity in more detail.\n\n        query: The query parameters for a query-type entities.\n\n        detail: Tagged value pairs for conveying additional information about the entity.\n\n        '
    from spark_fhir_schemas.stu3.complex_types.extension import ExtensionSchema
    from spark_fhir_schemas.stu3.complex_types.identifier import IdentifierSchema
    from spark_fhir_schemas.stu3.complex_types.reference import ReferenceSchema
    from spark_fhir_schemas.stu3.complex_types.coding import CodingSchema
    from spark_fhir_schemas.stu3.complex_types.auditevent_detail import AuditEvent_DetailSchema
    if ((max_recursion_limit and (nesting_list.count('AuditEvent_Entity') >= max_recursion_limit)) or (max_nesting_depth and (nesting_depth >= max_nesting_depth))):
        return StructType([StructField('id', StringType(), True)])
    my_nesting_list: List[str] = (nesting_list + ['AuditEvent_Entity'])
    schema = StructType([StructField('id', StringType(), True), StructField('extension', ArrayType(ExtensionSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth)), True), StructField('identifier', IdentifierSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('reference', ReferenceSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('type', CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('role', CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('lifecycle', CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=(extension_depth + 1), max_extension_depth=max_extension_depth), True), StructField('securityLabel', ArrayType(CodingSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth)), True), StructField('name', StringType(), True), StructField('description', StringType(), True), StructField('query', StringType(), True), StructField('detail', ArrayType(AuditEvent_DetailSchema.get_schema(max_nesting_depth=max_nesting_depth, nesting_depth=(nesting_depth + 1), nesting_list=my_nesting_list, max_recursion_limit=max_recursion_limit, include_extension=include_extension, extension_fields=extension_fields, extension_depth=extension_depth, max_extension_depth=max_extension_depth)), True)])
    if (not include_extension):
        schema.fields = [(c if (c.name != 'extension') else StructField('extension', StringType(), True)) for c in schema.fields]
    return schema