from __future__ import annotations
import datetime
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 ImagePatchResponse(Parsable):
    # The account_id property
    account_id: Optional[UUID] = None
    # The address_line_1 property
    address_line_1: Optional[str] = None
    # The address_line_2 property
    address_line_2: Optional[str] = None
    # The business_unit_id property
    business_unit_id: Optional[UUID] = None
    # The city property
    city: Optional[str] = None
    # The construction_type property
    construction_type: Optional[str] = None
    # The contract_type property
    contract_type: Optional[str] = None
    # The country property
    country: Optional[str] = None
    # The currency property
    currency: Optional[str] = None
    # The end_date property
    end_date: Optional[str] = None
    # The id property
    id: Optional[UUID] = None
    # The job_number property
    job_number: Optional[str] = None
    # The language property
    language: Optional[str] = None
    # The last_sign_in property
    last_sign_in: Optional[datetime.datetime] = None
    # The name property
    name: Optional[str] = None
    # The postal_code property
    postal_code: Optional[str] = None
    # The project_type property
    project_type: Optional[str] = None
    # The start_date property
    start_date: Optional[str] = None
    # The state_or_province property
    state_or_province: Optional[str] = None
    # The status property
    status: Optional[str] = None
    # The timezone property
    timezone: Optional[str] = None
    # The value property
    value: Optional[float] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ImagePatchResponse:
        """
        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: ImagePatchResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ImagePatchResponse()
    
    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()),
            "address_line_1": lambda n : setattr(self, 'address_line_1', n.get_str_value()),
            "address_line_2": lambda n : setattr(self, 'address_line_2', n.get_str_value()),
            "business_unit_id": lambda n : setattr(self, 'business_unit_id', n.get_uuid_value()),
            "city": lambda n : setattr(self, 'city', n.get_str_value()),
            "construction_type": lambda n : setattr(self, 'construction_type', n.get_str_value()),
            "contract_type": lambda n : setattr(self, 'contract_type', n.get_str_value()),
            "country": lambda n : setattr(self, 'country', n.get_str_value()),
            "currency": lambda n : setattr(self, 'currency', n.get_str_value()),
            "end_date": lambda n : setattr(self, 'end_date', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "job_number": lambda n : setattr(self, 'job_number', n.get_str_value()),
            "language": lambda n : setattr(self, 'language', n.get_str_value()),
            "last_sign_in": lambda n : setattr(self, 'last_sign_in', n.get_datetime_value()),
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "postal_code": lambda n : setattr(self, 'postal_code', n.get_str_value()),
            "project_type": lambda n : setattr(self, 'project_type', n.get_str_value()),
            "start_date": lambda n : setattr(self, 'start_date', n.get_str_value()),
            "state_or_province": lambda n : setattr(self, 'state_or_province', n.get_str_value()),
            "status": lambda n : setattr(self, 'status', n.get_str_value()),
            "timezone": lambda n : setattr(self, 'timezone', n.get_str_value()),
            "value": lambda n : setattr(self, 'value', n.get_float_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("address_line_1", self.address_line_1)
        writer.write_str_value("address_line_2", self.address_line_2)
        writer.write_uuid_value("business_unit_id", self.business_unit_id)
        writer.write_str_value("city", self.city)
        writer.write_str_value("construction_type", self.construction_type)
        writer.write_str_value("contract_type", self.contract_type)
        writer.write_str_value("country", self.country)
        writer.write_str_value("currency", self.currency)
        writer.write_str_value("end_date", self.end_date)
        writer.write_uuid_value("id", self.id)
        writer.write_str_value("job_number", self.job_number)
        writer.write_str_value("language", self.language)
        writer.write_datetime_value("last_sign_in", self.last_sign_in)
        writer.write_str_value("name", self.name)
        writer.write_str_value("postal_code", self.postal_code)
        writer.write_str_value("project_type", self.project_type)
        writer.write_str_value("start_date", self.start_date)
        writer.write_str_value("state_or_province", self.state_or_province)
        writer.write_str_value("status", self.status)
        writer.write_str_value("timezone", self.timezone)
        writer.write_float_value("value", self.value)
    

