{-# 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.SSM.Types.ResolvedTargets
-- 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.SSM.Types.ResolvedTargets where

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

-- | Information about targets that resolved during the Automation execution.
--
-- /See:/ 'newResolvedTargets' smart constructor.
data ResolvedTargets = ResolvedTargets'
  { -- | A boolean value indicating whether the resolved target list is
    -- truncated.
    ResolvedTargets -> Maybe Bool
truncated :: Prelude.Maybe Prelude.Bool,
    -- | A list of parameter values sent to targets that resolved during the
    -- Automation execution.
    ResolvedTargets -> Maybe [Text]
parameterValues :: Prelude.Maybe [Prelude.Text]
  }
  deriving (ResolvedTargets -> ResolvedTargets -> Bool
(ResolvedTargets -> ResolvedTargets -> Bool)
-> (ResolvedTargets -> ResolvedTargets -> Bool)
-> Eq ResolvedTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolvedTargets -> ResolvedTargets -> Bool
$c/= :: ResolvedTargets -> ResolvedTargets -> Bool
== :: ResolvedTargets -> ResolvedTargets -> Bool
$c== :: ResolvedTargets -> ResolvedTargets -> Bool
Prelude.Eq, ReadPrec [ResolvedTargets]
ReadPrec ResolvedTargets
Int -> ReadS ResolvedTargets
ReadS [ResolvedTargets]
(Int -> ReadS ResolvedTargets)
-> ReadS [ResolvedTargets]
-> ReadPrec ResolvedTargets
-> ReadPrec [ResolvedTargets]
-> Read ResolvedTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolvedTargets]
$creadListPrec :: ReadPrec [ResolvedTargets]
readPrec :: ReadPrec ResolvedTargets
$creadPrec :: ReadPrec ResolvedTargets
readList :: ReadS [ResolvedTargets]
$creadList :: ReadS [ResolvedTargets]
readsPrec :: Int -> ReadS ResolvedTargets
$creadsPrec :: Int -> ReadS ResolvedTargets
Prelude.Read, Int -> ResolvedTargets -> ShowS
[ResolvedTargets] -> ShowS
ResolvedTargets -> String
(Int -> ResolvedTargets -> ShowS)
-> (ResolvedTargets -> String)
-> ([ResolvedTargets] -> ShowS)
-> Show ResolvedTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolvedTargets] -> ShowS
$cshowList :: [ResolvedTargets] -> ShowS
show :: ResolvedTargets -> String
$cshow :: ResolvedTargets -> String
showsPrec :: Int -> ResolvedTargets -> ShowS
$cshowsPrec :: Int -> ResolvedTargets -> ShowS
Prelude.Show, (forall x. ResolvedTargets -> Rep ResolvedTargets x)
-> (forall x. Rep ResolvedTargets x -> ResolvedTargets)
-> Generic ResolvedTargets
forall x. Rep ResolvedTargets x -> ResolvedTargets
forall x. ResolvedTargets -> Rep ResolvedTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResolvedTargets x -> ResolvedTargets
$cfrom :: forall x. ResolvedTargets -> Rep ResolvedTargets x
Prelude.Generic)

-- |
-- Create a value of 'ResolvedTargets' 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:
--
-- 'truncated', 'resolvedTargets_truncated' - A boolean value indicating whether the resolved target list is
-- truncated.
--
-- 'parameterValues', 'resolvedTargets_parameterValues' - A list of parameter values sent to targets that resolved during the
-- Automation execution.
newResolvedTargets ::
  ResolvedTargets
newResolvedTargets :: ResolvedTargets
newResolvedTargets =
  ResolvedTargets' :: Maybe Bool -> Maybe [Text] -> ResolvedTargets
ResolvedTargets'
    { $sel:truncated:ResolvedTargets' :: Maybe Bool
truncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterValues:ResolvedTargets' :: Maybe [Text]
parameterValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | A boolean value indicating whether the resolved target list is
-- truncated.
resolvedTargets_truncated :: Lens.Lens' ResolvedTargets (Prelude.Maybe Prelude.Bool)
resolvedTargets_truncated :: (Maybe Bool -> f (Maybe Bool))
-> ResolvedTargets -> f ResolvedTargets
resolvedTargets_truncated = (ResolvedTargets -> Maybe Bool)
-> (ResolvedTargets -> Maybe Bool -> ResolvedTargets)
-> Lens ResolvedTargets ResolvedTargets (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolvedTargets' {Maybe Bool
truncated :: Maybe Bool
$sel:truncated:ResolvedTargets' :: ResolvedTargets -> Maybe Bool
truncated} -> Maybe Bool
truncated) (\s :: ResolvedTargets
s@ResolvedTargets' {} Maybe Bool
a -> ResolvedTargets
s {$sel:truncated:ResolvedTargets' :: Maybe Bool
truncated = Maybe Bool
a} :: ResolvedTargets)

-- | A list of parameter values sent to targets that resolved during the
-- Automation execution.
resolvedTargets_parameterValues :: Lens.Lens' ResolvedTargets (Prelude.Maybe [Prelude.Text])
resolvedTargets_parameterValues :: (Maybe [Text] -> f (Maybe [Text]))
-> ResolvedTargets -> f ResolvedTargets
resolvedTargets_parameterValues = (ResolvedTargets -> Maybe [Text])
-> (ResolvedTargets -> Maybe [Text] -> ResolvedTargets)
-> Lens
     ResolvedTargets ResolvedTargets (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolvedTargets' {Maybe [Text]
parameterValues :: Maybe [Text]
$sel:parameterValues:ResolvedTargets' :: ResolvedTargets -> Maybe [Text]
parameterValues} -> Maybe [Text]
parameterValues) (\s :: ResolvedTargets
s@ResolvedTargets' {} Maybe [Text]
a -> ResolvedTargets
s {$sel:parameterValues:ResolvedTargets' :: Maybe [Text]
parameterValues = Maybe [Text]
a} :: ResolvedTargets) ((Maybe [Text] -> f (Maybe [Text]))
 -> ResolvedTargets -> f ResolvedTargets)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ResolvedTargets
-> f ResolvedTargets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ResolvedTargets where
  parseJSON :: Value -> Parser ResolvedTargets
parseJSON =
    String
-> (Object -> Parser ResolvedTargets)
-> Value
-> Parser ResolvedTargets
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResolvedTargets"
      ( \Object
x ->
          Maybe Bool -> Maybe [Text] -> ResolvedTargets
ResolvedTargets'
            (Maybe Bool -> Maybe [Text] -> ResolvedTargets)
-> Parser (Maybe Bool) -> Parser (Maybe [Text] -> ResolvedTargets)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Truncated")
            Parser (Maybe [Text] -> ResolvedTargets)
-> Parser (Maybe [Text]) -> Parser ResolvedTargets
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParameterValues"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ResolvedTargets

instance Prelude.NFData ResolvedTargets