{-# 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.AppFlow.Types.PrivateConnectionProvisioningState
-- 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.AppFlow.Types.PrivateConnectionProvisioningState where

import Amazonka.AppFlow.Types.PrivateConnectionProvisioningFailureCause
import Amazonka.AppFlow.Types.PrivateConnectionProvisioningStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the private connection provisioning state.
--
-- /See:/ 'newPrivateConnectionProvisioningState' smart constructor.
data PrivateConnectionProvisioningState = PrivateConnectionProvisioningState'
  { -- | Specifies the private connection provisioning status.
    PrivateConnectionProvisioningState
-> Maybe PrivateConnectionProvisioningStatus
status :: Prelude.Maybe PrivateConnectionProvisioningStatus,
    -- | Specifies the private connection provisioning failure reason.
    PrivateConnectionProvisioningState -> Maybe Text
failureMessage :: Prelude.Maybe Prelude.Text,
    -- | Specifies the private connection provisioning failure cause.
    PrivateConnectionProvisioningState
-> Maybe PrivateConnectionProvisioningFailureCause
failureCause :: Prelude.Maybe PrivateConnectionProvisioningFailureCause
  }
  deriving (PrivateConnectionProvisioningState
-> PrivateConnectionProvisioningState -> Bool
(PrivateConnectionProvisioningState
 -> PrivateConnectionProvisioningState -> Bool)
-> (PrivateConnectionProvisioningState
    -> PrivateConnectionProvisioningState -> Bool)
-> Eq PrivateConnectionProvisioningState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PrivateConnectionProvisioningState
-> PrivateConnectionProvisioningState -> Bool
$c/= :: PrivateConnectionProvisioningState
-> PrivateConnectionProvisioningState -> Bool
== :: PrivateConnectionProvisioningState
-> PrivateConnectionProvisioningState -> Bool
$c== :: PrivateConnectionProvisioningState
-> PrivateConnectionProvisioningState -> Bool
Prelude.Eq, ReadPrec [PrivateConnectionProvisioningState]
ReadPrec PrivateConnectionProvisioningState
Int -> ReadS PrivateConnectionProvisioningState
ReadS [PrivateConnectionProvisioningState]
(Int -> ReadS PrivateConnectionProvisioningState)
-> ReadS [PrivateConnectionProvisioningState]
-> ReadPrec PrivateConnectionProvisioningState
-> ReadPrec [PrivateConnectionProvisioningState]
-> Read PrivateConnectionProvisioningState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PrivateConnectionProvisioningState]
$creadListPrec :: ReadPrec [PrivateConnectionProvisioningState]
readPrec :: ReadPrec PrivateConnectionProvisioningState
$creadPrec :: ReadPrec PrivateConnectionProvisioningState
readList :: ReadS [PrivateConnectionProvisioningState]
$creadList :: ReadS [PrivateConnectionProvisioningState]
readsPrec :: Int -> ReadS PrivateConnectionProvisioningState
$creadsPrec :: Int -> ReadS PrivateConnectionProvisioningState
Prelude.Read, Int -> PrivateConnectionProvisioningState -> ShowS
[PrivateConnectionProvisioningState] -> ShowS
PrivateConnectionProvisioningState -> String
(Int -> PrivateConnectionProvisioningState -> ShowS)
-> (PrivateConnectionProvisioningState -> String)
-> ([PrivateConnectionProvisioningState] -> ShowS)
-> Show PrivateConnectionProvisioningState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrivateConnectionProvisioningState] -> ShowS
$cshowList :: [PrivateConnectionProvisioningState] -> ShowS
show :: PrivateConnectionProvisioningState -> String
$cshow :: PrivateConnectionProvisioningState -> String
showsPrec :: Int -> PrivateConnectionProvisioningState -> ShowS
$cshowsPrec :: Int -> PrivateConnectionProvisioningState -> ShowS
Prelude.Show, (forall x.
 PrivateConnectionProvisioningState
 -> Rep PrivateConnectionProvisioningState x)
-> (forall x.
    Rep PrivateConnectionProvisioningState x
    -> PrivateConnectionProvisioningState)
