{-# 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.DomainTransferability
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53Domains.Types.DomainTransferability where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Domains.Types.Transferable

-- | A complex type that contains information about whether the specified
-- domain can be transferred to Route 53.
--
-- /See:/ 'newDomainTransferability' smart constructor.
data DomainTransferability = DomainTransferability'
  { DomainTransferability -> Maybe Transferable
transferable :: Prelude.Maybe Transferable
  }
  deriving (DomainTransferability -> DomainTransferability -> Bool
(DomainTransferability -> DomainTransferability -> Bool)
-> (DomainTransferability -> DomainTransferability -> Bool)
-> Eq DomainTransferability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainTransferability -> DomainTransferability -> Bool
$c/= :: DomainTransferability -> DomainTransferability -> Bool
== :: DomainTransferability -> DomainTransferability -> Bool
$c== :: DomainTransferability -> DomainTransferability -> Bool
Prelude.Eq, ReadPrec [DomainTransferability]
ReadPrec DomainTransferability
Int -> ReadS DomainTransferability
ReadS [DomainTransferability]
(Int -> ReadS DomainTransferability)
-> ReadS [DomainTransferability]
-> ReadPrec DomainTransferability
-> ReadPrec [DomainTransferability]
-> Read DomainTransferability
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainTransferability]
$creadListPrec :: ReadPrec [DomainTransferability]
readPrec :: ReadPrec DomainTransferability
$creadPrec :: ReadPrec DomainTransferability
readList :: ReadS [DomainTransferability]
$creadList :: ReadS [DomainTransferability]
readsPrec :: Int -> ReadS DomainTransferability
$creadsPrec :: Int -> ReadS DomainTransferability
Prelude.Read, Int -> DomainTransferability -> ShowS
[DomainTransferability] -> ShowS
DomainTransferability -> String
(Int -> DomainTransferability -> ShowS)
-> (DomainTransferability -> String)
-> ([DomainTransferability] -> ShowS)
-> Show DomainTransferability
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainTransferability] -> ShowS
$cshowList :: [DomainTransferability] -> ShowS
show :: DomainTransferability -> String
$cshow :: DomainTransferability -> String
showsPrec :: Int -> DomainTransferability -> ShowS
$cshowsPrec :: Int -> DomainTransferability -> ShowS
Prelude.Show, (forall x. DomainTransferability -> Rep DomainTransferability x)
-> (forall x. Rep DomainTransferability x -> DomainTransferability)
-> Generic DomainTransferability
forall x. Rep DomainTransferability x -> DomainTransferability
forall x. DomainTransferability -> Rep DomainTransferability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainTransferability x -> DomainTransferability
$cfrom :: forall x. DomainTransferability -> Rep DomainTransferability x
Prelude.Generic)

-- |
-- Create a value of 'DomainTransferability' 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:
--
-- 'transferable', 'domainTransferability_transferable' - Undocumented member.
newDomainTransferability ::
  DomainTransferability
newDomainTransferability :: DomainTransferability
newDomainTransferability =
  DomainTransferability' :: Maybe Transferable -> DomainTransferability
DomainTransferability'
    { $sel:transferable:DomainTransferability' :: Maybe Transferable
transferable =
        Maybe Transferable
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
domainTransferability_transferable :: Lens.Lens' DomainTransferability (Prelude.Maybe Transferable)
domainTransferability_transferable :: (Maybe Transferable -> f (Maybe Transferable))
-> DomainTransferability -> f DomainTransferability
domainTransferability_transferable = (DomainTransferability -> Maybe Transferable)
-> (DomainTransferability
    -> Maybe Transferable -> DomainTransferability)
-> Lens
     DomainTransferability
     DomainTransferability
     (Maybe Transferable)
     (Maybe Transferable)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainTransferability' {Maybe Transferable
transferable :: Maybe Transferable
$sel:transferable:DomainTransferability' :: DomainTransferability -> Maybe Transferable
transferable} -> Maybe Transferable
transferable) (\s :: DomainTransferability
s@DomainTransferability' {} Maybe Transferable
a -> DomainTransferability
s {$sel:transferable:DomainTransferability' :: Maybe Transferable
transferable = Maybe Transferable
a} :: DomainTransferability)

instance Core.FromJSON DomainTransferability where
  parseJSON :: Value -> Parser DomainTransferability
parseJSON =
    String
-> (Object -> Parser DomainTransferability)
-> Value
-> Parser DomainTransferability
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DomainTransferability"
      ( \Object
x ->
          Maybe Transferable -> DomainTransferability
DomainTransferability'
            (Maybe Transferable -> DomainTransferability)
-> Parser (Maybe Transferable) -> Parser DomainTransferability
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Transferable)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Transferable")
      )

instance Prelude.Hashable DomainTransferability

instance Prelude.NFData DomainTransferability