{-# 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.Route53RecoveryControlConfig.Types.ControlPanel
-- 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.Route53RecoveryControlConfig.Types.ControlPanel where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53RecoveryControlConfig.Types.Status

-- | A control panel represents a group of routing controls that can be
-- changed together in a single transaction.
--
-- /See:/ 'newControlPanel' smart constructor.
data ControlPanel = ControlPanel'
  { -- | The Amazon Resource Name (ARN) of the cluster that includes the control
    -- panel.
    ControlPanel -> Maybe Text
clusterArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the control panel.
    ControlPanel -> Maybe Text
controlPanelArn :: Prelude.Maybe Prelude.Text,
    -- | A flag that Amazon Route 53 Application Recovery Controller sets to true
    -- to designate the default control panel for a cluster. When you create a
    -- cluster, Amazon Route 53 Application Recovery Controller creates a
    -- control panel, and sets this flag for that control panel. If you create
    -- a control panel yourself, this flag is set to false.
    ControlPanel -> Maybe Bool
defaultControlPanel :: Prelude.Maybe Prelude.Bool,
    -- | The name of the control panel. You can use any non-white space character
    -- in the name.
    ControlPanel -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The number of routing controls in the control panel.
    ControlPanel -> Maybe Int
routingControlCount :: Prelude.Maybe Prelude.Int,
    -- | The deployment status of control panel. Status can be one of the
    -- following: PENDING, DEPLOYED, PENDING_DELETION.
    ControlPanel -> Maybe Status
status :: Prelude.Maybe Status
  }
  deriving (ControlPanel -> ControlPanel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControlPanel -> ControlPanel -> Bool
$c/= :: ControlPanel -> ControlPanel -> Bool
== :: ControlPanel -> ControlPanel -> Bool
$c== :: ControlPanel -> ControlPanel -> Bool
Prelude.Eq, ReadPrec [ControlPanel]
ReadPrec ControlPanel
Int -> ReadS ControlPanel
ReadS [ControlPanel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ControlPanel]
$creadListPrec :: ReadPrec [ControlPanel]
readPrec :: ReadPrec ControlPanel
$creadPrec :: ReadPrec ControlPanel
readList :: ReadS [ControlPanel]
$creadList :: ReadS [ControlPanel]
readsPrec :: Int -> ReadS ControlPanel
$creadsPrec :: Int -> ReadS ControlPanel
Prelude.Read, Int -> ControlPanel -> ShowS
[ControlPanel] -> ShowS
ControlPanel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ControlPanel] -> ShowS
$cshowList :: [ControlPanel] -> ShowS
show :: ControlPanel -> String
$cshow :: ControlPanel -> String
showsPrec :: Int -> ControlPanel -> ShowS
$cshowsPrec :: Int -> ControlPanel -> ShowS
Prelude.Show, forall x. Rep ControlPanel x -> ControlPanel
forall x. ControlPanel -> Rep ControlPanel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ControlPanel x -> ControlPanel
$cfrom :: forall x. ControlPanel -> Rep ControlPanel x
Prelude.Generic)

-- |
-- Create a value of 'ControlPanel' 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:
--
-- 'clusterArn', 'controlPanel_clusterArn' - The Amazon Resource Name (ARN) of the cluster that includes the control
-- panel.
--
-- 'controlPanelArn', 'controlPanel_controlPanelArn' - The Amazon Resource Name (ARN) of the control panel.
--
-- 'defaultControlPanel', 'controlPanel_defaultControlPanel' - A flag that Amazon Route 53 Application Recovery Controller sets to true
-- to designate the default control panel for a cluster. When you create a
-- cluster, Amazon Route 53 Application Recovery Controller creates a
-- control panel, and sets this flag for that control panel. If you create
-- a control panel yourself, this flag is set to false.
--
-- 'name', 'controlPanel_name' - The name of the control panel. You can use any non-white space character
-- in the name.
--
-- 'routingControlCount', 'controlPanel_routingControlCount' - The number of routing controls in the control panel.
--
-- 'status', 'controlPanel_status' - The deployment status of control panel. Status can be one of the
-- following: PENDING, DEPLOYED, PENDING_DELETION.
newControlPanel ::
  ControlPanel
