{-# 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.CellOutput
-- 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.CellOutput 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

-- | Information about a cell.
--
-- /See:/ 'newCellOutput' smart constructor.
data CellOutput = CellOutput'
  { -- | Tags on the resources.
    CellOutput -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The readiness scope for the cell, which can be a cell Amazon Resource
    -- Name (ARN) or a recovery group ARN. This is a list but currently can
    -- have only one element.
    CellOutput -> [Text]
parentReadinessScopes :: [Prelude.Text],
    -- | The Amazon Resource Name (ARN) for the cell.
    CellOutput -> Text
cellArn :: Prelude.Text,
    -- | The name of the cell.
    CellOutput -> Text
cellName :: Prelude.Text,
    -- | A list of cell ARNs.
    CellOutput -> [Text]
cells :: [Prelude.Text]
  }
  deriving (CellOutput -> CellOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CellOutput -> CellOutput -> Bool
$c/= :: CellOutput -> CellOutput -> Bool
== :: CellOutput -> CellOutput -> Bool
$c== :: CellOutput -> CellOutput -> Bool
Prelude.Eq, ReadPrec [CellOutput]
ReadPrec CellOutput
Int -> ReadS CellOutput
ReadS [CellOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CellOutput]
$creadListPrec :: ReadPrec [CellOutput]
readPrec :: ReadPrec CellOutput
$creadPrec :: ReadPrec CellOutput
readList :: ReadS [CellOutput]
$creadList :: ReadS [CellOutput]
readsPrec :: Int -> ReadS CellOutput
$creadsPrec :: Int -> ReadS CellOutput
Prelude.Read, Int -> CellOutput -> ShowS
[CellOutput] -> ShowS
CellOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CellOutput] -> ShowS
$cshowList :: [CellOutput] -> ShowS
show :: CellOutput -> String
$cshow :: CellOutput -> String
showsPrec :: Int -> CellOutput -> ShowS
$cshowsPrec :: Int -> CellOutput -> ShowS
Prelude.Show, forall x. Rep CellOutput x -> CellOutput
forall x. CellOutput -> Rep CellOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CellOutput x -> CellOutput
$cfrom :: forall x. CellOutput -> Rep CellOutput x
Prelude.Generic)

-- |
-- Create a value of 'CellOutput' 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', 'cellOutput_tags' - Tags on the resources.
--
-- 'parentReadinessScopes', 'cellOutput_parentReadinessScopes' - The readiness scope for the cell, which can be a cell Amazon Resource
-- Name (ARN) or a recovery group ARN. This is a list but currently can
-- have only one element.
--
-- 'cellArn', 'cellOutput_cellArn' - The Amazon Resource Name (ARN) for the cell.
--
-- 'cellName', 'cellOutput_cellName' - The name of the cell.
--
-- 'cells', 'cellOutput_cells' - A list of cell ARNs.
newCellOutput ::
  -- | 'cellArn'
  Prelude.Text ->
  -- | 'cellName'
  Prelude.Text ->
  CellOutput
newCellOutput :: Text -> Text -> CellOutput
newCellOutput Text
pCellArn_ Text
pCellName_ =
  CellOutput'
    { $sel:tags:CellOutput' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:parentReadinessScopes:CellOutput' :: [Text]
parentReadinessScopes = forall a. Monoid a => a
Prelude.mempty,
      $sel:cellArn:CellOutput' :: Text
cellArn = Text
pCellArn_,
      $sel:cellName:CellOutput' :: Text
cellName = Text
pCellName_,
      $sel:cells:CellOutput' :: [Text]
cells = forall a. Monoid a => a
Prelude.mempty
    }

