# coding: utf-8

"""
    Neurograph Core

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

    The version of the OpenAPI document: 1.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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class KnowledgeOrderQuery(BaseModel):
    """
    KnowledgeOrderQuery
    """ # noqa: E501
    billing_address_hash: Optional[StrictStr] = None
    channel: Optional[StrictStr] = None
    client_id: Optional[StrictStr] = Field(default=None, description="required")
    currency: Optional[StrictStr] = None
    customer_entity_id: Optional[StrictStr] = None
    email_at_order: Optional[StrictStr] = None
    ext_order_id: Optional[StrictStr] = None
    ext_order_number: Optional[StrictStr] = None
    ext_store_id: Optional[StrictStr] = None
    financial_status: Optional[StrictStr] = None
    fulfillment_status: Optional[StrictStr] = None
    limit: Optional[StrictInt] = None
    offset: Optional[StrictInt] = None
    phone_at_order: Optional[StrictStr] = None
    placed_from: Optional[StrictStr] = Field(default=None, description="raw string ISO-8601")
    placed_to: Optional[StrictStr] = None
    shipping_address_hash: Optional[StrictStr] = None
    source_name: Optional[StrictStr] = None
    status: Optional[StrictStr] = None
    store_entity_id: Optional[StrictStr] = None
    total_max: Optional[StrictStr] = None
    total_min: Optional[StrictStr] = None
    __properties: ClassVar[List[str]] = ["billing_address_hash", "channel", "client_id", "currency", "customer_entity_id", "email_at_order", "ext_order_id", "ext_order_number", "ext_store_id", "financial_status", "fulfillment_status", "limit", "offset", "phone_at_order", "placed_from", "placed_to", "shipping_address_hash", "source_name", "status", "store_entity_id", "total_max", "total_min"]

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


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of KnowledgeOrderQuery from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    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,
        )
        return _dict

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

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

        _obj = cls.model_validate({
            "billing_address_hash": obj.get("billing_address_hash"),
            "channel": obj.get("channel"),
            "client_id": obj.get("client_id"),
            "currency": obj.get("currency"),
            "customer_entity_id": obj.get("customer_entity_id"),
            "email_at_order": obj.get("email_at_order"),
            "ext_order_id": obj.get("ext_order_id"),
            "ext_order_number": obj.get("ext_order_number"),
            "ext_store_id": obj.get("ext_store_id"),
            "financial_status": obj.get("financial_status"),
            "fulfillment_status": obj.get("fulfillment_status"),
            "limit": obj.get("limit"),
            "offset": obj.get("offset"),
            "phone_at_order": obj.get("phone_at_order"),
            "placed_from": obj.get("placed_from"),
            "placed_to": obj.get("placed_to"),
            "shipping_address_hash": obj.get("shipping_address_hash"),
            "source_name": obj.get("source_name"),
            "status": obj.get("status"),
            "store_entity_id": obj.get("store_entity_id"),
            "total_max": obj.get("total_max"),
            "total_min": obj.get("total_min")
        })
        return _obj


