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 SearchGetResponse(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 city property
    city: Optional[str] = None
    # The country property
    country: Optional[str] = None
    # The description property
    description: Optional[str] = None
    # The erp_id property
    erp_id: Optional[str] = None
    # The id property
    id: Optional[UUID] = None
    # The name property
    name: Optional[str] = None
    # The phone property
    phone: Optional[str] = None
    # The postal_code property
    postal_code: Optional[str] = None
    # The state_or_province property
    state_or_province: Optional[str] = None
    # The tax_id property
    tax_id: Optional[str] = None
    # The trade property
    trade: Optional[str] = None
    # The website_url property
    website_url: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> SearchGetResponse:
        """
        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: SearchGetResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return SearchGetResponse()
    
    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()),
            "city": lambda n : setattr(self, 'city', n.get_str_value()),
            "country": lambda n : setattr(self, 'country', n.get_str_value()),
            "description": lambda n : setattr(self, 'description', n.get_str_value()),
            "erp_id": lambda n : setattr(self, 'erp_id', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "phone": lambda n : setattr(self, 'phone', n.get_str_value()),
            "postal_code": lambda n : setattr(self, 'postal_code', n.get_str_value()),
            "state_or_province": lambda n : setattr(self, 'state_or_province', n.get_str_value()),
            "tax_id": lambda n : setattr(self, 'tax_id', n.get_str_value()),
            "trade": lambda n : setattr(self, 'trade', n.get_str_value()),
            "website_url": lambda n : setattr(self, 'website_url', 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("address_line_1", self.address_line_1)
        writer.write_str_value("address_line_2", self.address_line_2)
        writer.write_str_value("city", self.city)
        writer.write_str_value("country", self.country)
        writer.write_str_value("description", self.description)
        writer.write_str_value("erp_id", self.erp_id)
        writer.write_uuid_value("id", self.id)
        writer.write_str_value("name", self.name)
        writer.write_str_value("phone", self.phone)
        writer.write_str_value("postal_code", self.postal_code)
        writer.write_str_value("state_or_province", self.state_or_province)
        writer.write_str_value("tax_id", self.tax_id)
        writer.write_str_value("trade", self.trade)
        writer.write_str_value("website_url", self.website_url)
    

