{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ElasticSearch.CreateOutboundCrossClusterSearchConnection
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new cross-cluster search connection from a source domain to a
-- destination domain.
module Amazonka.ElasticSearch.CreateOutboundCrossClusterSearchConnection
  ( -- * Creating a Request
    CreateOutboundCrossClusterSearchConnection (..),
    newCreateOutboundCrossClusterSearchConnection,

    -- * Request Lenses
    createOutboundCrossClusterSearchConnection_sourceDomainInfo,
    createOutboundCrossClusterSearchConnection_destinationDomainInfo,
    createOutboundCrossClusterSearchConnection_connectionAlias,

    -- * Destructuring the Response
    CreateOutboundCrossClusterSearchConnectionResponse (..),
    newCreateOutboundCrossClusterSearchConnectionResponse,

    -- * Response Lenses
    createOutboundCrossClusterSearchConnectionResponse_destinationDomainInfo,
    createOutboundCrossClusterSearchConnectionResponse_connectionAlias,
    createOutboundCrossClusterSearchConnectionResponse_crossClusterSearchConnectionId,
    createOutboundCrossClusterSearchConnectionResponse_connectionStatus,
    createOutboundCrossClusterSearchConnectionResponse_sourceDomainInfo,
    createOutboundCrossClusterSearchConnectionResponse_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

-- | Container for the parameters to the
-- @CreateOutboundCrossClusterSearchConnection@ operation.
--
-- /See:/ 'newCreateOutboundCrossClusterSearchConnection' smart constructor.
data CreateOutboundCrossClusterSearchConnection = CreateOutboundCrossClusterSearchConnection'
  { -- | Specifies the @DomainInformation@ for the source Elasticsearch domain.
    CreateOutboundCrossClusterSearchConnection -> DomainInformation
sourceDomainInfo :: DomainInformation,
    -- | Specifies the @DomainInformation@ for the destination Elasticsearch
    -- domain.
    CreateOutboundCrossClusterSearchConnection -> DomainInformation
destinationDomainInfo :: DomainInformation,
    -- | Specifies the connection alias that will be used by the customer for
    -- this connection.
    CreateOutboundCrossClusterSearchConnection -> Text
connectionAlias :: Prelude.Text
  }
  deriving (CreateOutboundCrossClusterSearchConnection
-> CreateOutboundCrossClusterSearchConnection -> Bool
(CreateOutboundCrossClusterSearchConnection
 -> CreateOutboundCrossClusterSearchConnection -> Bool)
-> (CreateOutboundCrossClusterSearchConnection
    -> CreateOutboundCrossClusterSearchConnection -> Bool)
-> Eq CreateOutboundCrossClusterSearchConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateOutboundCrossClusterSearchConnection
-> CreateOutboundCrossClusterSearchConnection -> Bool
$c/= :: CreateOutboundCrossClusterSearchConnection
-> CreateOutboundCrossClusterSearchConnection -> Bool
== :: CreateOutboundCrossClusterSearchConnection
-> CreateOutboundCrossClusterSearchConnection -> Bool
$c== :: CreateOutboundCrossClusterSearchConnection
-> CreateOutboundCrossClusterSearchConnection -> Bool
Prelude.Eq, ReadPrec [CreateOutboundCrossClusterSearchConnection]
ReadPrec CreateOutboundCrossClusterSearchConnection
Int -> ReadS CreateOutboundCrossClusterSearchConnection
ReadS [CreateOutboundCrossClusterSearchConnection]
(Int -> ReadS CreateOutboundCrossClusterSearchConnection)
-> ReadS [CreateOutboundCrossClusterSearchConnection]
-> ReadPrec CreateOutboundCrossClusterSearchConnection
-> ReadPrec [CreateOutboundCrossClusterSearchConnection]
-> Read CreateOutboundCrossClusterSearchConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateOutboundCrossClusterSearchConnection]
$creadListPrec :: ReadPrec [CreateOutboundCrossClusterSearchConnection]
readPrec :: ReadPrec CreateOutboundCrossClusterSearchConnection
$creadPrec :: ReadPrec CreateOutboundCrossClusterSearchConnection
readList :: ReadS [CreateOutboundCrossClusterSearchConnection]
$creadList :: ReadS [CreateOutboundCrossClusterSearchConnection]
readsPrec :: Int -> ReadS CreateOutboundCrossClusterSearchConnection
$creadsPrec :: Int -> ReadS CreateOutboundCrossClusterSearchConnection
Prelude.Read, Int -> CreateOutboundCrossClusterSearchConnection -> ShowS
[CreateOutboundCrossClusterSearchConnection] -> ShowS
CreateOutboundCrossClusterSearchConnection -> String
(Int -> CreateOutboundCrossClusterSearchConnection -> ShowS)
-> (CreateOutboundCrossClusterSearchConnection -> String)
-> ([CreateOutboundCrossClusterSearchConnection] -> ShowS)
-> Show CreateOutboundCrossClusterSearchConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateOutboundCrossClusterSearchConnection] -> ShowS
$cshowList :: [CreateOutboundCrossClusterSearchConnection] -> ShowS
show :: CreateOutboundCrossClusterSearchConnection -> String
$cshow :: CreateOutboundCrossClusterSearchConnection -> String
showsPrec :: Int -> CreateOutboundCrossClusterSearchConnection -> ShowS
$cshowsPrec :: Int -> CreateOutboundCrossClusterSearchConnection -> ShowS
Prelude.Show, (forall x.
 CreateOutboundCrossClusterSearchConnection
 -> Rep CreateOutboundCrossClusterSearchConnection x)
-> (forall x.
    Rep CreateOutboundCrossClusterSearchConnection x
    -> CreateOutboundCrossClusterSearchConnection)
-> Generic CreateOutboundCrossClusterSearchConnection
forall x.
Rep CreateOutboundCrossClusterSearchConnection x
-> CreateOutboundCrossClusterSearchConnection
forall x.
CreateOutboundCrossClusterSearchConnection
-> Rep CreateOutboundCrossClusterSearchConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateOutboundCrossClusterSearchConnection x
-> CreateOutboundCrossClusterSearchConnection
$cfrom :: forall x.
CreateOutboundCrossClusterSearchConnection
-> Rep CreateOutboundCrossClusterSearchConnection x
Prelude.Generic)