-> Generic PrivateConnectionProvisioningState
forall x.
Rep PrivateConnectionProvisioningState x
-> PrivateConnectionProvisioningState
forall x.
PrivateConnectionProvisioningState
-> Rep PrivateConnectionProvisioningState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PrivateConnectionProvisioningState x
-> PrivateConnectionProvisioningState
$cfrom :: forall x.
PrivateConnectionProvisioningState
-> Rep PrivateConnectionProvisioningState x
Prelude.Generic)

-- |
-- Create a value of 'PrivateConnectionProvisioningState' 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:
--
-- 'status', 'privateConnectionProvisioningState_status' - Specifies the private connection provisioning status.
--
-- 'failureMessage', 'privateConnectionProvisioningState_failureMessage' - Specifies the private connection provisioning failure reason.
--
-- 'failureCause', 'privateConnectionProvisioningState_failureCause' - Specifies the private connection provisioning failure cause.
newPrivateConnectionProvisioningState ::
  PrivateConnectionProvisioningState
newPrivateConnectionProvisioningState :: PrivateConnectionProvisioningState
newPrivateConnectionProvisioningState =
  PrivateConnectionProvisioningState' :: Maybe PrivateConnectionProvisioningStatus
-> Maybe Text
-> Maybe PrivateConnectionProvisioningFailureCause
-> PrivateConnectionProvisioningState
PrivateConnectionProvisioningState'
    { $sel:status:PrivateConnectionProvisioningState' :: Maybe PrivateConnectionProvisioningStatus
status =
        Maybe PrivateConnectionProvisioningStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:failureMessage:PrivateConnectionProvisioningState' :: Maybe Text
failureMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failureCause:PrivateConnectionProvisioningState' :: Maybe PrivateConnectionProvisioningFailureCause
failureCause = Maybe PrivateConnectionProvisioningFailureCause
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the private connection provisioning status.
privateConnectionProvisioningState_status :: Lens.Lens' PrivateConnectionProvisioningState (Prelude.Maybe PrivateConnectionProvisioningStatus)
privateConnectionProvisioningState_status :: (Maybe PrivateConnectionProvisioningStatus
 -> f (Maybe PrivateConnectionProvisioningStatus))
-> PrivateConnectionProvisioningState
-> f PrivateConnectionProvisioningState
privateConnectionProvisioningState_status = (PrivateConnectionProvisioningState
 -> Maybe PrivateConnectionProvisioningStatus)
-> (PrivateConnectionProvisioningState
    -> Maybe PrivateConnectionProvisioningStatus
    -> PrivateConnectionProvisioningState)
-> Lens
     PrivateConnectionProvisioningState
     PrivateConnectionProvisioningState
     (Maybe PrivateConnectionProvisioningStatus)
     (Maybe PrivateConnectionProvisioningStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateConnectionProvisioningState' {Maybe PrivateConnectionProvisioningStatus
status :: Maybe PrivateConnectionProvisioningStatus
$sel:status:PrivateConnectionProvisioningState' :: PrivateConnectionProvisioningState
-> Maybe PrivateConnectionProvisioningStatus
status} -> Maybe PrivateConnectionProvisioningStatus
status) (\s :: PrivateConnectionProvisioningState
s@PrivateConnectionProvisioningState' {} Maybe PrivateConnectionProvisioningStatus
a -> PrivateConnectionProvisioningState
s {$sel:status:PrivateConnectionProvisioningState' :: Maybe PrivateConnectionProvisioningStatus
status = Maybe PrivateConnectionProvisioningStatus
a} :: PrivateConnectionProvisioningState)

-- | Specifies the private connection provisioning failure reason.
privateConnectionProvisioningState_failureMessage :: Lens.Lens' PrivateConnectionProvisioningState (Prelude.Maybe Prelude.Text)
privateConnectionProvisioningState_failureMessage :: (Maybe Text -> f (Maybe Text))
-> PrivateConnectionProvisioningState
-> f PrivateConnectionProvisioningState
privateConnectionProvisioningState_failureMessage = (PrivateConnectionProvisioningState -> Maybe Text)
-> (PrivateConnectionProvisioningState
    -> Maybe Text -> PrivateConnectionProvisioningState)
-> Lens
     PrivateConnectionProvisioningState
     PrivateConnectionProvisioningState
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateConnectionProvisioningState' {Maybe Text
failureMessage :: Maybe Text
$sel:failureMessage:PrivateConnectionProvisioningState' :: PrivateConnectionProvisioningState -> Maybe Text
failureMessage} -> Maybe Text
failureMessage) (\s :: PrivateConnectionProvisioningState
s@PrivateConnectionProvisioningState' {} Maybe Text
a -> PrivateConnectionProvisioningState
s {$sel:failureMessage:PrivateConnectionProvisioningState' :: Maybe Text
failureMessage = Maybe Text
a} :: PrivateConnectionProvisioningState)

-- | Specifies the private connection provisioning failure cause.
privateConnectionProvisioningState_failureCause :: Lens.Lens' PrivateConnectionProvisioningState (Prelude.Maybe PrivateConnectionProvisioningFailureCause)
privateConnectionProvisioningState_failureCause :: (Maybe PrivateConnectionProvisioningFailureCause
 -> f (Maybe PrivateConnectionProvisioningFailureCause))
-> PrivateConnectionProvisioningState
-> f PrivateConnectionProvisioningState
privateConnectionProvisioningState_failureCause = (PrivateConnectionProvisioningState
 -> Maybe PrivateConnectionProvisioningFailureCause)
-> (PrivateConnectionProvisioningState
    -> Maybe PrivateConnectionProvisioningFailureCause
    -> PrivateConnectionProvisioningState)
-> Lens
     PrivateConnectionProvisioningState
     PrivateConnectionProvisioningState
     (Maybe PrivateConnectionProvisioningFailureCause)
     (Maybe PrivateConnectionProvisioningFailureCause)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrivateConnectionProvisioningState' {Maybe PrivateConnectionProvisioningFailureCause
failureCause :: Maybe PrivateConnectionProvisioningFailureCause
$sel:failureCause:PrivateConnectionProvisioningState' :: PrivateConnectionProvisioningState
-> Maybe PrivateConnectionProvisioningFailureCause
failureCause} -> Maybe PrivateConnectionProvisioningFailureCause
failureCause) (\s :: PrivateConnectionProvisioningState
s@PrivateConnectionProvisioningState' {} Maybe PrivateConnectionProvisioningFailureCause
a -> PrivateConnectionProvisioningState
s {$sel:failureCause:PrivateConnectionProvisioningState' :: Maybe PrivateConnectionProvisioningFailureCause
failureCause = Maybe PrivateConnectionProvisioningFailureCause
a} :: PrivateConnectionProvisioningState)

instance
  Core.FromJSON
    PrivateConnectionProvisioningState
  where
  parseJSON :: Value -> Parser PrivateConnectionProvisioningState
parseJSON =
    String
-> (Object -> Parser PrivateConnectionProvisioningState)
-> Value
-> Parser PrivateConnectionProvisioningState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PrivateConnectionProvisioningState"
      ( \Object
x ->
          Maybe PrivateConnectionProvisioningStatus
-> Maybe Text
-> Maybe PrivateConnectionProvisioningFailureCause
-> PrivateConnectionProvisioningState
PrivateConnectionProvisioningState'
            (Maybe PrivateConnectionProvisioningStatus
 -> Maybe Text
 -> Maybe PrivateConnectionProvisioningFailureCause
 -> PrivateConnectionProvisioningState)
-> Parser (Maybe PrivateConnectionProvisioningStatus)
-> Parser
     (Maybe Text
      -> Maybe PrivateConnectionProvisioningFailureCause
      -> PrivateConnectionProvisioningState)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe PrivateConnectionProvisioningStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe PrivateConnectionProvisioningFailureCause
   -> PrivateConnectionProvisioningState)
-> Parser (Maybe Text)
-> Parser
     (Maybe PrivateConnectionProvisioningFailureCause
      -> PrivateConnectionProvisioningState)
forall (f :: * -> *) a b. Applicative f => 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
"failureMessage")
            Parser
  (Maybe PrivateConnectionProvisioningFailureCause
   -> PrivateConnectionProvisioningState)
-> Parser (Maybe PrivateConnectionProvisioningFailureCause)
-> Parser PrivateConnectionProvisioningState
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe PrivateConnectionProvisioningFailureCause)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"failureCause")
      )

instance
  Prelude.Hashable
    PrivateConnectionProvisioningState

instance
  Prelude.NFData
    PrivateConnectionProvisioningState