{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.OutboundCrossClusterSearchConnectionStatus
-- 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)
module Amazonka.ElasticSearch.Types.OutboundCrossClusterSearchConnectionStatus where

import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types.OutboundCrossClusterSearchConnectionStatusCode
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the connection status of an outbound cross-cluster search
-- connection.
--
-- /See:/ 'newOutboundCrossClusterSearchConnectionStatus' smart constructor.
data OutboundCrossClusterSearchConnectionStatus = OutboundCrossClusterSearchConnectionStatus'
  { -- | Specifies verbose information for the outbound connection status.
    OutboundCrossClusterSearchConnectionStatus -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The state code for outbound connection. This can be one of the
    -- following:
    --
    -- -   VALIDATING: The outbound connection request is being validated.
    -- -   VALIDATION_FAILED: Validation failed for the connection request.
    -- -   PENDING_ACCEPTANCE: Outbound connection request is validated and is
    --     not yet accepted by destination domain owner.
    -- -   PROVISIONING: Outbound connection request is in process.
    -- -   ACTIVE: Outbound connection is active and ready to use.
    -- -   REJECTED: Outbound connection request is rejected by destination
    --     domain owner.
    -- -   DELETING: Outbound connection deletion is in progress.
    -- -   DELETED: Outbound connection is deleted and cannot be used further.
    OutboundCrossClusterSearchConnectionStatus
-> Maybe OutboundCrossClusterSearchConnectionStatusCode
statusCode :: Prelude.Maybe OutboundCrossClusterSearchConnectionStatusCode
  }
  deriving (OutboundCrossClusterSearchConnectionStatus
-> OutboundCrossClusterSearchConnectionStatus -> Bool
(OutboundCrossClusterSearchConnectionStatus
 -> OutboundCrossClusterSearchConnectionStatus -> Bool)
-> (OutboundCrossClusterSearchConnectionStatus
    -> OutboundCrossClusterSearchConnectionStatus -> Bool)
-> Eq OutboundCrossClusterSearchConnectionStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutboundCrossClusterSearchConnectionStatus
-> OutboundCrossClusterSearchConnectionStatus -> Bool
$c/= :: OutboundCrossClusterSearchConnectionStatus
-> OutboundCrossClusterSearchConnectionStatus -> Bool
== :: OutboundCrossClusterSearchConnectionStatus
-> OutboundCrossClusterSearchConnectionStatus -> Bool
$c== :: OutboundCrossClusterSearchConnectionStatus
-> OutboundCrossClusterSearchConnectionStatus -> Bool
Prelude.Eq, ReadPrec [OutboundCrossClusterSearchConnectionStatus]
ReadPrec OutboundCrossClusterSearchConnectionStatus
Int -> ReadS OutboundCrossClusterSearchConnectionStatus
ReadS [OutboundCrossClusterSearchConnectionStatus]
(Int -> ReadS OutboundCrossClusterSearchConnectionStatus)
-> ReadS [OutboundCrossClusterSearchConnectionStatus]
-> ReadPrec OutboundCrossClusterSearchConnectionStatus
-> ReadPrec [OutboundCrossClusterSearchConnectionStatus]
-> Read OutboundCrossClusterSearchConnectionStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutboundCrossClusterSearchConnectionStatus]
$creadListPrec :: ReadPrec [OutboundCrossClusterSearchConnectionStatus]
readPrec :: ReadPrec OutboundCrossClusterSearchConnectionStatus
$creadPrec :: ReadPrec OutboundCrossClusterSearchConnectionStatus
readList :: ReadS [OutboundCrossClusterSearchConnectionStatus]
$creadList :: ReadS [OutboundCrossClusterSearchConnectionStatus]
readsPrec :: Int -> ReadS OutboundCrossClusterSearchConnectionStatus
$creadsPrec :: Int -> ReadS OutboundCrossClusterSearchConnectionStatus
Prelude.Read, Int -> OutboundCrossClusterSearchConnectionStatus -> ShowS
[OutboundCrossClusterSearchConnectionStatus] -> ShowS
OutboundCrossClusterSearchConnectionStatus -> String
(Int -> OutboundCrossClusterSearchConnectionStatus -> ShowS)
-> (OutboundCrossClusterSearchConnectionStatus -> String)
-> ([OutboundCrossClusterSearchConnectionStatus] -> ShowS)
-> Show OutboundCrossClusterSearchConnectionStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutboundCrossClusterSearchConnectionStatus] -> ShowS
$cshowList :: [OutboundCrossClusterSearchConnectionStatus] -> ShowS
show :: OutboundCrossClusterSearchConnectionStatus -> String
$cshow :: OutboundCrossClusterSearchConnectionStatus -> String
showsPrec :: Int -> OutboundCrossClusterSearchConnectionStatus -> ShowS
$cshowsPrec :: Int -> OutboundCrossClusterSearchConnectionStatus -> ShowS
Prelude.Show, (forall x.
 OutboundCrossClusterSearchConnectionStatus
 -> Rep OutboundCrossClusterSearchConnectionStatus x)