-- |
-- Create a value of 'CreateOutboundCrossClusterSearchConnection' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'sourceDomainInfo', 'createOutboundCrossClusterSearchConnection_sourceDomainInfo' - Specifies the @DomainInformation@ for the source Elasticsearch domain.
--
-- 'destinationDomainInfo', 'createOutboundCrossClusterSearchConnection_destinationDomainInfo' - Specifies the @DomainInformation@ for the destination Elasticsearch
-- domain.
--
-- 'connectionAlias', 'createOutboundCrossClusterSearchConnection_connectionAlias' - Specifies the connection alias that will be used by the customer for
-- this connection.
newCreateOutboundCrossClusterSearchConnection ::
  -- | 'sourceDomainInfo'
  DomainInformation ->
  -- | 'destinationDomainInfo'
  DomainInformation ->
  -- | 'connectionAlias'
  Prelude.Text ->
  CreateOutboundCrossClusterSearchConnection
newCreateOutboundCrossClusterSearchConnection :: DomainInformation
-> DomainInformation
-> Text
-> CreateOutboundCrossClusterSearchConnection
newCreateOutboundCrossClusterSearchConnection
  DomainInformation
pSourceDomainInfo_
  DomainInformation
pDestinationDomainInfo_
  Text
pConnectionAlias_ =
    CreateOutboundCrossClusterSearchConnection' :: DomainInformation
-> DomainInformation
-> Text
-> CreateOutboundCrossClusterSearchConnection
CreateOutboundCrossClusterSearchConnection'
      { $sel:sourceDomainInfo:CreateOutboundCrossClusterSearchConnection' :: DomainInformation
sourceDomainInfo =
          DomainInformation
pSourceDomainInfo_,
        $sel:destinationDomainInfo:CreateOutboundCrossClusterSearchConnection' :: DomainInformation
destinationDomainInfo =
          DomainInformation
pDestinationDomainInfo_,
        $sel:connectionAlias:CreateOutboundCrossClusterSearchConnection' :: Text
connectionAlias =
          Text
pConnectionAlias_
      }

-- | Specifies the @DomainInformation@ for the source Elasticsearch domain.
createOutboundCrossClusterSearchConnection_sourceDomainInfo :: Lens.Lens' CreateOutboundCrossClusterSearchConnection DomainInformation
createOutboundCrossClusterSearchConnection_sourceDomainInfo :: (DomainInformation -> f DomainInformation)
-> CreateOutboundCrossClusterSearchConnection
-> f CreateOutboundCrossClusterSearchConnection
createOutboundCrossClusterSearchConnection_sourceDomainInfo = (CreateOutboundCrossClusterSearchConnection -> DomainInformation)
-> (CreateOutboundCrossClusterSearchConnection
    -> DomainInformation -> CreateOutboundCrossClusterSearchConnection)
