{-# 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.Scheduler.Types.TargetSummary
-- 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.Scheduler.Types.TargetSummary 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

-- | The details of a target.
--
-- /See:/ 'newTargetSummary' smart constructor.
data TargetSummary = TargetSummary'
  { -- | The Amazon Resource Name (ARN) of the target.
    TargetSummary -> Text
arn :: Prelude.Text
  }
  deriving (TargetSummary -> TargetSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TargetSummary -> TargetSummary -> Bool
$c/= :: TargetSummary -> TargetSummary -> Bool
== :: TargetSummary -> TargetSummary -> Bool
$c== :: TargetSummary -> TargetSummary -> Bool
Prelude.Eq, ReadPrec [TargetSummary]
ReadPrec TargetSummary
Int -> ReadS TargetSummary
ReadS [TargetSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TargetSummary]
$creadListPrec :: ReadPrec [TargetSummary]
readPrec :: ReadPrec TargetSummary
$creadPrec :: ReadPrec TargetSummary
readList :: ReadS [TargetSummary]
$creadList :: ReadS [TargetSummary]
readsPrec :: Int -> ReadS TargetSummary
$creadsPrec :: Int -> ReadS TargetSummary
Prelude.Read, Int -> TargetSummary -> ShowS
[TargetSummary] -> ShowS
TargetSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TargetSummary] -> ShowS
$cshowList :: [TargetSummary] -> ShowS
show :: TargetSummary -> String
$cshow :: TargetSummary -> String
showsPrec :: Int -> TargetSummary -> ShowS
$cshowsPrec :: Int -> TargetSummary -> ShowS
Prelude.Show, forall x. Rep TargetSummary x -> TargetSummary
forall x. TargetSummary -> Rep TargetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TargetSummary x -> TargetSummary
$cfrom :: forall x. TargetSummary -> Rep TargetSummary x
Prelude.Generic)

-- |
-- Create a value of 'TargetSummary' 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:
--
-- 'arn', 'targetSummary_arn' - The Amazon Resource Name (ARN) of the target.
newTargetSummary ::
  -- | 'arn'
  Prelude.Text ->
  TargetSummary
newTargetSummary :: Text -> TargetSummary
newTargetSummary Text
pArn_ = TargetSummary' {$sel:arn:TargetSummary' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the target.
targetSummary_arn :: Lens.Lens' TargetSummary Prelude.Text
targetSummary_arn :: Lens' TargetSummary Text
targetSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetSummary' {Text
arn :: Text
$sel:arn:TargetSummary' :: TargetSummary -> Text
arn} -> Text
arn) (\s :: TargetSummary
s@TargetSummary' {} Text
a -> TargetSummary
s {$sel:arn:TargetSummary' :: Text
arn = Text
a} :: TargetSummary)

instance Data.FromJSON TargetSummary where
  parseJSON :: Value -> Parser TargetSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TargetSummary"
      (\Object
x -> Text -> TargetSummary
TargetSummary' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Arn"))

instance Prelude.Hashable TargetSummary where
  hashWithSalt :: Int -> TargetSummary -> Int
hashWithSalt Int
_salt TargetSummary' {Text
arn :: Text
$sel:arn:TargetSummary' :: TargetSummary -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData TargetSummary where
  rnf :: TargetSummary -> ()
rnf TargetSummary' {Text
arn :: Text
$sel:arn:TargetSummary' :: TargetSummary -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn