# coding: utf-8

"""
    Mixpeek API

    This is the Mixpeek API, providing access to various endpoints for data processing and retrieval.

    The version of the OpenAPI document: 0.82
    Contact: info@mixpeek.com
    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, StrictInt
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class ReminderPreferences(BaseModel):
    """
    User preferences for reminder/nudge emails.
    """ # noqa: E501
    enabled: Optional[StrictBool] = Field(default=True, description="Master toggle for all reminder emails")
    onboarding_nudges: Optional[StrictBool] = Field(default=True, description="Funnel progression nudges")
    engagement_reminders: Optional[StrictBool] = Field(default=True, description="Re-engagement emails for inactivity")
    feature_tips: Optional[StrictBool] = Field(default=True, description="Helpful tips and inspiration")
    quiet_hours_start: Optional[StrictInt] = Field(default=None, description="Hour (0-23) to start quiet period (UTC)")
    quiet_hours_end: Optional[StrictInt] = Field(default=None, description="Hour (0-23) to end quiet period (UTC)")
    __properties: ClassVar[List[str]] = ["enabled", "onboarding_nudges", "engagement_reminders", "feature_tips", "quiet_hours_start", "quiet_hours_end"]

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

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

        _obj = cls.model_validate({
            "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
            "onboarding_nudges": obj.get("onboarding_nudges") if obj.get("onboarding_nudges") is not None else True,
            "engagement_reminders": obj.get("engagement_reminders") if obj.get("engagement_reminders") is not None else True,
            "feature_tips": obj.get("feature_tips") if obj.get("feature_tips") is not None else True,
            "quiet_hours_start": obj.get("quiet_hours_start"),
            "quiet_hours_end": obj.get("quiet_hours_end")
        })
        return _obj