-- | Tags on the resources.
cellOutput_tags :: Lens.Lens' CellOutput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
cellOutput_tags :: Lens' CellOutput (Maybe (HashMap Text Text))
cellOutput_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CellOutput' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CellOutput' :: CellOutput -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CellOutput
s@CellOutput' {} Maybe (HashMap Text Text)
a -> CellOutput
s {$sel:tags:CellOutput' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CellOutput) 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 readiness scope for the cell, which can be a cell Amazon Resource
-- Name (ARN) or a recovery group ARN. This is a list but currently can
-- have only one element.
cellOutput_parentReadinessScopes :: Lens.Lens' CellOutput [Prelude.Text]
cellOutput_parentReadinessScopes :: Lens' CellOutput [Text]
cellOutput_parentReadinessScopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CellOutput' {[Text]
parentReadinessScopes :: [Text]
$sel:parentReadinessScopes:CellOutput' :: CellOutput -> [Text]
parentReadinessScopes} -> [Text]
parentReadinessScopes) (\s :: CellOutput
s@CellOutput' {} [Text]
a -> CellOutput
s {$sel:parentReadinessScopes:CellOutput' :: [Text]
parentReadinessScopes = [Text]
a} :: CellOutput) 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

-- | The Amazon Resource Name (ARN) for the cell.
cellOutput_cellArn :: Lens.Lens' CellOutput Prelude.Text
cellOutput_cellArn :: Lens' CellOutput Text
cellOutput_cellArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CellOutput' {Text
cellArn :: Text
$sel:cellArn:CellOutput' :: CellOutput -> Text
cellArn} -> Text
cellArn) (\s :: CellOutput
s@CellOutput' {} Text
a -> CellOutput
s {$sel:cellArn:CellOutput' :: Text
cellArn = Text
a} :: CellOutput)

-- | The name of the cell.
cellOutput_cellName :: Lens.Lens' CellOutput Prelude.Text
cellOutput_cellName :: Lens' CellOutput Text
cellOutput_cellName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CellOutput' {Text
cellName :: Text
$sel:cellName:CellOutput' :: CellOutput -> Text
cellName} -> Text
cellName) (\s :: CellOutput
s@CellOutput' {} Text
a -> CellOutput
s {$sel:cellName:CellOutput' :: Text
cellName = Text
a} :: CellOutput)

-- | A list of cell ARNs.
cellOutput_cells :: Lens.Lens' CellOutput [Prelude.Text]
cellOutput_cells :: Lens' CellOutput [Text]
cellOutput_cells = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CellOutput' {[Text]
cells :: [Text]
$sel:cells:CellOutput' :: CellOutput -> [Text]
cells} -> [Text]
cells) (\s :: CellOutput
s@CellOutput' {} [Text]
a -> CellOutput
s {$sel:cells:CellOutput' :: [Text]
cells = [Text]
a} :: CellOutput) 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 CellOutput where
  parseJSON :: Value -> Parser CellOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CellOutput"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> [Text] -> Text -> Text -> [Text] -> CellOutput
CellOutput'
            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 (Maybe a)
Data..:? Key
"parentReadinessScopes"
                            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
"cellArn")
            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
"cellName")
            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 CellOutput where
  hashWithSalt :: Int -> CellOutput -> Int
hashWithSalt Int
_salt CellOutput' {[Text]
Maybe (HashMap Text Text)
Text
cells :: [Text]
cellName :: Text
cellArn :: Text
parentReadinessScopes :: [Text]
tags :: Maybe (HashMap Text Text)
$sel:cells:CellOutput' :: CellOutput -> [Text]
$sel:cellName:CellOutput' :: CellOutput -> Text
$sel:cellArn:CellOutput' :: CellOutput -> Text
$sel:parentReadinessScopes:CellOutput' :: CellOutput -> [Text]
$sel:tags:CellOutput' :: CellOutput -> 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]
parentReadinessScopes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cellArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cellName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
cells

instance Prelude.NFData CellOutput where
  rnf :: CellOutput -> ()
rnf CellOutput' {[Text]
Maybe (HashMap Text Text)
Text
cells :: [Text]
cellName :: Text
cellArn :: Text
parentReadinessScopes :: [Text]
tags :: Maybe (HashMap Text Text)
$sel:cells:CellOutput' :: CellOutput -> [Text]
$sel:cellName:CellOutput' :: CellOutput -> Text
$sel:cellArn:CellOutput' :: CellOutput -> Text
$sel:parentReadinessScopes:CellOutput' :: CellOutput -> [Text]
$sel:tags:CellOutput' :: CellOutput -> 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]
parentReadinessScopes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cellArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cellName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
cells