{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.Route53Domains.Types.DomainSuggestion
-- 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.DomainSuggestion where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Information about one suggested domain name.
--
-- /See:/ 'newDomainSuggestion' smart constructor.
data DomainSuggestion = DomainSuggestion'
  { -- | Whether the domain name is available for registering.
    --
    -- You can register only the domains that are designated as @AVAILABLE@.
    --
    -- Valid values:
    --
    -- [AVAILABLE]
    --     The domain name is available.
    --
    -- [AVAILABLE_RESERVED]
    --     The domain name is reserved under specific conditions.
    --
    -- [AVAILABLE_PREORDER]
    --     The domain name is available and can be preordered.
    --
    -- [DONT_KNOW]
    --     The TLD registry didn\'t reply with a definitive answer about
    --     whether the domain name is available. Route 53 can return this
    --     response for a variety of reasons, for example, the registry is
    --     performing maintenance. Try again later.
    --
    -- [PENDING]
    --     The TLD registry didn\'t return a response in the expected amount of
    --     time. When the response is delayed, it usually takes just a few
    --     extra seconds. You can resubmit the request immediately.
    --
    -- [RESERVED]
    --     The domain name has been reserved for another person or
    --     organization.
    --
    -- [UNAVAILABLE]
    --     The domain name is not available.
    --
    -- [UNAVAILABLE_PREMIUM]
    --     The domain name is not available.
    --
    -- [UNAVAILABLE_RESTRICTED]
    --     The domain name is forbidden.
    DomainSuggestion -> Maybe Text
availability :: Prelude.Maybe Prelude.Text,
    -- | A suggested domain name.
    DomainSuggestion -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text
  }
  deriving (DomainSuggestion -> DomainSuggestion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainSuggestion -> DomainSuggestion -> Bool
$c/= :: DomainSuggestion -> DomainSuggestion -> Bool
== :: DomainSuggestion -> DomainSuggestion -> Bool
$c== :: DomainSuggestion -> DomainSuggestion -> Bool
Prelude.Eq, ReadPrec [DomainSuggestion]
ReadPrec DomainSuggestion
Int -> ReadS DomainSuggestion
ReadS [DomainSuggestion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainSuggestion]
$creadListPrec :: ReadPrec [DomainSuggestion]
readPrec :: ReadPrec DomainSuggestion
$creadPrec :: ReadPrec DomainSuggestion
readList :: ReadS [DomainSuggestion]
$creadList :: ReadS [DomainSuggestion]
readsPrec :: Int -> ReadS DomainSuggestion
$creadsPrec :: Int -> ReadS DomainSuggestion
Prelude.Read, Int -> DomainSuggestion -> ShowS
[DomainSuggestion] -> ShowS
DomainSuggestion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainSuggestion] -> ShowS
$cshowList :: [DomainSuggestion] -> ShowS
show :: DomainSuggestion -> String
$cshow :: DomainSuggestion -> String
showsPrec :: Int -> DomainSuggestion -> ShowS
$cshowsPrec :: Int -> DomainSuggestion -> ShowS
Prelude.Show, forall x. Rep DomainSuggestion x -> DomainSuggestion
forall x. DomainSuggestion -> Rep DomainSuggestion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainSuggestion x -> DomainSuggestion
$cfrom :: forall x. DomainSuggestion -> Rep DomainSuggestion x
Prelude.Generic)

-- |
-- Create a value of 'DomainSuggestion' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'availability', 'domainSuggestion_availability' - Whether the domain name is available for registering.
--
-- You can register only the domains that are designated as @AVAILABLE@.
--
-- Valid values:
--
-- [AVAILABLE]
--     The domain name is available.
--
-- [AVAILABLE_RESERVED]
--     The domain name is reserved under specific conditions.
--
-- [AVAILABLE_PREORDER]
--     The domain name is available and can be preordered.
--
-- [DONT_KNOW]
--     The TLD registry didn\'t reply with a definitive answer about
--     whether the domain name is available. Route 53 can return this
--     response for a variety of reasons, for example, the registry is
--     performing maintenance. Try again later.
--
-- [PENDING]
--     The TLD registry didn\'t return a response in the expected amount of
--     time. When the response is delayed, it usually takes just a few
--     extra seconds. You can resubmit the request immediately.
--
-- [RESERVED]
--     The domain name has been reserved for another person or
--     organization.
--
-- [UNAVAILABLE]
--     The domain name is not available.
--
-- [UNAVAILABLE_PREMIUM]
--     The domain name is not available.
--
-- [UNAVAILABLE_RESTRICTED]
--     The domain name is forbidden.
--
-- 'domainName', 'domainSuggestion_domainName' - A suggested domain name.
newDomainSuggestion ::
  DomainSuggestion
