# 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 typing_extensions import Self

class UpdateUserRolesRequest(BaseModel):
    """
    UpdateUserRolesRequest
    """ # noqa: E501
    customer_id: Optional[StrictStr] = Field(default=None, alias="CustomerId")
    user_id: Optional[StrictStr] = Field(default=None, alias="UserId")
    new_role_id: Optional[StrictInt] = Field(default=None, alias="NewRoleId")
    new_account_ids: Optional[List[StrictStr]] = Field(default=None, alias="NewAccountIds")
    new_customer_ids: Optional[List[StrictStr]] = Field(default=None, alias="NewCustomerIds")
    delete_role_id: Optional[StrictInt] = Field(default=None, alias="DeleteRoleId")
    delete_account_ids: Optional[List[StrictStr]] = Field(default=None, alias="DeleteAccountIds")
    delete_customer_ids: Optional[List[StrictStr]] = Field(default=None, alias="DeleteCustomerIds")
    __properties: ClassVar[List[str]] = ["CustomerId", "UserId", "NewRoleId", "NewAccountIds", "NewCustomerIds", "DeleteRoleId", "DeleteAccountIds", "DeleteCustomerIds"]

    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 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 user_id (nullable) is None
        # and model_fields_set contains the field
        if self.user_id is None and "user_id" in self.model_fields_set:
            _dict['UserId'] = None

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "CustomerId": obj.get("CustomerId") if obj.get("CustomerId") is not None else None,
                        "UserId": obj.get("UserId") if obj.get("UserId") is not None else None,
                        "NewRoleId": obj.get("NewRoleId") if obj.get("NewRoleId") is not None else None,
                        "NewAccountIds": obj.get("NewAccountIds"),
                        "NewCustomerIds": obj.get("NewCustomerIds"),
                        "DeleteRoleId": obj.get("DeleteRoleId") if obj.get("DeleteRoleId") is not None else None,
                        "DeleteAccountIds": obj.get("DeleteAccountIds"),
                        "DeleteCustomerIds": obj.get("DeleteCustomerIds")
        })
        return _obj
