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

-- | A representation of the application, typically containing multiple
-- cells.
--
-- /See:/ 'newRecoveryGroupOutput' smart constructor.
data RecoveryGroupOutput = RecoveryGroupOutput'
  { -- | The tags associated with the recovery group.
    RecoveryGroupOutput -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) for the recovery group.
    RecoveryGroupOutput -> Text
recoveryGroupArn :: Prelude.Text,
    -- | The name of the recovery group.
    RecoveryGroupOutput -> Text
recoveryGroupName :: Prelude.Text,
    -- | A list of a cell\'s Amazon Resource Names (ARNs).
    RecoveryGroupOutput -> [Text]
cells :: [Prelude.Text]
  }
  deriving (RecoveryGroupOutput -> RecoveryGroupOutput -> Bool
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]
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
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. 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' - The tags associated with the recovery group.
--
-- 'recoveryGroupArn', 'recoveryGroupOutput_recoveryGroupArn' - The Amazon Resource Name (ARN) for the recovery group.
--
-- 'recoveryGroupName', 'recoveryGroupOutput_recoveryGroupName' - The name of the recovery group.
--
-- 'cells', 'recoveryGroupOutput_cells' - A list of a cell\'s Amazon Resource Names (ARNs).
newRecoveryGroupOutput ::
  -- | 'recoveryGroupArn'
  Prelude.Text ->
  -- | 'recoveryGroupName'
  Prelude.Text ->
  RecoveryGroupOutput
newRecoveryGroupOutput :: Text -> Text -> RecoveryGroupOutput
newRecoveryGroupOutput
  Text
pRecoveryGroupArn_
  Text
pRecoveryGroupName_ =
    RecoveryGroupOutput'
      { $sel:tags:RecoveryGroupOutput' :: Maybe (HashMap Text Text)
tags = 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 = forall a. Monoid a => a
Prelude.mempty
      }

-- | The tags associated with the recovery group.
recoveryGroupOutput_tags :: Lens.Lens' RecoveryGroupOutput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
recoveryGroupOutput_tags :: Lens' RecoveryGroupOutput (Maybe (HashMap Text Text))
recoveryGroupOutput_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) for the recovery group.
recoveryGroupOutput_recoveryGroupArn :: Lens.Lens' RecoveryGroupOutput Prelude.Text
recoveryGroupOutput_recoveryGroupArn :: Lens' RecoveryGroupOutput Text
recoveryGroupOutput_recoveryGroupArn = 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 recovery group.
recoveryGroupOutput_recoveryGroupName :: Lens.Lens' RecoveryGroupOutput Prelude.Text
recoveryGroupOutput_recoveryGroupName :: Lens' RecoveryGroupOutput Text
recoveryGroupOutput_recoveryGroupName = 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 a cell\'s Amazon Resource Names (ARNs).
recoveryGroupOutput_cells :: Lens.Lens' RecoveryGroupOutput [Prelude.Text]
recoveryGroupOutput_cells :: Lens' RecoveryGroupOutput [Text]
recoveryGroupOutput_cells = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable RecoveryGroupOutput where
  hashWithSalt :: Int -> RecoveryGroupOutput -> Int
hashWithSalt Int
_salt RecoveryGroupOutput' {[Text]
Maybe (HashMap Text Text)
Text
cells :: [Text]
recoveryGroupName :: Text
recoveryGroupArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:cells:RecoveryGroupOutput' :: RecoveryGroupOutput -> [Text]
$sel:recoveryGroupName:RecoveryGroupOutput' :: RecoveryGroupOutput -> Text
$sel:recoveryGroupArn:RecoveryGroupOutput' :: RecoveryGroupOutput -> Text
$sel:tags:RecoveryGroupOutput' :: RecoveryGroupOutput -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recoveryGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recoveryGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
cells

instance Prelude.NFData RecoveryGroupOutput where
  rnf :: RecoveryGroupOutput -> ()
rnf RecoveryGroupOutput' {[Text]
Maybe (HashMap Text Text)
Text
cells :: [Text]
recoveryGroupName :: Text
recoveryGroupArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:cells:RecoveryGroupOutput' :: RecoveryGroupOutput -> [Text]
$sel:recoveryGroupName:RecoveryGroupOutput' :: RecoveryGroupOutput -> Text
$sel:recoveryGroupArn:RecoveryGroupOutput' :: RecoveryGroupOutput -> Text
$sel:tags:RecoveryGroupOutput' :: RecoveryGroupOutput -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recoveryGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recoveryGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
cells