{-# 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.CloudTrail.StopLogging
(
StopLogging (..),
newStopLogging,
stopLogging_name,
StopLoggingResponse (..),
newStopLoggingResponse,
stopLoggingResponse_httpStatus,
)
where
import Amazonka.CloudTrail.Types
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 qualified Amazonka.Response as Response
data StopLogging = StopLogging'
{
StopLogging -> Text
name :: Prelude.Text
}
deriving (StopLogging -> StopLogging -> Bool
(StopLogging -> StopLogging -> Bool)
-> (StopLogging -> StopLogging -> Bool) -> Eq StopLogging
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopLogging -> StopLogging -> Bool
$c/= :: StopLogging -> StopLogging -> Bool
== :: StopLogging -> StopLogging -> Bool
$c== :: StopLogging -> StopLogging -> Bool
Prelude.Eq, ReadPrec [StopLogging]
ReadPrec StopLogging
Int -> ReadS StopLogging
ReadS [StopLogging]
(Int -> ReadS StopLogging)
-> ReadS [StopLogging]
-> ReadPrec StopLogging
-> ReadPrec [StopLogging]
-> Read StopLogging
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopLogging]
$creadListPrec :: ReadPrec [StopLogging]
readPrec :: ReadPrec StopLogging
$creadPrec :: ReadPrec StopLogging
readList :: ReadS [StopLogging]
$creadList :: ReadS [StopLogging]
readsPrec :: Int -> ReadS StopLogging
$creadsPrec :: Int -> ReadS StopLogging
Prelude.Read, Int -> StopLogging -> ShowS
[StopLogging] -> ShowS
StopLogging -> String
(Int -> StopLogging -> ShowS)
-> (StopLogging -> String)
-> ([StopLogging] -> ShowS)
-> Show StopLogging
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopLogging] -> ShowS
$cshowList :: [StopLogging] -> ShowS
show :: StopLogging -> String
$cshow :: StopLogging -> String
showsPrec :: Int -> StopLogging -> ShowS
$cshowsPrec :: Int -> StopLogging -> ShowS
Prelude.Show, (forall x. StopLogging -> Rep StopLogging x)
-> (forall x. Rep StopLogging x -> StopLogging)
-> Generic StopLogging
forall x. Rep StopLogging x -> StopLogging
forall x. StopLogging -> Rep StopLogging x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopLogging x -> StopLogging
$cfrom :: forall x. StopLogging -> Rep StopLogging x
Prelude.Generic)
newStopLogging ::
Prelude.Text ->
StopLogging
newStopLogging :: Text -> StopLogging
newStopLogging Text
pName_ = StopLogging' :: Text -> StopLogging
StopLogging' {$sel:name:StopLogging' :: Text
name = Text
pName_}
stopLogging_name :: Lens.Lens' StopLogging Prelude.Text
stopLogging_name :: (Text -> f Text) -> StopLogging -> f StopLogging
stopLogging_name = (StopLogging -> Text)
-> (StopLogging -> Text -> StopLogging)
-> Lens StopLogging StopLogging Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopLogging' {Text
name :: Text
$sel:name:StopLogging' :: StopLogging -> Text
name} -> Text
name) (\s :: StopLogging
s@StopLogging' {} Text
a -> StopLogging
s {$sel:name:StopLogging' :: Text
name = Text
a} :: StopLogging)
instance Core.AWSRequest StopLogging where
type AWSResponse StopLogging = StopLoggingResponse
request :: StopLogging -> Request StopLogging
request = Service -> StopLogging -> Request StopLogging
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopLogging
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopLogging)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StopLogging))
-> Logger
-> Service
-> Proxy StopLogging
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopLogging)))
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 -> StopLoggingResponse
StopLoggingResponse'
(Int -> StopLoggingResponse)
-> Either String Int -> Either String StopLoggingResponse
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 StopLogging
instance Prelude.NFData StopLogging
instance Core.ToHeaders StopLogging where
toHeaders :: StopLogging -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopLogging -> 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
"com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.StopLogging" ::
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 StopLogging where
toJSON :: StopLogging -> Value
toJSON StopLogging' {Text
name :: Text
$sel:name:StopLogging' :: StopLogging -> Text
..} =
[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 -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath StopLogging where
toPath :: StopLogging -> ByteString
toPath = ByteString -> StopLogging -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopLogging where
toQuery :: StopLogging -> QueryString
toQuery = QueryString -> StopLogging -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopLoggingResponse = StopLoggingResponse'
{
StopLoggingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopLoggingResponse -> StopLoggingResponse -> Bool
(StopLoggingResponse -> StopLoggingResponse -> Bool)
-> (StopLoggingResponse -> StopLoggingResponse -> Bool)
-> Eq StopLoggingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopLoggingResponse -> StopLoggingResponse -> Bool
$c/= :: StopLoggingResponse -> StopLoggingResponse -> Bool
== :: StopLoggingResponse -> StopLoggingResponse -> Bool
$c== :: StopLoggingResponse -> StopLoggingResponse -> Bool
Prelude.Eq, ReadPrec [StopLoggingResponse]
ReadPrec StopLoggingResponse
Int -> ReadS StopLoggingResponse
ReadS [StopLoggingResponse]
(Int -> ReadS StopLoggingResponse)
-> ReadS [StopLoggingResponse]
-> ReadPrec StopLoggingResponse
-> ReadPrec [StopLoggingResponse]
-> Read StopLoggingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopLoggingResponse]
$creadListPrec :: ReadPrec [StopLoggingResponse]
readPrec :: ReadPrec StopLoggingResponse
$creadPrec :: ReadPrec StopLoggingResponse
readList :: ReadS [StopLoggingResponse]
$creadList :: ReadS [StopLoggingResponse]
readsPrec :: Int -> ReadS StopLoggingResponse
$creadsPrec :: Int -> ReadS StopLoggingResponse
Prelude.Read, Int -> StopLoggingResponse -> ShowS
[StopLoggingResponse] -> ShowS
StopLoggingResponse -> String
(Int -> StopLoggingResponse -> ShowS)
-> (StopLoggingResponse -> String)
-> ([StopLoggingResponse] -> ShowS)
-> Show StopLoggingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopLoggingResponse] -> ShowS
$cshowList :: [StopLoggingResponse] -> ShowS
show :: StopLoggingResponse -> String
$cshow :: StopLoggingResponse -> String
showsPrec :: Int -> StopLoggingResponse -> ShowS
$cshowsPrec :: Int -> StopLoggingResponse -> ShowS
Prelude.Show, (forall x. StopLoggingResponse -> Rep StopLoggingResponse x)
-> (forall x. Rep StopLoggingResponse x -> StopLoggingResponse)
-> Generic StopLoggingResponse
forall x. Rep StopLoggingResponse x -> StopLoggingResponse
forall x. StopLoggingResponse -> Rep StopLoggingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopLoggingResponse x -> StopLoggingResponse
$cfrom :: forall x. StopLoggingResponse -> Rep StopLoggingResponse x
Prelude.Generic)
newStopLoggingResponse ::
Prelude.Int ->
StopLoggingResponse
newStopLoggingResponse :: Int -> StopLoggingResponse
newStopLoggingResponse Int
pHttpStatus_ =
StopLoggingResponse' :: Int -> StopLoggingResponse
StopLoggingResponse' {$sel:httpStatus:StopLoggingResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopLoggingResponse_httpStatus :: Lens.Lens' StopLoggingResponse Prelude.Int
stopLoggingResponse_httpStatus :: (Int -> f Int) -> StopLoggingResponse -> f StopLoggingResponse
stopLoggingResponse_httpStatus = (StopLoggingResponse -> Int)
-> (StopLoggingResponse -> Int -> StopLoggingResponse)
-> Lens StopLoggingResponse StopLoggingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopLoggingResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopLoggingResponse' :: StopLoggingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopLoggingResponse
s@StopLoggingResponse' {} Int
a -> StopLoggingResponse
s {$sel:httpStatus:StopLoggingResponse' :: Int
httpStatus = Int
a} :: StopLoggingResponse)
instance Prelude.NFData StopLoggingResponse