from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Optional, TYPE_CHECKING, Union
from uuid import UUID

@dataclass
class Business_units_structureGetResponse_business_units(Parsable):
    # The account_id property
    account_id: Optional[UUID] = None
    # The created_at property
    created_at: Optional[str] = None
    # The description property
    description: Optional[str] = None
    # The id property
    id: Optional[UUID] = None
    # The name property
    name: Optional[str] = None
    # The parent_id property
    parent_id: Optional[UUID] = None
    # The path property
    path: Optional[str] = None
    # The updated_at property
    updated_at: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> Business_units_structureGetResponse_business_units:
        """
        Creates a new instance of the appropriate class based on discriminator value
        param parse_node: The parse node to use to read the discriminator value and create the object
        Returns: Business_units_structureGetResponse_business_units
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return Business_units_structureGetResponse_business_units()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        fields: dict[str, Callable[[Any], None]] = {
            "account_id": lambda n : setattr(self, 'account_id', n.get_uuid_value()),
            "created_at": lambda n : setattr(self, 'created_at', n.get_str_value()),
            "description": lambda n : setattr(self, 'description', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "parent_id": lambda n : setattr(self, 'parent_id', n.get_uuid_value()),
            "path": lambda n : setattr(self, 'path', n.get_str_value()),
            "updated_at": lambda n : setattr(self, 'updated_at', n.get_str_value()),
        }
        return fields
    
    def serialize(self,writer: SerializationWriter) -> None:
        """
        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        """
        if writer is None:
            raise TypeError("writer cannot be null.")
        writer.write_uuid_value("account_id", self.account_id)
        writer.write_str_value("created_at", self.created_at)
        writer.write_str_value("description", self.description)
        writer.write_uuid_value("id", self.id)
        writer.write_str_value("name", self.name)
        writer.write_uuid_value("parent_id", self.parent_id)
        writer.write_str_value("path", self.path)
        writer.write_str_value("updated_at", self.updated_at)
    