newControlPanel :: ControlPanel
newControlPanel =
  ControlPanel'
    { $sel:clusterArn:ControlPanel' :: Maybe Text
clusterArn = forall a. Maybe a
Prelude.Nothing,
      $sel:controlPanelArn:ControlPanel' :: Maybe Text
controlPanelArn = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultControlPanel:ControlPanel' :: Maybe Bool
defaultControlPanel = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ControlPanel' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:routingControlCount:ControlPanel' :: Maybe Int
routingControlCount = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ControlPanel' :: Maybe Status
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the cluster that includes the control
-- panel.
controlPanel_clusterArn :: Lens.Lens' ControlPanel (Prelude.Maybe Prelude.Text)
controlPanel_clusterArn :: Lens' ControlPanel (Maybe Text)
controlPanel_clusterArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPanel' {Maybe Text
clusterArn :: Maybe Text
$sel:clusterArn:ControlPanel' :: ControlPanel -> Maybe Text
clusterArn} -> Maybe Text
clusterArn) (\s :: ControlPanel
s@ControlPanel' {} Maybe Text
a -> ControlPanel
s {$sel:clusterArn:ControlPanel' :: Maybe Text
clusterArn = Maybe Text
a} :: ControlPanel)

-- | The Amazon Resource Name (ARN) of the control panel.
controlPanel_controlPanelArn :: Lens.Lens' ControlPanel (Prelude.Maybe Prelude.Text)
controlPanel_controlPanelArn :: Lens' ControlPanel (Maybe Text)
controlPanel_controlPanelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPanel' {Maybe Text
controlPanelArn :: Maybe Text
$sel:controlPanelArn:ControlPanel' :: ControlPanel -> Maybe Text
controlPanelArn} -> Maybe Text
controlPanelArn) (\s :: ControlPanel
s@ControlPanel' {} Maybe Text
a -> ControlPanel
s {$sel:controlPanelArn:ControlPanel' :: Maybe Text
controlPanelArn = Maybe Text
a} :: ControlPanel)

-- | A flag that Amazon Route 53 Application Recovery Controller sets to true
-- to designate the default control panel for a cluster. When you create a
-- cluster, Amazon Route 53 Application Recovery Controller creates a
-- control panel, and sets this flag for that control panel. If you create
-- a control panel yourself, this flag is set to false.
controlPanel_defaultControlPanel :: Lens.Lens' ControlPanel (Prelude.Maybe Prelude.Bool)
controlPanel_defaultControlPanel :: Lens' ControlPanel (Maybe Bool)
controlPanel_defaultControlPanel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPanel' {Maybe Bool
defaultControlPanel :: Maybe Bool
$sel:defaultControlPanel:ControlPanel' :: ControlPanel -> Maybe Bool
defaultControlPanel} -> Maybe Bool
defaultControlPanel) (\s :: ControlPanel
s@ControlPanel' {} Maybe Bool
a -> ControlPanel
s {$sel:defaultControlPanel:ControlPanel' :: Maybe Bool
defaultControlPanel = Maybe Bool
a} :: ControlPanel)

-- | The name of the control panel. You can use any non-white space character
-- in the name.
controlPanel_name :: Lens.Lens' ControlPanel (Prelude.Maybe Prelude.Text)
controlPanel_name :: Lens' ControlPanel (Maybe Text)
controlPanel_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPanel' {Maybe Text
name :: Maybe Text
$sel:name:ControlPanel' :: ControlPanel -> Maybe Text
name} -> Maybe Text
name) (\s :: ControlPanel
s@ControlPanel' {} Maybe Text
a -> ControlPanel
s {$sel:name:ControlPanel' :: Maybe Text
name = Maybe Text
a} :: ControlPanel)

