{-# 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.PutGroupConfiguration
(
PutGroupConfiguration (..),
newPutGroupConfiguration,
putGroupConfiguration_group,
putGroupConfiguration_configuration,
PutGroupConfigurationResponse (..),
newPutGroupConfigurationResponse,
putGroupConfigurationResponse_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 PutGroupConfiguration = PutGroupConfiguration'
{
PutGroupConfiguration -> Maybe Text
group' :: Prelude.Maybe Prelude.Text,
PutGroupConfiguration -> Maybe [GroupConfigurationItem]
configuration :: Prelude.Maybe [GroupConfigurationItem]
}
deriving (PutGroupConfiguration -> PutGroupConfiguration -> Bool
(PutGroupConfiguration -> PutGroupConfiguration -> Bool)
-> (PutGroupConfiguration -> PutGroupConfiguration -> Bool)
-> Eq PutGroupConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutGroupConfiguration -> PutGroupConfiguration -> Bool
$c/= :: PutGroupConfiguration -> PutGroupConfiguration -> Bool
== :: PutGroupConfiguration -> PutGroupConfiguration -> Bool
$c== :: PutGroupConfiguration -> PutGroupConfiguration -> Bool
Prelude.Eq, ReadPrec [PutGroupConfiguration]
ReadPrec PutGroupConfiguration
Int -> ReadS PutGroupConfiguration
ReadS [PutGroupConfiguration]
(Int -> ReadS PutGroupConfiguration)
-> ReadS [PutGroupConfiguration]
-> ReadPrec PutGroupConfiguration
-> ReadPrec [PutGroupConfiguration]
-> Read PutGroupConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutGroupConfiguration]
$creadListPrec :: ReadPrec [PutGroupConfiguration]
readPrec :: ReadPrec PutGroupConfiguration
$creadPrec :: ReadPrec PutGroupConfiguration
readList :: ReadS [PutGroupConfiguration]
$creadList :: ReadS [PutGroupConfiguration]
readsPrec :: Int -> ReadS PutGroupConfiguration
$creadsPrec :: Int -> ReadS PutGroupConfiguration
Prelude.Read, Int -> PutGroupConfiguration -> ShowS
[PutGroupConfiguration] -> ShowS
PutGroupConfiguration -> String
(Int -> PutGroupConfiguration -> ShowS)
-> (PutGroupConfiguration -> String)
-> ([PutGroupConfiguration] -> ShowS)
-> Show PutGroupConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutGroupConfiguration] -> ShowS
$cshowList :: [PutGroupConfiguration] -> ShowS
show :: PutGroupConfiguration -> String
$cshow :: PutGroupConfiguration -> String
showsPrec :: Int -> PutGroupConfiguration -> ShowS
$cshowsPrec :: Int -> PutGroupConfiguration -> ShowS
Prelude.Show, (forall x. PutGroupConfiguration -> Rep PutGroupConfiguration x)
-> (forall x. Rep PutGroupConfiguration x -> PutGroupConfiguration)
-> Generic PutGroupConfiguration
forall x. Rep PutGroupConfiguration x -> PutGroupConfiguration
forall x. PutGroupConfiguration -> Rep PutGroupConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutGroupConfiguration x -> PutGroupConfiguration
$cfrom :: forall x. PutGroupConfiguration -> Rep PutGroupConfiguration x
Prelude.Generic)
newPutGroupConfiguration ::
PutGroupConfiguration
newPutGroupConfiguration :: PutGroupConfiguration
newPutGroupConfiguration =
PutGroupConfiguration' :: Maybe Text
-> Maybe [GroupConfigurationItem] -> PutGroupConfiguration
PutGroupConfiguration'
{ $sel:group':PutGroupConfiguration' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:PutGroupConfiguration' :: Maybe [GroupConfigurationItem]
configuration = Maybe [GroupConfigurationItem]
forall a. Maybe a
Prelude.Nothing
}
putGroupConfiguration_group :: Lens.Lens' PutGroupConfiguration (Prelude.Maybe Prelude.Text)
putGroupConfiguration_group :: (Maybe Text -> f (Maybe Text))
-> PutGroupConfiguration -> f PutGroupConfiguration
putGroupConfiguration_group = (PutGroupConfiguration -> Maybe Text)
-> (PutGroupConfiguration -> Maybe Text -> PutGroupConfiguration)
-> Lens
PutGroupConfiguration
PutGroupConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutGroupConfiguration' {Maybe Text
group' :: Maybe Text
$sel:group':PutGroupConfiguration' :: PutGroupConfiguration -> Maybe Text
group'} -> Maybe Text
group') (\s :: PutGroupConfiguration
s@PutGroupConfiguration' {} Maybe Text
a -> PutGroupConfiguration
s {$sel:group':PutGroupConfiguration' :: Maybe Text
group' = Maybe Text
a} :: PutGroupConfiguration)
putGroupConfiguration_configuration :: Lens.Lens' PutGroupConfiguration (Prelude.Maybe [GroupConfigurationItem])
putGroupConfiguration_configuration :: (Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> PutGroupConfiguration -> f PutGroupConfiguration
putGroupConfiguration_configuration = (PutGroupConfiguration -> Maybe [GroupConfigurationItem])
-> (PutGroupConfiguration
-> Maybe [GroupConfigurationItem] -> PutGroupConfiguration)
-> Lens
PutGroupConfiguration
PutGroupConfiguration
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutGroupConfiguration' {Maybe [GroupConfigurationItem]
configuration :: Maybe [GroupConfigurationItem]
$sel:configuration:PutGroupConfiguration' :: PutGroupConfiguration -> Maybe [GroupConfigurationItem]
configuration} -> Maybe [GroupConfigurationItem]
configuration) (\s :: PutGroupConfiguration
s@PutGroupConfiguration' {} Maybe [GroupConfigurationItem]
a -> PutGroupConfiguration
s {$sel:configuration:PutGroupConfiguration' :: Maybe [GroupConfigurationItem]
configuration = Maybe [GroupConfigurationItem]
a} :: PutGroupConfiguration) ((Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> PutGroupConfiguration -> f PutGroupConfiguration)
-> ((Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> (Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> PutGroupConfiguration
-> f PutGroupConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
-> Iso
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
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
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest PutGroupConfiguration where
type
AWSResponse PutGroupConfiguration =
PutGroupConfigurationResponse
request :: PutGroupConfiguration -> Request PutGroupConfiguration
request = Service -> PutGroupConfiguration -> Request PutGroupConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutGroupConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutGroupConfiguration)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutGroupConfiguration))
-> Logger
-> Service
-> Proxy PutGroupConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutGroupConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutGroupConfigurationResponse
PutGroupConfigurationResponse'
(Int -> PutGroupConfigurationResponse)
-> Either String Int -> Either String PutGroupConfigurationResponse
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))
)
instance Prelude.Hashable PutGroupConfiguration
instance Prelude.NFData PutGroupConfiguration
instance Core.ToHeaders PutGroupConfiguration where
toHeaders :: PutGroupConfiguration -> ResponseHeaders
toHeaders = ResponseHeaders -> PutGroupConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON PutGroupConfiguration where
toJSON :: PutGroupConfiguration -> Value
toJSON PutGroupConfiguration' {Maybe [GroupConfigurationItem]
Maybe Text
configuration :: Maybe [GroupConfigurationItem]
group' :: Maybe Text
$sel:configuration:PutGroupConfiguration' :: PutGroupConfiguration -> Maybe [GroupConfigurationItem]
$sel:group':PutGroupConfiguration' :: PutGroupConfiguration -> 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',
(Text
"Configuration" Text -> [GroupConfigurationItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([GroupConfigurationItem] -> Pair)
-> Maybe [GroupConfigurationItem] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GroupConfigurationItem]
configuration
]
)
instance Core.ToPath PutGroupConfiguration where
toPath :: PutGroupConfiguration -> ByteString
toPath = ByteString -> PutGroupConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/put-group-configuration"
instance Core.ToQuery PutGroupConfiguration where
toQuery :: PutGroupConfiguration -> QueryString
toQuery = QueryString -> PutGroupConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutGroupConfigurationResponse = PutGroupConfigurationResponse'
{
PutGroupConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutGroupConfigurationResponse
-> PutGroupConfigurationResponse -> Bool
(PutGroupConfigurationResponse
-> PutGroupConfigurationResponse -> Bool)
-> (PutGroupConfigurationResponse
-> PutGroupConfigurationResponse -> Bool)
-> Eq PutGroupConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutGroupConfigurationResponse
-> PutGroupConfigurationResponse -> Bool
$c/= :: PutGroupConfigurationResponse
-> PutGroupConfigurationResponse -> Bool
== :: PutGroupConfigurationResponse
-> PutGroupConfigurationResponse -> Bool
$c== :: PutGroupConfigurationResponse
-> PutGroupConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutGroupConfigurationResponse]
ReadPrec PutGroupConfigurationResponse
Int -> ReadS PutGroupConfigurationResponse
ReadS [PutGroupConfigurationResponse]
(Int -> ReadS PutGroupConfigurationResponse)
-> ReadS [PutGroupConfigurationResponse]
-> ReadPrec PutGroupConfigurationResponse
-> ReadPrec [PutGroupConfigurationResponse]
-> Read PutGroupConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutGroupConfigurationResponse]
$creadListPrec :: ReadPrec [PutGroupConfigurationResponse]
readPrec :: ReadPrec PutGroupConfigurationResponse
$creadPrec :: ReadPrec PutGroupConfigurationResponse
readList :: ReadS [PutGroupConfigurationResponse]
$creadList :: ReadS [PutGroupConfigurationResponse]
readsPrec :: Int -> ReadS PutGroupConfigurationResponse
$creadsPrec :: Int -> ReadS PutGroupConfigurationResponse
Prelude.Read, Int -> PutGroupConfigurationResponse -> ShowS
[PutGroupConfigurationResponse] -> ShowS
PutGroupConfigurationResponse -> String
(Int -> PutGroupConfigurationResponse -> ShowS)
-> (PutGroupConfigurationResponse -> String)
-> ([PutGroupConfigurationResponse] -> ShowS)
-> Show PutGroupConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutGroupConfigurationResponse] -> ShowS
$cshowList :: [PutGroupConfigurationResponse] -> ShowS
show :: PutGroupConfigurationResponse -> String
$cshow :: PutGroupConfigurationResponse -> String
showsPrec :: Int -> PutGroupConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutGroupConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutGroupConfigurationResponse
-> Rep PutGroupConfigurationResponse x)
-> (forall x.
Rep PutGroupConfigurationResponse x
-> PutGroupConfigurationResponse)
-> Generic PutGroupConfigurationResponse
forall x.
Rep PutGroupConfigurationResponse x
-> PutGroupConfigurationResponse
forall x.
PutGroupConfigurationResponse
-> Rep PutGroupConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutGroupConfigurationResponse x
-> PutGroupConfigurationResponse
$cfrom :: forall x.
PutGroupConfigurationResponse
-> Rep PutGroupConfigurationResponse x
Prelude.Generic)
newPutGroupConfigurationResponse ::
Prelude.Int ->
PutGroupConfigurationResponse
newPutGroupConfigurationResponse :: Int -> PutGroupConfigurationResponse
newPutGroupConfigurationResponse Int
pHttpStatus_ =
PutGroupConfigurationResponse' :: Int -> PutGroupConfigurationResponse
PutGroupConfigurationResponse'
{ $sel:httpStatus:PutGroupConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putGroupConfigurationResponse_httpStatus :: Lens.Lens' PutGroupConfigurationResponse Prelude.Int
putGroupConfigurationResponse_httpStatus :: (Int -> f Int)
-> PutGroupConfigurationResponse -> f PutGroupConfigurationResponse
putGroupConfigurationResponse_httpStatus = (PutGroupConfigurationResponse -> Int)
-> (PutGroupConfigurationResponse
-> Int -> PutGroupConfigurationResponse)
-> Lens
PutGroupConfigurationResponse PutGroupConfigurationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutGroupConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutGroupConfigurationResponse' :: PutGroupConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutGroupConfigurationResponse
s@PutGroupConfigurationResponse' {} Int
a -> PutGroupConfigurationResponse
s {$sel:httpStatus:PutGroupConfigurationResponse' :: Int
httpStatus = Int
a} :: PutGroupConfigurationResponse)
instance Prelude.NFData PutGroupConfigurationResponse