{-# 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.DeleteAccountSetting
(
DeleteAccountSetting (..),
newDeleteAccountSetting,
deleteAccountSetting_principalArn,
deleteAccountSetting_name,
DeleteAccountSettingResponse (..),
newDeleteAccountSettingResponse,
deleteAccountSettingResponse_setting,
deleteAccountSettingResponse_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 DeleteAccountSetting = DeleteAccountSetting'
{
DeleteAccountSetting -> Maybe Text
principalArn :: Prelude.Maybe Prelude.Text,
DeleteAccountSetting -> SettingName
name :: SettingName
}
deriving (DeleteAccountSetting -> DeleteAccountSetting -> Bool
(DeleteAccountSetting -> DeleteAccountSetting -> Bool)
-> (DeleteAccountSetting -> DeleteAccountSetting -> Bool)
-> Eq DeleteAccountSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccountSetting -> DeleteAccountSetting -> Bool
$c/= :: DeleteAccountSetting -> DeleteAccountSetting -> Bool
== :: DeleteAccountSetting -> DeleteAccountSetting -> Bool
$c== :: DeleteAccountSetting -> DeleteAccountSetting -> Bool
Prelude.Eq, ReadPrec [DeleteAccountSetting]
ReadPrec DeleteAccountSetting
Int -> ReadS DeleteAccountSetting
ReadS [DeleteAccountSetting]
(Int -> ReadS DeleteAccountSetting)
-> ReadS [DeleteAccountSetting]
-> ReadPrec DeleteAccountSetting
-> ReadPrec [DeleteAccountSetting]
-> Read DeleteAccountSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccountSetting]
$creadListPrec :: ReadPrec [DeleteAccountSetting]
readPrec :: ReadPrec DeleteAccountSetting
$creadPrec :: ReadPrec DeleteAccountSetting
readList :: ReadS [DeleteAccountSetting]
$creadList :: ReadS [DeleteAccountSetting]
readsPrec :: Int -> ReadS DeleteAccountSetting
$creadsPrec :: Int -> ReadS DeleteAccountSetting
Prelude.Read, Int -> DeleteAccountSetting -> ShowS
[DeleteAccountSetting] -> ShowS
DeleteAccountSetting -> String
(Int -> DeleteAccountSetting -> ShowS)
-> (DeleteAccountSetting -> String)
-> ([DeleteAccountSetting] -> ShowS)
-> Show DeleteAccountSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccountSetting] -> ShowS
$cshowList :: [DeleteAccountSetting] -> ShowS
show :: DeleteAccountSetting -> String
$cshow :: DeleteAccountSetting -> String
showsPrec :: Int -> DeleteAccountSetting -> ShowS
$cshowsPrec :: Int -> DeleteAccountSetting -> ShowS
Prelude.Show, (forall x. DeleteAccountSetting -> Rep DeleteAccountSetting x)
-> (forall x. Rep DeleteAccountSetting x -> DeleteAccountSetting)
-> Generic DeleteAccountSetting
forall x. Rep DeleteAccountSetting x -> DeleteAccountSetting
forall x. DeleteAccountSetting -> Rep DeleteAccountSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccountSetting x -> DeleteAccountSetting
$cfrom :: forall x. DeleteAccountSetting -> Rep DeleteAccountSetting x
Prelude.Generic)
newDeleteAccountSetting ::
SettingName ->
DeleteAccountSetting
newDeleteAccountSetting :: SettingName -> DeleteAccountSetting
newDeleteAccountSetting SettingName
pName_ =
DeleteAccountSetting' :: Maybe Text -> SettingName -> DeleteAccountSetting
DeleteAccountSetting'
{ $sel:principalArn:DeleteAccountSetting' :: Maybe Text
principalArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:DeleteAccountSetting' :: SettingName
name = SettingName
pName_
}
deleteAccountSetting_principalArn :: Lens.Lens' DeleteAccountSetting (Prelude.Maybe Prelude.Text)
deleteAccountSetting_principalArn :: (Maybe Text -> f (Maybe Text))
-> DeleteAccountSetting -> f DeleteAccountSetting
deleteAccountSetting_principalArn = (DeleteAccountSetting -> Maybe Text)
-> (DeleteAccountSetting -> Maybe Text -> DeleteAccountSetting)
-> Lens
DeleteAccountSetting DeleteAccountSetting (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccountSetting' {Maybe Text
principalArn :: Maybe Text
$sel:principalArn:DeleteAccountSetting' :: DeleteAccountSetting -> Maybe Text
principalArn} -> Maybe Text
principalArn) (\s :: DeleteAccountSetting
s@DeleteAccountSetting' {} Maybe Text
a -> DeleteAccountSetting
s {$sel:principalArn:DeleteAccountSetting' :: Maybe Text
principalArn = Maybe Text
a} :: DeleteAccountSetting)
deleteAccountSetting_name :: Lens.Lens' DeleteAccountSetting SettingName
deleteAccountSetting_name :: (SettingName -> f SettingName)
-> DeleteAccountSetting -> f DeleteAccountSetting
deleteAccountSetting_name = (DeleteAccountSetting -> SettingName)
-> (DeleteAccountSetting -> SettingName -> DeleteAccountSetting)
-> Lens
DeleteAccountSetting DeleteAccountSetting SettingName SettingName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccountSetting' {SettingName
name :: SettingName
$sel:name:DeleteAccountSetting' :: DeleteAccountSetting -> SettingName
name} -> SettingName
name) (\s :: DeleteAccountSetting
s@DeleteAccountSetting' {} SettingName
a -> DeleteAccountSetting
s {$sel:name:DeleteAccountSetting' :: SettingName
name = SettingName
a} :: DeleteAccountSetting)
instance Core.AWSRequest DeleteAccountSetting where
type
AWSResponse DeleteAccountSetting =
DeleteAccountSettingResponse
request :: DeleteAccountSetting -> Request DeleteAccountSetting
request = Service -> DeleteAccountSetting -> Request DeleteAccountSetting
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAccountSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteAccountSetting)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteAccountSetting))
-> Logger
-> Service
-> Proxy DeleteAccountSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteAccountSetting)))
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 -> DeleteAccountSettingResponse
DeleteAccountSettingResponse'
(Maybe Setting -> Int -> DeleteAccountSettingResponse)
-> Either String (Maybe Setting)
-> Either String (Int -> DeleteAccountSettingResponse)
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 -> DeleteAccountSettingResponse)
-> Either String Int -> Either String DeleteAccountSettingResponse
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 DeleteAccountSetting
instance Prelude.NFData DeleteAccountSetting
instance Core.ToHeaders DeleteAccountSetting where
toHeaders :: DeleteAccountSetting -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteAccountSetting -> 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.DeleteAccountSetting" ::
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 DeleteAccountSetting where
toJSON :: DeleteAccountSetting -> Value
toJSON DeleteAccountSetting' {Maybe Text
SettingName
name :: SettingName
principalArn :: Maybe Text
$sel:name:DeleteAccountSetting' :: DeleteAccountSetting -> SettingName
$sel:principalArn:DeleteAccountSetting' :: DeleteAccountSetting -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"principalArn" 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
principalArn,
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)
]
)
instance Core.ToPath DeleteAccountSetting where
toPath :: DeleteAccountSetting -> ByteString
toPath = ByteString -> DeleteAccountSetting -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteAccountSetting where
toQuery :: DeleteAccountSetting -> QueryString
toQuery = QueryString -> DeleteAccountSetting -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteAccountSettingResponse = DeleteAccountSettingResponse'
{
DeleteAccountSettingResponse -> Maybe Setting
setting :: Prelude.Maybe Setting,
DeleteAccountSettingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteAccountSettingResponse
-> DeleteAccountSettingResponse -> Bool
(DeleteAccountSettingResponse
-> DeleteAccountSettingResponse -> Bool)
-> (DeleteAccountSettingResponse
-> DeleteAccountSettingResponse -> Bool)
-> Eq DeleteAccountSettingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccountSettingResponse
-> DeleteAccountSettingResponse -> Bool
$c/= :: DeleteAccountSettingResponse
-> DeleteAccountSettingResponse -> Bool
== :: DeleteAccountSettingResponse
-> DeleteAccountSettingResponse -> Bool
$c== :: DeleteAccountSettingResponse
-> DeleteAccountSettingResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAccountSettingResponse]
ReadPrec DeleteAccountSettingResponse
Int -> ReadS DeleteAccountSettingResponse
ReadS [DeleteAccountSettingResponse]
(Int -> ReadS DeleteAccountSettingResponse)
-> ReadS [DeleteAccountSettingResponse]
-> ReadPrec DeleteAccountSettingResponse
-> ReadPrec [DeleteAccountSettingResponse]
-> Read DeleteAccountSettingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccountSettingResponse]
$creadListPrec :: ReadPrec [DeleteAccountSettingResponse]
readPrec :: ReadPrec DeleteAccountSettingResponse
$creadPrec :: ReadPrec DeleteAccountSettingResponse
readList :: ReadS [DeleteAccountSettingResponse]
$creadList :: ReadS [DeleteAccountSettingResponse]
readsPrec :: Int -> ReadS DeleteAccountSettingResponse
$creadsPrec :: Int -> ReadS DeleteAccountSettingResponse
Prelude.Read, Int -> DeleteAccountSettingResponse -> ShowS
[DeleteAccountSettingResponse] -> ShowS
DeleteAccountSettingResponse -> String
(Int -> DeleteAccountSettingResponse -> ShowS)
-> (DeleteAccountSettingResponse -> String)
-> ([DeleteAccountSettingResponse] -> ShowS)
-> Show DeleteAccountSettingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccountSettingResponse] -> ShowS
$cshowList :: [DeleteAccountSettingResponse] -> ShowS
show :: DeleteAccountSettingResponse -> String
$cshow :: DeleteAccountSettingResponse -> String
showsPrec :: Int -> DeleteAccountSettingResponse -> ShowS
$cshowsPrec :: Int -> DeleteAccountSettingResponse -> ShowS
Prelude.Show, (forall x.
DeleteAccountSettingResponse -> Rep DeleteAccountSettingResponse x)
-> (forall x.
Rep DeleteAccountSettingResponse x -> DeleteAccountSettingResponse)
-> Generic DeleteAccountSettingResponse
forall x.
Rep DeleteAccountSettingResponse x -> DeleteAccountSettingResponse
forall x.
DeleteAccountSettingResponse -> Rep DeleteAccountSettingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAccountSettingResponse x -> DeleteAccountSettingResponse
$cfrom :: forall x.
DeleteAccountSettingResponse -> Rep DeleteAccountSettingResponse x
Prelude.Generic)
newDeleteAccountSettingResponse ::
Prelude.Int ->
DeleteAccountSettingResponse
newDeleteAccountSettingResponse :: Int -> DeleteAccountSettingResponse
newDeleteAccountSettingResponse Int
pHttpStatus_ =
DeleteAccountSettingResponse' :: Maybe Setting -> Int -> DeleteAccountSettingResponse
DeleteAccountSettingResponse'
{ $sel:setting:DeleteAccountSettingResponse' :: Maybe Setting
setting =
Maybe Setting
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteAccountSettingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteAccountSettingResponse_setting :: Lens.Lens' DeleteAccountSettingResponse (Prelude.Maybe Setting)
deleteAccountSettingResponse_setting :: (Maybe Setting -> f (Maybe Setting))
-> DeleteAccountSettingResponse -> f DeleteAccountSettingResponse
deleteAccountSettingResponse_setting = (DeleteAccountSettingResponse -> Maybe Setting)
-> (DeleteAccountSettingResponse
-> Maybe Setting -> DeleteAccountSettingResponse)
-> Lens
DeleteAccountSettingResponse
DeleteAccountSettingResponse
(Maybe Setting)
(Maybe Setting)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccountSettingResponse' {Maybe Setting
setting :: Maybe Setting
$sel:setting:DeleteAccountSettingResponse' :: DeleteAccountSettingResponse -> Maybe Setting
setting} -> Maybe Setting
setting) (\s :: DeleteAccountSettingResponse
s@DeleteAccountSettingResponse' {} Maybe Setting
a -> DeleteAccountSettingResponse
s {$sel:setting:DeleteAccountSettingResponse' :: Maybe Setting
setting = Maybe Setting
a} :: DeleteAccountSettingResponse)
deleteAccountSettingResponse_httpStatus :: Lens.Lens' DeleteAccountSettingResponse Prelude.Int
deleteAccountSettingResponse_httpStatus :: (Int -> f Int)
-> DeleteAccountSettingResponse -> f DeleteAccountSettingResponse
deleteAccountSettingResponse_httpStatus = (DeleteAccountSettingResponse -> Int)
-> (DeleteAccountSettingResponse
-> Int -> DeleteAccountSettingResponse)
-> Lens
DeleteAccountSettingResponse DeleteAccountSettingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccountSettingResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAccountSettingResponse' :: DeleteAccountSettingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAccountSettingResponse
s@DeleteAccountSettingResponse' {} Int
a -> DeleteAccountSettingResponse
s {$sel:httpStatus:DeleteAccountSettingResponse' :: Int
httpStatus = Int
a} :: DeleteAccountSettingResponse)
instance Prelude.NFData DeleteAccountSettingResponse