# coding: utf-8

"""
    Jellyfin API

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

    The version of the OpenAPI document: 10.11.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
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class ItemCounts(BaseModel):
    """
    Class LibrarySummary.
    """ # noqa: E501
    movie_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the movie count.", alias="MovieCount")
    series_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the series count.", alias="SeriesCount")
    episode_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the episode count.", alias="EpisodeCount")
    artist_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the artist count.", alias="ArtistCount")
    program_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the program count.", alias="ProgramCount")
    trailer_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the trailer count.", alias="TrailerCount")
    song_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the song count.", alias="SongCount")
    album_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the album count.", alias="AlbumCount")
    music_video_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the music video count.", alias="MusicVideoCount")
    box_set_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the box set count.", alias="BoxSetCount")
    book_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the book count.", alias="BookCount")
    item_count: Optional[StrictInt] = Field(default=None, description="Gets or sets the item count.", alias="ItemCount")
    __properties: ClassVar[List[str]] = ["MovieCount", "SeriesCount", "EpisodeCount", "ArtistCount", "ProgramCount", "TrailerCount", "SongCount", "AlbumCount", "MusicVideoCount", "BoxSetCount", "BookCount", "ItemCount"]

    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 ItemCounts 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 ItemCounts from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "MovieCount": obj.get("MovieCount"),
            "SeriesCount": obj.get("SeriesCount"),
            "EpisodeCount": obj.get("EpisodeCount"),
            "ArtistCount": obj.get("ArtistCount"),
            "ProgramCount": obj.get("ProgramCount"),
            "TrailerCount": obj.get("TrailerCount"),
            "SongCount": obj.get("SongCount"),
            "AlbumCount": obj.get("AlbumCount"),
            "MusicVideoCount": obj.get("MusicVideoCount"),
            "BoxSetCount": obj.get("BoxSetCount"),
            "BookCount": obj.get("BookCount"),
            "ItemCount": obj.get("ItemCount")
        })
        return _obj


