# 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 neurograph.v1.models.reports_public_branding import ReportsPublicBranding
from typing import Optional, Set
from typing_extensions import Self

class ReportsPublicReportResponse(BaseModel):
    """
    ReportsPublicReportResponse
    """ # noqa: E501
    branding: Optional[ReportsPublicBranding] = Field(default=None, description="Organization branding")
    call_to_action: Optional[StrictStr] = None
    client_name: Optional[StrictStr] = Field(default=None, description="Client info")
    embed_url: Optional[StrictStr] = None
    error: Optional[StrictStr] = Field(default=None, description="Error message for non-200 responses")
    executive_summary: Optional[StrictStr] = Field(default=None, description="AI-generated summary")
    id: Optional[StrictStr] = Field(default=None, description="Report data")
    key_highlights: Optional[List[StrictStr]] = None
    key_stats: Optional[List[StrictInt]] = None
    linked_concepts: Optional[List[StrictStr]] = Field(default=None, description="Existing metadata")
    linked_themes: Optional[List[StrictStr]] = None
    main_insights: Optional[List[StrictStr]] = None
    name: Optional[StrictStr] = None
    og_image_url: Optional[StrictStr] = Field(default=None, description="OG Image URL for social sharing")
    report_type: Optional[StrictStr] = None
    report_type_label: Optional[StrictStr] = None
    thumbnail_url: Optional[StrictStr] = None
    ts_created: Optional[StrictStr] = None
    __properties: ClassVar[List[str]] = ["branding", "call_to_action", "client_name", "embed_url", "error", "executive_summary", "id", "key_highlights", "key_stats", "linked_concepts", "linked_themes", "main_insights", "name", "og_image_url", "report_type", "report_type_label", "thumbnail_url", "ts_created"]

    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 ReportsPublicReportResponse 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,
        )
        # override the default output from pydantic by calling `to_dict()` of branding
        if self.branding:
            _dict['branding'] = self.branding.to_dict()
        return _dict

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

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

        _obj = cls.model_validate({
            "branding": ReportsPublicBranding.from_dict(obj["branding"]) if obj.get("branding") is not None else None,
            "call_to_action": obj.get("call_to_action"),
            "client_name": obj.get("client_name"),
            "embed_url": obj.get("embed_url"),
            "error": obj.get("error"),
            "executive_summary": obj.get("executive_summary"),
            "id": obj.get("id"),
            "key_highlights": obj.get("key_highlights"),
            "key_stats": obj.get("key_stats"),
            "linked_concepts": obj.get("linked_concepts"),
            "linked_themes": obj.get("linked_themes"),
            "main_insights": obj.get("main_insights"),
            "name": obj.get("name"),
            "og_image_url": obj.get("og_image_url"),
            "report_type": obj.get("report_type"),
            "report_type_label": obj.get("report_type_label"),
            "thumbnail_url": obj.get("thumbnail_url"),
            "ts_created": obj.get("ts_created")
        })
        return _obj


