{-# 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.OpsWorks.DescribeRdsDbInstances
(
DescribeRdsDbInstances (..),
newDescribeRdsDbInstances,
describeRdsDbInstances_rdsDbInstanceArns,
describeRdsDbInstances_stackId,
DescribeRdsDbInstancesResponse (..),
newDescribeRdsDbInstancesResponse,
describeRdsDbInstancesResponse_rdsDbInstances,
describeRdsDbInstancesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeRdsDbInstances = DescribeRdsDbInstances'
{
DescribeRdsDbInstances -> Maybe [Text]
rdsDbInstanceArns :: Prelude.Maybe [Prelude.Text],
DescribeRdsDbInstances -> Text
stackId :: Prelude.Text
}
deriving (DescribeRdsDbInstances -> DescribeRdsDbInstances -> Bool
(DescribeRdsDbInstances -> DescribeRdsDbInstances -> Bool)
-> (DescribeRdsDbInstances -> DescribeRdsDbInstances -> Bool)
-> Eq DescribeRdsDbInstances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRdsDbInstances -> DescribeRdsDbInstances -> Bool
$c/= :: DescribeRdsDbInstances -> DescribeRdsDbInstances -> Bool
== :: DescribeRdsDbInstances -> DescribeRdsDbInstances -> Bool
$c== :: DescribeRdsDbInstances -> DescribeRdsDbInstances -> Bool
Prelude.Eq, ReadPrec [DescribeRdsDbInstances]
ReadPrec DescribeRdsDbInstances
Int -> ReadS DescribeRdsDbInstances
ReadS [DescribeRdsDbInstances]
(Int -> ReadS DescribeRdsDbInstances)
-> ReadS [DescribeRdsDbInstances]
-> ReadPrec DescribeRdsDbInstances
-> ReadPrec [DescribeRdsDbInstances]
-> Read DescribeRdsDbInstances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRdsDbInstances]
$creadListPrec :: ReadPrec [DescribeRdsDbInstances]
readPrec :: ReadPrec DescribeRdsDbInstances
$creadPrec :: ReadPrec DescribeRdsDbInstances
readList :: ReadS [DescribeRdsDbInstances]
$creadList :: ReadS [DescribeRdsDbInstances]
readsPrec :: Int -> ReadS DescribeRdsDbInstances
$creadsPrec :: Int -> ReadS DescribeRdsDbInstances
Prelude.Read, Int -> DescribeRdsDbInstances -> ShowS
[DescribeRdsDbInstances] -> ShowS
DescribeRdsDbInstances -> String
(Int -> DescribeRdsDbInstances -> ShowS)
-> (DescribeRdsDbInstances -> String)
-> ([DescribeRdsDbInstances] -> ShowS)
-> Show DescribeRdsDbInstances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRdsDbInstances] -> ShowS
$cshowList :: [DescribeRdsDbInstances] -> ShowS
show :: DescribeRdsDbInstances -> String
$cshow :: DescribeRdsDbInstances -> String
showsPrec :: Int -> DescribeRdsDbInstances -> ShowS
$cshowsPrec :: Int -> DescribeRdsDbInstances -> ShowS
Prelude.Show, (forall x. DescribeRdsDbInstances -> Rep DescribeRdsDbInstances x)
-> (forall x.
Rep DescribeRdsDbInstances x -> DescribeRdsDbInstances)
-> Generic DescribeRdsDbInstances
forall x. Rep DescribeRdsDbInstances x -> DescribeRdsDbInstances
forall x. DescribeRdsDbInstances -> Rep DescribeRdsDbInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRdsDbInstances x -> DescribeRdsDbInstances
$cfrom :: forall x. DescribeRdsDbInstances -> Rep DescribeRdsDbInstances x
Prelude.Generic)
newDescribeRdsDbInstances ::
Prelude.Text ->
DescribeRdsDbInstances
newDescribeRdsDbInstances :: Text -> DescribeRdsDbInstances
newDescribeRdsDbInstances Text
pStackId_ =
DescribeRdsDbInstances' :: Maybe [Text] -> Text -> DescribeRdsDbInstances
DescribeRdsDbInstances'
{ $sel:rdsDbInstanceArns:DescribeRdsDbInstances' :: Maybe [Text]
rdsDbInstanceArns =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:stackId:DescribeRdsDbInstances' :: Text
stackId = Text
pStackId_
}
describeRdsDbInstances_rdsDbInstanceArns :: Lens.Lens' DescribeRdsDbInstances (Prelude.Maybe [Prelude.Text])
describeRdsDbInstances_rdsDbInstanceArns :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeRdsDbInstances -> f DescribeRdsDbInstances
describeRdsDbInstances_rdsDbInstanceArns = (DescribeRdsDbInstances -> Maybe [Text])
-> (DescribeRdsDbInstances
-> Maybe [Text] -> DescribeRdsDbInstances)
-> Lens
DescribeRdsDbInstances
DescribeRdsDbInstances
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRdsDbInstances' {Maybe [Text]
rdsDbInstanceArns :: Maybe [Text]
$sel:rdsDbInstanceArns:DescribeRdsDbInstances' :: DescribeRdsDbInstances -> Maybe [Text]
rdsDbInstanceArns} -> Maybe [Text]
rdsDbInstanceArns) (\s :: DescribeRdsDbInstances
s@DescribeRdsDbInstances' {} Maybe [Text]
a -> DescribeRdsDbInstances
s {$sel:rdsDbInstanceArns:DescribeRdsDbInstances' :: Maybe [Text]
rdsDbInstanceArns = Maybe [Text]
a} :: DescribeRdsDbInstances) ((Maybe [Text] -> f (Maybe [Text]))
-> DescribeRdsDbInstances -> f DescribeRdsDbInstances)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeRdsDbInstances
-> f DescribeRdsDbInstances
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeRdsDbInstances_stackId :: Lens.Lens' DescribeRdsDbInstances Prelude.Text
describeRdsDbInstances_stackId :: (Text -> f Text)
-> DescribeRdsDbInstances -> f DescribeRdsDbInstances
describeRdsDbInstances_stackId = (DescribeRdsDbInstances -> Text)
-> (DescribeRdsDbInstances -> Text -> DescribeRdsDbInstances)
-> Lens DescribeRdsDbInstances DescribeRdsDbInstances Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRdsDbInstances' {Text
stackId :: Text
$sel:stackId:DescribeRdsDbInstances' :: DescribeRdsDbInstances -> Text
stackId} -> Text
stackId) (\s :: DescribeRdsDbInstances
s@DescribeRdsDbInstances' {} Text
a -> DescribeRdsDbInstances
s {$sel:stackId:DescribeRdsDbInstances' :: Text
stackId = Text
a} :: DescribeRdsDbInstances)
instance Core.AWSRequest DescribeRdsDbInstances where
type
AWSResponse DescribeRdsDbInstances =
DescribeRdsDbInstancesResponse
request :: DescribeRdsDbInstances -> Request DescribeRdsDbInstances
request = Service -> DescribeRdsDbInstances -> Request DescribeRdsDbInstances
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRdsDbInstances
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRdsDbInstances)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRdsDbInstances))
-> Logger
-> Service
-> Proxy DescribeRdsDbInstances
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRdsDbInstances)))
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 ->
Maybe [RdsDbInstance] -> Int -> DescribeRdsDbInstancesResponse
DescribeRdsDbInstancesResponse'
(Maybe [RdsDbInstance] -> Int -> DescribeRdsDbInstancesResponse)
-> Either String (Maybe [RdsDbInstance])
-> Either String (Int -> DescribeRdsDbInstancesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [RdsDbInstance]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RdsDbInstances" Either String (Maybe (Maybe [RdsDbInstance]))
-> Maybe [RdsDbInstance] -> Either String (Maybe [RdsDbInstance])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RdsDbInstance]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeRdsDbInstancesResponse)
-> Either String Int
-> Either String DescribeRdsDbInstancesResponse
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 DescribeRdsDbInstances
instance Prelude.NFData DescribeRdsDbInstances
instance Core.ToHeaders DescribeRdsDbInstances where
toHeaders :: DescribeRdsDbInstances -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeRdsDbInstances -> 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
"OpsWorks_20130218.DescribeRdsDbInstances" ::
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 DescribeRdsDbInstances where
toJSON :: DescribeRdsDbInstances -> Value
toJSON DescribeRdsDbInstances' {Maybe [Text]
Text
stackId :: Text
rdsDbInstanceArns :: Maybe [Text]
$sel:stackId:DescribeRdsDbInstances' :: DescribeRdsDbInstances -> Text
$sel:rdsDbInstanceArns:DescribeRdsDbInstances' :: DescribeRdsDbInstances -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RdsDbInstanceArns" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
rdsDbInstanceArns,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StackId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stackId)
]
)
instance Core.ToPath DescribeRdsDbInstances where
toPath :: DescribeRdsDbInstances -> ByteString
toPath = ByteString -> DescribeRdsDbInstances -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeRdsDbInstances where
toQuery :: DescribeRdsDbInstances -> QueryString
toQuery = QueryString -> DescribeRdsDbInstances -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeRdsDbInstancesResponse = DescribeRdsDbInstancesResponse'
{
DescribeRdsDbInstancesResponse -> Maybe [RdsDbInstance]
rdsDbInstances :: Prelude.Maybe [RdsDbInstance],
DescribeRdsDbInstancesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRdsDbInstancesResponse
-> DescribeRdsDbInstancesResponse -> Bool
(DescribeRdsDbInstancesResponse
-> DescribeRdsDbInstancesResponse -> Bool)
-> (DescribeRdsDbInstancesResponse
-> DescribeRdsDbInstancesResponse -> Bool)
-> Eq DescribeRdsDbInstancesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRdsDbInstancesResponse
-> DescribeRdsDbInstancesResponse -> Bool
$c/= :: DescribeRdsDbInstancesResponse
-> DescribeRdsDbInstancesResponse -> Bool
== :: DescribeRdsDbInstancesResponse
-> DescribeRdsDbInstancesResponse -> Bool
$c== :: DescribeRdsDbInstancesResponse
-> DescribeRdsDbInstancesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRdsDbInstancesResponse]
ReadPrec DescribeRdsDbInstancesResponse
Int -> ReadS DescribeRdsDbInstancesResponse
ReadS [DescribeRdsDbInstancesResponse]
(Int -> ReadS DescribeRdsDbInstancesResponse)
-> ReadS [DescribeRdsDbInstancesResponse]
-> ReadPrec DescribeRdsDbInstancesResponse
-> ReadPrec [DescribeRdsDbInstancesResponse]
-> Read DescribeRdsDbInstancesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRdsDbInstancesResponse]
$creadListPrec :: ReadPrec [DescribeRdsDbInstancesResponse]
readPrec :: ReadPrec DescribeRdsDbInstancesResponse
$creadPrec :: ReadPrec DescribeRdsDbInstancesResponse
readList :: ReadS [DescribeRdsDbInstancesResponse]
$creadList :: ReadS [DescribeRdsDbInstancesResponse]
readsPrec :: Int -> ReadS DescribeRdsDbInstancesResponse
$creadsPrec :: Int -> ReadS DescribeRdsDbInstancesResponse
Prelude.Read, Int -> DescribeRdsDbInstancesResponse -> ShowS
[DescribeRdsDbInstancesResponse] -> ShowS
DescribeRdsDbInstancesResponse -> String
(Int -> DescribeRdsDbInstancesResponse -> ShowS)
-> (DescribeRdsDbInstancesResponse -> String)
-> ([DescribeRdsDbInstancesResponse] -> ShowS)
-> Show DescribeRdsDbInstancesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRdsDbInstancesResponse] -> ShowS
$cshowList :: [DescribeRdsDbInstancesResponse] -> ShowS
show :: DescribeRdsDbInstancesResponse -> String
$cshow :: DescribeRdsDbInstancesResponse -> String
showsPrec :: Int -> DescribeRdsDbInstancesResponse -> ShowS
$cshowsPrec :: Int -> DescribeRdsDbInstancesResponse -> ShowS
Prelude.Show, (forall x.
DescribeRdsDbInstancesResponse
-> Rep DescribeRdsDbInstancesResponse x)
-> (forall x.
Rep DescribeRdsDbInstancesResponse x
-> DescribeRdsDbInstancesResponse)
-> Generic DescribeRdsDbInstancesResponse
forall x.
Rep DescribeRdsDbInstancesResponse x
-> DescribeRdsDbInstancesResponse
forall x.
DescribeRdsDbInstancesResponse
-> Rep DescribeRdsDbInstancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRdsDbInstancesResponse x
-> DescribeRdsDbInstancesResponse
$cfrom :: forall x.
DescribeRdsDbInstancesResponse
-> Rep DescribeRdsDbInstancesResponse x
Prelude.Generic)
newDescribeRdsDbInstancesResponse ::
Prelude.Int ->
DescribeRdsDbInstancesResponse
newDescribeRdsDbInstancesResponse :: Int -> DescribeRdsDbInstancesResponse
newDescribeRdsDbInstancesResponse Int
pHttpStatus_ =
DescribeRdsDbInstancesResponse' :: Maybe [RdsDbInstance] -> Int -> DescribeRdsDbInstancesResponse
DescribeRdsDbInstancesResponse'
{ $sel:rdsDbInstances:DescribeRdsDbInstancesResponse' :: Maybe [RdsDbInstance]
rdsDbInstances =
Maybe [RdsDbInstance]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRdsDbInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRdsDbInstancesResponse_rdsDbInstances :: Lens.Lens' DescribeRdsDbInstancesResponse (Prelude.Maybe [RdsDbInstance])
describeRdsDbInstancesResponse_rdsDbInstances :: (Maybe [RdsDbInstance] -> f (Maybe [RdsDbInstance]))
-> DescribeRdsDbInstancesResponse
-> f DescribeRdsDbInstancesResponse
describeRdsDbInstancesResponse_rdsDbInstances = (DescribeRdsDbInstancesResponse -> Maybe [RdsDbInstance])
-> (DescribeRdsDbInstancesResponse
-> Maybe [RdsDbInstance] -> DescribeRdsDbInstancesResponse)
-> Lens
DescribeRdsDbInstancesResponse
DescribeRdsDbInstancesResponse
(Maybe [RdsDbInstance])
(Maybe [RdsDbInstance])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRdsDbInstancesResponse' {Maybe [RdsDbInstance]
rdsDbInstances :: Maybe [RdsDbInstance]
$sel:rdsDbInstances:DescribeRdsDbInstancesResponse' :: DescribeRdsDbInstancesResponse -> Maybe [RdsDbInstance]
rdsDbInstances} -> Maybe [RdsDbInstance]
rdsDbInstances) (\s :: DescribeRdsDbInstancesResponse
s@DescribeRdsDbInstancesResponse' {} Maybe [RdsDbInstance]
a -> DescribeRdsDbInstancesResponse
s {$sel:rdsDbInstances:DescribeRdsDbInstancesResponse' :: Maybe [RdsDbInstance]
rdsDbInstances = Maybe [RdsDbInstance]
a} :: DescribeRdsDbInstancesResponse) ((Maybe [RdsDbInstance] -> f (Maybe [RdsDbInstance]))
-> DescribeRdsDbInstancesResponse
-> f DescribeRdsDbInstancesResponse)
-> ((Maybe [RdsDbInstance] -> f (Maybe [RdsDbInstance]))
-> Maybe [RdsDbInstance] -> f (Maybe [RdsDbInstance]))
-> (Maybe [RdsDbInstance] -> f (Maybe [RdsDbInstance]))
-> DescribeRdsDbInstancesResponse
-> f DescribeRdsDbInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RdsDbInstance] [RdsDbInstance] [RdsDbInstance] [RdsDbInstance]
-> Iso
(Maybe [RdsDbInstance])
(Maybe [RdsDbInstance])
(Maybe [RdsDbInstance])
(Maybe [RdsDbInstance])
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
[RdsDbInstance] [RdsDbInstance] [RdsDbInstance] [RdsDbInstance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeRdsDbInstancesResponse_httpStatus :: Lens.Lens' DescribeRdsDbInstancesResponse Prelude.Int
describeRdsDbInstancesResponse_httpStatus :: (Int -> f Int)
-> DescribeRdsDbInstancesResponse
-> f DescribeRdsDbInstancesResponse
describeRdsDbInstancesResponse_httpStatus = (DescribeRdsDbInstancesResponse -> Int)
-> (DescribeRdsDbInstancesResponse
-> Int -> DescribeRdsDbInstancesResponse)
-> Lens
DescribeRdsDbInstancesResponse
DescribeRdsDbInstancesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRdsDbInstancesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRdsDbInstancesResponse' :: DescribeRdsDbInstancesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRdsDbInstancesResponse
s@DescribeRdsDbInstancesResponse' {} Int
a -> DescribeRdsDbInstancesResponse
s {$sel:httpStatus:DescribeRdsDbInstancesResponse' :: Int
httpStatus = Int
a} :: DescribeRdsDbInstancesResponse)
instance
Prelude.NFData
DescribeRdsDbInstancesResponse