-> (forall x.
    Rep OutboundCrossClusterSearchConnectionStatus x
    -> OutboundCrossClusterSearchConnectionStatus)
-> Generic OutboundCrossClusterSearchConnectionStatus
forall x.
Rep OutboundCrossClusterSearchConnectionStatus x
-> OutboundCrossClusterSearchConnectionStatus
forall x.
OutboundCrossClusterSearchConnectionStatus
-> Rep OutboundCrossClusterSearchConnectionStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OutboundCrossClusterSearchConnectionStatus x
-> OutboundCrossClusterSearchConnectionStatus
$cfrom :: forall x.
OutboundCrossClusterSearchConnectionStatus
-> Rep OutboundCrossClusterSearchConnectionStatus x
Prelude.Generic)

-- |
-- Create a value of 'OutboundCrossClusterSearchConnectionStatus' 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:
--
-- 'message', 'outboundCrossClusterSearchConnectionStatus_message' - Specifies verbose information for the outbound connection status.
--
-- 'statusCode', 'outboundCrossClusterSearchConnectionStatus_statusCode' - The state code for outbound connection. This can be one of the
-- following:
--
-- -   VALIDATING: The outbound connection request is being validated.
-- -   VALIDATION_FAILED: Validation failed for the connection request.
-- -   PENDING_ACCEPTANCE: Outbound connection request is validated and is
--     not yet accepted by destination domain owner.
-- -   PROVISIONING: Outbound connection request is in process.
-- -   ACTIVE: Outbound connection is active and ready to use.
-- -   REJECTED: Outbound connection request is rejected by destination
--     domain owner.
-- -   DELETING: Outbound connection deletion is in progress.
-- -   DELETED: Outbound connection is deleted and cannot be used further.
newOutboundCrossClusterSearchConnectionStatus ::
  OutboundCrossClusterSearchConnectionStatus
newOutboundCrossClusterSearchConnectionStatus :: OutboundCrossClusterSearchConnectionStatus
newOutboundCrossClusterSearchConnectionStatus =
  OutboundCrossClusterSearchConnectionStatus' :: Maybe Text
-> Maybe OutboundCrossClusterSearchConnectionStatusCode
-> OutboundCrossClusterSearchConnectionStatus
OutboundCrossClusterSearchConnectionStatus'
    { $sel:message:OutboundCrossClusterSearchConnectionStatus' :: Maybe Text
message =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:OutboundCrossClusterSearchConnectionStatus' :: Maybe OutboundCrossClusterSearchConnectionStatusCode
statusCode = Maybe OutboundCrossClusterSearchConnectionStatusCode
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies verbose information for the outbound connection status.
outboundCrossClusterSearchConnectionStatus_message :: Lens.Lens' OutboundCrossClusterSearchConnectionStatus (Prelude.Maybe Prelude.Text)
outboundCrossClusterSearchConnectionStatus_message :: (Maybe Text -> f (Maybe Text))
-> OutboundCrossClusterSearchConnectionStatus
-> f OutboundCrossClusterSearchConnectionStatus
outboundCrossClusterSearchConnectionStatus_message = (OutboundCrossClusterSearchConnectionStatus -> Maybe Text)
-> (OutboundCrossClusterSearchConnectionStatus
    -> Maybe Text -> OutboundCrossClusterSearchConnectionStatus)
-> Lens
     OutboundCrossClusterSearchConnectionStatus
     OutboundCrossClusterSearchConnectionStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutboundCrossClusterSearchConnectionStatus' {Maybe Text
message :: Maybe Text
$sel:message:OutboundCrossClusterSearchConnectionStatus' :: OutboundCrossClusterSearchConnectionStatus -> Maybe Text
message} -> Maybe Text
message) (\s :: OutboundCrossClusterSearchConnectionStatus
s@OutboundCrossClusterSearchConnectionStatus' {} Maybe Text
a -> OutboundCrossClusterSearchConnectionStatus
s {$sel:message:OutboundCrossClusterSearchConnectionStatus' :: Maybe Text
message = Maybe Text
a} :: OutboundCrossClusterSearchConnectionStatus)

