{-# 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.Route53RecoveryReadiness.Types.RecoveryGroupOutput
-- 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.Route53RecoveryReadiness.Types.RecoveryGroupOutput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A Recovery Group generally containing multiple Cells
--
-- /See:/ 'newRecoveryGroupOutput' smart constructor.
data RecoveryGroupOutput = RecoveryGroupOutput'
  { RecoveryGroupOutput -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The arn for the RecoveryGroup
    RecoveryGroupOutput -> Text
recoveryGroupArn :: Prelude.Text,
    -- | The name of the RecoveryGroup
    RecoveryGroupOutput -> Text
recoveryGroupName :: Prelude.Text,
    -- | A list of Cell arns
    RecoveryGroupOutput -> [Text]
cells :: [Prelude.Text]
  }
  deriving (RecoveryGroupOutput -> RecoveryGroupOutput -> Bool
(RecoveryGroupOutput -> RecoveryGroupOutput -> Bool)
-> (RecoveryGroupOutput -> RecoveryGroupOutput -> Bool)
-> Eq RecoveryGroupOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecoveryGroupOutput -> RecoveryGroupOutput -> Bool
$c/= :: RecoveryGroupOutput -> RecoveryGroupOutput -> Bool
== :: RecoveryGroupOutput -> RecoveryGroupOutput -> Bool
$c== :: RecoveryGroupOutput -> RecoveryGroupOutput -> Bool
Prelude.Eq, ReadPrec [RecoveryGroupOutput]
ReadPrec RecoveryGroupOutput
Int -> ReadS RecoveryGroupOutput
ReadS [RecoveryGroupOutput]
(Int -> ReadS RecoveryGroupOutput)
-> ReadS [RecoveryGroupOutput]
-> ReadPrec RecoveryGroupOutput
-> ReadPrec [RecoveryGroupOutput]
-> Read RecoveryGroupOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecoveryGroupOutput]
$creadListPrec :: ReadPrec [RecoveryGroupOutput]
readPrec :: ReadPrec RecoveryGroupOutput
$creadPrec :: ReadPrec RecoveryGroupOutput
readList :: ReadS [RecoveryGroupOutput]
$creadList :: ReadS [RecoveryGroupOutput]
readsPrec :: Int -> ReadS RecoveryGroupOutput
$creadsPrec :: Int -> ReadS RecoveryGroupOutput
Prelude.Read, Int -> RecoveryGroupOutput -> ShowS
[RecoveryGroupOutput] -> ShowS
RecoveryGroupOutput -> String
(Int -> RecoveryGroupOutput -> ShowS)
-> (RecoveryGroupOutput -> String)
-> ([RecoveryGroupOutput] -> ShowS)
-> Show RecoveryGroupOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecoveryGroupOutput] -> ShowS
$cshowList :: [RecoveryGroupOutput] -> ShowS
show :: RecoveryGroupOutput -> String
$cshow :: RecoveryGroupOutput -> String
showsPrec :: Int -> RecoveryGroupOutput -> ShowS
$cshowsPrec :: Int -> RecoveryGroupOutput -> ShowS
Prelude.Show, (forall x. RecoveryGroupOutput -> Rep RecoveryGroupOutput x)
-> (forall x. Rep RecoveryGroupOutput x -> RecoveryGroupOutput)
-> Generic RecoveryGroupOutput
forall x. Rep RecoveryGroupOutput x -> RecoveryGroupOutput
forall x. RecoveryGroupOutput -> Rep RecoveryGroupOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecoveryGroupOutput x -> RecoveryGroupOutput
$cfrom :: forall x. RecoveryGroupOutput -> Rep RecoveryGroupOutput x
Prelude.Generic)

-- |
-- Create a value of 'RecoveryGroupOutput' 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:
--
-- 'tags', 'recoveryGroupOutput_tags' - Undocumented member.
--
-- 'recoveryGroupArn', 'recoveryGroupOutput_recoveryGroupArn' - The arn for the RecoveryGroup
--
-- 'recoveryGroupName', 'recoveryGroupOutput_recoveryGroupName' - The name of the RecoveryGroup
--
-- 'cells', 'recoveryGroupOutput_cells' - A list of Cell arns
newRecoveryGroupOutput ::
  -- | 'recoveryGroupArn'
  Prelude.Text ->
  -- | 'recoveryGroupName'
  Prelude.Text ->
  RecoveryGroupOutput
newRecoveryGroupOutput :: Text -> Text -> RecoveryGroupOutput
newRecoveryGroupOutput
  Text
pRecoveryGroupArn_
  Text
pRecoveryGroupName_ =
    RecoveryGroupOutput' :: Maybe (HashMap Text Text)
