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