-- | The number of routing controls in the control panel.
controlPanel_routingControlCount :: Lens.Lens' ControlPanel (Prelude.Maybe Prelude.Int)
controlPanel_routingControlCount :: Lens' ControlPanel (Maybe Int)
controlPanel_routingControlCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPanel' {Maybe Int
routingControlCount :: Maybe Int
$sel:routingControlCount:ControlPanel' :: ControlPanel -> Maybe Int
routingControlCount} -> Maybe Int
routingControlCount) (\s :: ControlPanel
s@ControlPanel' {} Maybe Int
a -> ControlPanel
s {$sel:routingControlCount:ControlPanel' :: Maybe Int
routingControlCount = Maybe Int
a} :: ControlPanel)

-- | The deployment status of control panel. Status can be one of the
-- following: PENDING, DEPLOYED, PENDING_DELETION.
controlPanel_status :: Lens.Lens' ControlPanel (Prelude.Maybe Status)
controlPanel_status :: Lens' ControlPanel (Maybe Status)
controlPanel_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlPanel' {Maybe Status
status :: Maybe Status
$sel:status:ControlPanel' :: ControlPanel -> Maybe Status
status} -> Maybe Status
status) (\s :: ControlPanel
s@ControlPanel' {} Maybe Status
a -> ControlPanel
s {$sel:status:ControlPanel' :: Maybe Status
status = Maybe Status
a} :: ControlPanel)

instance Data.FromJSON ControlPanel where
  parseJSON :: Value -> Parser ControlPanel
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ControlPanel"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Status
-> ControlPanel
ControlPanel'
            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
"ClusterArn")
            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
"ControlPanelArn")
            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
"DefaultControlPanel")
            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
"Name")
            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
"RoutingControlCount")
            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
"Status")
      )

instance Prelude.Hashable ControlPanel where
  hashWithSalt :: Int -> ControlPanel -> Int
hashWithSalt Int
_salt ControlPanel' {Maybe Bool
Maybe Int
Maybe Text
Maybe Status
status :: Maybe Status
routingControlCount :: Maybe Int
name :: Maybe Text
defaultControlPanel :: Maybe Bool
controlPanelArn :: Maybe Text
clusterArn :: Maybe Text
$sel:status:ControlPanel' :: ControlPanel -> Maybe Status
$sel:routingControlCount:ControlPanel' :: ControlPanel -> Maybe Int
$sel:name:ControlPanel' :: ControlPanel -> Maybe Text
$sel:defaultControlPanel:ControlPanel' :: ControlPanel -> Maybe Bool
$sel:controlPanelArn:ControlPanel' :: ControlPanel -> Maybe Text
$sel:clusterArn:ControlPanel' :: ControlPanel -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
controlPanelArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
defaultControlPanel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
routingControlCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Status
status

instance Prelude.NFData ControlPanel where
  rnf :: ControlPanel -> ()
rnf ControlPanel' {Maybe Bool
Maybe Int
Maybe Text
Maybe Status
status :: Maybe Status
routingControlCount :: Maybe Int
name :: Maybe Text
defaultControlPanel :: Maybe Bool
controlPanelArn :: Maybe Text
clusterArn :: Maybe Text
$sel:status:ControlPanel' :: ControlPanel -> Maybe Status
$sel:routingControlCount:ControlPanel' :: ControlPanel -> Maybe Int
$sel:name:ControlPanel' :: ControlPanel -> Maybe Text
$sel:defaultControlPanel:ControlPanel' :: ControlPanel -> Maybe Bool
$sel:controlPanelArn:ControlPanel' :: ControlPanel -> Maybe Text
$sel:clusterArn:ControlPanel' :: ControlPanel -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
controlPanelArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
defaultControlPanel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
routingControlCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Status
status