{-# 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.ECS.PutAccountSettingDefault
(
PutAccountSettingDefault (..),
newPutAccountSettingDefault,
putAccountSettingDefault_name,
putAccountSettingDefault_value,
PutAccountSettingDefaultResponse (..),
newPutAccountSettingDefaultResponse,
putAccountSettingDefaultResponse_setting,
putAccountSettingDefaultResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ECS.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 PutAccountSettingDefault = PutAccountSettingDefault'
{
PutAccountSettingDefault -> SettingName
name :: SettingName,
PutAccountSettingDefault -> Text
value :: Prelude.Text
}
deriving (PutAccountSettingDefault -> PutAccountSettingDefault -> Bool
(PutAccountSettingDefault -> PutAccountSettingDefault -> Bool)
-> (PutAccountSettingDefault -> PutAccountSettingDefault -> Bool)
-> Eq PutAccountSettingDefault
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountSettingDefault -> PutAccountSettingDefault -> Bool
$c/= :: PutAccountSettingDefault -> PutAccountSettingDefault -> Bool
== :: PutAccountSettingDefault -> PutAccountSettingDefault -> Bool
$c== :: PutAccountSettingDefault -> PutAccountSettingDefault -> Bool
Prelude.Eq, ReadPrec [PutAccountSettingDefault]
ReadPrec PutAccountSettingDefault
Int -> ReadS PutAccountSettingDefault
ReadS [PutAccountSettingDefault]
(Int -> ReadS PutAccountSettingDefault)
-> ReadS [PutAccountSettingDefault]
-> ReadPrec PutAccountSettingDefault
-> ReadPrec [PutAccountSettingDefault]
-> Read PutAccountSettingDefault
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountSettingDefault]
$creadListPrec :: ReadPrec [PutAccountSettingDefault]
readPrec :: ReadPrec PutAccountSettingDefault
$creadPrec :: ReadPrec PutAccountSettingDefault
readList :: ReadS [PutAccountSettingDefault]
$creadList :: ReadS [PutAccountSettingDefault]
readsPrec :: Int -> ReadS PutAccountSettingDefault
$creadsPrec :: Int -> ReadS PutAccountSettingDefault
Prelude.Read, Int -> PutAccountSettingDefault -> ShowS
[PutAccountSettingDefault] -> ShowS
PutAccountSettingDefault -> String
(Int -> PutAccountSettingDefault -> ShowS)
-> (PutAccountSettingDefault -> String)
-> ([PutAccountSettingDefault] -> ShowS)
-> Show PutAccountSettingDefault
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountSettingDefault] -> ShowS
$cshowList :: [PutAccountSettingDefault] -> ShowS
show :: PutAccountSettingDefault -> String
$cshow :: PutAccountSettingDefault -> String
showsPrec :: Int -> PutAccountSettingDefault -> ShowS
$cshowsPrec :: Int -> PutAccountSettingDefault -> ShowS
Prelude.Show, (forall x.
PutAccountSettingDefault -> Rep PutAccountSettingDefault x)
-> (forall x.
Rep PutAccountSettingDefault x -> PutAccountSettingDefault)
-> Generic PutAccountSettingDefault
forall x.
Rep PutAccountSettingDefault x -> PutAccountSettingDefault
forall x.
PutAccountSettingDefault -> Rep PutAccountSettingDefault x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccountSettingDefault x -> PutAccountSettingDefault
$cfrom :: forall x.
PutAccountSettingDefault -> Rep PutAccountSettingDefault x
Prelude.Generic)
newPutAccountSettingDefault ::
SettingName ->
Prelude.Text ->
PutAccountSettingDefault
newPutAccountSettingDefault :: SettingName -> Text -> PutAccountSettingDefault
newPutAccountSettingDefault SettingName
pName_ Text
pValue_ =
PutAccountSettingDefault' :: SettingName -> Text -> PutAccountSettingDefault
PutAccountSettingDefault'
{ $sel:name:PutAccountSettingDefault' :: SettingName
name = SettingName
pName_,
$sel:value:PutAccountSettingDefault' :: Text
value = Text
pValue_
}
putAccountSettingDefault_name :: Lens.Lens' PutAccountSettingDefault SettingName
putAccountSettingDefault_name :: (SettingName -> f SettingName)
-> PutAccountSettingDefault -> f PutAccountSettingDefault
putAccountSettingDefault_name = (PutAccountSettingDefault -> SettingName)
-> (PutAccountSettingDefault
-> SettingName -> PutAccountSettingDefault)
-> Lens
PutAccountSettingDefault
PutAccountSettingDefault
SettingName
SettingName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountSettingDefault' {SettingName
name :: SettingName
$sel:name:PutAccountSettingDefault' :: PutAccountSettingDefault -> SettingName
name} -> SettingName
name) (\s :: PutAccountSettingDefault
s@PutAccountSettingDefault' {} SettingName
a -> PutAccountSettingDefault
s {$sel:name:PutAccountSettingDefault' :: SettingName
name = SettingName
a} :: PutAccountSettingDefault)
putAccountSettingDefault_value :: Lens.Lens' PutAccountSettingDefault Prelude.Text
putAccountSettingDefault_value :: (Text -> f Text)
-> PutAccountSettingDefault -> f PutAccountSettingDefault
putAccountSettingDefault_value = (PutAccountSettingDefault -> Text)
-> (PutAccountSettingDefault -> Text -> PutAccountSettingDefault)
-> Lens PutAccountSettingDefault PutAccountSettingDefault Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountSettingDefault' {Text
value :: Text
$sel:value:PutAccountSettingDefault' :: PutAccountSettingDefault -> Text
value} -> Text
value) (\s :: PutAccountSettingDefault
s@PutAccountSettingDefault' {} Text
a -> PutAccountSettingDefault
s {$sel:value:PutAccountSettingDefault' :: Text
value = Text
a} :: PutAccountSettingDefault)
instance Core.AWSRequest PutAccountSettingDefault where
type
AWSResponse PutAccountSettingDefault =
PutAccountSettingDefaultResponse
request :: PutAccountSettingDefault -> Request PutAccountSettingDefault
request = Service
-> PutAccountSettingDefault -> Request PutAccountSettingDefault
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutAccountSettingDefault
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutAccountSettingDefault)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutAccountSettingDefault))
-> Logger
-> Service
-> Proxy PutAccountSettingDefault
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutAccountSettingDefault)))
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 Setting -> Int -> PutAccountSettingDefaultResponse
PutAccountSettingDefaultResponse'
(Maybe Setting -> Int -> PutAccountSettingDefaultResponse)
-> Either String (Maybe Setting)
-> Either String (Int -> PutAccountSettingDefaultResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Setting)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"setting")
Either String (Int -> PutAccountSettingDefaultResponse)
-> Either String Int
-> Either String PutAccountSettingDefaultResponse
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 PutAccountSettingDefault
instance Prelude.NFData PutAccountSettingDefault
instance Core.ToHeaders PutAccountSettingDefault where
toHeaders :: PutAccountSettingDefault -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutAccountSettingDefault -> 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
"AmazonEC2ContainerServiceV20141113.PutAccountSettingDefault" ::
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 PutAccountSettingDefault where
toJSON :: PutAccountSettingDefault -> Value
toJSON PutAccountSettingDefault' {Text
SettingName
value :: Text
name :: SettingName
$sel:value:PutAccountSettingDefault' :: PutAccountSettingDefault -> Text
$sel:name:PutAccountSettingDefault' :: PutAccountSettingDefault -> SettingName
..} =
[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
"name" Text -> SettingName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SettingName
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
value)
]
)
instance Core.ToPath PutAccountSettingDefault where
toPath :: PutAccountSettingDefault -> ByteString
toPath = ByteString -> PutAccountSettingDefault -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutAccountSettingDefault where
toQuery :: PutAccountSettingDefault -> QueryString
toQuery = QueryString -> PutAccountSettingDefault -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutAccountSettingDefaultResponse = PutAccountSettingDefaultResponse'
{
PutAccountSettingDefaultResponse -> Maybe Setting
setting :: Prelude.Maybe Setting,
PutAccountSettingDefaultResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutAccountSettingDefaultResponse
-> PutAccountSettingDefaultResponse -> Bool
(PutAccountSettingDefaultResponse
-> PutAccountSettingDefaultResponse -> Bool)
-> (PutAccountSettingDefaultResponse
-> PutAccountSettingDefaultResponse -> Bool)
-> Eq PutAccountSettingDefaultResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountSettingDefaultResponse
-> PutAccountSettingDefaultResponse -> Bool
$c/= :: PutAccountSettingDefaultResponse
-> PutAccountSettingDefaultResponse -> Bool
== :: PutAccountSettingDefaultResponse
-> PutAccountSettingDefaultResponse -> Bool
$c== :: PutAccountSettingDefaultResponse
-> PutAccountSettingDefaultResponse -> Bool
Prelude.Eq, ReadPrec [PutAccountSettingDefaultResponse]
ReadPrec PutAccountSettingDefaultResponse
Int -> ReadS PutAccountSettingDefaultResponse
ReadS [PutAccountSettingDefaultResponse]
(Int -> ReadS PutAccountSettingDefaultResponse)
-> ReadS [PutAccountSettingDefaultResponse]
-> ReadPrec PutAccountSettingDefaultResponse
-> ReadPrec [PutAccountSettingDefaultResponse]
-> Read PutAccountSettingDefaultResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountSettingDefaultResponse]
$creadListPrec :: ReadPrec [PutAccountSettingDefaultResponse]
readPrec :: ReadPrec PutAccountSettingDefaultResponse
$creadPrec :: ReadPrec PutAccountSettingDefaultResponse
readList :: ReadS [PutAccountSettingDefaultResponse]
$creadList :: ReadS [PutAccountSettingDefaultResponse]
readsPrec :: Int -> ReadS PutAccountSettingDefaultResponse
$creadsPrec :: Int -> ReadS PutAccountSettingDefaultResponse
Prelude.Read, Int -> PutAccountSettingDefaultResponse -> ShowS
[PutAccountSettingDefaultResponse] -> ShowS
PutAccountSettingDefaultResponse -> String
(Int -> PutAccountSettingDefaultResponse -> ShowS)
-> (PutAccountSettingDefaultResponse -> String)
-> ([PutAccountSettingDefaultResponse] -> ShowS)
-> Show PutAccountSettingDefaultResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountSettingDefaultResponse] -> ShowS
$cshowList :: [PutAccountSettingDefaultResponse] -> ShowS
show :: PutAccountSettingDefaultResponse -> String
$cshow :: PutAccountSettingDefaultResponse -> String
showsPrec :: Int -> PutAccountSettingDefaultResponse -> ShowS
$cshowsPrec :: Int -> PutAccountSettingDefaultResponse -> ShowS
Prelude.Show, (forall x.
PutAccountSettingDefaultResponse
-> Rep PutAccountSettingDefaultResponse x)
-> (forall x.
Rep PutAccountSettingDefaultResponse x
-> PutAccountSettingDefaultResponse)
-> Generic PutAccountSettingDefaultResponse
forall x.
Rep PutAccountSettingDefaultResponse x
-> PutAccountSettingDefaultResponse
forall x.
PutAccountSettingDefaultResponse
-> Rep PutAccountSettingDefaultResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccountSettingDefaultResponse x
-> PutAccountSettingDefaultResponse
$cfrom :: forall x.
PutAccountSettingDefaultResponse
-> Rep PutAccountSettingDefaultResponse x
Prelude.Generic)
newPutAccountSettingDefaultResponse ::
Prelude.Int ->
PutAccountSettingDefaultResponse
newPutAccountSettingDefaultResponse :: Int -> PutAccountSettingDefaultResponse
newPutAccountSettingDefaultResponse Int
pHttpStatus_ =
PutAccountSettingDefaultResponse' :: Maybe Setting -> Int -> PutAccountSettingDefaultResponse
PutAccountSettingDefaultResponse'
{ $sel:setting:PutAccountSettingDefaultResponse' :: Maybe Setting
setting =
Maybe Setting
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutAccountSettingDefaultResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putAccountSettingDefaultResponse_setting :: Lens.Lens' PutAccountSettingDefaultResponse (Prelude.Maybe Setting)
putAccountSettingDefaultResponse_setting :: (Maybe Setting -> f (Maybe Setting))
-> PutAccountSettingDefaultResponse
-> f PutAccountSettingDefaultResponse
putAccountSettingDefaultResponse_setting = (PutAccountSettingDefaultResponse -> Maybe Setting)
-> (PutAccountSettingDefaultResponse
-> Maybe Setting -> PutAccountSettingDefaultResponse)
-> Lens
PutAccountSettingDefaultResponse
PutAccountSettingDefaultResponse
(Maybe Setting)
(Maybe Setting)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountSettingDefaultResponse' {Maybe Setting
setting :: Maybe Setting
$sel:setting:PutAccountSettingDefaultResponse' :: PutAccountSettingDefaultResponse -> Maybe Setting
setting} -> Maybe Setting
setting) (\s :: PutAccountSettingDefaultResponse
s@PutAccountSettingDefaultResponse' {} Maybe Setting
a -> PutAccountSettingDefaultResponse
s {$sel:setting:PutAccountSettingDefaultResponse' :: Maybe Setting
setting = Maybe Setting
a} :: PutAccountSettingDefaultResponse)
putAccountSettingDefaultResponse_httpStatus :: Lens.Lens' PutAccountSettingDefaultResponse Prelude.Int
putAccountSettingDefaultResponse_httpStatus :: (Int -> f Int)
-> PutAccountSettingDefaultResponse
-> f PutAccountSettingDefaultResponse
putAccountSettingDefaultResponse_httpStatus = (PutAccountSettingDefaultResponse -> Int)
-> (PutAccountSettingDefaultResponse
-> Int -> PutAccountSettingDefaultResponse)
-> Lens
PutAccountSettingDefaultResponse
PutAccountSettingDefaultResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountSettingDefaultResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAccountSettingDefaultResponse' :: PutAccountSettingDefaultResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutAccountSettingDefaultResponse
s@PutAccountSettingDefaultResponse' {} Int
a -> PutAccountSettingDefaultResponse
s {$sel:httpStatus:PutAccountSettingDefaultResponse' :: Int
httpStatus = Int
a} :: PutAccountSettingDefaultResponse)
instance
Prelude.NFData
PutAccountSettingDefaultResponse