{-# 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.RDS.DescribeDBSnapshotAttributes
(
DescribeDBSnapshotAttributes (..),
newDescribeDBSnapshotAttributes,
describeDBSnapshotAttributes_dbSnapshotIdentifier,
DescribeDBSnapshotAttributesResponse (..),
newDescribeDBSnapshotAttributesResponse,
describeDBSnapshotAttributesResponse_dbSnapshotAttributesResult,
describeDBSnapshotAttributesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeDBSnapshotAttributes = DescribeDBSnapshotAttributes'
{
DescribeDBSnapshotAttributes -> Text
dbSnapshotIdentifier :: Prelude.Text
}
deriving (DescribeDBSnapshotAttributes
-> DescribeDBSnapshotAttributes -> Bool
(DescribeDBSnapshotAttributes
-> DescribeDBSnapshotAttributes -> Bool)
-> (DescribeDBSnapshotAttributes
-> DescribeDBSnapshotAttributes -> Bool)
-> Eq DescribeDBSnapshotAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBSnapshotAttributes
-> DescribeDBSnapshotAttributes -> Bool
$c/= :: DescribeDBSnapshotAttributes
-> DescribeDBSnapshotAttributes -> Bool
== :: DescribeDBSnapshotAttributes
-> DescribeDBSnapshotAttributes -> Bool
$c== :: DescribeDBSnapshotAttributes
-> DescribeDBSnapshotAttributes -> Bool
Prelude.Eq, ReadPrec [DescribeDBSnapshotAttributes]
ReadPrec DescribeDBSnapshotAttributes
Int -> ReadS DescribeDBSnapshotAttributes
ReadS [DescribeDBSnapshotAttributes]
(Int -> ReadS DescribeDBSnapshotAttributes)
-> ReadS [DescribeDBSnapshotAttributes]
-> ReadPrec DescribeDBSnapshotAttributes
-> ReadPrec [DescribeDBSnapshotAttributes]
-> Read DescribeDBSnapshotAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBSnapshotAttributes]
$creadListPrec :: ReadPrec [DescribeDBSnapshotAttributes]
readPrec :: ReadPrec DescribeDBSnapshotAttributes
$creadPrec :: ReadPrec DescribeDBSnapshotAttributes
readList :: ReadS [DescribeDBSnapshotAttributes]
$creadList :: ReadS [DescribeDBSnapshotAttributes]
readsPrec :: Int -> ReadS DescribeDBSnapshotAttributes
$creadsPrec :: Int -> ReadS DescribeDBSnapshotAttributes
Prelude.Read, Int -> DescribeDBSnapshotAttributes -> ShowS
[DescribeDBSnapshotAttributes] -> ShowS
DescribeDBSnapshotAttributes -> String
(Int -> DescribeDBSnapshotAttributes -> ShowS)
-> (DescribeDBSnapshotAttributes -> String)
-> ([DescribeDBSnapshotAttributes] -> ShowS)
-> Show DescribeDBSnapshotAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBSnapshotAttributes] -> ShowS
$cshowList :: [DescribeDBSnapshotAttributes] -> ShowS
show :: DescribeDBSnapshotAttributes -> String
$cshow :: DescribeDBSnapshotAttributes -> String
showsPrec :: Int -> DescribeDBSnapshotAttributes -> ShowS
$cshowsPrec :: Int -> DescribeDBSnapshotAttributes -> ShowS
Prelude.Show, (forall x.
DescribeDBSnapshotAttributes -> Rep DescribeDBSnapshotAttributes x)
-> (forall x.
Rep DescribeDBSnapshotAttributes x -> DescribeDBSnapshotAttributes)
-> Generic DescribeDBSnapshotAttributes
forall x.
Rep DescribeDBSnapshotAttributes x -> DescribeDBSnapshotAttributes
forall x.
DescribeDBSnapshotAttributes -> Rep DescribeDBSnapshotAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBSnapshotAttributes x -> DescribeDBSnapshotAttributes
$cfrom :: forall x.
DescribeDBSnapshotAttributes -> Rep DescribeDBSnapshotAttributes x
Prelude.Generic)
newDescribeDBSnapshotAttributes ::
Prelude.Text ->
DescribeDBSnapshotAttributes
newDescribeDBSnapshotAttributes :: Text -> DescribeDBSnapshotAttributes
newDescribeDBSnapshotAttributes
Text
pDBSnapshotIdentifier_ =
DescribeDBSnapshotAttributes' :: Text -> DescribeDBSnapshotAttributes
DescribeDBSnapshotAttributes'
{ $sel:dbSnapshotIdentifier:DescribeDBSnapshotAttributes' :: Text
dbSnapshotIdentifier =
Text
pDBSnapshotIdentifier_
}
describeDBSnapshotAttributes_dbSnapshotIdentifier :: Lens.Lens' DescribeDBSnapshotAttributes Prelude.Text
describeDBSnapshotAttributes_dbSnapshotIdentifier :: (Text -> f Text)
-> DescribeDBSnapshotAttributes -> f DescribeDBSnapshotAttributes
describeDBSnapshotAttributes_dbSnapshotIdentifier = (DescribeDBSnapshotAttributes -> Text)
-> (DescribeDBSnapshotAttributes
-> Text -> DescribeDBSnapshotAttributes)
-> Lens
DescribeDBSnapshotAttributes DescribeDBSnapshotAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshotAttributes' {Text
dbSnapshotIdentifier :: Text
$sel:dbSnapshotIdentifier:DescribeDBSnapshotAttributes' :: DescribeDBSnapshotAttributes -> Text
dbSnapshotIdentifier} -> Text
dbSnapshotIdentifier) (\s :: DescribeDBSnapshotAttributes
s@DescribeDBSnapshotAttributes' {} Text
a -> DescribeDBSnapshotAttributes
s {$sel:dbSnapshotIdentifier:DescribeDBSnapshotAttributes' :: Text
dbSnapshotIdentifier = Text
a} :: DescribeDBSnapshotAttributes)
instance Core.AWSRequest DescribeDBSnapshotAttributes where
type
AWSResponse DescribeDBSnapshotAttributes =
DescribeDBSnapshotAttributesResponse
request :: DescribeDBSnapshotAttributes
-> Request DescribeDBSnapshotAttributes
request = Service
-> DescribeDBSnapshotAttributes
-> Request DescribeDBSnapshotAttributes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDBSnapshotAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDBSnapshotAttributes)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeDBSnapshotAttributes))
-> Logger
-> Service
-> Proxy DescribeDBSnapshotAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDBSnapshotAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DescribeDBSnapshotAttributesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBSnapshotAttributesResult
-> Int -> DescribeDBSnapshotAttributesResponse
DescribeDBSnapshotAttributesResponse'
(Maybe DBSnapshotAttributesResult
-> Int -> DescribeDBSnapshotAttributesResponse)
-> Either String (Maybe DBSnapshotAttributesResult)
-> Either String (Int -> DescribeDBSnapshotAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBSnapshotAttributesResult)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBSnapshotAttributesResult")
Either String (Int -> DescribeDBSnapshotAttributesResponse)
-> Either String Int
-> Either String DescribeDBSnapshotAttributesResponse
forall (f :: * -> *) a b. Applicative f => 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
DescribeDBSnapshotAttributes
instance Prelude.NFData DescribeDBSnapshotAttributes
instance Core.ToHeaders DescribeDBSnapshotAttributes where
toHeaders :: DescribeDBSnapshotAttributes -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeDBSnapshotAttributes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeDBSnapshotAttributes where
toPath :: DescribeDBSnapshotAttributes -> ByteString
toPath = ByteString -> DescribeDBSnapshotAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeDBSnapshotAttributes where
toQuery :: DescribeDBSnapshotAttributes -> QueryString
toQuery DescribeDBSnapshotAttributes' {Text
dbSnapshotIdentifier :: Text
$sel:dbSnapshotIdentifier:DescribeDBSnapshotAttributes' :: DescribeDBSnapshotAttributes -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DescribeDBSnapshotAttributes" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"DBSnapshotIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbSnapshotIdentifier
]
data DescribeDBSnapshotAttributesResponse = DescribeDBSnapshotAttributesResponse'
{ DescribeDBSnapshotAttributesResponse
-> Maybe DBSnapshotAttributesResult
dbSnapshotAttributesResult :: Prelude.Maybe DBSnapshotAttributesResult,
DescribeDBSnapshotAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeDBSnapshotAttributesResponse
-> DescribeDBSnapshotAttributesResponse -> Bool
(DescribeDBSnapshotAttributesResponse
-> DescribeDBSnapshotAttributesResponse -> Bool)
-> (DescribeDBSnapshotAttributesResponse
-> DescribeDBSnapshotAttributesResponse -> Bool)
-> Eq DescribeDBSnapshotAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBSnapshotAttributesResponse
-> DescribeDBSnapshotAttributesResponse -> Bool
$c/= :: DescribeDBSnapshotAttributesResponse
-> DescribeDBSnapshotAttributesResponse -> Bool
== :: DescribeDBSnapshotAttributesResponse
-> DescribeDBSnapshotAttributesResponse -> Bool
$c== :: DescribeDBSnapshotAttributesResponse
-> DescribeDBSnapshotAttributesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDBSnapshotAttributesResponse]
ReadPrec DescribeDBSnapshotAttributesResponse
Int -> ReadS DescribeDBSnapshotAttributesResponse
ReadS [DescribeDBSnapshotAttributesResponse]
(Int -> ReadS DescribeDBSnapshotAttributesResponse)
-> ReadS [DescribeDBSnapshotAttributesResponse]
-> ReadPrec DescribeDBSnapshotAttributesResponse
-> ReadPrec [DescribeDBSnapshotAttributesResponse]
-> Read DescribeDBSnapshotAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBSnapshotAttributesResponse]
$creadListPrec :: ReadPrec [DescribeDBSnapshotAttributesResponse]
readPrec :: ReadPrec DescribeDBSnapshotAttributesResponse
$creadPrec :: ReadPrec DescribeDBSnapshotAttributesResponse
readList :: ReadS [DescribeDBSnapshotAttributesResponse]
$creadList :: ReadS [DescribeDBSnapshotAttributesResponse]
readsPrec :: Int -> ReadS DescribeDBSnapshotAttributesResponse
$creadsPrec :: Int -> ReadS DescribeDBSnapshotAttributesResponse
Prelude.Read, Int -> DescribeDBSnapshotAttributesResponse -> ShowS
[DescribeDBSnapshotAttributesResponse] -> ShowS
DescribeDBSnapshotAttributesResponse -> String
(Int -> DescribeDBSnapshotAttributesResponse -> ShowS)
-> (DescribeDBSnapshotAttributesResponse -> String)
-> ([DescribeDBSnapshotAttributesResponse] -> ShowS)
-> Show DescribeDBSnapshotAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBSnapshotAttributesResponse] -> ShowS
$cshowList :: [DescribeDBSnapshotAttributesResponse] -> ShowS
show :: DescribeDBSnapshotAttributesResponse -> String
$cshow :: DescribeDBSnapshotAttributesResponse -> String
showsPrec :: Int -> DescribeDBSnapshotAttributesResponse -> ShowS
$cshowsPrec :: Int -> DescribeDBSnapshotAttributesResponse -> ShowS
Prelude.Show, (forall x.
DescribeDBSnapshotAttributesResponse
-> Rep DescribeDBSnapshotAttributesResponse x)
-> (forall x.
Rep DescribeDBSnapshotAttributesResponse x
-> DescribeDBSnapshotAttributesResponse)
-> Generic DescribeDBSnapshotAttributesResponse
forall x.
Rep DescribeDBSnapshotAttributesResponse x
-> DescribeDBSnapshotAttributesResponse
forall x.
DescribeDBSnapshotAttributesResponse
-> Rep DescribeDBSnapshotAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBSnapshotAttributesResponse x
-> DescribeDBSnapshotAttributesResponse
$cfrom :: forall x.
DescribeDBSnapshotAttributesResponse
-> Rep DescribeDBSnapshotAttributesResponse x
Prelude.Generic)
newDescribeDBSnapshotAttributesResponse ::
Prelude.Int ->
DescribeDBSnapshotAttributesResponse
newDescribeDBSnapshotAttributesResponse :: Int -> DescribeDBSnapshotAttributesResponse
newDescribeDBSnapshotAttributesResponse Int
pHttpStatus_ =
DescribeDBSnapshotAttributesResponse' :: Maybe DBSnapshotAttributesResult
-> Int -> DescribeDBSnapshotAttributesResponse
DescribeDBSnapshotAttributesResponse'
{ $sel:dbSnapshotAttributesResult:DescribeDBSnapshotAttributesResponse' :: Maybe DBSnapshotAttributesResult
dbSnapshotAttributesResult =
Maybe DBSnapshotAttributesResult
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeDBSnapshotAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeDBSnapshotAttributesResponse_dbSnapshotAttributesResult :: Lens.Lens' DescribeDBSnapshotAttributesResponse (Prelude.Maybe DBSnapshotAttributesResult)
describeDBSnapshotAttributesResponse_dbSnapshotAttributesResult :: (Maybe DBSnapshotAttributesResult
-> f (Maybe DBSnapshotAttributesResult))
-> DescribeDBSnapshotAttributesResponse
-> f DescribeDBSnapshotAttributesResponse
describeDBSnapshotAttributesResponse_dbSnapshotAttributesResult = (DescribeDBSnapshotAttributesResponse
-> Maybe DBSnapshotAttributesResult)
-> (DescribeDBSnapshotAttributesResponse
-> Maybe DBSnapshotAttributesResult
-> DescribeDBSnapshotAttributesResponse)
-> Lens
DescribeDBSnapshotAttributesResponse
DescribeDBSnapshotAttributesResponse
(Maybe DBSnapshotAttributesResult)
(Maybe DBSnapshotAttributesResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshotAttributesResponse' {Maybe DBSnapshotAttributesResult
dbSnapshotAttributesResult :: Maybe DBSnapshotAttributesResult
$sel:dbSnapshotAttributesResult:DescribeDBSnapshotAttributesResponse' :: DescribeDBSnapshotAttributesResponse
-> Maybe DBSnapshotAttributesResult
dbSnapshotAttributesResult} -> Maybe DBSnapshotAttributesResult
dbSnapshotAttributesResult) (\s :: DescribeDBSnapshotAttributesResponse
s@DescribeDBSnapshotAttributesResponse' {} Maybe DBSnapshotAttributesResult
a -> DescribeDBSnapshotAttributesResponse
s {$sel:dbSnapshotAttributesResult:DescribeDBSnapshotAttributesResponse' :: Maybe DBSnapshotAttributesResult
dbSnapshotAttributesResult = Maybe DBSnapshotAttributesResult
a} :: DescribeDBSnapshotAttributesResponse)
describeDBSnapshotAttributesResponse_httpStatus :: Lens.Lens' DescribeDBSnapshotAttributesResponse Prelude.Int
describeDBSnapshotAttributesResponse_httpStatus :: (Int -> f Int)
-> DescribeDBSnapshotAttributesResponse
-> f DescribeDBSnapshotAttributesResponse
describeDBSnapshotAttributesResponse_httpStatus = (DescribeDBSnapshotAttributesResponse -> Int)
-> (DescribeDBSnapshotAttributesResponse
-> Int -> DescribeDBSnapshotAttributesResponse)
-> Lens
DescribeDBSnapshotAttributesResponse
DescribeDBSnapshotAttributesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshotAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDBSnapshotAttributesResponse' :: DescribeDBSnapshotAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDBSnapshotAttributesResponse
s@DescribeDBSnapshotAttributesResponse' {} Int
a -> DescribeDBSnapshotAttributesResponse
s {$sel:httpStatus:DescribeDBSnapshotAttributesResponse' :: Int
httpStatus = Int
a} :: DescribeDBSnapshotAttributesResponse)
instance
Prelude.NFData
DescribeDBSnapshotAttributesResponse