# coding: utf-8

"""
    Canva Connect API

    API for building integrations with Canva via a REST api

    The version of the OpenAPI document: latest
    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 ErrorCode(str, Enum):
    """
    A short string indicating what failed. This field can be used to handle errors programmatically. 
    """

    """
    allowed enum values
    """
    INTERNAL_ERROR = 'internal_error'
    INVALID_FIELD = 'invalid_field'
    INVALID_HEADER_VALUE = 'invalid_header_value'
    PERMISSION_DENIED = 'permission_denied'
    TOO_MANY_REQUESTS = 'too_many_requests'
    NOT_FOUND = 'not_found'
    BAD_REQUEST_BODY = 'bad_request_body'
    BAD_HTTP_METHOD = 'bad_http_method'
    BAD_REQUEST_PARAMS = 'bad_request_params'
    BAD_QUERY_PARAMS = 'bad_query_params'
    ENDPOINT_NOT_FOUND = 'endpoint_not_found'
    UNSUPPORTED_VERSION = 'unsupported_version'
    INVALID_ACCESS_TOKEN = 'invalid_access_token'
    REVOKED_ACCESS_TOKEN = 'revoked_access_token'
    MISSING_FIELD = 'missing_field'
    MISSING_SCOPE = 'missing_scope'
    INVALID_GRANT = 'invalid_grant'
    INVALID_REQUEST = 'invalid_request'
    INVALID_CLIENT = 'invalid_client'
    UNAUTHORIZED_CLIENT = 'unauthorized_client'
    UNSUPPORTED_GRANT_TYPE = 'unsupported_grant_type'
    INVALID_SCOPE = 'invalid_scope'
    INVALID_BASIC_HEADER = 'invalid_basic_header'
    INVALID_FILE_FORMAT = 'invalid_file_format'
    QUOTA_EXCEEDED = 'quota_exceeded'
    UNSUPPORTED_CONTENT_TYPE = 'unsupported_content_type'
    REQUEST_TOO_LARGE = 'request_too_large'
    FOLDER_NOT_FOUND = 'folder_not_found'
    ITEM_IN_MULTIPLE_FOLDERS = 'item_in_multiple_folders'
    ASSET_NOT_FOUND = 'asset_not_found'
    MAX_LIMIT_REACHED = 'max_limit_reached'
    PERMISSION_NOT_FOUND = 'permission_not_found'
    PERMISSION_EXISTS = 'permission_exists'
    UNAUTHORIZED_USER = 'unauthorized_user'
    USER_NOT_FOUND = 'user_not_found'
    GROUP_NOT_FOUND = 'group_not_found'
    APP_NOT_FOUND = 'app_not_found'
    CONTENT_NOT_FOUND = 'content_not_found'
    DOCTYPE_NOT_FOUND = 'doctype_not_found'
    DESIGN_NOT_FOUND = 'design_not_found'
    OFFSET_TOO_LARGE = 'offset_too_large'
    PAGE_NOT_FOUND = 'page_not_found'
    DESIGN_OR_COMMENT_NOT_FOUND = 'design_or_comment_not_found'
    DESIGN_TYPE_NOT_FOUND = 'design_type_not_found'
    TEAM_NOT_FOUND = 'team_not_found'
    COMMENT_NOT_FOUND = 'comment_not_found'
    TOO_MANY_COMMENTS = 'too_many_comments'
    TOO_MANY_REPLIES = 'too_many_replies'
    MESSAGE_TOO_LONG = 'message_too_long'
    DESIGN_NOT_FILLABLE = 'design_not_fillable'
    AUTOFILL_DATA_INVALID = 'autofill_data_invalid'
    FEATURE_NOT_AVAILABLE = 'feature_not_available'
    LICENSE_REQUIRED = 'license_required'

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


