{-# 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.Route53.GetDNSSEC
(
GetDNSSEC (..),
newGetDNSSEC,
getDNSSEC_hostedZoneId,
GetDNSSECResponse (..),
newGetDNSSECResponse,
getDNSSECResponse_httpStatus,
getDNSSECResponse_status,
getDNSSECResponse_keySigningKeys,
)
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.Route53.Types
data GetDNSSEC = GetDNSSEC'
{
GetDNSSEC -> ResourceId
hostedZoneId :: ResourceId
}
deriving (GetDNSSEC -> GetDNSSEC -> Bool
(GetDNSSEC -> GetDNSSEC -> Bool)
-> (GetDNSSEC -> GetDNSSEC -> Bool) -> Eq GetDNSSEC
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDNSSEC -> GetDNSSEC -> Bool
$c/= :: GetDNSSEC -> GetDNSSEC -> Bool
== :: GetDNSSEC -> GetDNSSEC -> Bool
$c== :: GetDNSSEC -> GetDNSSEC -> Bool
Prelude.Eq, ReadPrec [GetDNSSEC]
ReadPrec GetDNSSEC
Int -> ReadS GetDNSSEC
ReadS [GetDNSSEC]
(Int -> ReadS GetDNSSEC)
-> ReadS [GetDNSSEC]
-> ReadPrec GetDNSSEC
-> ReadPrec [GetDNSSEC]
-> Read GetDNSSEC
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDNSSEC]
$creadListPrec :: ReadPrec [GetDNSSEC]
readPrec :: ReadPrec GetDNSSEC
$creadPrec :: ReadPrec GetDNSSEC
readList :: ReadS [GetDNSSEC]
$creadList :: ReadS [GetDNSSEC]
readsPrec :: Int -> ReadS GetDNSSEC
$creadsPrec :: Int -> ReadS GetDNSSEC
Prelude.Read, Int -> GetDNSSEC -> ShowS
[GetDNSSEC] -> ShowS
GetDNSSEC -> String
(Int -> GetDNSSEC -> ShowS)
-> (GetDNSSEC -> String)
-> ([GetDNSSEC] -> ShowS)
-> Show GetDNSSEC
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDNSSEC] -> ShowS
$cshowList :: [GetDNSSEC] -> ShowS
show :: GetDNSSEC -> String
$cshow :: GetDNSSEC -> String
showsPrec :: Int -> GetDNSSEC -> ShowS
$cshowsPrec :: Int -> GetDNSSEC -> ShowS
Prelude.Show, (forall x. GetDNSSEC -> Rep GetDNSSEC x)
-> (forall x. Rep GetDNSSEC x -> GetDNSSEC) -> Generic GetDNSSEC
forall x. Rep GetDNSSEC x -> GetDNSSEC
forall x. GetDNSSEC -> Rep GetDNSSEC x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDNSSEC x -> GetDNSSEC
$cfrom :: forall x. GetDNSSEC -> Rep GetDNSSEC x
Prelude.Generic)
newGetDNSSEC ::
ResourceId ->
GetDNSSEC
newGetDNSSEC :: ResourceId -> GetDNSSEC
newGetDNSSEC ResourceId
pHostedZoneId_ =
GetDNSSEC' :: ResourceId -> GetDNSSEC
GetDNSSEC' {$sel:hostedZoneId:GetDNSSEC' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_}
getDNSSEC_hostedZoneId :: Lens.Lens' GetDNSSEC ResourceId
getDNSSEC_hostedZoneId :: (ResourceId -> f ResourceId) -> GetDNSSEC -> f GetDNSSEC
getDNSSEC_hostedZoneId = (GetDNSSEC -> ResourceId)
-> (GetDNSSEC -> ResourceId -> GetDNSSEC)
-> Lens GetDNSSEC GetDNSSEC ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDNSSEC' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:GetDNSSEC' :: GetDNSSEC -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: GetDNSSEC
s@GetDNSSEC' {} ResourceId
a -> GetDNSSEC
s {$sel:hostedZoneId:GetDNSSEC' :: ResourceId
hostedZoneId = ResourceId
a} :: GetDNSSEC)
instance Core.AWSRequest GetDNSSEC where
type AWSResponse GetDNSSEC = GetDNSSECResponse
request :: GetDNSSEC -> Request GetDNSSEC
request = Service -> GetDNSSEC -> Request GetDNSSEC
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetDNSSEC
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDNSSEC)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetDNSSEC))
-> Logger
-> Service
-> Proxy GetDNSSEC
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDNSSEC)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> DNSSECStatus -> [KeySigningKey] -> GetDNSSECResponse
GetDNSSECResponse'
(Int -> DNSSECStatus -> [KeySigningKey] -> GetDNSSECResponse)
-> Either String Int
-> Either
String (DNSSECStatus -> [KeySigningKey] -> GetDNSSECResponse)
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 (DNSSECStatus -> [KeySigningKey] -> GetDNSSECResponse)
-> Either String DNSSECStatus
-> Either String ([KeySigningKey] -> GetDNSSECResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String DNSSECStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")
Either String ([KeySigningKey] -> GetDNSSECResponse)
-> Either String [KeySigningKey] -> Either String GetDNSSECResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"KeySigningKeys" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String [KeySigningKey])
-> Either String [KeySigningKey]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [KeySigningKey]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
)
)
instance Prelude.Hashable GetDNSSEC
instance Prelude.NFData GetDNSSEC
instance Core.ToHeaders GetDNSSEC where
toHeaders :: GetDNSSEC -> ResponseHeaders
toHeaders = ResponseHeaders -> GetDNSSEC -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetDNSSEC where
toPath :: GetDNSSEC -> ByteString
toPath GetDNSSEC' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:GetDNSSEC' :: GetDNSSEC -> ResourceId
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2013-04-01/hostedzone/",
ResourceId -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ResourceId
hostedZoneId,
ByteString
"/dnssec"
]
instance Core.ToQuery GetDNSSEC where
toQuery :: GetDNSSEC -> QueryString
toQuery = QueryString -> GetDNSSEC -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetDNSSECResponse = GetDNSSECResponse'
{
GetDNSSECResponse -> Int
httpStatus :: Prelude.Int,
GetDNSSECResponse -> DNSSECStatus
status :: DNSSECStatus,
GetDNSSECResponse -> [KeySigningKey]
keySigningKeys :: [KeySigningKey]
}
deriving (GetDNSSECResponse -> GetDNSSECResponse -> Bool
(GetDNSSECResponse -> GetDNSSECResponse -> Bool)
-> (GetDNSSECResponse -> GetDNSSECResponse -> Bool)
-> Eq GetDNSSECResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDNSSECResponse -> GetDNSSECResponse -> Bool
$c/= :: GetDNSSECResponse -> GetDNSSECResponse -> Bool
== :: GetDNSSECResponse -> GetDNSSECResponse -> Bool
$c== :: GetDNSSECResponse -> GetDNSSECResponse -> Bool
Prelude.Eq, ReadPrec [GetDNSSECResponse]
ReadPrec GetDNSSECResponse
Int -> ReadS GetDNSSECResponse
ReadS [GetDNSSECResponse]
(Int -> ReadS GetDNSSECResponse)
-> ReadS [GetDNSSECResponse]
-> ReadPrec GetDNSSECResponse
-> ReadPrec [GetDNSSECResponse]
-> Read GetDNSSECResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDNSSECResponse]
$creadListPrec :: ReadPrec [GetDNSSECResponse]
readPrec :: ReadPrec GetDNSSECResponse
$creadPrec :: ReadPrec GetDNSSECResponse
readList :: ReadS [GetDNSSECResponse]
$creadList :: ReadS [GetDNSSECResponse]
readsPrec :: Int -> ReadS GetDNSSECResponse
$creadsPrec :: Int -> ReadS GetDNSSECResponse
Prelude.Read, Int -> GetDNSSECResponse -> ShowS
[GetDNSSECResponse] -> ShowS
GetDNSSECResponse -> String
(Int -> GetDNSSECResponse -> ShowS)
-> (GetDNSSECResponse -> String)
-> ([GetDNSSECResponse] -> ShowS)
-> Show GetDNSSECResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDNSSECResponse] -> ShowS
$cshowList :: [GetDNSSECResponse] -> ShowS
show :: GetDNSSECResponse -> String
$cshow :: GetDNSSECResponse -> String
showsPrec :: Int -> GetDNSSECResponse -> ShowS
$cshowsPrec :: Int -> GetDNSSECResponse -> ShowS
Prelude.Show, (forall x. GetDNSSECResponse -> Rep GetDNSSECResponse x)
-> (forall x. Rep GetDNSSECResponse x -> GetDNSSECResponse)
-> Generic GetDNSSECResponse
forall x. Rep GetDNSSECResponse x -> GetDNSSECResponse
forall x. GetDNSSECResponse -> Rep GetDNSSECResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDNSSECResponse x -> GetDNSSECResponse
$cfrom :: forall x. GetDNSSECResponse -> Rep GetDNSSECResponse x
Prelude.Generic)
newGetDNSSECResponse ::
Prelude.Int ->
DNSSECStatus ->
GetDNSSECResponse
newGetDNSSECResponse :: Int -> DNSSECStatus -> GetDNSSECResponse
newGetDNSSECResponse Int
pHttpStatus_ DNSSECStatus
pStatus_ =
GetDNSSECResponse' :: Int -> DNSSECStatus -> [KeySigningKey] -> GetDNSSECResponse
GetDNSSECResponse'
{ $sel:httpStatus:GetDNSSECResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:status:GetDNSSECResponse' :: DNSSECStatus
status = DNSSECStatus
pStatus_,
$sel:keySigningKeys:GetDNSSECResponse' :: [KeySigningKey]
keySigningKeys = [KeySigningKey]
forall a. Monoid a => a
Prelude.mempty
}
getDNSSECResponse_httpStatus :: Lens.Lens' GetDNSSECResponse Prelude.Int
getDNSSECResponse_httpStatus :: (Int -> f Int) -> GetDNSSECResponse -> f GetDNSSECResponse
getDNSSECResponse_httpStatus = (GetDNSSECResponse -> Int)
-> (GetDNSSECResponse -> Int -> GetDNSSECResponse)
-> Lens GetDNSSECResponse GetDNSSECResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDNSSECResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDNSSECResponse' :: GetDNSSECResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDNSSECResponse
s@GetDNSSECResponse' {} Int
a -> GetDNSSECResponse
s {$sel:httpStatus:GetDNSSECResponse' :: Int
httpStatus = Int
a} :: GetDNSSECResponse)
getDNSSECResponse_status :: Lens.Lens' GetDNSSECResponse DNSSECStatus
getDNSSECResponse_status :: (DNSSECStatus -> f DNSSECStatus)
-> GetDNSSECResponse -> f GetDNSSECResponse
getDNSSECResponse_status = (GetDNSSECResponse -> DNSSECStatus)
-> (GetDNSSECResponse -> DNSSECStatus -> GetDNSSECResponse)
-> Lens
GetDNSSECResponse GetDNSSECResponse DNSSECStatus DNSSECStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDNSSECResponse' {DNSSECStatus
status :: DNSSECStatus
$sel:status:GetDNSSECResponse' :: GetDNSSECResponse -> DNSSECStatus
status} -> DNSSECStatus
status) (\s :: GetDNSSECResponse
s@GetDNSSECResponse' {} DNSSECStatus
a -> GetDNSSECResponse
s {$sel:status:GetDNSSECResponse' :: DNSSECStatus
status = DNSSECStatus
a} :: GetDNSSECResponse)
getDNSSECResponse_keySigningKeys :: Lens.Lens' GetDNSSECResponse [KeySigningKey]
getDNSSECResponse_keySigningKeys :: ([KeySigningKey] -> f [KeySigningKey])
-> GetDNSSECResponse -> f GetDNSSECResponse
getDNSSECResponse_keySigningKeys = (GetDNSSECResponse -> [KeySigningKey])
-> (GetDNSSECResponse -> [KeySigningKey] -> GetDNSSECResponse)
-> Lens
GetDNSSECResponse GetDNSSECResponse [KeySigningKey] [KeySigningKey]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDNSSECResponse' {[KeySigningKey]
keySigningKeys :: [KeySigningKey]
$sel:keySigningKeys:GetDNSSECResponse' :: GetDNSSECResponse -> [KeySigningKey]
keySigningKeys} -> [KeySigningKey]
keySigningKeys) (\s :: GetDNSSECResponse
s@GetDNSSECResponse' {} [KeySigningKey]
a -> GetDNSSECResponse
s {$sel:keySigningKeys:GetDNSSECResponse' :: [KeySigningKey]
keySigningKeys = [KeySigningKey]
a} :: GetDNSSECResponse) (([KeySigningKey] -> f [KeySigningKey])
-> GetDNSSECResponse -> f GetDNSSECResponse)
-> (([KeySigningKey] -> f [KeySigningKey])
-> [KeySigningKey] -> f [KeySigningKey])
-> ([KeySigningKey] -> f [KeySigningKey])
-> GetDNSSECResponse
-> f GetDNSSECResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([KeySigningKey] -> f [KeySigningKey])
-> [KeySigningKey] -> f [KeySigningKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData GetDNSSECResponse