{-# 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.ElasticSearch.AcceptInboundCrossClusterSearchConnection
(
AcceptInboundCrossClusterSearchConnection (..),
newAcceptInboundCrossClusterSearchConnection,
acceptInboundCrossClusterSearchConnection_crossClusterSearchConnectionId,
AcceptInboundCrossClusterSearchConnectionResponse (..),
newAcceptInboundCrossClusterSearchConnectionResponse,
acceptInboundCrossClusterSearchConnectionResponse_crossClusterSearchConnection,
acceptInboundCrossClusterSearchConnectionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types
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 AcceptInboundCrossClusterSearchConnection = AcceptInboundCrossClusterSearchConnection'
{
AcceptInboundCrossClusterSearchConnection -> Text
crossClusterSearchConnectionId :: Prelude.Text
}
deriving (AcceptInboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnection -> Bool
(AcceptInboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnection -> Bool)
-> (AcceptInboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnection -> Bool)
-> Eq AcceptInboundCrossClusterSearchConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptInboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnection -> Bool
$c/= :: AcceptInboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnection -> Bool
== :: AcceptInboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnection -> Bool
$c== :: AcceptInboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnection -> Bool
Prelude.Eq, ReadPrec [AcceptInboundCrossClusterSearchConnection]
ReadPrec AcceptInboundCrossClusterSearchConnection
Int -> ReadS AcceptInboundCrossClusterSearchConnection
ReadS [AcceptInboundCrossClusterSearchConnection]
(Int -> ReadS AcceptInboundCrossClusterSearchConnection)
-> ReadS [AcceptInboundCrossClusterSearchConnection]
-> ReadPrec AcceptInboundCrossClusterSearchConnection
-> ReadPrec [AcceptInboundCrossClusterSearchConnection]
-> Read AcceptInboundCrossClusterSearchConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptInboundCrossClusterSearchConnection]
$creadListPrec :: ReadPrec [AcceptInboundCrossClusterSearchConnection]
readPrec :: ReadPrec AcceptInboundCrossClusterSearchConnection
$creadPrec :: ReadPrec AcceptInboundCrossClusterSearchConnection
readList :: ReadS [AcceptInboundCrossClusterSearchConnection]
$creadList :: ReadS [AcceptInboundCrossClusterSearchConnection]
readsPrec :: Int -> ReadS AcceptInboundCrossClusterSearchConnection
$creadsPrec :: Int -> ReadS AcceptInboundCrossClusterSearchConnection
Prelude.Read, Int -> AcceptInboundCrossClusterSearchConnection -> ShowS
[AcceptInboundCrossClusterSearchConnection] -> ShowS
AcceptInboundCrossClusterSearchConnection -> String
(Int -> AcceptInboundCrossClusterSearchConnection -> ShowS)
-> (AcceptInboundCrossClusterSearchConnection -> String)
-> ([AcceptInboundCrossClusterSearchConnection] -> ShowS)
-> Show AcceptInboundCrossClusterSearchConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptInboundCrossClusterSearchConnection] -> ShowS
$cshowList :: [AcceptInboundCrossClusterSearchConnection] -> ShowS
show :: AcceptInboundCrossClusterSearchConnection -> String
$cshow :: AcceptInboundCrossClusterSearchConnection -> String
showsPrec :: Int -> AcceptInboundCrossClusterSearchConnection -> ShowS
$cshowsPrec :: Int -> AcceptInboundCrossClusterSearchConnection -> ShowS
Prelude.Show, (forall x.
AcceptInboundCrossClusterSearchConnection
-> Rep AcceptInboundCrossClusterSearchConnection x)
-> (forall x.
Rep AcceptInboundCrossClusterSearchConnection x
-> AcceptInboundCrossClusterSearchConnection)
-> Generic AcceptInboundCrossClusterSearchConnection
forall x.
Rep AcceptInboundCrossClusterSearchConnection x
-> AcceptInboundCrossClusterSearchConnection
forall x.
AcceptInboundCrossClusterSearchConnection
-> Rep AcceptInboundCrossClusterSearchConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcceptInboundCrossClusterSearchConnection x
-> AcceptInboundCrossClusterSearchConnection
$cfrom :: forall x.
AcceptInboundCrossClusterSearchConnection
-> Rep AcceptInboundCrossClusterSearchConnection x
Prelude.Generic)
newAcceptInboundCrossClusterSearchConnection ::
Prelude.Text ->
AcceptInboundCrossClusterSearchConnection
newAcceptInboundCrossClusterSearchConnection :: Text -> AcceptInboundCrossClusterSearchConnection
newAcceptInboundCrossClusterSearchConnection
Text
pCrossClusterSearchConnectionId_ =
AcceptInboundCrossClusterSearchConnection' :: Text -> AcceptInboundCrossClusterSearchConnection
AcceptInboundCrossClusterSearchConnection'
{ $sel:crossClusterSearchConnectionId:AcceptInboundCrossClusterSearchConnection' :: Text
crossClusterSearchConnectionId =
Text
pCrossClusterSearchConnectionId_
}
acceptInboundCrossClusterSearchConnection_crossClusterSearchConnectionId :: Lens.Lens' AcceptInboundCrossClusterSearchConnection Prelude.Text
acceptInboundCrossClusterSearchConnection_crossClusterSearchConnectionId :: (Text -> f Text)
-> AcceptInboundCrossClusterSearchConnection
-> f AcceptInboundCrossClusterSearchConnection
acceptInboundCrossClusterSearchConnection_crossClusterSearchConnectionId = (AcceptInboundCrossClusterSearchConnection -> Text)
-> (AcceptInboundCrossClusterSearchConnection
-> Text -> AcceptInboundCrossClusterSearchConnection)
-> Lens
AcceptInboundCrossClusterSearchConnection
AcceptInboundCrossClusterSearchConnection
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptInboundCrossClusterSearchConnection' {Text
crossClusterSearchConnectionId :: Text
$sel:crossClusterSearchConnectionId:AcceptInboundCrossClusterSearchConnection' :: AcceptInboundCrossClusterSearchConnection -> Text
crossClusterSearchConnectionId} -> Text
crossClusterSearchConnectionId) (\s :: AcceptInboundCrossClusterSearchConnection
s@AcceptInboundCrossClusterSearchConnection' {} Text
a -> AcceptInboundCrossClusterSearchConnection
s {$sel:crossClusterSearchConnectionId:AcceptInboundCrossClusterSearchConnection' :: Text
crossClusterSearchConnectionId = Text
a} :: AcceptInboundCrossClusterSearchConnection)
instance
Core.AWSRequest
AcceptInboundCrossClusterSearchConnection
where
type
AWSResponse
AcceptInboundCrossClusterSearchConnection =
AcceptInboundCrossClusterSearchConnectionResponse
request :: AcceptInboundCrossClusterSearchConnection
-> Request AcceptInboundCrossClusterSearchConnection
request = Service
-> AcceptInboundCrossClusterSearchConnection
-> Request AcceptInboundCrossClusterSearchConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AcceptInboundCrossClusterSearchConnection
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse AcceptInboundCrossClusterSearchConnection)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either
String (AWSResponse AcceptInboundCrossClusterSearchConnection))
-> Logger
-> Service
-> Proxy AcceptInboundCrossClusterSearchConnection
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse AcceptInboundCrossClusterSearchConnection)))
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 InboundCrossClusterSearchConnection
-> Int -> AcceptInboundCrossClusterSearchConnectionResponse
AcceptInboundCrossClusterSearchConnectionResponse'
(Maybe InboundCrossClusterSearchConnection
-> Int -> AcceptInboundCrossClusterSearchConnectionResponse)
-> Either String (Maybe InboundCrossClusterSearchConnection)
-> Either
String (Int -> AcceptInboundCrossClusterSearchConnectionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe InboundCrossClusterSearchConnection)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CrossClusterSearchConnection")
Either
String (Int -> AcceptInboundCrossClusterSearchConnectionResponse)
-> Either String Int
-> Either String AcceptInboundCrossClusterSearchConnectionResponse
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
AcceptInboundCrossClusterSearchConnection
instance
Prelude.NFData
AcceptInboundCrossClusterSearchConnection
instance
Core.ToHeaders
AcceptInboundCrossClusterSearchConnection
where
toHeaders :: AcceptInboundCrossClusterSearchConnection -> ResponseHeaders
toHeaders = ResponseHeaders
-> AcceptInboundCrossClusterSearchConnection -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance
Core.ToJSON
AcceptInboundCrossClusterSearchConnection
where
toJSON :: AcceptInboundCrossClusterSearchConnection -> Value
toJSON = Value -> AcceptInboundCrossClusterSearchConnection -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance
Core.ToPath
AcceptInboundCrossClusterSearchConnection
where
toPath :: AcceptInboundCrossClusterSearchConnection -> ByteString
toPath AcceptInboundCrossClusterSearchConnection' {Text
crossClusterSearchConnectionId :: Text
$sel:crossClusterSearchConnectionId:AcceptInboundCrossClusterSearchConnection' :: AcceptInboundCrossClusterSearchConnection -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2015-01-01/es/ccs/inboundConnection/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
crossClusterSearchConnectionId,
ByteString
"/accept"
]
instance
Core.ToQuery
AcceptInboundCrossClusterSearchConnection
where
toQuery :: AcceptInboundCrossClusterSearchConnection -> QueryString
toQuery = QueryString
-> AcceptInboundCrossClusterSearchConnection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AcceptInboundCrossClusterSearchConnectionResponse = AcceptInboundCrossClusterSearchConnectionResponse'
{
AcceptInboundCrossClusterSearchConnectionResponse
-> Maybe InboundCrossClusterSearchConnection
crossClusterSearchConnection :: Prelude.Maybe InboundCrossClusterSearchConnection,
AcceptInboundCrossClusterSearchConnectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AcceptInboundCrossClusterSearchConnectionResponse
-> AcceptInboundCrossClusterSearchConnectionResponse -> Bool
(AcceptInboundCrossClusterSearchConnectionResponse
-> AcceptInboundCrossClusterSearchConnectionResponse -> Bool)
-> (AcceptInboundCrossClusterSearchConnectionResponse
-> AcceptInboundCrossClusterSearchConnectionResponse -> Bool)
-> Eq AcceptInboundCrossClusterSearchConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptInboundCrossClusterSearchConnectionResponse
-> AcceptInboundCrossClusterSearchConnectionResponse -> Bool
$c/= :: AcceptInboundCrossClusterSearchConnectionResponse
-> AcceptInboundCrossClusterSearchConnectionResponse -> Bool
== :: AcceptInboundCrossClusterSearchConnectionResponse
-> AcceptInboundCrossClusterSearchConnectionResponse -> Bool
$c== :: AcceptInboundCrossClusterSearchConnectionResponse
-> AcceptInboundCrossClusterSearchConnectionResponse -> Bool
Prelude.Eq, ReadPrec [AcceptInboundCrossClusterSearchConnectionResponse]
ReadPrec AcceptInboundCrossClusterSearchConnectionResponse
Int -> ReadS AcceptInboundCrossClusterSearchConnectionResponse
ReadS [AcceptInboundCrossClusterSearchConnectionResponse]
(Int -> ReadS AcceptInboundCrossClusterSearchConnectionResponse)
-> ReadS [AcceptInboundCrossClusterSearchConnectionResponse]
-> ReadPrec AcceptInboundCrossClusterSearchConnectionResponse
-> ReadPrec [AcceptInboundCrossClusterSearchConnectionResponse]
-> Read AcceptInboundCrossClusterSearchConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptInboundCrossClusterSearchConnectionResponse]
$creadListPrec :: ReadPrec [AcceptInboundCrossClusterSearchConnectionResponse]
readPrec :: ReadPrec AcceptInboundCrossClusterSearchConnectionResponse
$creadPrec :: ReadPrec AcceptInboundCrossClusterSearchConnectionResponse
readList :: ReadS [AcceptInboundCrossClusterSearchConnectionResponse]
$creadList :: ReadS [AcceptInboundCrossClusterSearchConnectionResponse]
readsPrec :: Int -> ReadS AcceptInboundCrossClusterSearchConnectionResponse
$creadsPrec :: Int -> ReadS AcceptInboundCrossClusterSearchConnectionResponse
Prelude.Read, Int -> AcceptInboundCrossClusterSearchConnectionResponse -> ShowS
[AcceptInboundCrossClusterSearchConnectionResponse] -> ShowS
AcceptInboundCrossClusterSearchConnectionResponse -> String
(Int -> AcceptInboundCrossClusterSearchConnectionResponse -> ShowS)
-> (AcceptInboundCrossClusterSearchConnectionResponse -> String)
-> ([AcceptInboundCrossClusterSearchConnectionResponse] -> ShowS)
-> Show AcceptInboundCrossClusterSearchConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptInboundCrossClusterSearchConnectionResponse] -> ShowS
$cshowList :: [AcceptInboundCrossClusterSearchConnectionResponse] -> ShowS
show :: AcceptInboundCrossClusterSearchConnectionResponse -> String
$cshow :: AcceptInboundCrossClusterSearchConnectionResponse -> String
showsPrec :: Int -> AcceptInboundCrossClusterSearchConnectionResponse -> ShowS
$cshowsPrec :: Int -> AcceptInboundCrossClusterSearchConnectionResponse -> ShowS
Prelude.Show, (forall x.
AcceptInboundCrossClusterSearchConnectionResponse
-> Rep AcceptInboundCrossClusterSearchConnectionResponse x)
-> (forall x.
Rep AcceptInboundCrossClusterSearchConnectionResponse x
-> AcceptInboundCrossClusterSearchConnectionResponse)
-> Generic AcceptInboundCrossClusterSearchConnectionResponse
forall x.
Rep AcceptInboundCrossClusterSearchConnectionResponse x
-> AcceptInboundCrossClusterSearchConnectionResponse
forall x.
AcceptInboundCrossClusterSearchConnectionResponse
-> Rep AcceptInboundCrossClusterSearchConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcceptInboundCrossClusterSearchConnectionResponse x
-> AcceptInboundCrossClusterSearchConnectionResponse
$cfrom :: forall x.
AcceptInboundCrossClusterSearchConnectionResponse
-> Rep AcceptInboundCrossClusterSearchConnectionResponse x
Prelude.Generic)
newAcceptInboundCrossClusterSearchConnectionResponse ::
Prelude.Int ->
AcceptInboundCrossClusterSearchConnectionResponse
newAcceptInboundCrossClusterSearchConnectionResponse :: Int -> AcceptInboundCrossClusterSearchConnectionResponse
newAcceptInboundCrossClusterSearchConnectionResponse
Int
pHttpStatus_ =
AcceptInboundCrossClusterSearchConnectionResponse' :: Maybe InboundCrossClusterSearchConnection
-> Int -> AcceptInboundCrossClusterSearchConnectionResponse
AcceptInboundCrossClusterSearchConnectionResponse'
{ $sel:crossClusterSearchConnection:AcceptInboundCrossClusterSearchConnectionResponse' :: Maybe InboundCrossClusterSearchConnection
crossClusterSearchConnection =
Maybe InboundCrossClusterSearchConnection
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AcceptInboundCrossClusterSearchConnectionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
acceptInboundCrossClusterSearchConnectionResponse_crossClusterSearchConnection :: Lens.Lens' AcceptInboundCrossClusterSearchConnectionResponse (Prelude.Maybe InboundCrossClusterSearchConnection)
acceptInboundCrossClusterSearchConnectionResponse_crossClusterSearchConnection :: (Maybe InboundCrossClusterSearchConnection
-> f (Maybe InboundCrossClusterSearchConnection))
-> AcceptInboundCrossClusterSearchConnectionResponse
-> f AcceptInboundCrossClusterSearchConnectionResponse
acceptInboundCrossClusterSearchConnectionResponse_crossClusterSearchConnection = (AcceptInboundCrossClusterSearchConnectionResponse
-> Maybe InboundCrossClusterSearchConnection)
-> (AcceptInboundCrossClusterSearchConnectionResponse
-> Maybe InboundCrossClusterSearchConnection
-> AcceptInboundCrossClusterSearchConnectionResponse)
-> Lens
AcceptInboundCrossClusterSearchConnectionResponse
AcceptInboundCrossClusterSearchConnectionResponse
(Maybe InboundCrossClusterSearchConnection)
(Maybe InboundCrossClusterSearchConnection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptInboundCrossClusterSearchConnectionResponse' {Maybe InboundCrossClusterSearchConnection
crossClusterSearchConnection :: Maybe InboundCrossClusterSearchConnection
$sel:crossClusterSearchConnection:AcceptInboundCrossClusterSearchConnectionResponse' :: AcceptInboundCrossClusterSearchConnectionResponse
-> Maybe InboundCrossClusterSearchConnection
crossClusterSearchConnection} -> Maybe InboundCrossClusterSearchConnection
crossClusterSearchConnection) (\s :: AcceptInboundCrossClusterSearchConnectionResponse
s@AcceptInboundCrossClusterSearchConnectionResponse' {} Maybe InboundCrossClusterSearchConnection
a -> AcceptInboundCrossClusterSearchConnectionResponse
s {$sel:crossClusterSearchConnection:AcceptInboundCrossClusterSearchConnectionResponse' :: Maybe InboundCrossClusterSearchConnection
crossClusterSearchConnection = Maybe InboundCrossClusterSearchConnection
a} :: AcceptInboundCrossClusterSearchConnectionResponse)
acceptInboundCrossClusterSearchConnectionResponse_httpStatus :: Lens.Lens' AcceptInboundCrossClusterSearchConnectionResponse Prelude.Int
acceptInboundCrossClusterSearchConnectionResponse_httpStatus :: (Int -> f Int)
-> AcceptInboundCrossClusterSearchConnectionResponse
-> f AcceptInboundCrossClusterSearchConnectionResponse
acceptInboundCrossClusterSearchConnectionResponse_httpStatus = (AcceptInboundCrossClusterSearchConnectionResponse -> Int)
-> (AcceptInboundCrossClusterSearchConnectionResponse
-> Int -> AcceptInboundCrossClusterSearchConnectionResponse)
-> Lens
AcceptInboundCrossClusterSearchConnectionResponse
AcceptInboundCrossClusterSearchConnectionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptInboundCrossClusterSearchConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:AcceptInboundCrossClusterSearchConnectionResponse' :: AcceptInboundCrossClusterSearchConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AcceptInboundCrossClusterSearchConnectionResponse
s@AcceptInboundCrossClusterSearchConnectionResponse' {} Int
a -> AcceptInboundCrossClusterSearchConnectionResponse
s {$sel:httpStatus:AcceptInboundCrossClusterSearchConnectionResponse' :: Int
httpStatus = Int
a} :: AcceptInboundCrossClusterSearchConnectionResponse)
instance
Prelude.NFData
AcceptInboundCrossClusterSearchConnectionResponse