# 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, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class LiveBroadcastStatus(BaseModel):
    """
    Live broadcast state.
    """ # noqa: E501
    life_cycle_status: Optional[StrictStr] = Field(default=None, description="The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method.", alias="lifeCycleStatus")
    live_broadcast_priority: Optional[StrictStr] = Field(default=None, description="Priority of the live broadcast event (internal state).", alias="liveBroadcastPriority")
    made_for_kids: Optional[StrictBool] = Field(default=None, description="Whether the broadcast is made for kids or not, decided by YouTube instead of the creator. This field is read only.", alias="madeForKids")
    privacy_status: Optional[StrictStr] = Field(default=None, description="The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource.", alias="privacyStatus")
    recording_status: Optional[StrictStr] = Field(default=None, description="The broadcast's recording status.", alias="recordingStatus")
    self_declared_made_for_kids: Optional[StrictBool] = Field(default=None, description="This field will be set to True if the creator declares the broadcast to be kids only: go/live-cw-work.", alias="selfDeclaredMadeForKids")
    __properties: ClassVar[List[str]] = ["lifeCycleStatus", "liveBroadcastPriority", "madeForKids", "privacyStatus", "recordingStatus", "selfDeclaredMadeForKids"]

    @field_validator('life_cycle_status')
    def life_cycle_status_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['lifeCycleStatusUnspecified', 'created', 'ready', 'testing', 'live', 'complete', 'revoked', 'testStarting', 'liveStarting']):
            raise ValueError("must be one of enum values ('lifeCycleStatusUnspecified', 'created', 'ready', 'testing', 'live', 'complete', 'revoked', 'testStarting', 'liveStarting')")
        return value

    @field_validator('live_broadcast_priority')
    def live_broadcast_priority_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['liveBroadcastPriorityUnspecified', 'low', 'normal', 'high']):
            raise ValueError("must be one of enum values ('liveBroadcastPriorityUnspecified', 'low', 'normal', 'high')")
        return value

    @field_validator('privacy_status')
    def privacy_status_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['public', 'unlisted', 'private']):
            raise ValueError("must be one of enum values ('public', 'unlisted', 'private')")
        return value

    @field_validator('recording_status')
    def recording_status_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set(['liveBroadcastRecordingStatusUnspecified', 'notRecording', 'recording', 'recorded']):
            raise ValueError("must be one of enum values ('liveBroadcastRecordingStatusUnspecified', 'notRecording', 'recording', 'recorded')")
        return value

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

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

        _obj = cls.model_validate({
            "lifeCycleStatus": obj.get("lifeCycleStatus"),
            "liveBroadcastPriority": obj.get("liveBroadcastPriority"),
            "madeForKids": obj.get("madeForKids"),
            "privacyStatus": obj.get("privacyStatus"),
            "recordingStatus": obj.get("recordingStatus"),
            "selfDeclaredMadeForKids": obj.get("selfDeclaredMadeForKids")
        })
        return _obj


