{-# 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.Discovery.DescribeConfigurations
(
DescribeConfigurations (..),
newDescribeConfigurations,
describeConfigurations_configurationIds,
DescribeConfigurationsResponse (..),
newDescribeConfigurationsResponse,
describeConfigurationsResponse_configurations,
describeConfigurationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Discovery.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeConfigurations = DescribeConfigurations'
{
DescribeConfigurations -> [Text]
configurationIds :: [Prelude.Text]
}
deriving (DescribeConfigurations -> DescribeConfigurations -> Bool
(DescribeConfigurations -> DescribeConfigurations -> Bool)
-> (DescribeConfigurations -> DescribeConfigurations -> Bool)
-> Eq DescribeConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConfigurations -> DescribeConfigurations -> Bool
$c/= :: DescribeConfigurations -> DescribeConfigurations -> Bool
== :: DescribeConfigurations -> DescribeConfigurations -> Bool
$c== :: DescribeConfigurations -> DescribeConfigurations -> Bool
Prelude.Eq, ReadPrec [DescribeConfigurations]
ReadPrec DescribeConfigurations
Int -> ReadS DescribeConfigurations
ReadS [DescribeConfigurations]
(Int -> ReadS DescribeConfigurations)
-> ReadS [DescribeConfigurations]
-> ReadPrec DescribeConfigurations
-> ReadPrec [DescribeConfigurations]
-> Read DescribeConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConfigurations]
$creadListPrec :: ReadPrec [DescribeConfigurations]
readPrec :: ReadPrec DescribeConfigurations
$creadPrec :: ReadPrec DescribeConfigurations
readList :: ReadS [DescribeConfigurations]
$creadList :: ReadS [DescribeConfigurations]
readsPrec :: Int -> ReadS DescribeConfigurations
$creadsPrec :: Int -> ReadS DescribeConfigurations
Prelude.Read, Int -> DescribeConfigurations -> ShowS
[DescribeConfigurations] -> ShowS
DescribeConfigurations -> String
(Int -> DescribeConfigurations -> ShowS)
-> (DescribeConfigurations -> String)
-> ([DescribeConfigurations] -> ShowS)
-> Show DescribeConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConfigurations] -> ShowS
$cshowList :: [DescribeConfigurations] -> ShowS
show :: DescribeConfigurations -> String
$cshow :: DescribeConfigurations -> String
showsPrec :: Int -> DescribeConfigurations -> ShowS
$cshowsPrec :: Int -> DescribeConfigurations -> ShowS
Prelude.Show, (forall x. DescribeConfigurations -> Rep DescribeConfigurations x)
-> (forall x.
Rep DescribeConfigurations x -> DescribeConfigurations)
-> Generic DescribeConfigurations
forall x. Rep DescribeConfigurations x -> DescribeConfigurations
forall x. DescribeConfigurations -> Rep DescribeConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeConfigurations x -> DescribeConfigurations
$cfrom :: forall x. DescribeConfigurations -> Rep DescribeConfigurations x
Prelude.Generic)
newDescribeConfigurations ::
DescribeConfigurations
newDescribeConfigurations :: DescribeConfigurations
newDescribeConfigurations =
DescribeConfigurations' :: [Text] -> DescribeConfigurations
DescribeConfigurations'
{ $sel:configurationIds:DescribeConfigurations' :: [Text]
configurationIds =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
describeConfigurations_configurationIds :: Lens.Lens' DescribeConfigurations [Prelude.Text]
describeConfigurations_configurationIds :: ([Text] -> f [Text])
-> DescribeConfigurations -> f DescribeConfigurations
describeConfigurations_configurationIds = (DescribeConfigurations -> [Text])
-> (DescribeConfigurations -> [Text] -> DescribeConfigurations)
-> Lens DescribeConfigurations DescribeConfigurations [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConfigurations' {[Text]
configurationIds :: [Text]
$sel:configurationIds:DescribeConfigurations' :: DescribeConfigurations -> [Text]
configurationIds} -> [Text]
configurationIds) (\s :: DescribeConfigurations
s@DescribeConfigurations' {} [Text]
a -> DescribeConfigurations
s {$sel:configurationIds:DescribeConfigurations' :: [Text]
configurationIds = [Text]
a} :: DescribeConfigurations) (([Text] -> f [Text])
-> DescribeConfigurations -> f DescribeConfigurations)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribeConfigurations
-> f DescribeConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DescribeConfigurations where
type
AWSResponse DescribeConfigurations =
DescribeConfigurationsResponse
request :: DescribeConfigurations -> Request DescribeConfigurations
request = Service -> DescribeConfigurations -> Request DescribeConfigurations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeConfigurations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeConfigurations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeConfigurations))
-> Logger
-> Service
-> Proxy DescribeConfigurations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeConfigurations)))
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 [HashMap Text Text] -> Int -> DescribeConfigurationsResponse
DescribeConfigurationsResponse'
(Maybe [HashMap Text Text]
-> Int -> DescribeConfigurationsResponse)
-> Either String (Maybe [HashMap Text Text])
-> Either String (Int -> DescribeConfigurationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [HashMap Text Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"configurations" Either String (Maybe (Maybe [HashMap Text Text]))
-> Maybe [HashMap Text Text]
-> Either String (Maybe [HashMap Text Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [HashMap Text Text]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeConfigurationsResponse)
-> Either String Int
-> Either String DescribeConfigurationsResponse
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 DescribeConfigurations
instance Prelude.NFData DescribeConfigurations
instance Core.ToHeaders DescribeConfigurations where
toHeaders :: DescribeConfigurations -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeConfigurations -> 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
"AWSPoseidonService_V2015_11_01.DescribeConfigurations" ::
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 DescribeConfigurations where
toJSON :: DescribeConfigurations -> Value
toJSON DescribeConfigurations' {[Text]
configurationIds :: [Text]
$sel:configurationIds:DescribeConfigurations' :: DescribeConfigurations -> [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
"configurationIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
configurationIds)
]
)
instance Core.ToPath DescribeConfigurations where
toPath :: DescribeConfigurations -> ByteString
toPath = ByteString -> DescribeConfigurations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeConfigurations where
toQuery :: DescribeConfigurations -> QueryString
toQuery = QueryString -> DescribeConfigurations -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeConfigurationsResponse = DescribeConfigurationsResponse'
{
DescribeConfigurationsResponse -> Maybe [HashMap Text Text]
configurations :: Prelude.Maybe [Prelude.HashMap Prelude.Text Prelude.Text],
DescribeConfigurationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeConfigurationsResponse
-> DescribeConfigurationsResponse -> Bool
(DescribeConfigurationsResponse
-> DescribeConfigurationsResponse -> Bool)
-> (DescribeConfigurationsResponse
-> DescribeConfigurationsResponse -> Bool)
-> Eq DescribeConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConfigurationsResponse
-> DescribeConfigurationsResponse -> Bool
$c/= :: DescribeConfigurationsResponse
-> DescribeConfigurationsResponse -> Bool
== :: DescribeConfigurationsResponse
-> DescribeConfigurationsResponse -> Bool
$c== :: DescribeConfigurationsResponse
-> DescribeConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeConfigurationsResponse]
ReadPrec DescribeConfigurationsResponse
Int -> ReadS DescribeConfigurationsResponse
ReadS [DescribeConfigurationsResponse]
(Int -> ReadS DescribeConfigurationsResponse)
-> ReadS [DescribeConfigurationsResponse]
-> ReadPrec DescribeConfigurationsResponse
-> ReadPrec [DescribeConfigurationsResponse]
-> Read DescribeConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConfigurationsResponse]
$creadListPrec :: ReadPrec [DescribeConfigurationsResponse]
readPrec :: ReadPrec DescribeConfigurationsResponse
$creadPrec :: ReadPrec DescribeConfigurationsResponse
readList :: ReadS [DescribeConfigurationsResponse]
$creadList :: ReadS [DescribeConfigurationsResponse]
readsPrec :: Int -> ReadS DescribeConfigurationsResponse
$creadsPrec :: Int -> ReadS DescribeConfigurationsResponse
Prelude.Read, Int -> DescribeConfigurationsResponse -> ShowS
[DescribeConfigurationsResponse] -> ShowS
DescribeConfigurationsResponse -> String
(Int -> DescribeConfigurationsResponse -> ShowS)
-> (DescribeConfigurationsResponse -> String)
-> ([DescribeConfigurationsResponse] -> ShowS)
-> Show DescribeConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConfigurationsResponse] -> ShowS
$cshowList :: [DescribeConfigurationsResponse] -> ShowS
show :: DescribeConfigurationsResponse -> String
$cshow :: DescribeConfigurationsResponse -> String
showsPrec :: Int -> DescribeConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
DescribeConfigurationsResponse
-> Rep DescribeConfigurationsResponse x)
-> (forall x.
Rep DescribeConfigurationsResponse x
-> DescribeConfigurationsResponse)
-> Generic DescribeConfigurationsResponse
forall x.
Rep DescribeConfigurationsResponse x
-> DescribeConfigurationsResponse
forall x.
DescribeConfigurationsResponse
-> Rep DescribeConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConfigurationsResponse x
-> DescribeConfigurationsResponse
$cfrom :: forall x.
DescribeConfigurationsResponse
-> Rep DescribeConfigurationsResponse x
Prelude.Generic)
newDescribeConfigurationsResponse ::
Prelude.Int ->
DescribeConfigurationsResponse
newDescribeConfigurationsResponse :: Int -> DescribeConfigurationsResponse
newDescribeConfigurationsResponse Int
pHttpStatus_ =
DescribeConfigurationsResponse' :: Maybe [HashMap Text Text] -> Int -> DescribeConfigurationsResponse
DescribeConfigurationsResponse'
{ $sel:configurations:DescribeConfigurationsResponse' :: Maybe [HashMap Text Text]
configurations =
Maybe [HashMap Text Text]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeConfigurationsResponse_configurations :: Lens.Lens' DescribeConfigurationsResponse (Prelude.Maybe [Prelude.HashMap Prelude.Text Prelude.Text])
describeConfigurationsResponse_configurations :: (Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> DescribeConfigurationsResponse
-> f DescribeConfigurationsResponse
describeConfigurationsResponse_configurations = (DescribeConfigurationsResponse -> Maybe [HashMap Text Text])
-> (DescribeConfigurationsResponse
-> Maybe [HashMap Text Text] -> DescribeConfigurationsResponse)
-> Lens
DescribeConfigurationsResponse
DescribeConfigurationsResponse
(Maybe [HashMap Text Text])
(Maybe [HashMap Text Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConfigurationsResponse' {Maybe [HashMap Text Text]
configurations :: Maybe [HashMap Text Text]
$sel:configurations:DescribeConfigurationsResponse' :: DescribeConfigurationsResponse -> Maybe [HashMap Text Text]
configurations} -> Maybe [HashMap Text Text]
configurations) (\s :: DescribeConfigurationsResponse
s@DescribeConfigurationsResponse' {} Maybe [HashMap Text Text]
a -> DescribeConfigurationsResponse
s {$sel:configurations:DescribeConfigurationsResponse' :: Maybe [HashMap Text Text]
configurations = Maybe [HashMap Text Text]
a} :: DescribeConfigurationsResponse) ((Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> DescribeConfigurationsResponse
-> f DescribeConfigurationsResponse)
-> ((Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> (Maybe [HashMap Text Text] -> f (Maybe [HashMap Text Text]))
-> DescribeConfigurationsResponse
-> f DescribeConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
-> Iso
(Maybe [HashMap Text Text])
(Maybe [HashMap Text Text])
(Maybe [HashMap Text Text])
(Maybe [HashMap Text 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
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
[HashMap Text Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeConfigurationsResponse_httpStatus :: Lens.Lens' DescribeConfigurationsResponse Prelude.Int
describeConfigurationsResponse_httpStatus :: (Int -> f Int)
-> DescribeConfigurationsResponse
-> f DescribeConfigurationsResponse
describeConfigurationsResponse_httpStatus = (DescribeConfigurationsResponse -> Int)
-> (DescribeConfigurationsResponse
-> Int -> DescribeConfigurationsResponse)
-> Lens
DescribeConfigurationsResponse
DescribeConfigurationsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConfigurationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeConfigurationsResponse' :: DescribeConfigurationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeConfigurationsResponse
s@DescribeConfigurationsResponse' {} Int
a -> DescribeConfigurationsResponse
s {$sel:httpStatus:DescribeConfigurationsResponse' :: Int
httpStatus = Int
a} :: DescribeConfigurationsResponse)
instance
Prelude.NFData
DescribeConfigurationsResponse