# coding: utf-8

"""
    CustomerManagementService

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 1.0.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union, Set
from openapi_client.models.customer.lcid import LCID
from typing_extensions import Self

class UserInvitation(BaseModel):
    """
    UserInvitation
    """ # noqa: E501
    id: Optional[StrictStr] = Field(default=None, alias="Id")
    first_name: Optional[StrictStr] = Field(default=None, alias="FirstName")
    last_name: Optional[StrictStr] = Field(default=None, alias="LastName")
    email: Optional[StrictStr] = Field(default=None, alias="Email")
    customer_id: Optional[StrictStr] = Field(default=None, alias="CustomerId")
    role_id: Optional[StrictInt] = Field(default=None, alias="RoleId")
    account_ids: Optional[List[StrictStr]] = Field(default=None, alias="AccountIds")
    expiration_date: Optional[datetime] = Field(default=None, alias="ExpirationDate")
    lcid: Optional[LCID] = Field(default=None, alias="Lcid")
    __properties: ClassVar[List[str]] = ["Id", "FirstName", "LastName", "Email", "CustomerId", "RoleId", "AccountIds", "ExpirationDate", "Lcid"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )
	

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # set to None if id (nullable) is None
        # and model_fields_set contains the field
        if self.id is None and "id" in self.model_fields_set:
            _dict['Id'] = None

        # set to None if first_name (nullable) is None
        # and model_fields_set contains the field
        if self.first_name is None and "first_name" in self.model_fields_set:
            _dict['FirstName'] = None

        # set to None if last_name (nullable) is None
        # and model_fields_set contains the field
        if self.last_name is None and "last_name" in self.model_fields_set:
            _dict['LastName'] = None

        # set to None if email (nullable) is None
        # and model_fields_set contains the field
        if self.email is None and "email" in self.model_fields_set:
            _dict['Email'] = None

        # set to None if customer_id (nullable) is None
        # and model_fields_set contains the field
        if self.customer_id is None and "customer_id" in self.model_fields_set:
            _dict['CustomerId'] = None

        # set to None if role_id (nullable) is None
        # and model_fields_set contains the field
        if self.role_id is None and "role_id" in self.model_fields_set:
            _dict['RoleId'] = None

        # set to None if account_ids (nullable) is None
        # and model_fields_set contains the field
        if self.account_ids is None and "account_ids" in self.model_fields_set:
            _dict['AccountIds'] = None

        # set to None if expiration_date (nullable) is None
        # and model_fields_set contains the field
        if self.expiration_date is None and "expiration_date" in self.model_fields_set:
            _dict['ExpirationDate'] = None

        # set to None if lcid (nullable) is None
        # and model_fields_set contains the field
        if self.lcid is None and "lcid" in self.model_fields_set:
            _dict['Lcid'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of UserInvitation from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "Id": obj.get("Id") if obj.get("Id") is not None else None,
                        "FirstName": obj.get("FirstName") if obj.get("FirstName") is not None else None,
                        "LastName": obj.get("LastName") if obj.get("LastName") is not None else None,
                        "Email": obj.get("Email") if obj.get("Email") is not None else None,
                        "CustomerId": obj.get("CustomerId") if obj.get("CustomerId") is not None else None,
                        "RoleId": obj.get("RoleId") if obj.get("RoleId") is not None else None,
                        "AccountIds": obj.get("AccountIds"),
                        "ExpirationDate": obj.get("ExpirationDate") if obj.get("ExpirationDate") is not None else None,
                        "Lcid": obj.get("Lcid") if obj.get("Lcid") is not None else None
        })
        return _obj
