# coding: utf-8

"""
    Test Results API

    Get test result metrics for Network and Application Synthetics tests.

    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 DnsResponseCode(str, Enum):
    """
    DNS response code (RCODE), including extended RCODE values (RFC 1035 and RFC 6891).
    """

    """
    allowed enum values
    """
    NOERROR = 'noerror'
    FORMERR = 'formerr'
    SERVFAIL = 'servfail'
    NXDOMAIN = 'nxdomain'
    NOTIMP = 'notimp'
    REFUSED = 'refused'
    YXDOMAIN = 'yxdomain'
    YXRRSET = 'yxrrset'
    NXRRSET = 'nxrrset'
    NOTAUTH = 'notauth'
    NOTZONE = 'notzone'
    UNKNOWN_MINUS_11 = 'unknown-11'
    UNKNOWN_MINUS_12 = 'unknown-12'
    UNKNOWN_MINUS_13 = 'unknown-13'
    UNKNOWN_MINUS_14 = 'unknown-14'
    UNKNOWN_MINUS_15 = 'unknown-15'
    BADVERS = 'badvers'
    BADKEY = 'badkey'
    BADTIME = 'badtime'
    BADMODE = 'badmode'
    BADNAME = 'badname'
    BADALG = 'badalg'
    BADTRUNC = 'badtrunc'
    BADCOOKIE = 'badcookie'
    UNKNOWN = 'unknown'

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

    @classmethod
    def _missing_(cls, value):
        """Handle unknown values"""
        return cls.UNKNOWN