newDomainSuggestion :: DomainSuggestion
newDomainSuggestion =
  DomainSuggestion'
    { $sel:availability:DomainSuggestion' :: Maybe Text
availability = forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:DomainSuggestion' :: Maybe Text
domainName = forall a. Maybe a
Prelude.Nothing
    }

-- | Whether the domain name is available for registering.
--
-- You can register only the domains that are designated as @AVAILABLE@.
--
-- Valid values:
--
-- [AVAILABLE]
--     The domain name is available.
--
-- [AVAILABLE_RESERVED]
--     The domain name is reserved under specific conditions.
--
-- [AVAILABLE_PREORDER]
--     The domain name is available and can be preordered.
--
-- [DONT_KNOW]
--     The TLD registry didn\'t reply with a definitive answer about
--     whether the domain name is available. Route 53 can return this
--     response for a variety of reasons, for example, the registry is
--     performing maintenance. Try again later.
--
-- [PENDING]
--     The TLD registry didn\'t return a response in the expected amount of
--     time. When the response is delayed, it usually takes just a few
--     extra seconds. You can resubmit the request immediately.
--
-- [RESERVED]
--     The domain name has been reserved for another person or
--     organization.
--
-- [UNAVAILABLE]
--     The domain name is not available.
--
-- [UNAVAILABLE_PREMIUM]
--     The domain name is not available.
--
-- [UNAVAILABLE_RESTRICTED]
--     The domain name is forbidden.
domainSuggestion_availability :: Lens.Lens' DomainSuggestion (Prelude.Maybe Prelude.Text)
domainSuggestion_availability :: Lens' DomainSuggestion (Maybe Text)
domainSuggestion_availability = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainSuggestion' {Maybe Text
availability :: Maybe Text
$sel:availability:DomainSuggestion' :: DomainSuggestion -> Maybe Text
availability} -> Maybe Text
availability) (\s :: DomainSuggestion
s@DomainSuggestion' {} Maybe Text
a -> DomainSuggestion
s {$sel:availability:DomainSuggestion' :: Maybe Text
availability = Maybe Text
a} :: DomainSuggestion)

-- | A suggested domain name.
domainSuggestion_domainName :: Lens.Lens' DomainSuggestion (Prelude.Maybe Prelude.Text)
domainSuggestion_domainName :: Lens' DomainSuggestion (Maybe Text)
domainSuggestion_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainSuggestion' {Maybe Text
domainName :: Maybe Text
$sel:domainName:DomainSuggestion' :: DomainSuggestion -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: DomainSuggestion
s@DomainSuggestion' {} Maybe Text
a -> DomainSuggestion
s {$sel:domainName:DomainSuggestion' :: Maybe Text
domainName = Maybe Text
a} :: DomainSuggestion)

instance Data.FromJSON DomainSuggestion where
  parseJSON :: Value -> Parser DomainSuggestion
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DomainSuggestion"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> DomainSuggestion
DomainSuggestion'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Availability")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DomainName")
      )

instance Prelude.Hashable DomainSuggestion where
  hashWithSalt :: Int -> DomainSuggestion -> Int
hashWithSalt Int
_salt DomainSuggestion' {Maybe Text
domainName :: Maybe Text
availability :: Maybe Text
$sel:domainName:DomainSuggestion' :: DomainSuggestion -> Maybe Text
$sel:availability:DomainSuggestion' :: DomainSuggestion -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availability
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainName

instance Prelude.NFData DomainSuggestion where
  rnf :: DomainSuggestion -> ()
rnf DomainSuggestion' {Maybe Text
domainName :: Maybe Text
availability :: Maybe Text
$sel:domainName:DomainSuggestion' :: DomainSuggestion -> Maybe Text
$sel:availability:DomainSuggestion' :: DomainSuggestion -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availability
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainName