# 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 json
from enum import Enum
from typing_extensions import Self


class Granularity(str, Enum):
    """
    Specifies the time interval at which analytics data is broken down. Determines how metrics are grouped within the requested date range. **Note:** The `HOUR` enum no longer provides data for conversion metrics, but it still returns data for non-conversion metrics. All other enums are unchanged.
    """

    """
    allowed enum values
    """
    TOTAL = 'TOTAL'
    DAY = 'DAY'
    HOUR = 'HOUR'
    WEEK = 'WEEK'
    MONTH = 'MONTH'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of Granularity from a JSON string"""
        return cls(json.loads(json_str))


