from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union

from pyspark.sql.types import StructType, DataType
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.base_types.fhir_complex_type_base import FhirComplexTypeBase
from spark_fhir_schemas.r4.complex_types.contributor import ContributorSchema


if TYPE_CHECKING:
    pass
    # id_ (string)
    # extension (Extension)
    # type_ (ContributorType)
    from spark_auto_mapper_fhir.value_sets.contributor_type import ContributorTypeCode

    # name (string)
    # contact (ContactDetail)
    from spark_auto_mapper_fhir.complex_types.contact_detail import ContactDetail


# This file is auto-generated by generate_classes so do not edit manually
# noinspection PyPep8Naming
class Contributor(FhirComplexTypeBase):
    """
    Contributor
    fhir-base.xsd
        A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.
        If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions
    """

    # noinspection PyPep8Naming
    def __init__(
        self,
        *,
        id_: Optional[FhirString] = None,
        extension: Optional[FhirList[ExtensionBase]] = None,
        type_: ContributorTypeCode,
        name: FhirString,
        contact: Optional[FhirList[ContactDetail]] = None,
    ) -> None:
        """
            A contributor to the content of a knowledge asset, including authors, editors,
        reviewers, and endorsers.
            If the element is present, it must have a value for at least one of the
        defined elements, an @id referenced from the Narrative, or extensions

            :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 type_: The type of contributor.
            :param name: The name of the individual or organization responsible for the contribution.
            :param contact: Contact details to assist a user in finding and communicating with the
        contributor.
        """
        super().__init__(
            id_=id_,
            extension=extension,
            type_=type_,
            name=name,
            contact=contact,
        )

    def get_schema(
        self, include_extension: bool
    ) -> Optional[Union[StructType, DataType]]:
        return ContributorSchema.get_schema(include_extension=include_extension)

from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union

from pyspark.sql.types import StructType, DataType
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.base_types.fhir_complex_type_base import FhirComplexTypeBase
from spark_fhir_schemas.r4.complex_types.contributor import ContributorSchema


if TYPE_CHECKING:
    pass
    # id_ (string)
    # extension (Extension)
    # type_ (ContributorType)
    from spark_auto_mapper_fhir.value_sets.contributor_type import ContributorTypeCode

    # name (string)
    # contact (ContactDetail)
    from spark_auto_mapper_fhir.complex_types.contact_detail import ContactDetail


# This file is auto-generated by generate_classes so do not edit manually
# noinspection PyPep8Naming
class Contributor(FhirComplexTypeBase):
    """
    Contributor
    fhir-base.xsd
        A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.
        If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions
    """

    # noinspection PyPep8Naming
    def __init__(
        self,
        *,
        id_: Optional[FhirString] = None,
        extension: Optional[FhirList[ExtensionBase]] = None,
        type_: ContributorTypeCode,
        name: FhirString,
        contact: Optional[FhirList[ContactDetail]] = None,
    ) -> None:
        """
            A contributor to the content of a knowledge asset, including authors, editors,
        reviewers, and endorsers.
            If the element is present, it must have a value for at least one of the
        defined elements, an @id referenced from the Narrative, or extensions

            :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 type_: The type of contributor.
            :param name: The name of the individual or organization responsible for the contribution.
            :param contact: Contact details to assist a user in finding and communicating with the
        contributor.
        """
        super().__init__(
            id_=id_,
            extension=extension,
            type_=type_,
            name=name,
            contact=contact,
        )

    def get_schema(
        self, include_extension: bool
    ) -> Optional[Union[StructType, DataType]]:
        return ContributorSchema.get_schema(include_extension=include_extension)

# id_ (string) # extension (Extension) # type_ (ContributorType) # name (string) # contact (ContactDetail) # This file is auto-generated by generate_classes so do not edit manually # noinspection PyPep8Naming Contributor     fhir-base.xsd         A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.         If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions # noinspection PyPep8Naming A contributor to the content of a knowledge asset, including authors, editors,         reviewers, and endorsers.             If the element is present, it must have a value for at least one of the         defined elements, an @id referenced from the Narrative, or extensions              :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 type_: The type of contributor.             :param name: The name of the individual or organization responsible for the contribution.             :param contact: Contact details to assist a user in finding and communicating with the         contributor.