{-# 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.ResourceGroups.GetGroupConfiguration
(
GetGroupConfiguration (..),
newGetGroupConfiguration,
getGroupConfiguration_group,
GetGroupConfigurationResponse (..),
newGetGroupConfigurationResponse,
getGroupConfigurationResponse_groupConfiguration,
getGroupConfigurationResponse_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 Amazonka.ResourceGroups.Types
import qualified Amazonka.Response as Response
data GetGroupConfiguration = GetGroupConfiguration'
{
GetGroupConfiguration -> Maybe Text
group' :: Prelude.Maybe Prelude.Text
}
deriving (GetGroupConfiguration -> GetGroupConfiguration -> Bool
(GetGroupConfiguration -> GetGroupConfiguration -> Bool)
-> (GetGroupConfiguration -> GetGroupConfiguration -> Bool)
-> Eq GetGroupConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGroupConfiguration -> GetGroupConfiguration -> Bool
$c/= :: GetGroupConfiguration -> GetGroupConfiguration -> Bool
== :: GetGroupConfiguration -> GetGroupConfiguration -> Bool
$c== :: GetGroupConfiguration -> GetGroupConfiguration -> Bool
Prelude.Eq, ReadPrec [GetGroupConfiguration]
ReadPrec GetGroupConfiguration
Int -> ReadS GetGroupConfiguration
ReadS [GetGroupConfiguration]
(Int -> ReadS GetGroupConfiguration)
-> ReadS [GetGroupConfiguration]
-> ReadPrec GetGroupConfiguration
-> ReadPrec [GetGroupConfiguration]
-> Read GetGroupConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGroupConfiguration]
$creadListPrec :: ReadPrec [GetGroupConfiguration]
readPrec :: ReadPrec GetGroupConfiguration
$creadPrec :: ReadPrec GetGroupConfiguration
readList :: ReadS [GetGroupConfiguration]
$creadList :: ReadS [GetGroupConfiguration]
readsPrec :: Int -> ReadS GetGroupConfiguration
$creadsPrec :: Int -> ReadS GetGroupConfiguration
Prelude.Read, Int -> GetGroupConfiguration -> ShowS
[GetGroupConfiguration] -> ShowS
GetGroupConfiguration -> String
(Int -> GetGroupConfiguration -> ShowS)
-> (GetGroupConfiguration -> String)
-> ([GetGroupConfiguration] -> ShowS)
-> Show GetGroupConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGroupConfiguration] -> ShowS
$cshowList :: [GetGroupConfiguration] -> ShowS
show :: GetGroupConfiguration -> String
$cshow :: GetGroupConfiguration -> String
showsPrec :: Int -> GetGroupConfiguration -> ShowS
$cshowsPrec :: Int -> GetGroupConfiguration -> ShowS
Prelude.Show, (forall x. GetGroupConfiguration -> Rep GetGroupConfiguration x)
-> (forall x. Rep GetGroupConfiguration x -> GetGroupConfiguration)
-> Generic GetGroupConfiguration
forall x. Rep GetGroupConfiguration x -> GetGroupConfiguration
forall x. GetGroupConfiguration -> Rep GetGroupConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetGroupConfiguration x -> GetGroupConfiguration
$cfrom :: forall x. GetGroupConfiguration -> Rep GetGroupConfiguration x
Prelude.Generic)
newGetGroupConfiguration ::
GetGroupConfiguration
newGetGroupConfiguration :: GetGroupConfiguration
newGetGroupConfiguration =
GetGroupConfiguration' :: Maybe Text -> GetGroupConfiguration
GetGroupConfiguration' {$sel:group':GetGroupConfiguration' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing}
getGroupConfiguration_group :: Lens.Lens' GetGroupConfiguration (Prelude.Maybe Prelude.Text)
getGroupConfiguration_group :: (Maybe Text -> f (Maybe Text))
-> GetGroupConfiguration -> f GetGroupConfiguration
getGroupConfiguration_group = (GetGroupConfiguration -> Maybe Text)
-> (GetGroupConfiguration -> Maybe Text -> GetGroupConfiguration)
-> Lens
GetGroupConfiguration
GetGroupConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGroupConfiguration' {Maybe Text
group' :: Maybe Text
$sel:group':GetGroupConfiguration' :: GetGroupConfiguration -> Maybe Text
group'} -> Maybe Text
group') (\s :: GetGroupConfiguration
s@GetGroupConfiguration' {} Maybe Text
a -> GetGroupConfiguration
s {$sel:group':GetGroupConfiguration' :: Maybe Text
group' = Maybe Text
a} :: GetGroupConfiguration)
instance Core.AWSRequest GetGroupConfiguration where
type
AWSResponse GetGroupConfiguration =
GetGroupConfigurationResponse
request :: GetGroupConfiguration -> Request GetGroupConfiguration
request = Service -> GetGroupConfiguration -> Request GetGroupConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetGroupConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetGroupConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetGroupConfiguration))
-> Logger
-> Service
-> Proxy GetGroupConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetGroupConfiguration)))
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 GroupConfiguration -> Int -> GetGroupConfigurationResponse
GetGroupConfigurationResponse'
(Maybe GroupConfiguration -> Int -> GetGroupConfigurationResponse)
-> Either String (Maybe GroupConfiguration)
-> Either String (Int -> GetGroupConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe GroupConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GroupConfiguration")
Either String (Int -> GetGroupConfigurationResponse)
-> Either String Int -> Either String GetGroupConfigurationResponse
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 GetGroupConfiguration
instance Prelude.NFData GetGroupConfiguration
instance Core.ToHeaders GetGroupConfiguration where
toHeaders :: GetGroupConfiguration -> ResponseHeaders
toHeaders = ResponseHeaders -> GetGroupConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON GetGroupConfiguration where
toJSON :: GetGroupConfiguration -> Value
toJSON GetGroupConfiguration' {Maybe Text
group' :: Maybe Text
$sel:group':GetGroupConfiguration' :: GetGroupConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Group" 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
group']
)
instance Core.ToPath GetGroupConfiguration where
toPath :: GetGroupConfiguration -> ByteString
toPath = ByteString -> GetGroupConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/get-group-configuration"
instance Core.ToQuery GetGroupConfiguration where
toQuery :: GetGroupConfiguration -> QueryString
toQuery = QueryString -> GetGroupConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetGroupConfigurationResponse = GetGroupConfigurationResponse'
{
GetGroupConfigurationResponse -> Maybe GroupConfiguration
groupConfiguration :: Prelude.Maybe GroupConfiguration,
GetGroupConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetGroupConfigurationResponse
-> GetGroupConfigurationResponse -> Bool
(GetGroupConfigurationResponse
-> GetGroupConfigurationResponse -> Bool)
-> (GetGroupConfigurationResponse
-> GetGroupConfigurationResponse -> Bool)
-> Eq GetGroupConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGroupConfigurationResponse
-> GetGroupConfigurationResponse -> Bool
$c/= :: GetGroupConfigurationResponse
-> GetGroupConfigurationResponse -> Bool
== :: GetGroupConfigurationResponse
-> GetGroupConfigurationResponse -> Bool
$c== :: GetGroupConfigurationResponse
-> GetGroupConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetGroupConfigurationResponse]
ReadPrec GetGroupConfigurationResponse
Int -> ReadS GetGroupConfigurationResponse
ReadS [GetGroupConfigurationResponse]
(Int -> ReadS GetGroupConfigurationResponse)
-> ReadS [GetGroupConfigurationResponse]
-> ReadPrec GetGroupConfigurationResponse
-> ReadPrec [GetGroupConfigurationResponse]
-> Read GetGroupConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGroupConfigurationResponse]
$creadListPrec :: ReadPrec [GetGroupConfigurationResponse]
readPrec :: ReadPrec GetGroupConfigurationResponse
$creadPrec :: ReadPrec GetGroupConfigurationResponse
readList :: ReadS [GetGroupConfigurationResponse]
$creadList :: ReadS [GetGroupConfigurationResponse]
readsPrec :: Int -> ReadS GetGroupConfigurationResponse
$creadsPrec :: Int -> ReadS GetGroupConfigurationResponse
Prelude.Read, Int -> GetGroupConfigurationResponse -> ShowS
[GetGroupConfigurationResponse] -> ShowS
GetGroupConfigurationResponse -> String
(Int -> GetGroupConfigurationResponse -> ShowS)
-> (GetGroupConfigurationResponse -> String)
-> ([GetGroupConfigurationResponse] -> ShowS)
-> Show GetGroupConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGroupConfigurationResponse] -> ShowS
$cshowList :: [GetGroupConfigurationResponse] -> ShowS
show :: GetGroupConfigurationResponse -> String
$cshow :: GetGroupConfigurationResponse -> String
showsPrec :: Int -> GetGroupConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetGroupConfigurationResponse -> ShowS
Prelude.Show, (forall x.
GetGroupConfigurationResponse
-> Rep GetGroupConfigurationResponse x)
-> (forall x.
Rep GetGroupConfigurationResponse x
-> GetGroupConfigurationResponse)
-> Generic GetGroupConfigurationResponse
forall x.
Rep GetGroupConfigurationResponse x
-> GetGroupConfigurationResponse
forall x.
GetGroupConfigurationResponse
-> Rep GetGroupConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetGroupConfigurationResponse x
-> GetGroupConfigurationResponse
$cfrom :: forall x.
GetGroupConfigurationResponse
-> Rep GetGroupConfigurationResponse x
Prelude.Generic)
newGetGroupConfigurationResponse ::
Prelude.Int ->
GetGroupConfigurationResponse
newGetGroupConfigurationResponse :: Int -> GetGroupConfigurationResponse
newGetGroupConfigurationResponse Int
pHttpStatus_ =
GetGroupConfigurationResponse' :: Maybe GroupConfiguration -> Int -> GetGroupConfigurationResponse
GetGroupConfigurationResponse'
{ $sel:groupConfiguration:GetGroupConfigurationResponse' :: Maybe GroupConfiguration
groupConfiguration =
Maybe GroupConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetGroupConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getGroupConfigurationResponse_groupConfiguration :: Lens.Lens' GetGroupConfigurationResponse (Prelude.Maybe GroupConfiguration)
getGroupConfigurationResponse_groupConfiguration :: (Maybe GroupConfiguration -> f (Maybe GroupConfiguration))
-> GetGroupConfigurationResponse -> f GetGroupConfigurationResponse
getGroupConfigurationResponse_groupConfiguration = (GetGroupConfigurationResponse -> Maybe GroupConfiguration)
-> (GetGroupConfigurationResponse
-> Maybe GroupConfiguration -> GetGroupConfigurationResponse)
-> Lens
GetGroupConfigurationResponse
GetGroupConfigurationResponse
(Maybe GroupConfiguration)
(Maybe GroupConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGroupConfigurationResponse' {Maybe GroupConfiguration
groupConfiguration :: Maybe GroupConfiguration
$sel:groupConfiguration:GetGroupConfigurationResponse' :: GetGroupConfigurationResponse -> Maybe GroupConfiguration
groupConfiguration} -> Maybe GroupConfiguration
groupConfiguration) (\s :: GetGroupConfigurationResponse
s@GetGroupConfigurationResponse' {} Maybe GroupConfiguration
a -> GetGroupConfigurationResponse
s {$sel:groupConfiguration:GetGroupConfigurationResponse' :: Maybe GroupConfiguration
groupConfiguration = Maybe GroupConfiguration
a} :: GetGroupConfigurationResponse)
getGroupConfigurationResponse_httpStatus :: Lens.Lens' GetGroupConfigurationResponse Prelude.Int
getGroupConfigurationResponse_httpStatus :: (Int -> f Int)
-> GetGroupConfigurationResponse -> f GetGroupConfigurationResponse
getGroupConfigurationResponse_httpStatus = (GetGroupConfigurationResponse -> Int)
-> (GetGroupConfigurationResponse
-> Int -> GetGroupConfigurationResponse)
-> Lens
GetGroupConfigurationResponse GetGroupConfigurationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGroupConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetGroupConfigurationResponse' :: GetGroupConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetGroupConfigurationResponse
s@GetGroupConfigurationResponse' {} Int
a -> GetGroupConfigurationResponse
s {$sel:httpStatus:GetGroupConfigurationResponse' :: Int
httpStatus = Int
a} :: GetGroupConfigurationResponse)
instance Prelude.NFData GetGroupConfigurationResponse