-> Lens
     CreateOutboundCrossClusterSearchConnection
     CreateOutboundCrossClusterSearchConnection
     DomainInformation
     DomainInformation
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnection' {DomainInformation
sourceDomainInfo :: DomainInformation
$sel:sourceDomainInfo:CreateOutboundCrossClusterSearchConnection' :: CreateOutboundCrossClusterSearchConnection -> DomainInformation
sourceDomainInfo} -> DomainInformation
sourceDomainInfo) (\s :: CreateOutboundCrossClusterSearchConnection
s@CreateOutboundCrossClusterSearchConnection' {} DomainInformation
a -> CreateOutboundCrossClusterSearchConnection
s {$sel:sourceDomainInfo:CreateOutboundCrossClusterSearchConnection' :: DomainInformation
sourceDomainInfo = DomainInformation
a} :: CreateOutboundCrossClusterSearchConnection)

-- | Specifies the @DomainInformation@ for the destination Elasticsearch
-- domain.
createOutboundCrossClusterSearchConnection_destinationDomainInfo :: Lens.Lens' CreateOutboundCrossClusterSearchConnection DomainInformation
createOutboundCrossClusterSearchConnection_destinationDomainInfo :: (DomainInformation -> f DomainInformation)
-> CreateOutboundCrossClusterSearchConnection
-> f CreateOutboundCrossClusterSearchConnection
createOutboundCrossClusterSearchConnection_destinationDomainInfo = (CreateOutboundCrossClusterSearchConnection -> DomainInformation)
-> (CreateOutboundCrossClusterSearchConnection
    -> DomainInformation -> CreateOutboundCrossClusterSearchConnection)
-> Lens
     CreateOutboundCrossClusterSearchConnection
     CreateOutboundCrossClusterSearchConnection
     DomainInformation
     DomainInformation
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnection' {DomainInformation
destinationDomainInfo :: DomainInformation
$sel:destinationDomainInfo:CreateOutboundCrossClusterSearchConnection' :: CreateOutboundCrossClusterSearchConnection -> DomainInformation
destinationDomainInfo} -> DomainInformation
destinationDomainInfo) (\s :: CreateOutboundCrossClusterSearchConnection
s@CreateOutboundCrossClusterSearchConnection' {} DomainInformation
a -> CreateOutboundCrossClusterSearchConnection
s {$sel:destinationDomainInfo:CreateOutboundCrossClusterSearchConnection' :: DomainInformation
destinationDomainInfo = DomainInformation
a} :: CreateOutboundCrossClusterSearchConnection)

-- | Specifies the connection alias that will be used by the customer for
-- this connection.
createOutboundCrossClusterSearchConnection_connectionAlias :: Lens.Lens' CreateOutboundCrossClusterSearchConnection Prelude.Text
createOutboundCrossClusterSearchConnection_connectionAlias :: (Text -> f Text)
-> CreateOutboundCrossClusterSearchConnection
-> f CreateOutboundCrossClusterSearchConnection
createOutboundCrossClusterSearchConnection_connectionAlias = (CreateOutboundCrossClusterSearchConnection -> Text)
-> (CreateOutboundCrossClusterSearchConnection
    -> Text -> CreateOutboundCrossClusterSearchConnection)
-> Lens
     CreateOutboundCrossClusterSearchConnection
     CreateOutboundCrossClusterSearchConnection
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnection' {Text
connectionAlias :: Text
$sel:connectionAlias:CreateOutboundCrossClusterSearchConnection' :: CreateOutboundCrossClusterSearchConnection -> Text
connectionAlias} -> Text
connectionAlias) (\s :: CreateOutboundCrossClusterSearchConnection
s@CreateOutboundCrossClusterSearchConnection' {} Text
a -> CreateOutboundCrossClusterSearchConnection
s {$sel:connectionAlias:CreateOutboundCrossClusterSearchConnection' :: Text
connectionAlias = Text
a} :: CreateOutboundCrossClusterSearchConnection)

instance
  Core.AWSRequest
    CreateOutboundCrossClusterSearchConnection
  where
  type
    AWSResponse
      CreateOutboundCrossClusterSearchConnection =
      CreateOutboundCrossClusterSearchConnectionResponse
  request :: CreateOutboundCrossClusterSearchConnection
