{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53Domains.Types
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53Domains.Types
  ( -- * Service Configuration
    defaultService,

    -- * Errors
    _DnssecLimitExceeded,
    _DomainLimitExceeded,
    _DuplicateRequest,
    _InvalidInput,
    _OperationLimitExceeded,
    _TLDRulesViolation,
    _UnsupportedTLD,

    -- * ContactType
    ContactType (..),

    -- * CountryCode
    CountryCode (..),

    -- * DomainAvailability
    DomainAvailability (..),

    -- * ExtraParamName
    ExtraParamName (..),

    -- * ListDomainsAttributeName
    ListDomainsAttributeName (..),

    -- * ListOperationsSortAttributeName
    ListOperationsSortAttributeName (..),

    -- * OperationStatus
    OperationStatus (..),

    -- * OperationType
    OperationType (..),

    -- * Operator
    Operator (..),

    -- * ReachabilityStatus
    ReachabilityStatus (..),

    -- * SortOrder
    SortOrder (..),

    -- * StatusFlag
    StatusFlag (..),

    -- * Transferable
    Transferable (..),

    -- * BillingRecord
    BillingRecord (..),
    newBillingRecord,
    billingRecord_billDate,
    billingRecord_domainName,
    billingRecord_invoiceId,
    billingRecord_operation,
    billingRecord_price,

    -- * Consent
    Consent (..),
    newConsent,
    consent_maxPrice,
    consent_currency,

    -- * ContactDetail
    ContactDetail (..),
    newContactDetail,
    contactDetail_addressLine1,
    contactDetail_addressLine2,
    contactDetail_city,
    contactDetail_contactType,
    contactDetail_countryCode,
    contactDetail_email,
    contactDetail_extraParams,
    contactDetail_fax,
    contactDetail_firstName,
    contactDetail_lastName,
    contactDetail_organizationName,
    contactDetail_phoneNumber,
    contactDetail_state,
    contactDetail_zipCode,

    -- * DnssecKey
    DnssecKey (..),
    newDnssecKey,
    dnssecKey_algorithm,
    dnssecKey_digest,
    dnssecKey_digestType,
    dnssecKey_flags,
    dnssecKey_id,
    dnssecKey_keyTag,
    dnssecKey_publicKey,

    -- * DnssecSigningAttributes
    DnssecSigningAttributes (..),
    newDnssecSigningAttributes,
    dnssecSigningAttributes_algorithm,
    dnssecSigningAttributes_flags,
    dnssecSigningAttributes_publicKey,

    -- * DomainPrice
    DomainPrice (..),
    newDomainPrice,
    domainPrice_changeOwnershipPrice,
    domainPrice_name,
    domainPrice_registrationPrice,
    domainPrice_renewalPrice,
    domainPrice_restorationPrice,
    domainPrice_transferPrice,

    -- * DomainSuggestion
    DomainSuggestion (..),
    newDomainSuggestion,
    domainSuggestion_availability,
    domainSuggestion_domainName,

    -- * DomainSummary
    DomainSummary (..),
    newDomainSummary,
    domainSummary_autoRenew,
    domainSummary_domainName,
    domainSummary_expiry,
    domainSummary_transferLock,

    -- * DomainTransferability
    DomainTransferability (..),
    newDomainTransferability,
    domainTransferability_transferable,

    -- * ExtraParam
    ExtraParam (..),
    newExtraParam,
    extraParam_name,
    extraParam_value,

    -- * FilterCondition
    FilterCondition (..),
    newFilterCondition,
    filterCondition_name,
    filterCondition_operator,
    filterCondition_values,

    -- * Nameserver
    Nameserver (..),
    newNameserver,
    nameserver_glueIps,
    nameserver_name,

    -- * OperationSummary
    OperationSummary (..),
    newOperationSummary,
    operationSummary_domainName,
    operationSummary_lastUpdatedDate,
    operationSummary_message,
    operationSummary_operationId,
    operationSummary_status,
    operationSummary_statusFlag,
    operationSummary_submittedDate,
    operationSummary_type,

    -- * PriceWithCurrency
    PriceWithCurrency (..),
    newPriceWithCurrency,
    priceWithCurrency_price,
    priceWithCurrency_currency,

    -- * SortCondition
    SortCondition (..),
    newSortCondition,
    sortCondition_name,
    sortCondition_sortOrder,

    -- * Tag
    Tag (..),
    newTag,
    tag_key,
    tag_value,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Domains.Types.BillingRecord
import Amazonka.Route53Domains.Types.Consent
import Amazonka.Route53Domains.Types.ContactDetail
import Amazonka.Route53Domains.Types.ContactType
import Amazonka.Route53Domains.Types.CountryCode
import Amazonka.Route53Domains.Types.DnssecKey
import Amazonka.Route53Domains.Types.DnssecSigningAttributes
import Amazonka.Route53Domains.Types.DomainAvailability
import Amazonka.Route53Domains.Types.DomainPrice
import Amazonka.Route53Domains.Types.DomainSuggestion
import Amazonka.Route53Domains.Types.DomainSummary
import Amazonka.Route53Domains.Types.DomainTransferability
import Amazonka.Route53Domains.Types.ExtraParam
import Amazonka.Route53Domains.Types.ExtraParamName
import Amazonka.Route53Domains.Types.FilterCondition
import Amazonka.Route53Domains.Types.ListDomainsAttributeName
import Amazonka.Route53Domains.Types.ListOperationsSortAttributeName
import Amazonka.Route53Domains.Types.Nameserver
import Amazonka.Route53Domains.Types.OperationStatus
import Amazonka.Route53Domains.Types.OperationSummary
import Amazonka.Route53Domains.Types.OperationType
import Amazonka.Route53Domains.Types.Operator
import Amazonka.Route53Domains.Types.PriceWithCurrency
import Amazonka.Route53Domains.Types.ReachabilityStatus
import Amazonka.Route53Domains.Types.SortCondition
import Amazonka.Route53Domains.Types.SortOrder
import Amazonka.Route53Domains.Types.StatusFlag
import Amazonka.Route53Domains.Types.Tag
import Amazonka.Route53Domains.Types.Transferable
import qualified Amazonka.Sign.V4 as Sign

-- | API version @2014-05-15@ of the Amazon Route 53 Domains SDK configuration.
defaultService :: Core.Service
defaultService :: Service
defaultService =
  Core.Service
    { $sel:abbrev:Service :: Abbrev
Core.abbrev = Abbrev
"Route53Domains",
      $sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
      $sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"route53domains",
      $sel:signingName:Service :: ByteString
Core.signingName = ByteString
"route53domains",
      $sel:version:Service :: ByteString
Core.version = ByteString
"2014-05-15",
      $sel:s3AddressingStyle:Service :: S3AddressingStyle
Core.s3AddressingStyle = S3AddressingStyle
Core.S3AddressingStyleAuto,
      $sel:endpoint:Service :: Region -> Endpoint
Core.endpoint = Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
      $sel:timeout:Service :: Maybe Seconds
Core.timeout = forall a. a -> Maybe a
Prelude.Just Seconds
70,
      $sel:check:Service :: Status -> Bool
Core.check = Status -> Bool
Core.statusSuccess,
      $sel:error:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core.error = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"Route53Domains",
      $sel:retry:Service :: Retry
Core.retry = Retry
retry
    }
  where
    retry :: Retry
retry =
      Core.Exponential
        { $sel:base:Exponential :: Double
Core.base = Double
5.0e-2,
          $sel:growth:Exponential :: Int
Core.growth = Int
2,
          $sel:attempts:Exponential :: Int
Core.attempts = Int
5,
          $sel:check:Exponential :: ServiceError -> Maybe Text
Core.check = forall {a}. IsString a => ServiceError -> Maybe a
check
        }
    check :: ServiceError -> Maybe a
check ServiceError
e
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throttling"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
              ErrorCode
"ProvisionedThroughputExceededException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
      | Bool
Prelude.otherwise = forall a. Maybe a
Prelude.Nothing

-- | This error is returned if you call @AssociateDelegationSignerToDomain@
-- when the specified domain has reached the maximum number of DS records.
-- You can\'t add any additional DS records unless you delete an existing
-- one first.
_DnssecLimitExceeded :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_DnssecLimitExceeded :: forall a. AsError a => Fold a ServiceError
_DnssecLimitExceeded =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"DnssecLimitExceeded"

-- | The number of domains has exceeded the allowed threshold for the
-- account.
_DomainLimitExceeded :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_DomainLimitExceeded :: forall a. AsError a => Fold a ServiceError
_DomainLimitExceeded =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"DomainLimitExceeded"

-- | The request is already in progress for the domain.
_DuplicateRequest :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_DuplicateRequest :: forall a. AsError a => Fold a ServiceError
_DuplicateRequest =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"DuplicateRequest"

-- | The requested item is not acceptable. For example, for APIs that accept
-- a domain name, the request might specify a domain name that doesn\'t
-- belong to the account that submitted the request. For
-- @AcceptDomainTransferFromAnotherAwsAccount@, the password might be
-- invalid.
_InvalidInput :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_InvalidInput :: forall a. AsError a => Fold a ServiceError
_InvalidInput =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"InvalidInput"

-- | The number of operations or jobs running exceeded the allowed threshold
-- for the account.
_OperationLimitExceeded :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_OperationLimitExceeded :: forall a. AsError a => Fold a ServiceError
_OperationLimitExceeded =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"OperationLimitExceeded"

-- | The top-level domain does not support this operation.
_TLDRulesViolation :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_TLDRulesViolation :: forall a. AsError a => Fold a ServiceError
_TLDRulesViolation =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"TLDRulesViolation"

-- | Amazon Route 53 does not support this top-level domain (TLD).
_UnsupportedTLD :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_UnsupportedTLD :: forall a. AsError a => Fold a ServiceError
_UnsupportedTLD =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"UnsupportedTLD"