{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types
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
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]
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
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. 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'
{ $sel:principalArn:DeleteAccountSetting' :: Maybe Text
principalArn =
forall a. Maybe a
Prelude.Nothing,
$sel:name:DeleteAccountSetting' :: SettingName
name = SettingName
pName_
}
deleteAccountSetting_principalArn :: Lens.Lens' DeleteAccountSetting (Prelude.Maybe Prelude.Text)
deleteAccountSetting_principalArn :: Lens' DeleteAccountSetting (Maybe Text)
deleteAccountSetting_principalArn = 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 :: Lens' DeleteAccountSetting SettingName
deleteAccountSetting_name = 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 :: (Service -> Service)
-> DeleteAccountSetting -> Request DeleteAccountSetting
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteAccountSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteAccountSetting)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Setting -> Int -> DeleteAccountSettingResponse
DeleteAccountSettingResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"setting")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteAccountSetting where
hashWithSalt :: Int -> DeleteAccountSetting -> Int
hashWithSalt Int
_salt DeleteAccountSetting' {Maybe Text
SettingName
name :: SettingName
principalArn :: Maybe Text
$sel:name:DeleteAccountSetting' :: DeleteAccountSetting -> SettingName
$sel:principalArn:DeleteAccountSetting' :: DeleteAccountSetting -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
principalArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SettingName
name
instance Prelude.NFData DeleteAccountSetting where
rnf :: DeleteAccountSetting -> ()
rnf DeleteAccountSetting' {Maybe Text
SettingName
name :: SettingName
principalArn :: Maybe Text
$sel:name:DeleteAccountSetting' :: DeleteAccountSetting -> SettingName
$sel:principalArn:DeleteAccountSetting' :: DeleteAccountSetting -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
principalArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SettingName
name
instance Data.ToHeaders DeleteAccountSetting where
toHeaders :: DeleteAccountSetting -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonEC2ContainerServiceV20141113.DeleteAccountSetting" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"principalArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
principalArn,
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SettingName
name)
]
)
instance Data.ToPath DeleteAccountSetting where
toPath :: DeleteAccountSetting -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteAccountSetting where
toQuery :: DeleteAccountSetting -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:setting:DeleteAccountSettingResponse' :: Maybe Setting
setting =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteAccountSettingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteAccountSettingResponse_setting :: Lens.Lens' DeleteAccountSettingResponse (Prelude.Maybe Setting)
deleteAccountSettingResponse_setting :: Lens' DeleteAccountSettingResponse (Maybe Setting)
deleteAccountSettingResponse_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 :: Lens' DeleteAccountSettingResponse Int
deleteAccountSettingResponse_httpStatus = 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 where
rnf :: DeleteAccountSettingResponse -> ()
rnf DeleteAccountSettingResponse' {Int
Maybe Setting
httpStatus :: Int
setting :: Maybe Setting
$sel:httpStatus:DeleteAccountSettingResponse' :: DeleteAccountSettingResponse -> Int
$sel:setting:DeleteAccountSettingResponse' :: DeleteAccountSettingResponse -> Maybe Setting
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Setting
setting
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus