{-# 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.CloudWatchEvents.DeleteConnection
(
DeleteConnection (..),
newDeleteConnection,
deleteConnection_name,
DeleteConnectionResponse (..),
newDeleteConnectionResponse,
deleteConnectionResponse_connectionArn,
deleteConnectionResponse_connectionState,
deleteConnectionResponse_creationTime,
deleteConnectionResponse_lastAuthorizedTime,
deleteConnectionResponse_lastModifiedTime,
deleteConnectionResponse_httpStatus,
)
where
import Amazonka.CloudWatchEvents.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteConnection = DeleteConnection'
{
DeleteConnection -> Text
name :: Prelude.Text
}
deriving (DeleteConnection -> DeleteConnection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnection -> DeleteConnection -> Bool
$c/= :: DeleteConnection -> DeleteConnection -> Bool
== :: DeleteConnection -> DeleteConnection -> Bool
$c== :: DeleteConnection -> DeleteConnection -> Bool
Prelude.Eq, ReadPrec [DeleteConnection]
ReadPrec DeleteConnection
Int -> ReadS DeleteConnection
ReadS [DeleteConnection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnection]
$creadListPrec :: ReadPrec [DeleteConnection]
readPrec :: ReadPrec DeleteConnection
$creadPrec :: ReadPrec DeleteConnection
readList :: ReadS [DeleteConnection]
$creadList :: ReadS [DeleteConnection]
readsPrec :: Int -> ReadS DeleteConnection
$creadsPrec :: Int -> ReadS DeleteConnection
Prelude.Read, Int -> DeleteConnection -> ShowS
[DeleteConnection] -> ShowS
DeleteConnection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnection] -> ShowS
$cshowList :: [DeleteConnection] -> ShowS
show :: DeleteConnection -> String
$cshow :: DeleteConnection -> String
showsPrec :: Int -> DeleteConnection -> ShowS
$cshowsPrec :: Int -> DeleteConnection -> ShowS
Prelude.Show, forall x. Rep DeleteConnection x -> DeleteConnection
forall x. DeleteConnection -> Rep DeleteConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteConnection x -> DeleteConnection
$cfrom :: forall x. DeleteConnection -> Rep DeleteConnection x
Prelude.Generic)
newDeleteConnection ::
Prelude.Text ->
DeleteConnection
newDeleteConnection :: Text -> DeleteConnection
newDeleteConnection Text
pName_ =
DeleteConnection' {$sel:name:DeleteConnection' :: Text
name = Text
pName_}
deleteConnection_name :: Lens.Lens' DeleteConnection Prelude.Text
deleteConnection_name :: Lens' DeleteConnection Text
deleteConnection_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnection' {Text
name :: Text
$sel:name:DeleteConnection' :: DeleteConnection -> Text
name} -> Text
name) (\s :: DeleteConnection
s@DeleteConnection' {} Text
a -> DeleteConnection
s {$sel:name:DeleteConnection' :: Text
name = Text
a} :: DeleteConnection)
instance Core.AWSRequest DeleteConnection where
type
AWSResponse DeleteConnection =
DeleteConnectionResponse
request :: (Service -> Service)
-> DeleteConnection -> Request DeleteConnection
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 DeleteConnection
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteConnection)))
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 Text
-> Maybe ConnectionState
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Int
-> DeleteConnectionResponse
DeleteConnectionResponse'
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
"ConnectionArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ConnectionState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastAuthorizedTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModifiedTime")
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 DeleteConnection where
hashWithSalt :: Int -> DeleteConnection -> Int
hashWithSalt Int
_salt DeleteConnection' {Text
name :: Text
$sel:name:DeleteConnection' :: DeleteConnection -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData DeleteConnection where
rnf :: DeleteConnection -> ()
rnf DeleteConnection' {Text
name :: Text
$sel:name:DeleteConnection' :: DeleteConnection -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders DeleteConnection where
toHeaders :: DeleteConnection -> 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
"AWSEvents.DeleteConnection" :: 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 DeleteConnection where
toJSON :: DeleteConnection -> Value
toJSON DeleteConnection' {Text
name :: Text
$sel:name:DeleteConnection' :: DeleteConnection -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)]
)
instance Data.ToPath DeleteConnection where
toPath :: DeleteConnection -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteConnection where
toQuery :: DeleteConnection -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteConnectionResponse = DeleteConnectionResponse'
{
DeleteConnectionResponse -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
DeleteConnectionResponse -> Maybe ConnectionState
connectionState :: Prelude.Maybe ConnectionState,
DeleteConnectionResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
DeleteConnectionResponse -> Maybe POSIX
lastAuthorizedTime :: Prelude.Maybe Data.POSIX,
DeleteConnectionResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
DeleteConnectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteConnectionResponse -> DeleteConnectionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnectionResponse -> DeleteConnectionResponse -> Bool
$c/= :: DeleteConnectionResponse -> DeleteConnectionResponse -> Bool
== :: DeleteConnectionResponse -> DeleteConnectionResponse -> Bool
$c== :: DeleteConnectionResponse -> DeleteConnectionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteConnectionResponse]
ReadPrec DeleteConnectionResponse
Int -> ReadS DeleteConnectionResponse
ReadS [DeleteConnectionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnectionResponse]
$creadListPrec :: ReadPrec [DeleteConnectionResponse]
readPrec :: ReadPrec DeleteConnectionResponse
$creadPrec :: ReadPrec DeleteConnectionResponse
readList :: ReadS [DeleteConnectionResponse]
$creadList :: ReadS [DeleteConnectionResponse]
readsPrec :: Int -> ReadS DeleteConnectionResponse
$creadsPrec :: Int -> ReadS DeleteConnectionResponse
Prelude.Read, Int -> DeleteConnectionResponse -> ShowS
[DeleteConnectionResponse] -> ShowS
DeleteConnectionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnectionResponse] -> ShowS
$cshowList :: [DeleteConnectionResponse] -> ShowS
show :: DeleteConnectionResponse -> String
$cshow :: DeleteConnectionResponse -> String
showsPrec :: Int -> DeleteConnectionResponse -> ShowS
$cshowsPrec :: Int -> DeleteConnectionResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteConnectionResponse x -> DeleteConnectionResponse
forall x.
DeleteConnectionResponse -> Rep DeleteConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConnectionResponse x -> DeleteConnectionResponse
$cfrom :: forall x.
DeleteConnectionResponse -> Rep DeleteConnectionResponse x
Prelude.Generic)
newDeleteConnectionResponse ::
Prelude.Int ->
DeleteConnectionResponse
newDeleteConnectionResponse :: Int -> DeleteConnectionResponse
newDeleteConnectionResponse Int
pHttpStatus_ =
DeleteConnectionResponse'
{ $sel:connectionArn:DeleteConnectionResponse' :: Maybe Text
connectionArn =
forall a. Maybe a
Prelude.Nothing,
$sel:connectionState:DeleteConnectionResponse' :: Maybe ConnectionState
connectionState = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:DeleteConnectionResponse' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:lastAuthorizedTime:DeleteConnectionResponse' :: Maybe POSIX
lastAuthorizedTime = forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTime:DeleteConnectionResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteConnectionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteConnectionResponse_connectionArn :: Lens.Lens' DeleteConnectionResponse (Prelude.Maybe Prelude.Text)
deleteConnectionResponse_connectionArn :: Lens' DeleteConnectionResponse (Maybe Text)
deleteConnectionResponse_connectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionResponse' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: DeleteConnectionResponse
s@DeleteConnectionResponse' {} Maybe Text
a -> DeleteConnectionResponse
s {$sel:connectionArn:DeleteConnectionResponse' :: Maybe Text
connectionArn = Maybe Text
a} :: DeleteConnectionResponse)
deleteConnectionResponse_connectionState :: Lens.Lens' DeleteConnectionResponse (Prelude.Maybe ConnectionState)
deleteConnectionResponse_connectionState :: Lens' DeleteConnectionResponse (Maybe ConnectionState)
deleteConnectionResponse_connectionState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionResponse' {Maybe ConnectionState
connectionState :: Maybe ConnectionState
$sel:connectionState:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe ConnectionState
connectionState} -> Maybe ConnectionState
connectionState) (\s :: DeleteConnectionResponse
s@DeleteConnectionResponse' {} Maybe ConnectionState
a -> DeleteConnectionResponse
s {$sel:connectionState:DeleteConnectionResponse' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
a} :: DeleteConnectionResponse)
deleteConnectionResponse_creationTime :: Lens.Lens' DeleteConnectionResponse (Prelude.Maybe Prelude.UTCTime)
deleteConnectionResponse_creationTime :: Lens' DeleteConnectionResponse (Maybe UTCTime)
deleteConnectionResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DeleteConnectionResponse
s@DeleteConnectionResponse' {} Maybe POSIX
a -> DeleteConnectionResponse
s {$sel:creationTime:DeleteConnectionResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DeleteConnectionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
deleteConnectionResponse_lastAuthorizedTime :: Lens.Lens' DeleteConnectionResponse (Prelude.Maybe Prelude.UTCTime)
deleteConnectionResponse_lastAuthorizedTime :: Lens' DeleteConnectionResponse (Maybe UTCTime)
deleteConnectionResponse_lastAuthorizedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionResponse' {Maybe POSIX
lastAuthorizedTime :: Maybe POSIX
$sel:lastAuthorizedTime:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe POSIX
lastAuthorizedTime} -> Maybe POSIX
lastAuthorizedTime) (\s :: DeleteConnectionResponse
s@DeleteConnectionResponse' {} Maybe POSIX
a -> DeleteConnectionResponse
s {$sel:lastAuthorizedTime:DeleteConnectionResponse' :: Maybe POSIX
lastAuthorizedTime = Maybe POSIX
a} :: DeleteConnectionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
deleteConnectionResponse_lastModifiedTime :: Lens.Lens' DeleteConnectionResponse (Prelude.Maybe Prelude.UTCTime)
deleteConnectionResponse_lastModifiedTime :: Lens' DeleteConnectionResponse (Maybe UTCTime)
deleteConnectionResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: DeleteConnectionResponse
s@DeleteConnectionResponse' {} Maybe POSIX
a -> DeleteConnectionResponse
s {$sel:lastModifiedTime:DeleteConnectionResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: DeleteConnectionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
deleteConnectionResponse_httpStatus :: Lens.Lens' DeleteConnectionResponse Prelude.Int
deleteConnectionResponse_httpStatus :: Lens' DeleteConnectionResponse Int
deleteConnectionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteConnectionResponse' :: DeleteConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteConnectionResponse
s@DeleteConnectionResponse' {} Int
a -> DeleteConnectionResponse
s {$sel:httpStatus:DeleteConnectionResponse' :: Int
httpStatus = Int
a} :: DeleteConnectionResponse)
instance Prelude.NFData DeleteConnectionResponse where
rnf :: DeleteConnectionResponse -> ()
rnf DeleteConnectionResponse' {Int
Maybe Text
Maybe POSIX
Maybe ConnectionState
httpStatus :: Int
lastModifiedTime :: Maybe POSIX
lastAuthorizedTime :: Maybe POSIX
creationTime :: Maybe POSIX
connectionState :: Maybe ConnectionState
connectionArn :: Maybe Text
$sel:httpStatus:DeleteConnectionResponse' :: DeleteConnectionResponse -> Int
$sel:lastModifiedTime:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe POSIX
$sel:lastAuthorizedTime:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe POSIX
$sel:creationTime:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe POSIX
$sel:connectionState:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe ConnectionState
$sel:connectionArn:DeleteConnectionResponse' :: DeleteConnectionResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectionState
connectionState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastAuthorizedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus