{-# 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.OpenSearch.Types.OutboundConnectionStatus
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.OpenSearch.Types.OutboundConnectionStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearch.Types.OutboundConnectionStatusCode
import qualified Amazonka.Prelude as Prelude

-- | The status of an outbound cross-cluster connection.
--
-- /See:/ 'newOutboundConnectionStatus' smart constructor.
data OutboundConnectionStatus = OutboundConnectionStatus'
  { -- | Verbose information for the outbound connection.
    OutboundConnectionStatus -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The status code for the outbound connection. 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 the remote domain owner.
    --
    -- -   __APPROVED__ - Outbound connection has been approved by the remote
    --     domain owner for getting provisioned.
    --
    -- -   __PROVISIONING__ - Outbound connection request is in process.
    --
    -- -   __ACTIVE__ - Outbound connection is active and ready to use.
    --
    -- -   __REJECTING__ - Outbound connection rejection by remote domain owner
    --     is in progress.
    --
    -- -   __REJECTED__ - Outbound connection request is rejected by remote
    --     domain owner.
    --
    -- -   __DELETING__ - Outbound connection deletion is in progress.
    --
    -- -   __DELETED__ - Outbound connection is deleted and can no longer be
    --     used.
    OutboundConnectionStatus -> Maybe OutboundConnectionStatusCode
statusCode :: Prelude.Maybe OutboundConnectionStatusCode
  }
  deriving (OutboundConnectionStatus -> OutboundConnectionStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutboundConnectionStatus -> OutboundConnectionStatus -> Bool
$c/= :: OutboundConnectionStatus -> OutboundConnectionStatus -> Bool
== :: OutboundConnectionStatus -> OutboundConnectionStatus -> Bool
$c== :: OutboundConnectionStatus -> OutboundConnectionStatus -> Bool
Prelude.Eq, ReadPrec [OutboundConnectionStatus]
ReadPrec OutboundConnectionStatus
Int -> ReadS OutboundConnectionStatus
ReadS [OutboundConnectionStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutboundConnectionStatus]
$creadListPrec :: ReadPrec [OutboundConnectionStatus]
readPrec :: ReadPrec OutboundConnectionStatus
$creadPrec :: ReadPrec OutboundConnectionStatus
readList :: ReadS [OutboundConnectionStatus]
$creadList :: ReadS [OutboundConnectionStatus]
readsPrec :: Int -> ReadS OutboundConnectionStatus
$creadsPrec :: Int -> ReadS OutboundConnectionStatus
Prelude.Read, Int -> OutboundConnectionStatus -> ShowS
[OutboundConnectionStatus] -> ShowS
OutboundConnectionStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutboundConnectionStatus] -> ShowS
$cshowList :: [OutboundConnectionStatus] -> ShowS
show :: OutboundConnectionStatus -> String
$cshow :: OutboundConnectionStatus -> String
showsPrec :: Int -> OutboundConnectionStatus -> ShowS
$cshowsPrec :: Int -> OutboundConnectionStatus -> ShowS
Prelude.Show, forall x.
Rep OutboundConnectionStatus x -> OutboundConnectionStatus
forall x.
OutboundConnectionStatus -> Rep OutboundConnectionStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OutboundConnectionStatus x -> OutboundConnectionStatus
$cfrom :: forall x.
OutboundConnectionStatus -> Rep OutboundConnectionStatus x
Prelude.Generic)

-- |
-- Create a value of 'OutboundConnectionStatus' 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', 'outboundConnectionStatus_message' - Verbose information for the outbound connection.
--
-- 'statusCode', 'outboundConnectionStatus_statusCode' - The status code for the outbound connection. 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 the remote domain owner.
--
-- -   __APPROVED__ - Outbound connection has been approved by the remote
--     domain owner for getting provisioned.
--
-- -   __PROVISIONING__ - Outbound connection request is in process.
--
-- -   __ACTIVE__ - Outbound connection is active and ready to use.
--
-- -   __REJECTING__ - Outbound connection rejection by remote domain owner
--     is in progress.
--
-- -   __REJECTED__ - Outbound connection request is rejected by remote
--     domain owner.
--
-- -   __DELETING__ - Outbound connection deletion is in progress.
--
-- -   __DELETED__ - Outbound connection is deleted and can no longer be
--     used.
newOutboundConnectionStatus ::
  OutboundConnectionStatus
newOutboundConnectionStatus :: OutboundConnectionStatus
newOutboundConnectionStatus =
  OutboundConnectionStatus'
    { $sel:message:OutboundConnectionStatus' :: Maybe Text
message =
        forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:OutboundConnectionStatus' :: Maybe OutboundConnectionStatusCode
statusCode = forall a. Maybe a
Prelude.Nothing
    }

-- | Verbose information for the outbound connection.
outboundConnectionStatus_message :: Lens.Lens' OutboundConnectionStatus (Prelude.Maybe Prelude.Text)
outboundConnectionStatus_message :: Lens' OutboundConnectionStatus (Maybe Text)
outboundConnectionStatus_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutboundConnectionStatus' {Maybe Text
message :: Maybe Text
$sel:message:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe Text
message} -> Maybe Text
message) (\s :: OutboundConnectionStatus
s@OutboundConnectionStatus' {} Maybe Text
a -> OutboundConnectionStatus
s {$sel:message:OutboundConnectionStatus' :: Maybe Text
message = Maybe Text
a} :: OutboundConnectionStatus)

-- | The status code for the outbound connection. 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 the remote domain owner.
--
-- -   __APPROVED__ - Outbound connection has been approved by the remote
--     domain owner for getting provisioned.
--
-- -   __PROVISIONING__ - Outbound connection request is in process.
--
-- -   __ACTIVE__ - Outbound connection is active and ready to use.
--
-- -   __REJECTING__ - Outbound connection rejection by remote domain owner
--     is in progress.
--
-- -   __REJECTED__ - Outbound connection request is rejected by remote
--     domain owner.
--
-- -   __DELETING__ - Outbound connection deletion is in progress.
--
-- -   __DELETED__ - Outbound connection is deleted and can no longer be
--     used.
outboundConnectionStatus_statusCode :: Lens.Lens' OutboundConnectionStatus (Prelude.Maybe OutboundConnectionStatusCode)
outboundConnectionStatus_statusCode :: Lens' OutboundConnectionStatus (Maybe OutboundConnectionStatusCode)
outboundConnectionStatus_statusCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutboundConnectionStatus' {Maybe OutboundConnectionStatusCode
statusCode :: Maybe OutboundConnectionStatusCode
$sel:statusCode:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe OutboundConnectionStatusCode
statusCode} -> Maybe OutboundConnectionStatusCode
statusCode) (\s :: OutboundConnectionStatus
s@OutboundConnectionStatus' {} Maybe OutboundConnectionStatusCode
a -> OutboundConnectionStatus
s {$sel:statusCode:OutboundConnectionStatus' :: Maybe OutboundConnectionStatusCode
statusCode = Maybe OutboundConnectionStatusCode
a} :: OutboundConnectionStatus)

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

instance Prelude.Hashable OutboundConnectionStatus where
  hashWithSalt :: Int -> OutboundConnectionStatus -> Int
hashWithSalt Int
_salt OutboundConnectionStatus' {Maybe Text
Maybe OutboundConnectionStatusCode
statusCode :: Maybe OutboundConnectionStatusCode
message :: Maybe Text
$sel:statusCode:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe OutboundConnectionStatusCode
$sel:message:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OutboundConnectionStatusCode
statusCode

instance Prelude.NFData OutboundConnectionStatus where
  rnf :: OutboundConnectionStatus -> ()
rnf OutboundConnectionStatus' {Maybe Text
Maybe OutboundConnectionStatusCode
statusCode :: Maybe OutboundConnectionStatusCode
message :: Maybe Text
$sel:statusCode:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe OutboundConnectionStatusCode
$sel:message:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OutboundConnectionStatusCode
statusCode