{-# 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.FMS.Types.ResourceSetSummary
-- 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.FMS.Types.ResourceSetSummary 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

-- | Summarizes the resource sets used in a policy.
--
-- /See:/ 'newResourceSetSummary' smart constructor.
data ResourceSetSummary = ResourceSetSummary'
  { -- | A description of the resource set.
    ResourceSetSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the resource set. This ID is returned in the
    -- responses to create and list commands. You provide it to operations like
    -- update and delete.
    ResourceSetSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The last time that the resource set was changed.
    ResourceSetSummary -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Data.POSIX,
    -- | The descriptive name of the resource set. You can\'t change the name of
    -- a resource set after you create it.
    ResourceSetSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (ResourceSetSummary -> ResourceSetSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceSetSummary -> ResourceSetSummary -> Bool
$c/= :: ResourceSetSummary -> ResourceSetSummary -> Bool
== :: ResourceSetSummary -> ResourceSetSummary -> Bool
$c== :: ResourceSetSummary -> ResourceSetSummary -> Bool
Prelude.Eq, ReadPrec [ResourceSetSummary]
ReadPrec ResourceSetSummary
Int -> ReadS ResourceSetSummary
ReadS [ResourceSetSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceSetSummary]
$creadListPrec :: ReadPrec [ResourceSetSummary]
readPrec :: ReadPrec ResourceSetSummary
$creadPrec :: ReadPrec ResourceSetSummary
readList :: ReadS [ResourceSetSummary]
$creadList :: ReadS [ResourceSetSummary]
readsPrec :: Int -> ReadS ResourceSetSummary
$creadsPrec :: Int -> ReadS ResourceSetSummary
Prelude.Read, Int -> ResourceSetSummary -> ShowS
[ResourceSetSummary] -> ShowS
ResourceSetSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceSetSummary] -> ShowS
$cshowList :: [ResourceSetSummary] -> ShowS
show :: ResourceSetSummary -> String
$cshow :: ResourceSetSummary -> String
showsPrec :: Int -> ResourceSetSummary -> ShowS
$cshowsPrec :: Int -> ResourceSetSummary -> ShowS
Prelude.Show, forall x. Rep ResourceSetSummary x -> ResourceSetSummary
forall x. ResourceSetSummary -> Rep ResourceSetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceSetSummary x -> ResourceSetSummary
$cfrom :: forall x. ResourceSetSummary -> Rep ResourceSetSummary x
Prelude.Generic)

-- |
-- Create a value of 'ResourceSetSummary' 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:
--
-- 'description', 'resourceSetSummary_description' - A description of the resource set.
--
-- 'id', 'resourceSetSummary_id' - A unique identifier for the resource set. This ID is returned in the
-- responses to create and list commands. You provide it to operations like
-- update and delete.
--
-- 'lastUpdateTime', 'resourceSetSummary_lastUpdateTime' - The last time that the resource set was changed.
--
-- 'name', 'resourceSetSummary_name' - The descriptive name of the resource set. You can\'t change the name of
-- a resource set after you create it.
newResourceSetSummary ::
  ResourceSetSummary
newResourceSetSummary :: ResourceSetSummary
newResourceSetSummary =
  ResourceSetSummary'
    { $sel:description:ResourceSetSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ResourceSetSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:ResourceSetSummary' :: Maybe POSIX
lastUpdateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ResourceSetSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | A description of the resource set.
resourceSetSummary_description :: Lens.Lens' ResourceSetSummary (Prelude.Maybe Prelude.Text)
resourceSetSummary_description :: Lens' ResourceSetSummary (Maybe Text)
resourceSetSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetSummary' {Maybe Text
description :: Maybe Text
$sel:description:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ResourceSetSummary
s@ResourceSetSummary' {} Maybe Text
a -> ResourceSetSummary
s {$sel:description:ResourceSetSummary' :: Maybe Text
description = Maybe Text
a} :: ResourceSetSummary)

-- | A unique identifier for the resource set. This ID is returned in the
-- responses to create and list commands. You provide it to operations like
-- update and delete.
resourceSetSummary_id :: Lens.Lens' ResourceSetSummary (Prelude.Maybe Prelude.Text)
resourceSetSummary_id :: Lens' ResourceSetSummary (Maybe Text)
resourceSetSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetSummary' {Maybe Text
id :: Maybe Text
$sel:id:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ResourceSetSummary
s@ResourceSetSummary' {} Maybe Text
a -> ResourceSetSummary
s {$sel:id:ResourceSetSummary' :: Maybe Text
id = Maybe Text
a} :: ResourceSetSummary)

-- | The last time that the resource set was changed.
resourceSetSummary_lastUpdateTime :: Lens.Lens' ResourceSetSummary (Prelude.Maybe Prelude.UTCTime)
resourceSetSummary_lastUpdateTime :: Lens' ResourceSetSummary (Maybe UTCTime)
resourceSetSummary_lastUpdateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetSummary' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:ResourceSetSummary' :: ResourceSetSummary -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: ResourceSetSummary
s@ResourceSetSummary' {} Maybe POSIX
a -> ResourceSetSummary
s {$sel:lastUpdateTime:ResourceSetSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: ResourceSetSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The descriptive name of the resource set. You can\'t change the name of
-- a resource set after you create it.
resourceSetSummary_name :: Lens.Lens' ResourceSetSummary (Prelude.Maybe Prelude.Text)
resourceSetSummary_name :: Lens' ResourceSetSummary (Maybe Text)
resourceSetSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetSummary' {Maybe Text
name :: Maybe Text
$sel:name:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ResourceSetSummary
s@ResourceSetSummary' {} Maybe Text
a -> ResourceSetSummary
s {$sel:name:ResourceSetSummary' :: Maybe Text
name = Maybe Text
a} :: ResourceSetSummary)

instance Data.FromJSON ResourceSetSummary where
  parseJSON :: Value -> Parser ResourceSetSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ResourceSetSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe POSIX -> Maybe Text -> ResourceSetSummary
ResourceSetSummary'
            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
"Description")
            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
"Id")
            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
"LastUpdateTime")
            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
"Name")
      )

instance Prelude.Hashable ResourceSetSummary where
  hashWithSalt :: Int -> ResourceSetSummary -> Int
hashWithSalt Int
_salt ResourceSetSummary' {Maybe Text
Maybe POSIX
name :: Maybe Text
lastUpdateTime :: Maybe POSIX
id :: Maybe Text
description :: Maybe Text
$sel:name:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
$sel:lastUpdateTime:ResourceSetSummary' :: ResourceSetSummary -> Maybe POSIX
$sel:id:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
$sel:description:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData ResourceSetSummary where
  rnf :: ResourceSetSummary -> ()
rnf ResourceSetSummary' {Maybe Text
Maybe POSIX
name :: Maybe Text
lastUpdateTime :: Maybe POSIX
id :: Maybe Text
description :: Maybe Text
$sel:name:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
$sel:lastUpdateTime:ResourceSetSummary' :: ResourceSetSummary -> Maybe POSIX
$sel:id:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
$sel:description:ResourceSetSummary' :: ResourceSetSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name