-> Text -> Text -> [Text] -> RecoveryGroupOutput
RecoveryGroupOutput'
      { $sel:tags:RecoveryGroupOutput' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:recoveryGroupArn:RecoveryGroupOutput' :: Text
recoveryGroupArn = Text
pRecoveryGroupArn_,
        $sel:recoveryGroupName:RecoveryGroupOutput' :: Text
recoveryGroupName = Text
pRecoveryGroupName_,
        $sel:cells:RecoveryGroupOutput' :: [Text]
cells = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | Undocumented member.
recoveryGroupOutput_tags :: Lens.Lens' RecoveryGroupOutput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
recoveryGroupOutput_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RecoveryGroupOutput -> f RecoveryGroupOutput
recoveryGroupOutput_tags = (RecoveryGroupOutput -> Maybe (HashMap Text Text))
-> (RecoveryGroupOutput
    -> Maybe (HashMap Text Text) -> RecoveryGroupOutput)
-> Lens
     RecoveryGroupOutput
     RecoveryGroupOutput
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryGroupOutput' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:RecoveryGroupOutput' :: RecoveryGroupOutput -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: RecoveryGroupOutput
s@RecoveryGroupOutput' {} Maybe (HashMap Text Text)
a -> RecoveryGroupOutput
s {$sel:tags:RecoveryGroupOutput' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: RecoveryGroupOutput) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> RecoveryGroupOutput -> f RecoveryGroupOutput)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RecoveryGroupOutput
-> f RecoveryGroupOutput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The arn for the RecoveryGroup
recoveryGroupOutput_recoveryGroupArn :: Lens.Lens' RecoveryGroupOutput Prelude.Text
recoveryGroupOutput_recoveryGroupArn :: (Text -> f Text) -> RecoveryGroupOutput -> f RecoveryGroupOutput
recoveryGroupOutput_recoveryGroupArn = (RecoveryGroupOutput -> Text)
-> (RecoveryGroupOutput -> Text -> RecoveryGroupOutput)
-> Lens RecoveryGroupOutput RecoveryGroupOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryGroupOutput' {Text
recoveryGroupArn :: Text
$sel:recoveryGroupArn:RecoveryGroupOutput' :: RecoveryGroupOutput -> Text
recoveryGroupArn} -> Text
recoveryGroupArn) (\s :: RecoveryGroupOutput
s@RecoveryGroupOutput' {} Text
a -> RecoveryGroupOutput
s {$sel:recoveryGroupArn:RecoveryGroupOutput' :: Text
recoveryGroupArn = Text
a} :: RecoveryGroupOutput)

-- | The name of the RecoveryGroup
recoveryGroupOutput_recoveryGroupName :: Lens.Lens' RecoveryGroupOutput Prelude.Text
recoveryGroupOutput_recoveryGroupName :: (Text -> f Text) -> RecoveryGroupOutput -> f RecoveryGroupOutput
recoveryGroupOutput_recoveryGroupName = (RecoveryGroupOutput -> Text)
-> (RecoveryGroupOutput -> Text -> RecoveryGroupOutput)
-> Lens RecoveryGroupOutput RecoveryGroupOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryGroupOutput' {Text
recoveryGroupName :: Text
$sel:recoveryGroupName:RecoveryGroupOutput' :: RecoveryGroupOutput -> Text
recoveryGroupName} -> Text
recoveryGroupName) (\s :: RecoveryGroupOutput
s@RecoveryGroupOutput' {} Text
a -> RecoveryGroupOutput
s {$sel:recoveryGroupName:RecoveryGroupOutput' :: Text
recoveryGroupName = Text
a} :: RecoveryGroupOutput)

-- | A list of Cell arns
recoveryGroupOutput_cells :: Lens.Lens' RecoveryGroupOutput [Prelude.Text]
recoveryGroupOutput_cells :: ([Text] -> f [Text])
-> RecoveryGroupOutput -> f RecoveryGroupOutput
recoveryGroupOutput_cells = (RecoveryGroupOutput -> [Text])
-> (RecoveryGroupOutput -> [Text] -> RecoveryGroupOutput)
-> Lens RecoveryGroupOutput RecoveryGroupOutput [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryGroupOutput' {[Text]
cells :: [Text]
$sel:cells:RecoveryGroupOutput' :: RecoveryGroupOutput -> [Text]
cells} -> [Text]
cells) (\s :: RecoveryGroupOutput
s@RecoveryGroupOutput' {} [Text]
a -> RecoveryGroupOutput
s {$sel:cells:RecoveryGroupOutput' :: [Text]
cells = [Text]
a} :: RecoveryGroupOutput) (([Text] -> f [Text])
 -> RecoveryGroupOutput -> f RecoveryGroupOutput)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> RecoveryGroupOutput
-> f RecoveryGroupOutput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON RecoveryGroupOutput where
  parseJSON :: Value -> Parser RecoveryGroupOutput
parseJSON =
    String
-> (Object -> Parser RecoveryGroupOutput)
-> Value
-> Parser RecoveryGroupOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RecoveryGroupOutput"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Text -> Text -> [Text] -> RecoveryGroupOutput
RecoveryGroupOutput'
            (Maybe (HashMap Text Text)
 -> Text -> Text -> [Text] -> RecoveryGroupOutput)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> [Text] -> RecoveryGroupOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> Text -> [Text] -> RecoveryGroupOutput)
-> Parser Text -> Parser (Text -> [Text] -> RecoveryGroupOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"recoveryGroupArn")
            Parser (Text -> [Text] -> RecoveryGroupOutput)
-> Parser Text -> Parser ([Text] -> RecoveryGroupOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"recoveryGroupName")
            Parser ([Text] -> RecoveryGroupOutput)
-> Parser [Text] -> Parser RecoveryGroupOutput
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
"cells" Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable RecoveryGroupOutput

instance Prelude.NFData RecoveryGroupOutput