-> Request CreateOutboundCrossClusterSearchConnection
request = Service
-> CreateOutboundCrossClusterSearchConnection
-> Request CreateOutboundCrossClusterSearchConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateOutboundCrossClusterSearchConnection
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateOutboundCrossClusterSearchConnection)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse CreateOutboundCrossClusterSearchConnection))
-> Logger
-> Service
-> Proxy CreateOutboundCrossClusterSearchConnection
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateOutboundCrossClusterSearchConnection)))
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 DomainInformation
-> Maybe Text
-> Maybe Text
-> Maybe OutboundCrossClusterSearchConnectionStatus
-> Maybe DomainInformation
-> Int
-> CreateOutboundCrossClusterSearchConnectionResponse
CreateOutboundCrossClusterSearchConnectionResponse'
            (Maybe DomainInformation
 -> Maybe Text
 -> Maybe Text
 -> Maybe OutboundCrossClusterSearchConnectionStatus
 -> Maybe DomainInformation
 -> Int
 -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Either String (Maybe DomainInformation)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe OutboundCrossClusterSearchConnectionStatus
      -> Maybe DomainInformation
      -> Int
      -> CreateOutboundCrossClusterSearchConnectionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DomainInformation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DestinationDomainInfo")
              Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe OutboundCrossClusterSearchConnectionStatus
   -> Maybe DomainInformation
   -> Int
   -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe OutboundCrossClusterSearchConnectionStatus
      -> Maybe DomainInformation
      -> Int
      -> CreateOutboundCrossClusterSearchConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConnectionAlias")
              Either
  String
  (Maybe Text
   -> Maybe OutboundCrossClusterSearchConnectionStatus
   -> Maybe DomainInformation
   -> Int
   -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe OutboundCrossClusterSearchConnectionStatus
      -> Maybe DomainInformation
      -> Int
      -> CreateOutboundCrossClusterSearchConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CrossClusterSearchConnectionId")
              Either
  String
  (Maybe OutboundCrossClusterSearchConnectionStatus
   -> Maybe DomainInformation
   -> Int
   -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Either String (Maybe OutboundCrossClusterSearchConnectionStatus)
-> Either
     String
     (Maybe DomainInformation
      -> Int -> CreateOutboundCrossClusterSearchConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe OutboundCrossClusterSearchConnectionStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConnectionStatus")
              Either
  String
  (Maybe DomainInformation
   -> Int -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Either String (Maybe DomainInformation)
-> Either
     String (Int -> CreateOutboundCrossClusterSearchConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DomainInformation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SourceDomainInfo")
              Either
  String (Int -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Either String Int
-> Either String CreateOutboundCrossClusterSearchConnectionResponse
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
    CreateOutboundCrossClusterSearchConnection

instance
  Prelude.NFData
    CreateOutboundCrossClusterSearchConnection

instance
  Core.ToHeaders
    CreateOutboundCrossClusterSearchConnection
  where
  toHeaders :: CreateOutboundCrossClusterSearchConnection -> ResponseHeaders
toHeaders = ResponseHeaders
-> CreateOutboundCrossClusterSearchConnection -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance
  Core.ToJSON
    CreateOutboundCrossClusterSearchConnection
  where
  toJSON :: CreateOutboundCrossClusterSearchConnection -> Value
toJSON
    CreateOutboundCrossClusterSearchConnection' {Text
DomainInformation
connectionAlias :: Text
destinationDomainInfo :: DomainInformation
sourceDomainInfo :: DomainInformation
$sel:connectionAlias:CreateOutboundCrossClusterSearchConnection' :: CreateOutboundCrossClusterSearchConnection -> Text
$sel:destinationDomainInfo:CreateOutboundCrossClusterSearchConnection' :: CreateOutboundCrossClusterSearchConnection -> DomainInformation
$sel:sourceDomainInfo:CreateOutboundCrossClusterSearchConnection' :: CreateOutboundCrossClusterSearchConnection -> DomainInformation
..} =
      [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
"SourceDomainInfo" Text -> DomainInformation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DomainInformation
sourceDomainInfo),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                ( Text
"DestinationDomainInfo"
                    Text -> DomainInformation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DomainInformation
destinationDomainInfo
                ),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                (Text
"ConnectionAlias" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
connectionAlias)
            ]
        )

instance
  Core.ToPath
    CreateOutboundCrossClusterSearchConnection
  where
  toPath :: CreateOutboundCrossClusterSearchConnection -> ByteString
toPath =
    ByteString
-> CreateOutboundCrossClusterSearchConnection -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/2015-01-01/es/ccs/outboundConnection"

instance
  Core.ToQuery
    CreateOutboundCrossClusterSearchConnection
  where
  toQuery :: CreateOutboundCrossClusterSearchConnection -> QueryString
toQuery = QueryString
-> CreateOutboundCrossClusterSearchConnection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The result of a @CreateOutboundCrossClusterSearchConnection@ request.
-- Contains the details of the newly created cross-cluster search
-- connection.
--
-- /See:/ 'newCreateOutboundCrossClusterSearchConnectionResponse' smart constructor.
data CreateOutboundCrossClusterSearchConnectionResponse = CreateOutboundCrossClusterSearchConnectionResponse'
  { -- | Specifies the @DomainInformation@ for the destination Elasticsearch
    -- domain.
    CreateOutboundCrossClusterSearchConnectionResponse
-> Maybe DomainInformation
destinationDomainInfo :: Prelude.Maybe DomainInformation,
    -- | Specifies the connection alias provided during the create connection
    -- request.
    CreateOutboundCrossClusterSearchConnectionResponse -> Maybe Text
connectionAlias :: Prelude.Maybe Prelude.Text,
    -- | Unique id for the created outbound connection, which is used for
    -- subsequent operations on connection.
    CreateOutboundCrossClusterSearchConnectionResponse -> Maybe Text
crossClusterSearchConnectionId :: Prelude.Maybe Prelude.Text,
    -- | Specifies the @OutboundCrossClusterSearchConnectionStatus@ for the newly
    -- created connection.
    CreateOutboundCrossClusterSearchConnectionResponse
-> Maybe OutboundCrossClusterSearchConnectionStatus
connectionStatus :: Prelude.Maybe OutboundCrossClusterSearchConnectionStatus,
    -- | Specifies the @DomainInformation@ for the source Elasticsearch domain.
    CreateOutboundCrossClusterSearchConnectionResponse
-> Maybe DomainInformation
sourceDomainInfo :: Prelude.Maybe DomainInformation,
    -- | The response's http status code.
    CreateOutboundCrossClusterSearchConnectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateOutboundCrossClusterSearchConnectionResponse
-> CreateOutboundCrossClusterSearchConnectionResponse -> Bool
(CreateOutboundCrossClusterSearchConnectionResponse
 -> CreateOutboundCrossClusterSearchConnectionResponse -> Bool)
-> (CreateOutboundCrossClusterSearchConnectionResponse
    -> CreateOutboundCrossClusterSearchConnectionResponse -> Bool)
-> Eq CreateOutboundCrossClusterSearchConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateOutboundCrossClusterSearchConnectionResponse
-> CreateOutboundCrossClusterSearchConnectionResponse -> Bool
$c/= :: CreateOutboundCrossClusterSearchConnectionResponse
-> CreateOutboundCrossClusterSearchConnectionResponse -> Bool
== :: CreateOutboundCrossClusterSearchConnectionResponse
-> CreateOutboundCrossClusterSearchConnectionResponse -> Bool
$c== :: CreateOutboundCrossClusterSearchConnectionResponse
-> CreateOutboundCrossClusterSearchConnectionResponse -> Bool
Prelude.Eq, ReadPrec [CreateOutboundCrossClusterSearchConnectionResponse]
ReadPrec CreateOutboundCrossClusterSearchConnectionResponse
Int -> ReadS CreateOutboundCrossClusterSearchConnectionResponse
ReadS [CreateOutboundCrossClusterSearchConnectionResponse]
(Int -> ReadS CreateOutboundCrossClusterSearchConnectionResponse)
-> ReadS [CreateOutboundCrossClusterSearchConnectionResponse]
-> ReadPrec CreateOutboundCrossClusterSearchConnectionResponse
-> ReadPrec [CreateOutboundCrossClusterSearchConnectionResponse]
-> Read CreateOutboundCrossClusterSearchConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateOutboundCrossClusterSearchConnectionResponse]
$creadListPrec :: ReadPrec [CreateOutboundCrossClusterSearchConnectionResponse]
readPrec :: ReadPrec CreateOutboundCrossClusterSearchConnectionResponse
$creadPrec :: ReadPrec CreateOutboundCrossClusterSearchConnectionResponse
readList :: ReadS [CreateOutboundCrossClusterSearchConnectionResponse]
$creadList :: ReadS [CreateOutboundCrossClusterSearchConnectionResponse]
readsPrec :: Int -> ReadS CreateOutboundCrossClusterSearchConnectionResponse
$creadsPrec :: Int -> ReadS CreateOutboundCrossClusterSearchConnectionResponse
Prelude.Read, Int -> CreateOutboundCrossClusterSearchConnectionResponse -> ShowS
[CreateOutboundCrossClusterSearchConnectionResponse] -> ShowS
CreateOutboundCrossClusterSearchConnectionResponse -> String
(Int
 -> CreateOutboundCrossClusterSearchConnectionResponse -> ShowS)
-> (CreateOutboundCrossClusterSearchConnectionResponse -> String)
-> ([CreateOutboundCrossClusterSearchConnectionResponse] -> ShowS)
-> Show CreateOutboundCrossClusterSearchConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateOutboundCrossClusterSearchConnectionResponse] -> ShowS
$cshowList :: [CreateOutboundCrossClusterSearchConnectionResponse] -> ShowS
show :: CreateOutboundCrossClusterSearchConnectionResponse -> String
$cshow :: CreateOutboundCrossClusterSearchConnectionResponse -> String
showsPrec :: Int -> CreateOutboundCrossClusterSearchConnectionResponse -> ShowS
$cshowsPrec :: Int -> CreateOutboundCrossClusterSearchConnectionResponse -> ShowS
Prelude.Show, (forall x.
 CreateOutboundCrossClusterSearchConnectionResponse
 -> Rep CreateOutboundCrossClusterSearchConnectionResponse x)
-> (forall x.
    Rep CreateOutboundCrossClusterSearchConnectionResponse x
    -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Generic CreateOutboundCrossClusterSearchConnectionResponse
forall x.
Rep CreateOutboundCrossClusterSearchConnectionResponse x
-> CreateOutboundCrossClusterSearchConnectionResponse
forall x.
CreateOutboundCrossClusterSearchConnectionResponse
-> Rep CreateOutboundCrossClusterSearchConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateOutboundCrossClusterSearchConnectionResponse x
-> CreateOutboundCrossClusterSearchConnectionResponse
$cfrom :: forall x.
CreateOutboundCrossClusterSearchConnectionResponse
-> Rep CreateOutboundCrossClusterSearchConnectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateOutboundCrossClusterSearchConnectionResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'destinationDomainInfo', 'createOutboundCrossClusterSearchConnectionResponse_destinationDomainInfo' - Specifies the @DomainInformation@ for the destination Elasticsearch
-- domain.
--
-- 'connectionAlias', 'createOutboundCrossClusterSearchConnectionResponse_connectionAlias' - Specifies the connection alias provided during the create connection
-- request.
--
-- 'crossClusterSearchConnectionId', 'createOutboundCrossClusterSearchConnectionResponse_crossClusterSearchConnectionId' - Unique id for the created outbound connection, which is used for
-- subsequent operations on connection.
--
-- 'connectionStatus', 'createOutboundCrossClusterSearchConnectionResponse_connectionStatus' - Specifies the @OutboundCrossClusterSearchConnectionStatus@ for the newly
-- created connection.
--
-- 'sourceDomainInfo', 'createOutboundCrossClusterSearchConnectionResponse_sourceDomainInfo' - Specifies the @DomainInformation@ for the source Elasticsearch domain.
--
-- 'httpStatus', 'createOutboundCrossClusterSearchConnectionResponse_httpStatus' - The response's http status code.
newCreateOutboundCrossClusterSearchConnectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateOutboundCrossClusterSearchConnectionResponse
newCreateOutboundCrossClusterSearchConnectionResponse :: Int -> CreateOutboundCrossClusterSearchConnectionResponse
newCreateOutboundCrossClusterSearchConnectionResponse
  Int
pHttpStatus_ =
    CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe DomainInformation
-> Maybe Text
-> Maybe Text
-> Maybe OutboundCrossClusterSearchConnectionStatus
-> Maybe DomainInformation
-> Int
-> CreateOutboundCrossClusterSearchConnectionResponse
CreateOutboundCrossClusterSearchConnectionResponse'
      { $sel:destinationDomainInfo:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe DomainInformation
destinationDomainInfo =
          Maybe DomainInformation
forall a. Maybe a
Prelude.Nothing,
        $sel:connectionAlias:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe Text
connectionAlias =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:crossClusterSearchConnectionId:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe Text
crossClusterSearchConnectionId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:connectionStatus:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe OutboundCrossClusterSearchConnectionStatus
connectionStatus =
          Maybe OutboundCrossClusterSearchConnectionStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceDomainInfo:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe DomainInformation
sourceDomainInfo =
          Maybe DomainInformation
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateOutboundCrossClusterSearchConnectionResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Specifies the @DomainInformation@ for the destination Elasticsearch
-- domain.
createOutboundCrossClusterSearchConnectionResponse_destinationDomainInfo :: Lens.Lens' CreateOutboundCrossClusterSearchConnectionResponse (Prelude.Maybe DomainInformation)
createOutboundCrossClusterSearchConnectionResponse_destinationDomainInfo :: (Maybe DomainInformation -> f (Maybe DomainInformation))
-> CreateOutboundCrossClusterSearchConnectionResponse
-> f CreateOutboundCrossClusterSearchConnectionResponse
createOutboundCrossClusterSearchConnectionResponse_destinationDomainInfo = (CreateOutboundCrossClusterSearchConnectionResponse
 -> Maybe DomainInformation)
-> (CreateOutboundCrossClusterSearchConnectionResponse
    -> Maybe DomainInformation
    -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Lens
     CreateOutboundCrossClusterSearchConnectionResponse
     CreateOutboundCrossClusterSearchConnectionResponse
     (Maybe DomainInformation)
     (Maybe DomainInformation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnectionResponse' {Maybe DomainInformation
destinationDomainInfo :: Maybe DomainInformation
$sel:destinationDomainInfo:CreateOutboundCrossClusterSearchConnectionResponse' :: CreateOutboundCrossClusterSearchConnectionResponse
-> Maybe DomainInformation
destinationDomainInfo} -> Maybe DomainInformation
destinationDomainInfo) (\s :: CreateOutboundCrossClusterSearchConnectionResponse
s@CreateOutboundCrossClusterSearchConnectionResponse' {} Maybe DomainInformation
a -> CreateOutboundCrossClusterSearchConnectionResponse
s {$sel:destinationDomainInfo:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe DomainInformation
destinationDomainInfo = Maybe DomainInformation
a} :: CreateOutboundCrossClusterSearchConnectionResponse)

-- | Specifies the connection alias provided during the create connection
-- request.
createOutboundCrossClusterSearchConnectionResponse_connectionAlias :: Lens.Lens' CreateOutboundCrossClusterSearchConnectionResponse (Prelude.Maybe Prelude.Text)
createOutboundCrossClusterSearchConnectionResponse_connectionAlias :: (Maybe Text -> f (Maybe Text))
-> CreateOutboundCrossClusterSearchConnectionResponse
-> f CreateOutboundCrossClusterSearchConnectionResponse
createOutboundCrossClusterSearchConnectionResponse_connectionAlias = (CreateOutboundCrossClusterSearchConnectionResponse -> Maybe Text)
-> (CreateOutboundCrossClusterSearchConnectionResponse
    -> Maybe Text
    -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Lens
     CreateOutboundCrossClusterSearchConnectionResponse
     CreateOutboundCrossClusterSearchConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnectionResponse' {Maybe Text
connectionAlias :: Maybe Text
$sel:connectionAlias:CreateOutboundCrossClusterSearchConnectionResponse' :: CreateOutboundCrossClusterSearchConnectionResponse -> Maybe Text
connectionAlias} -> Maybe Text
connectionAlias) (\s :: CreateOutboundCrossClusterSearchConnectionResponse
s@CreateOutboundCrossClusterSearchConnectionResponse' {} Maybe Text
a -> CreateOutboundCrossClusterSearchConnectionResponse
s {$sel:connectionAlias:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe Text
connectionAlias = Maybe Text
a} :: CreateOutboundCrossClusterSearchConnectionResponse)

-- | Unique id for the created outbound connection, which is used for
-- subsequent operations on connection.
createOutboundCrossClusterSearchConnectionResponse_crossClusterSearchConnectionId :: Lens.Lens' CreateOutboundCrossClusterSearchConnectionResponse (Prelude.Maybe Prelude.Text)
createOutboundCrossClusterSearchConnectionResponse_crossClusterSearchConnectionId :: (Maybe Text -> f (Maybe Text))
-> CreateOutboundCrossClusterSearchConnectionResponse
-> f CreateOutboundCrossClusterSearchConnectionResponse
createOutboundCrossClusterSearchConnectionResponse_crossClusterSearchConnectionId = (CreateOutboundCrossClusterSearchConnectionResponse -> Maybe Text)
-> (CreateOutboundCrossClusterSearchConnectionResponse
    -> Maybe Text
    -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Lens
     CreateOutboundCrossClusterSearchConnectionResponse
     CreateOutboundCrossClusterSearchConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnectionResponse' {Maybe Text
crossClusterSearchConnectionId :: Maybe Text
$sel:crossClusterSearchConnectionId:CreateOutboundCrossClusterSearchConnectionResponse' :: CreateOutboundCrossClusterSearchConnectionResponse -> Maybe Text
crossClusterSearchConnectionId} -> Maybe Text
crossClusterSearchConnectionId) (\s :: CreateOutboundCrossClusterSearchConnectionResponse
s@CreateOutboundCrossClusterSearchConnectionResponse' {} Maybe Text
a -> CreateOutboundCrossClusterSearchConnectionResponse
s {$sel:crossClusterSearchConnectionId:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe Text
crossClusterSearchConnectionId = Maybe Text
a} :: CreateOutboundCrossClusterSearchConnectionResponse)

-- | Specifies the @OutboundCrossClusterSearchConnectionStatus@ for the newly
-- created connection.
createOutboundCrossClusterSearchConnectionResponse_connectionStatus :: Lens.Lens' CreateOutboundCrossClusterSearchConnectionResponse (Prelude.Maybe OutboundCrossClusterSearchConnectionStatus)
createOutboundCrossClusterSearchConnectionResponse_connectionStatus :: (Maybe OutboundCrossClusterSearchConnectionStatus
 -> f (Maybe OutboundCrossClusterSearchConnectionStatus))
-> CreateOutboundCrossClusterSearchConnectionResponse
-> f CreateOutboundCrossClusterSearchConnectionResponse
createOutboundCrossClusterSearchConnectionResponse_connectionStatus = (CreateOutboundCrossClusterSearchConnectionResponse
 -> Maybe OutboundCrossClusterSearchConnectionStatus)
-> (CreateOutboundCrossClusterSearchConnectionResponse
    -> Maybe OutboundCrossClusterSearchConnectionStatus
    -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Lens
     CreateOutboundCrossClusterSearchConnectionResponse
     CreateOutboundCrossClusterSearchConnectionResponse
     (Maybe OutboundCrossClusterSearchConnectionStatus)
     (Maybe OutboundCrossClusterSearchConnectionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnectionResponse' {Maybe OutboundCrossClusterSearchConnectionStatus
connectionStatus :: Maybe OutboundCrossClusterSearchConnectionStatus
$sel:connectionStatus:CreateOutboundCrossClusterSearchConnectionResponse' :: CreateOutboundCrossClusterSearchConnectionResponse
-> Maybe OutboundCrossClusterSearchConnectionStatus
connectionStatus} -> Maybe OutboundCrossClusterSearchConnectionStatus
connectionStatus) (\s :: CreateOutboundCrossClusterSearchConnectionResponse
s@CreateOutboundCrossClusterSearchConnectionResponse' {} Maybe OutboundCrossClusterSearchConnectionStatus
a -> CreateOutboundCrossClusterSearchConnectionResponse
s {$sel:connectionStatus:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe OutboundCrossClusterSearchConnectionStatus
connectionStatus = Maybe OutboundCrossClusterSearchConnectionStatus
a} :: CreateOutboundCrossClusterSearchConnectionResponse)

-- | Specifies the @DomainInformation@ for the source Elasticsearch domain.
createOutboundCrossClusterSearchConnectionResponse_sourceDomainInfo :: Lens.Lens' CreateOutboundCrossClusterSearchConnectionResponse (Prelude.Maybe DomainInformation)
createOutboundCrossClusterSearchConnectionResponse_sourceDomainInfo :: (Maybe DomainInformation -> f (Maybe DomainInformation))
-> CreateOutboundCrossClusterSearchConnectionResponse
-> f CreateOutboundCrossClusterSearchConnectionResponse
createOutboundCrossClusterSearchConnectionResponse_sourceDomainInfo = (CreateOutboundCrossClusterSearchConnectionResponse
 -> Maybe DomainInformation)
-> (CreateOutboundCrossClusterSearchConnectionResponse
    -> Maybe DomainInformation
    -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Lens
     CreateOutboundCrossClusterSearchConnectionResponse
     CreateOutboundCrossClusterSearchConnectionResponse
     (Maybe DomainInformation)
     (Maybe DomainInformation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnectionResponse' {Maybe DomainInformation
sourceDomainInfo :: Maybe DomainInformation
$sel:sourceDomainInfo:CreateOutboundCrossClusterSearchConnectionResponse' :: CreateOutboundCrossClusterSearchConnectionResponse
-> Maybe DomainInformation
sourceDomainInfo} -> Maybe DomainInformation
sourceDomainInfo) (\s :: CreateOutboundCrossClusterSearchConnectionResponse
s@CreateOutboundCrossClusterSearchConnectionResponse' {} Maybe DomainInformation
a -> CreateOutboundCrossClusterSearchConnectionResponse
s {$sel:sourceDomainInfo:CreateOutboundCrossClusterSearchConnectionResponse' :: Maybe DomainInformation
sourceDomainInfo = Maybe DomainInformation
a} :: CreateOutboundCrossClusterSearchConnectionResponse)

-- | The response's http status code.
createOutboundCrossClusterSearchConnectionResponse_httpStatus :: Lens.Lens' CreateOutboundCrossClusterSearchConnectionResponse Prelude.Int
createOutboundCrossClusterSearchConnectionResponse_httpStatus :: (Int -> f Int)
-> CreateOutboundCrossClusterSearchConnectionResponse
-> f CreateOutboundCrossClusterSearchConnectionResponse
createOutboundCrossClusterSearchConnectionResponse_httpStatus = (CreateOutboundCrossClusterSearchConnectionResponse -> Int)
-> (CreateOutboundCrossClusterSearchConnectionResponse
    -> Int -> CreateOutboundCrossClusterSearchConnectionResponse)
-> Lens
     CreateOutboundCrossClusterSearchConnectionResponse
     CreateOutboundCrossClusterSearchConnectionResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOutboundCrossClusterSearchConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateOutboundCrossClusterSearchConnectionResponse' :: CreateOutboundCrossClusterSearchConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateOutboundCrossClusterSearchConnectionResponse
s@CreateOutboundCrossClusterSearchConnectionResponse' {} Int
a -> CreateOutboundCrossClusterSearchConnectionResponse
s {$sel:httpStatus:CreateOutboundCrossClusterSearchConnectionResponse' :: Int
httpStatus = Int
a} :: CreateOutboundCrossClusterSearchConnectionResponse)

instance
  Prelude.NFData
    CreateOutboundCrossClusterSearchConnectionResponse