# coding: utf-8

"""
    YouTube Data API v3

    The YouTube Data API v3 is an API that provides access to YouTube data, such as videos, playlists, and channels.

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

class ChannelSettings(BaseModel):
    """
    Branding properties for the channel view.
    """ # noqa: E501
    country: Optional[StrictStr] = Field(default=None, description="The country of the channel.")
    default_language: Optional[StrictStr] = Field(default=None, alias="defaultLanguage")
    default_tab: Optional[StrictStr] = Field(default=None, description="Which content tab users should see when viewing the channel.", alias="defaultTab")
    description: Optional[StrictStr] = Field(default=None, description="Specifies the channel description.")
    featured_channels_title: Optional[StrictStr] = Field(default=None, description="Title for the featured channels tab.", alias="featuredChannelsTitle")
    featured_channels_urls: Optional[List[StrictStr]] = Field(default=None, description="The list of featured channels.", alias="featuredChannelsUrls")
    keywords: Optional[StrictStr] = Field(default=None, description="Lists keywords associated with the channel, comma-separated.")
    moderate_comments: Optional[StrictBool] = Field(default=None, description="Whether user-submitted comments left on the channel page need to be approved by the channel owner to be publicly visible.", alias="moderateComments")
    profile_color: Optional[StrictStr] = Field(default=None, description="A prominent color that can be rendered on this channel page.", alias="profileColor")
    show_browse_view: Optional[StrictBool] = Field(default=None, description="Whether the tab to browse the videos should be displayed.", alias="showBrowseView")
    show_related_channels: Optional[StrictBool] = Field(default=None, description="Whether related channels should be proposed.", alias="showRelatedChannels")
    title: Optional[StrictStr] = Field(default=None, description="Specifies the channel title.")
    tracking_analytics_account_id: Optional[StrictStr] = Field(default=None, description="The ID for a Google Analytics account to track and measure traffic to the channels.", alias="trackingAnalyticsAccountId")
    unsubscribed_trailer: Optional[StrictStr] = Field(default=None, description="The trailer of the channel, for users that are not subscribers.", alias="unsubscribedTrailer")
    __properties: ClassVar[List[str]] = ["country", "defaultLanguage", "defaultTab", "description", "featuredChannelsTitle", "featuredChannelsUrls", "keywords", "moderateComments", "profileColor", "showBrowseView", "showRelatedChannels", "title", "trackingAnalyticsAccountId", "unsubscribedTrailer"]

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

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

        _obj = cls.model_validate({
            "country": obj.get("country"),
            "defaultLanguage": obj.get("defaultLanguage"),
            "defaultTab": obj.get("defaultTab"),
            "description": obj.get("description"),
            "featuredChannelsTitle": obj.get("featuredChannelsTitle"),
            "featuredChannelsUrls": obj.get("featuredChannelsUrls"),
            "keywords": obj.get("keywords"),
            "moderateComments": obj.get("moderateComments"),
            "profileColor": obj.get("profileColor"),
            "showBrowseView": obj.get("showBrowseView"),
            "showRelatedChannels": obj.get("showRelatedChannels"),
            "title": obj.get("title"),
            "trackingAnalyticsAccountId": obj.get("trackingAnalyticsAccountId"),
            "unsubscribedTrailer": obj.get("unsubscribedTrailer")
        })
        return _obj


