{-# 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.OpenSearch.DeleteOutboundConnection
(
DeleteOutboundConnection (..),
newDeleteOutboundConnection,
deleteOutboundConnection_connectionId,
DeleteOutboundConnectionResponse (..),
newDeleteOutboundConnectionResponse,
deleteOutboundConnectionResponse_connection,
deleteOutboundConnectionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteOutboundConnection = DeleteOutboundConnection'
{
DeleteOutboundConnection -> Text
connectionId :: Prelude.Text
}
deriving (DeleteOutboundConnection -> DeleteOutboundConnection -> Bool
(DeleteOutboundConnection -> DeleteOutboundConnection -> Bool)
-> (DeleteOutboundConnection -> DeleteOutboundConnection -> Bool)
-> Eq DeleteOutboundConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOutboundConnection -> DeleteOutboundConnection -> Bool
$c/= :: DeleteOutboundConnection -> DeleteOutboundConnection -> Bool
== :: DeleteOutboundConnection -> DeleteOutboundConnection -> Bool
$c== :: DeleteOutboundConnection -> DeleteOutboundConnection -> Bool
Prelude.Eq, ReadPrec [DeleteOutboundConnection]
ReadPrec DeleteOutboundConnection
Int -> ReadS DeleteOutboundConnection
ReadS [DeleteOutboundConnection]
(Int -> ReadS DeleteOutboundConnection)
-> ReadS [DeleteOutboundConnection]
-> ReadPrec DeleteOutboundConnection
-> ReadPrec [DeleteOutboundConnection]
-> Read DeleteOutboundConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOutboundConnection]
$creadListPrec :: ReadPrec [DeleteOutboundConnection]
readPrec :: ReadPrec DeleteOutboundConnection
$creadPrec :: ReadPrec DeleteOutboundConnection
readList :: ReadS [DeleteOutboundConnection]
$creadList :: ReadS [DeleteOutboundConnection]
readsPrec :: Int -> ReadS DeleteOutboundConnection
$creadsPrec :: Int -> ReadS DeleteOutboundConnection
Prelude.Read, Int -> DeleteOutboundConnection -> ShowS
[DeleteOutboundConnection] -> ShowS
DeleteOutboundConnection -> String
(Int -> DeleteOutboundConnection -> ShowS)
-> (DeleteOutboundConnection -> String)
-> ([DeleteOutboundConnection] -> ShowS)
-> Show DeleteOutboundConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOutboundConnection] -> ShowS
$cshowList :: [DeleteOutboundConnection] -> ShowS
show :: DeleteOutboundConnection -> String
$cshow :: DeleteOutboundConnection -> String
showsPrec :: Int -> DeleteOutboundConnection -> ShowS
$cshowsPrec :: Int -> DeleteOutboundConnection -> ShowS
Prelude.Show, (forall x.
DeleteOutboundConnection -> Rep DeleteOutboundConnection x)
-> (forall x.
Rep DeleteOutboundConnection x -> DeleteOutboundConnection)
-> Generic DeleteOutboundConnection
forall x.
Rep DeleteOutboundConnection x -> DeleteOutboundConnection
forall x.
DeleteOutboundConnection -> Rep DeleteOutboundConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteOutboundConnection x -> DeleteOutboundConnection
$cfrom :: forall x.
DeleteOutboundConnection -> Rep DeleteOutboundConnection x
Prelude.Generic)
newDeleteOutboundConnection ::
Prelude.Text ->
DeleteOutboundConnection
newDeleteOutboundConnection :: Text -> DeleteOutboundConnection
newDeleteOutboundConnection Text
pConnectionId_ =
DeleteOutboundConnection' :: Text -> DeleteOutboundConnection
DeleteOutboundConnection'
{ $sel:connectionId:DeleteOutboundConnection' :: Text
connectionId =
Text
pConnectionId_
}
deleteOutboundConnection_connectionId :: Lens.Lens' DeleteOutboundConnection Prelude.Text
deleteOutboundConnection_connectionId :: (Text -> f Text)
-> DeleteOutboundConnection -> f DeleteOutboundConnection
deleteOutboundConnection_connectionId = (DeleteOutboundConnection -> Text)
-> (DeleteOutboundConnection -> Text -> DeleteOutboundConnection)
-> Lens DeleteOutboundConnection DeleteOutboundConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOutboundConnection' {Text
connectionId :: Text
$sel:connectionId:DeleteOutboundConnection' :: DeleteOutboundConnection -> Text
connectionId} -> Text
connectionId) (\s :: DeleteOutboundConnection
s@DeleteOutboundConnection' {} Text
a -> DeleteOutboundConnection
s {$sel:connectionId:DeleteOutboundConnection' :: Text
connectionId = Text
a} :: DeleteOutboundConnection)
instance Core.AWSRequest DeleteOutboundConnection where
type
AWSResponse DeleteOutboundConnection =
DeleteOutboundConnectionResponse
request :: DeleteOutboundConnection -> Request DeleteOutboundConnection
request = Service
-> DeleteOutboundConnection -> Request DeleteOutboundConnection
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteOutboundConnection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteOutboundConnection)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteOutboundConnection))
-> Logger
-> Service
-> Proxy DeleteOutboundConnection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteOutboundConnection)))
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 OutboundConnection -> Int -> DeleteOutboundConnectionResponse
DeleteOutboundConnectionResponse'
(Maybe OutboundConnection
-> Int -> DeleteOutboundConnectionResponse)
-> Either String (Maybe OutboundConnection)
-> Either String (Int -> DeleteOutboundConnectionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe OutboundConnection)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Connection")
Either String (Int -> DeleteOutboundConnectionResponse)
-> Either String Int
-> Either String DeleteOutboundConnectionResponse
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 DeleteOutboundConnection
instance Prelude.NFData DeleteOutboundConnection
instance Core.ToHeaders DeleteOutboundConnection where
toHeaders :: DeleteOutboundConnection -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteOutboundConnection -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteOutboundConnection where
toPath :: DeleteOutboundConnection -> ByteString
toPath DeleteOutboundConnection' {Text
connectionId :: Text
$sel:connectionId:DeleteOutboundConnection' :: DeleteOutboundConnection -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2021-01-01/opensearch/cc/outboundConnection/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
connectionId
]
instance Core.ToQuery DeleteOutboundConnection where
toQuery :: DeleteOutboundConnection -> QueryString
toQuery = QueryString -> DeleteOutboundConnection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteOutboundConnectionResponse = DeleteOutboundConnectionResponse'
{
DeleteOutboundConnectionResponse -> Maybe OutboundConnection
connection :: Prelude.Maybe OutboundConnection,
DeleteOutboundConnectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteOutboundConnectionResponse
-> DeleteOutboundConnectionResponse -> Bool
(DeleteOutboundConnectionResponse
-> DeleteOutboundConnectionResponse -> Bool)
-> (DeleteOutboundConnectionResponse
-> DeleteOutboundConnectionResponse -> Bool)
-> Eq DeleteOutboundConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOutboundConnectionResponse
-> DeleteOutboundConnectionResponse -> Bool
$c/= :: DeleteOutboundConnectionResponse
-> DeleteOutboundConnectionResponse -> Bool
== :: DeleteOutboundConnectionResponse
-> DeleteOutboundConnectionResponse -> Bool
$c== :: DeleteOutboundConnectionResponse
-> DeleteOutboundConnectionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteOutboundConnectionResponse]
ReadPrec DeleteOutboundConnectionResponse
Int -> ReadS DeleteOutboundConnectionResponse
ReadS [DeleteOutboundConnectionResponse]
(Int -> ReadS DeleteOutboundConnectionResponse)
-> ReadS [DeleteOutboundConnectionResponse]
-> ReadPrec DeleteOutboundConnectionResponse
-> ReadPrec [DeleteOutboundConnectionResponse]
-> Read DeleteOutboundConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOutboundConnectionResponse]
$creadListPrec :: ReadPrec [DeleteOutboundConnectionResponse]
readPrec :: ReadPrec DeleteOutboundConnectionResponse
$creadPrec :: ReadPrec DeleteOutboundConnectionResponse
readList :: ReadS [DeleteOutboundConnectionResponse]
$creadList :: ReadS [DeleteOutboundConnectionResponse]
readsPrec :: Int -> ReadS DeleteOutboundConnectionResponse
$creadsPrec :: Int -> ReadS DeleteOutboundConnectionResponse
Prelude.Read, Int -> DeleteOutboundConnectionResponse -> ShowS
[DeleteOutboundConnectionResponse] -> ShowS
DeleteOutboundConnectionResponse -> String
(Int -> DeleteOutboundConnectionResponse -> ShowS)
-> (DeleteOutboundConnectionResponse -> String)
-> ([DeleteOutboundConnectionResponse] -> ShowS)
-> Show DeleteOutboundConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOutboundConnectionResponse] -> ShowS
$cshowList :: [DeleteOutboundConnectionResponse] -> ShowS
show :: DeleteOutboundConnectionResponse -> String
$cshow :: DeleteOutboundConnectionResponse -> String
showsPrec :: Int -> DeleteOutboundConnectionResponse -> ShowS
$cshowsPrec :: Int -> DeleteOutboundConnectionResponse -> ShowS
Prelude.Show, (forall x.
DeleteOutboundConnectionResponse
-> Rep DeleteOutboundConnectionResponse x)
-> (forall x.
Rep DeleteOutboundConnectionResponse x
-> DeleteOutboundConnectionResponse)
-> Generic DeleteOutboundConnectionResponse
forall x.
Rep DeleteOutboundConnectionResponse x
-> DeleteOutboundConnectionResponse
forall x.
DeleteOutboundConnectionResponse
-> Rep DeleteOutboundConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteOutboundConnectionResponse x
-> DeleteOutboundConnectionResponse
$cfrom :: forall x.
DeleteOutboundConnectionResponse
-> Rep DeleteOutboundConnectionResponse x
Prelude.Generic)
newDeleteOutboundConnectionResponse ::
Prelude.Int ->
DeleteOutboundConnectionResponse
newDeleteOutboundConnectionResponse :: Int -> DeleteOutboundConnectionResponse
newDeleteOutboundConnectionResponse Int
pHttpStatus_ =
DeleteOutboundConnectionResponse' :: Maybe OutboundConnection -> Int -> DeleteOutboundConnectionResponse
DeleteOutboundConnectionResponse'
{ $sel:connection:DeleteOutboundConnectionResponse' :: Maybe OutboundConnection
connection =
Maybe OutboundConnection
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteOutboundConnectionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteOutboundConnectionResponse_connection :: Lens.Lens' DeleteOutboundConnectionResponse (Prelude.Maybe OutboundConnection)
deleteOutboundConnectionResponse_connection :: (Maybe OutboundConnection -> f (Maybe OutboundConnection))
-> DeleteOutboundConnectionResponse
-> f DeleteOutboundConnectionResponse
deleteOutboundConnectionResponse_connection = (DeleteOutboundConnectionResponse -> Maybe OutboundConnection)
-> (DeleteOutboundConnectionResponse
-> Maybe OutboundConnection -> DeleteOutboundConnectionResponse)
-> Lens
DeleteOutboundConnectionResponse
DeleteOutboundConnectionResponse
(Maybe OutboundConnection)
(Maybe OutboundConnection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOutboundConnectionResponse' {Maybe OutboundConnection
connection :: Maybe OutboundConnection
$sel:connection:DeleteOutboundConnectionResponse' :: DeleteOutboundConnectionResponse -> Maybe OutboundConnection
connection} -> Maybe OutboundConnection
connection) (\s :: DeleteOutboundConnectionResponse
s@DeleteOutboundConnectionResponse' {} Maybe OutboundConnection
a -> DeleteOutboundConnectionResponse
s {$sel:connection:DeleteOutboundConnectionResponse' :: Maybe OutboundConnection
connection = Maybe OutboundConnection
a} :: DeleteOutboundConnectionResponse)
deleteOutboundConnectionResponse_httpStatus :: Lens.Lens' DeleteOutboundConnectionResponse Prelude.Int
deleteOutboundConnectionResponse_httpStatus :: (Int -> f Int)
-> DeleteOutboundConnectionResponse
-> f DeleteOutboundConnectionResponse
deleteOutboundConnectionResponse_httpStatus = (DeleteOutboundConnectionResponse -> Int)
-> (DeleteOutboundConnectionResponse
-> Int -> DeleteOutboundConnectionResponse)
-> Lens
DeleteOutboundConnectionResponse
DeleteOutboundConnectionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOutboundConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteOutboundConnectionResponse' :: DeleteOutboundConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteOutboundConnectionResponse
s@DeleteOutboundConnectionResponse' {} Int
a -> DeleteOutboundConnectionResponse
s {$sel:httpStatus:DeleteOutboundConnectionResponse' :: Int
httpStatus = Int
a} :: DeleteOutboundConnectionResponse)
instance
Prelude.NFData
DeleteOutboundConnectionResponse