-- | The state code for outbound connection. This can be one of the
-- following:
--
-- -   VALIDATING: The outbound connection request is being validated.
-- -   VALIDATION_FAILED: Validation failed for the connection request.
-- -   PENDING_ACCEPTANCE: Outbound connection request is validated and is
--     not yet accepted by destination domain owner.
-- -   PROVISIONING: Outbound connection request is in process.
-- -   ACTIVE: Outbound connection is active and ready to use.
-- -   REJECTED: Outbound connection request is rejected by destination
--     domain owner.
-- -   DELETING: Outbound connection deletion is in progress.
-- -   DELETED: Outbound connection is deleted and cannot be used further.
outboundCrossClusterSearchConnectionStatus_statusCode :: Lens.Lens' OutboundCrossClusterSearchConnectionStatus (Prelude.Maybe OutboundCrossClusterSearchConnectionStatusCode)
outboundCrossClusterSearchConnectionStatus_statusCode :: (Maybe OutboundCrossClusterSearchConnectionStatusCode
 -> f (Maybe OutboundCrossClusterSearchConnectionStatusCode))
-> OutboundCrossClusterSearchConnectionStatus
-> f OutboundCrossClusterSearchConnectionStatus
outboundCrossClusterSearchConnectionStatus_statusCode = (OutboundCrossClusterSearchConnectionStatus
 -> Maybe OutboundCrossClusterSearchConnectionStatusCode)
-> (OutboundCrossClusterSearchConnectionStatus
    -> Maybe OutboundCrossClusterSearchConnectionStatusCode
    -> OutboundCrossClusterSearchConnectionStatus)
-> Lens
     OutboundCrossClusterSearchConnectionStatus
     OutboundCrossClusterSearchConnectionStatus
     (Maybe OutboundCrossClusterSearchConnectionStatusCode)
     (Maybe OutboundCrossClusterSearchConnectionStatusCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutboundCrossClusterSearchConnectionStatus' {Maybe OutboundCrossClusterSearchConnectionStatusCode
statusCode :: Maybe OutboundCrossClusterSearchConnectionStatusCode
$sel:statusCode:OutboundCrossClusterSearchConnectionStatus' :: OutboundCrossClusterSearchConnectionStatus
-> Maybe OutboundCrossClusterSearchConnectionStatusCode
statusCode} -> Maybe OutboundCrossClusterSearchConnectionStatusCode
statusCode) (\s :: OutboundCrossClusterSearchConnectionStatus
s@OutboundCrossClusterSearchConnectionStatus' {} Maybe OutboundCrossClusterSearchConnectionStatusCode
a -> OutboundCrossClusterSearchConnectionStatus
s {$sel:statusCode:OutboundCrossClusterSearchConnectionStatus' :: Maybe OutboundCrossClusterSearchConnectionStatusCode
statusCode = Maybe OutboundCrossClusterSearchConnectionStatusCode
a} :: OutboundCrossClusterSearchConnectionStatus)

instance
  Core.FromJSON
    OutboundCrossClusterSearchConnectionStatus
  where
  parseJSON :: Value -> Parser OutboundCrossClusterSearchConnectionStatus
parseJSON =
    String
-> (Object -> Parser OutboundCrossClusterSearchConnectionStatus)
-> Value
-> Parser OutboundCrossClusterSearchConnectionStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OutboundCrossClusterSearchConnectionStatus"
      ( \Object
x ->
          Maybe Text
-> Maybe OutboundCrossClusterSearchConnectionStatusCode
-> OutboundCrossClusterSearchConnectionStatus
OutboundCrossClusterSearchConnectionStatus'
            (Maybe Text
 -> Maybe OutboundCrossClusterSearchConnectionStatusCode
 -> OutboundCrossClusterSearchConnectionStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe OutboundCrossClusterSearchConnectionStatusCode
      -> OutboundCrossClusterSearchConnectionStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Message")
              Parser
  (Maybe OutboundCrossClusterSearchConnectionStatusCode
   -> OutboundCrossClusterSearchConnectionStatus)
-> Parser (Maybe OutboundCrossClusterSearchConnectionStatusCode)
-> Parser OutboundCrossClusterSearchConnectionStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe OutboundCrossClusterSearchConnectionStatusCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusCode")
      )

instance
  Prelude.Hashable
    OutboundCrossClusterSearchConnectionStatus

instance
  Prelude.NFData
    OutboundCrossClusterSearchConnectionStatus