{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Route53Domains.CheckDomainTransferability
(
CheckDomainTransferability (..),
newCheckDomainTransferability,
checkDomainTransferability_authCode,
checkDomainTransferability_domainName,
CheckDomainTransferabilityResponse (..),
newCheckDomainTransferabilityResponse,
checkDomainTransferabilityResponse_httpStatus,
checkDomainTransferabilityResponse_transferability,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53Domains.Types
data CheckDomainTransferability = CheckDomainTransferability'
{
CheckDomainTransferability -> Maybe (Sensitive Text)
authCode :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CheckDomainTransferability -> Text
domainName :: Prelude.Text
}
deriving (CheckDomainTransferability -> CheckDomainTransferability -> Bool
(CheckDomainTransferability -> CheckDomainTransferability -> Bool)
-> (CheckDomainTransferability
-> CheckDomainTransferability -> Bool)
-> Eq CheckDomainTransferability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckDomainTransferability -> CheckDomainTransferability -> Bool
$c/= :: CheckDomainTransferability -> CheckDomainTransferability -> Bool
== :: CheckDomainTransferability -> CheckDomainTransferability -> Bool
$c== :: CheckDomainTransferability -> CheckDomainTransferability -> Bool
Prelude.Eq, Int -> CheckDomainTransferability -> ShowS
[CheckDomainTransferability] -> ShowS
CheckDomainTransferability -> String
(Int -> CheckDomainTransferability -> ShowS)
-> (CheckDomainTransferability -> String)
-> ([CheckDomainTransferability] -> ShowS)
-> Show CheckDomainTransferability
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckDomainTransferability] -> ShowS
$cshowList :: [CheckDomainTransferability] -> ShowS
show :: CheckDomainTransferability -> String
$cshow :: CheckDomainTransferability -> String
showsPrec :: Int -> CheckDomainTransferability -> ShowS
$cshowsPrec :: Int -> CheckDomainTransferability -> ShowS
Prelude.Show, (forall x.
CheckDomainTransferability -> Rep CheckDomainTransferability x)
-> (forall x.
Rep CheckDomainTransferability x -> CheckDomainTransferability)
-> Generic CheckDomainTransferability
forall x.
Rep CheckDomainTransferability x -> CheckDomainTransferability
forall x.
CheckDomainTransferability -> Rep CheckDomainTransferability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CheckDomainTransferability x -> CheckDomainTransferability
$cfrom :: forall x.
CheckDomainTransferability -> Rep CheckDomainTransferability x
Prelude.Generic)
newCheckDomainTransferability ::
Prelude.Text ->
CheckDomainTransferability
newCheckDomainTransferability :: Text -> CheckDomainTransferability
newCheckDomainTransferability Text
pDomainName_ =
CheckDomainTransferability' :: Maybe (Sensitive Text) -> Text -> CheckDomainTransferability
CheckDomainTransferability'
{ $sel:authCode:CheckDomainTransferability' :: Maybe (Sensitive Text)
authCode =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:CheckDomainTransferability' :: Text
domainName = Text
pDomainName_
}
checkDomainTransferability_authCode :: Lens.Lens' CheckDomainTransferability (Prelude.Maybe Prelude.Text)
checkDomainTransferability_authCode :: (Maybe Text -> f (Maybe Text))
-> CheckDomainTransferability -> f CheckDomainTransferability
checkDomainTransferability_authCode = (CheckDomainTransferability -> Maybe (Sensitive Text))
-> (CheckDomainTransferability
-> Maybe (Sensitive Text) -> CheckDomainTransferability)
-> Lens
CheckDomainTransferability
CheckDomainTransferability
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDomainTransferability' {Maybe (Sensitive Text)
authCode :: Maybe (Sensitive Text)
$sel:authCode:CheckDomainTransferability' :: CheckDomainTransferability -> Maybe (Sensitive Text)
authCode} -> Maybe (Sensitive Text)
authCode) (\s :: CheckDomainTransferability
s@CheckDomainTransferability' {} Maybe (Sensitive Text)
a -> CheckDomainTransferability
s {$sel:authCode:CheckDomainTransferability' :: Maybe (Sensitive Text)
authCode = Maybe (Sensitive Text)
a} :: CheckDomainTransferability) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CheckDomainTransferability -> f CheckDomainTransferability)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CheckDomainTransferability
-> f CheckDomainTransferability
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
checkDomainTransferability_domainName :: Lens.Lens' CheckDomainTransferability Prelude.Text
checkDomainTransferability_domainName :: (Text -> f Text)
-> CheckDomainTransferability -> f CheckDomainTransferability
checkDomainTransferability_domainName = (CheckDomainTransferability -> Text)
-> (CheckDomainTransferability
-> Text -> CheckDomainTransferability)
-> Lens
CheckDomainTransferability CheckDomainTransferability Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDomainTransferability' {Text
domainName :: Text
$sel:domainName:CheckDomainTransferability' :: CheckDomainTransferability -> Text
domainName} -> Text
domainName) (\s :: CheckDomainTransferability
s@CheckDomainTransferability' {} Text
a -> CheckDomainTransferability
s {$sel:domainName:CheckDomainTransferability' :: Text
domainName = Text
a} :: CheckDomainTransferability)
instance Core.AWSRequest CheckDomainTransferability where
type
AWSResponse CheckDomainTransferability =
CheckDomainTransferabilityResponse
request :: CheckDomainTransferability -> Request CheckDomainTransferability
request = Service
-> CheckDomainTransferability -> Request CheckDomainTransferability
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CheckDomainTransferability
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CheckDomainTransferability)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CheckDomainTransferability))
-> Logger
-> Service
-> Proxy CheckDomainTransferability
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CheckDomainTransferability)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> DomainTransferability -> CheckDomainTransferabilityResponse
CheckDomainTransferabilityResponse'
(Int
-> DomainTransferability -> CheckDomainTransferabilityResponse)
-> Either String Int
-> Either
String
(DomainTransferability -> CheckDomainTransferabilityResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either
String
(DomainTransferability -> CheckDomainTransferabilityResponse)
-> Either String DomainTransferability
-> Either String CheckDomainTransferabilityResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DomainTransferability
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Transferability")
)
instance Prelude.Hashable CheckDomainTransferability
instance Prelude.NFData CheckDomainTransferability
instance Core.ToHeaders CheckDomainTransferability where
toHeaders :: CheckDomainTransferability -> ResponseHeaders
toHeaders =
ResponseHeaders -> CheckDomainTransferability -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Route53Domains_v20140515.CheckDomainTransferability" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CheckDomainTransferability where
toJSON :: CheckDomainTransferability -> Value
toJSON CheckDomainTransferability' {Maybe (Sensitive Text)
Text
domainName :: Text
authCode :: Maybe (Sensitive Text)
$sel:domainName:CheckDomainTransferability' :: CheckDomainTransferability -> Text
$sel:authCode:CheckDomainTransferability' :: CheckDomainTransferability -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AuthCode" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
authCode,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
]
)
instance Core.ToPath CheckDomainTransferability where
toPath :: CheckDomainTransferability -> ByteString
toPath = ByteString -> CheckDomainTransferability -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CheckDomainTransferability where
toQuery :: CheckDomainTransferability -> QueryString
toQuery = QueryString -> CheckDomainTransferability -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CheckDomainTransferabilityResponse = CheckDomainTransferabilityResponse'
{
CheckDomainTransferabilityResponse -> Int
httpStatus :: Prelude.Int,
CheckDomainTransferabilityResponse -> DomainTransferability
transferability :: DomainTransferability
}
deriving (CheckDomainTransferabilityResponse
-> CheckDomainTransferabilityResponse -> Bool
(CheckDomainTransferabilityResponse
-> CheckDomainTransferabilityResponse -> Bool)
-> (CheckDomainTransferabilityResponse
-> CheckDomainTransferabilityResponse -> Bool)
-> Eq CheckDomainTransferabilityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckDomainTransferabilityResponse
-> CheckDomainTransferabilityResponse -> Bool
$c/= :: CheckDomainTransferabilityResponse
-> CheckDomainTransferabilityResponse -> Bool
== :: CheckDomainTransferabilityResponse
-> CheckDomainTransferabilityResponse -> Bool
$c== :: CheckDomainTransferabilityResponse
-> CheckDomainTransferabilityResponse -> Bool
Prelude.Eq, ReadPrec [CheckDomainTransferabilityResponse]
ReadPrec CheckDomainTransferabilityResponse
Int -> ReadS CheckDomainTransferabilityResponse
ReadS [CheckDomainTransferabilityResponse]
(Int -> ReadS CheckDomainTransferabilityResponse)
-> ReadS [CheckDomainTransferabilityResponse]
-> ReadPrec CheckDomainTransferabilityResponse
-> ReadPrec [CheckDomainTransferabilityResponse]
-> Read CheckDomainTransferabilityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckDomainTransferabilityResponse]
$creadListPrec :: ReadPrec [CheckDomainTransferabilityResponse]
readPrec :: ReadPrec CheckDomainTransferabilityResponse
$creadPrec :: ReadPrec CheckDomainTransferabilityResponse
readList :: ReadS [CheckDomainTransferabilityResponse]
$creadList :: ReadS [CheckDomainTransferabilityResponse]
readsPrec :: Int -> ReadS CheckDomainTransferabilityResponse
$creadsPrec :: Int -> ReadS CheckDomainTransferabilityResponse
Prelude.Read, Int -> CheckDomainTransferabilityResponse -> ShowS
[CheckDomainTransferabilityResponse] -> ShowS
CheckDomainTransferabilityResponse -> String
(Int -> CheckDomainTransferabilityResponse -> ShowS)
-> (CheckDomainTransferabilityResponse -> String)
-> ([CheckDomainTransferabilityResponse] -> ShowS)
-> Show CheckDomainTransferabilityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckDomainTransferabilityResponse] -> ShowS
$cshowList :: [CheckDomainTransferabilityResponse] -> ShowS
show :: CheckDomainTransferabilityResponse -> String
$cshow :: CheckDomainTransferabilityResponse -> String
showsPrec :: Int -> CheckDomainTransferabilityResponse -> ShowS
$cshowsPrec :: Int -> CheckDomainTransferabilityResponse -> ShowS
Prelude.Show, (forall x.
CheckDomainTransferabilityResponse
-> Rep CheckDomainTransferabilityResponse x)
-> (forall x.
Rep CheckDomainTransferabilityResponse x
-> CheckDomainTransferabilityResponse)
-> Generic CheckDomainTransferabilityResponse
forall x.
Rep CheckDomainTransferabilityResponse x
-> CheckDomainTransferabilityResponse
forall x.
CheckDomainTransferabilityResponse
-> Rep CheckDomainTransferabilityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CheckDomainTransferabilityResponse x
-> CheckDomainTransferabilityResponse
$cfrom :: forall x.
CheckDomainTransferabilityResponse
-> Rep CheckDomainTransferabilityResponse x
Prelude.Generic)
newCheckDomainTransferabilityResponse ::
Prelude.Int ->
DomainTransferability ->
CheckDomainTransferabilityResponse
newCheckDomainTransferabilityResponse :: Int -> DomainTransferability -> CheckDomainTransferabilityResponse
newCheckDomainTransferabilityResponse
Int
pHttpStatus_
DomainTransferability
pTransferability_ =
CheckDomainTransferabilityResponse' :: Int -> DomainTransferability -> CheckDomainTransferabilityResponse
CheckDomainTransferabilityResponse'
{ $sel:httpStatus:CheckDomainTransferabilityResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:transferability:CheckDomainTransferabilityResponse' :: DomainTransferability
transferability = DomainTransferability
pTransferability_
}
checkDomainTransferabilityResponse_httpStatus :: Lens.Lens' CheckDomainTransferabilityResponse Prelude.Int
checkDomainTransferabilityResponse_httpStatus :: (Int -> f Int)
-> CheckDomainTransferabilityResponse
-> f CheckDomainTransferabilityResponse
checkDomainTransferabilityResponse_httpStatus = (CheckDomainTransferabilityResponse -> Int)
-> (CheckDomainTransferabilityResponse
-> Int -> CheckDomainTransferabilityResponse)
-> Lens
CheckDomainTransferabilityResponse
CheckDomainTransferabilityResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDomainTransferabilityResponse' {Int
httpStatus :: Int
$sel:httpStatus:CheckDomainTransferabilityResponse' :: CheckDomainTransferabilityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CheckDomainTransferabilityResponse
s@CheckDomainTransferabilityResponse' {} Int
a -> CheckDomainTransferabilityResponse
s {$sel:httpStatus:CheckDomainTransferabilityResponse' :: Int
httpStatus = Int
a} :: CheckDomainTransferabilityResponse)
checkDomainTransferabilityResponse_transferability :: Lens.Lens' CheckDomainTransferabilityResponse DomainTransferability
checkDomainTransferabilityResponse_transferability :: (DomainTransferability -> f DomainTransferability)
-> CheckDomainTransferabilityResponse
-> f CheckDomainTransferabilityResponse
checkDomainTransferabilityResponse_transferability = (CheckDomainTransferabilityResponse -> DomainTransferability)
-> (CheckDomainTransferabilityResponse
-> DomainTransferability -> CheckDomainTransferabilityResponse)
-> Lens
CheckDomainTransferabilityResponse
CheckDomainTransferabilityResponse
DomainTransferability
DomainTransferability
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckDomainTransferabilityResponse' {DomainTransferability
transferability :: DomainTransferability
$sel:transferability:CheckDomainTransferabilityResponse' :: CheckDomainTransferabilityResponse -> DomainTransferability
transferability} -> DomainTransferability
transferability) (\s :: CheckDomainTransferabilityResponse
s@CheckDomainTransferabilityResponse' {} DomainTransferability
a -> CheckDomainTransferabilityResponse
s {$sel:transferability:CheckDomainTransferabilityResponse' :: DomainTransferability
transferability = DomainTransferability
a} :: CheckDomainTransferabilityResponse)
instance
Prelude.NFData
CheckDomainTransferabilityResponse