# coding: utf-8

"""
    Pinterest REST API

    Pinterest's REST API

    The version of the OpenAPI document: 5.23.0
    Contact: blah+oapicf@cliffano.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, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class BaseInviteDataResponseInviteData(BaseModel):
    """
    Metadata for the invite/request.
    """ # noqa: E501
    invite_expiration: Optional[StrictInt] = Field(default=None, description="The date and time when the invite/request will expire. Returned in milliseconds.")
    invite_status: Optional[StrictStr] = Field(default=None, description="The current status of the invite. The invite can be in one of the following states PENDING, ACCEPTED, DECLINED, CANCELLED, EXPIRED.")
    invite_type: Optional[StrictStr] = Field(default=None, description="The type of invite. <br>'MEMBER_INVITE' is to invite a member to access your business assets. <br>'PARTNER_INVITE' is to invite a partner to access your business assets. <br>'PARTNER_REQUEST' is to request access a partner's business assets.")
    last_updated_time: Optional[StrictInt] = Field(default=None, description="The date and time the invite/request was last updated. Returned in milliseconds.")
    sent_at: Optional[StrictInt] = Field(default=None, description="The date and time the invite/request was sent/created. Returned in milliseconds.")
    __properties: ClassVar[List[str]] = ["invite_expiration", "invite_status", "invite_type", "last_updated_time", "sent_at"]

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

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

        _obj = cls.model_validate({
            "invite_expiration": obj.get("invite_expiration"),
            "invite_status": obj.get("invite_status"),
            "invite_type": obj.get("invite_type"),
            "last_updated_time": obj.get("last_updated_time"),
            "sent_at": obj.get("sent_at")
        })
        return _obj


