{-# 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.EnableDomainAutoRenew
(
EnableDomainAutoRenew (..),
newEnableDomainAutoRenew,
enableDomainAutoRenew_domainName,
EnableDomainAutoRenewResponse (..),
newEnableDomainAutoRenewResponse,
enableDomainAutoRenewResponse_httpStatus,
)
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 EnableDomainAutoRenew = EnableDomainAutoRenew'
{
EnableDomainAutoRenew -> Text
domainName :: Prelude.Text
}
deriving (EnableDomainAutoRenew -> EnableDomainAutoRenew -> Bool
(EnableDomainAutoRenew -> EnableDomainAutoRenew -> Bool)
-> (EnableDomainAutoRenew -> EnableDomainAutoRenew -> Bool)
-> Eq EnableDomainAutoRenew
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableDomainAutoRenew -> EnableDomainAutoRenew -> Bool
$c/= :: EnableDomainAutoRenew -> EnableDomainAutoRenew -> Bool
== :: EnableDomainAutoRenew -> EnableDomainAutoRenew -> Bool
$c== :: EnableDomainAutoRenew -> EnableDomainAutoRenew -> Bool
Prelude.Eq, ReadPrec [EnableDomainAutoRenew]
ReadPrec EnableDomainAutoRenew
Int -> ReadS EnableDomainAutoRenew
ReadS [EnableDomainAutoRenew]
(Int -> ReadS EnableDomainAutoRenew)
-> ReadS [EnableDomainAutoRenew]
-> ReadPrec EnableDomainAutoRenew
-> ReadPrec [EnableDomainAutoRenew]
-> Read EnableDomainAutoRenew
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableDomainAutoRenew]
$creadListPrec :: ReadPrec [EnableDomainAutoRenew]
readPrec :: ReadPrec EnableDomainAutoRenew
$creadPrec :: ReadPrec EnableDomainAutoRenew
readList :: ReadS [EnableDomainAutoRenew]
$creadList :: ReadS [EnableDomainAutoRenew]
readsPrec :: Int -> ReadS EnableDomainAutoRenew
$creadsPrec :: Int -> ReadS EnableDomainAutoRenew
Prelude.Read, Int -> EnableDomainAutoRenew -> ShowS
[EnableDomainAutoRenew] -> ShowS
EnableDomainAutoRenew -> String
(Int -> EnableDomainAutoRenew -> ShowS)
-> (EnableDomainAutoRenew -> String)
-> ([EnableDomainAutoRenew] -> ShowS)
-> Show EnableDomainAutoRenew
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableDomainAutoRenew] -> ShowS
$cshowList :: [EnableDomainAutoRenew] -> ShowS
show :: EnableDomainAutoRenew -> String
$cshow :: EnableDomainAutoRenew -> String
showsPrec :: Int -> EnableDomainAutoRenew -> ShowS
$cshowsPrec :: Int -> EnableDomainAutoRenew -> ShowS
Prelude.Show, (forall x. EnableDomainAutoRenew -> Rep EnableDomainAutoRenew x)
-> (forall x. Rep EnableDomainAutoRenew x -> EnableDomainAutoRenew)
-> Generic EnableDomainAutoRenew
forall x. Rep EnableDomainAutoRenew x -> EnableDomainAutoRenew
forall x. EnableDomainAutoRenew -> Rep EnableDomainAutoRenew x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableDomainAutoRenew x -> EnableDomainAutoRenew
$cfrom :: forall x. EnableDomainAutoRenew -> Rep EnableDomainAutoRenew x
Prelude.Generic)
newEnableDomainAutoRenew ::
Prelude.Text ->
EnableDomainAutoRenew
newEnableDomainAutoRenew :: Text -> EnableDomainAutoRenew
newEnableDomainAutoRenew Text
pDomainName_ =
EnableDomainAutoRenew' :: Text -> EnableDomainAutoRenew
EnableDomainAutoRenew' {$sel:domainName:EnableDomainAutoRenew' :: Text
domainName = Text
pDomainName_}
enableDomainAutoRenew_domainName :: Lens.Lens' EnableDomainAutoRenew Prelude.Text
enableDomainAutoRenew_domainName :: (Text -> f Text)
-> EnableDomainAutoRenew -> f EnableDomainAutoRenew
enableDomainAutoRenew_domainName = (EnableDomainAutoRenew -> Text)
-> (EnableDomainAutoRenew -> Text -> EnableDomainAutoRenew)
-> Lens EnableDomainAutoRenew EnableDomainAutoRenew Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableDomainAutoRenew' {Text
domainName :: Text
$sel:domainName:EnableDomainAutoRenew' :: EnableDomainAutoRenew -> Text
domainName} -> Text
domainName) (\s :: EnableDomainAutoRenew
s@EnableDomainAutoRenew' {} Text
a -> EnableDomainAutoRenew
s {$sel:domainName:EnableDomainAutoRenew' :: Text
domainName = Text
a} :: EnableDomainAutoRenew)
instance Core.AWSRequest EnableDomainAutoRenew where
type
AWSResponse EnableDomainAutoRenew =
EnableDomainAutoRenewResponse
request :: EnableDomainAutoRenew -> Request EnableDomainAutoRenew
request = Service -> EnableDomainAutoRenew -> Request EnableDomainAutoRenew
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy EnableDomainAutoRenew
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableDomainAutoRenew)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse EnableDomainAutoRenew))
-> Logger
-> Service
-> Proxy EnableDomainAutoRenew
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableDomainAutoRenew)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> EnableDomainAutoRenewResponse
EnableDomainAutoRenewResponse'
(Int -> EnableDomainAutoRenewResponse)
-> Either String Int -> Either String EnableDomainAutoRenewResponse
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))
)
instance Prelude.Hashable EnableDomainAutoRenew
instance Prelude.NFData EnableDomainAutoRenew
instance Core.ToHeaders EnableDomainAutoRenew where
toHeaders :: EnableDomainAutoRenew -> ResponseHeaders
toHeaders =
ResponseHeaders -> EnableDomainAutoRenew -> 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.EnableDomainAutoRenew" ::
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 EnableDomainAutoRenew where
toJSON :: EnableDomainAutoRenew -> Value
toJSON EnableDomainAutoRenew' {Text
domainName :: Text
$sel:domainName:EnableDomainAutoRenew' :: EnableDomainAutoRenew -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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 EnableDomainAutoRenew where
toPath :: EnableDomainAutoRenew -> ByteString
toPath = ByteString -> EnableDomainAutoRenew -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery EnableDomainAutoRenew where
toQuery :: EnableDomainAutoRenew -> QueryString
toQuery = QueryString -> EnableDomainAutoRenew -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data EnableDomainAutoRenewResponse = EnableDomainAutoRenewResponse'
{
EnableDomainAutoRenewResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableDomainAutoRenewResponse
-> EnableDomainAutoRenewResponse -> Bool
(EnableDomainAutoRenewResponse
-> EnableDomainAutoRenewResponse -> Bool)
-> (EnableDomainAutoRenewResponse
-> EnableDomainAutoRenewResponse -> Bool)
-> Eq EnableDomainAutoRenewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableDomainAutoRenewResponse
-> EnableDomainAutoRenewResponse -> Bool
$c/= :: EnableDomainAutoRenewResponse
-> EnableDomainAutoRenewResponse -> Bool
== :: EnableDomainAutoRenewResponse
-> EnableDomainAutoRenewResponse -> Bool
$c== :: EnableDomainAutoRenewResponse
-> EnableDomainAutoRenewResponse -> Bool
Prelude.Eq, ReadPrec [EnableDomainAutoRenewResponse]
ReadPrec EnableDomainAutoRenewResponse
Int -> ReadS EnableDomainAutoRenewResponse
ReadS [EnableDomainAutoRenewResponse]
(Int -> ReadS EnableDomainAutoRenewResponse)
-> ReadS [EnableDomainAutoRenewResponse]
-> ReadPrec EnableDomainAutoRenewResponse
-> ReadPrec [EnableDomainAutoRenewResponse]
-> Read EnableDomainAutoRenewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableDomainAutoRenewResponse]
$creadListPrec :: ReadPrec [EnableDomainAutoRenewResponse]
readPrec :: ReadPrec EnableDomainAutoRenewResponse
$creadPrec :: ReadPrec EnableDomainAutoRenewResponse
readList :: ReadS [EnableDomainAutoRenewResponse]
$creadList :: ReadS [EnableDomainAutoRenewResponse]
readsPrec :: Int -> ReadS EnableDomainAutoRenewResponse
$creadsPrec :: Int -> ReadS EnableDomainAutoRenewResponse
Prelude.Read, Int -> EnableDomainAutoRenewResponse -> ShowS
[EnableDomainAutoRenewResponse] -> ShowS
EnableDomainAutoRenewResponse -> String
(Int -> EnableDomainAutoRenewResponse -> ShowS)
-> (EnableDomainAutoRenewResponse -> String)
-> ([EnableDomainAutoRenewResponse] -> ShowS)
-> Show EnableDomainAutoRenewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableDomainAutoRenewResponse] -> ShowS
$cshowList :: [EnableDomainAutoRenewResponse] -> ShowS
show :: EnableDomainAutoRenewResponse -> String
$cshow :: EnableDomainAutoRenewResponse -> String
showsPrec :: Int -> EnableDomainAutoRenewResponse -> ShowS
$cshowsPrec :: Int -> EnableDomainAutoRenewResponse -> ShowS
Prelude.Show, (forall x.
EnableDomainAutoRenewResponse
-> Rep EnableDomainAutoRenewResponse x)
-> (forall x.
Rep EnableDomainAutoRenewResponse x
-> EnableDomainAutoRenewResponse)
-> Generic EnableDomainAutoRenewResponse
forall x.
Rep EnableDomainAutoRenewResponse x
-> EnableDomainAutoRenewResponse
forall x.
EnableDomainAutoRenewResponse
-> Rep EnableDomainAutoRenewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableDomainAutoRenewResponse x
-> EnableDomainAutoRenewResponse
$cfrom :: forall x.
EnableDomainAutoRenewResponse
-> Rep EnableDomainAutoRenewResponse x
Prelude.Generic)
newEnableDomainAutoRenewResponse ::
Prelude.Int ->
EnableDomainAutoRenewResponse
newEnableDomainAutoRenewResponse :: Int -> EnableDomainAutoRenewResponse
newEnableDomainAutoRenewResponse Int
pHttpStatus_ =
EnableDomainAutoRenewResponse' :: Int -> EnableDomainAutoRenewResponse
EnableDomainAutoRenewResponse'
{ $sel:httpStatus:EnableDomainAutoRenewResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
enableDomainAutoRenewResponse_httpStatus :: Lens.Lens' EnableDomainAutoRenewResponse Prelude.Int
enableDomainAutoRenewResponse_httpStatus :: (Int -> f Int)
-> EnableDomainAutoRenewResponse -> f EnableDomainAutoRenewResponse
enableDomainAutoRenewResponse_httpStatus = (EnableDomainAutoRenewResponse -> Int)
-> (EnableDomainAutoRenewResponse
-> Int -> EnableDomainAutoRenewResponse)
-> Lens
EnableDomainAutoRenewResponse EnableDomainAutoRenewResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableDomainAutoRenewResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableDomainAutoRenewResponse' :: EnableDomainAutoRenewResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EnableDomainAutoRenewResponse
s@EnableDomainAutoRenewResponse' {} Int
a -> EnableDomainAutoRenewResponse
s {$sel:httpStatus:EnableDomainAutoRenewResponse' :: Int
httpStatus = Int
a} :: EnableDomainAutoRenewResponse)
instance Prelude.NFData EnableDomainAutoRenewResponse