{-# 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.ScheduleGroupSummary
-- 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.ScheduleGroupSummary 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
import Amazonka.Scheduler.Types.ScheduleGroupState

-- | The details of a schedule group.
--
-- /See:/ 'newScheduleGroupSummary' smart constructor.
data ScheduleGroupSummary = ScheduleGroupSummary'
  { -- | The Amazon Resource Name (ARN) of the schedule group.
    ScheduleGroupSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time at which the schedule group was created.
    ScheduleGroupSummary -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | The time at which the schedule group was last modified.
    ScheduleGroupSummary -> Maybe POSIX
lastModificationDate :: Prelude.Maybe Data.POSIX,
    -- | The name of the schedule group.
    ScheduleGroupSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Specifies the state of the schedule group.
    ScheduleGroupSummary -> Maybe ScheduleGroupState
state :: Prelude.Maybe ScheduleGroupState
  }
  deriving (ScheduleGroupSummary -> ScheduleGroupSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScheduleGroupSummary -> ScheduleGroupSummary -> Bool
$c/= :: ScheduleGroupSummary -> ScheduleGroupSummary -> Bool
== :: ScheduleGroupSummary -> ScheduleGroupSummary -> Bool
$c== :: ScheduleGroupSummary -> ScheduleGroupSummary -> Bool
Prelude.Eq, ReadPrec [ScheduleGroupSummary]
ReadPrec ScheduleGroupSummary
Int -> ReadS ScheduleGroupSummary
ReadS [ScheduleGroupSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScheduleGroupSummary]
$creadListPrec :: ReadPrec [ScheduleGroupSummary]
readPrec :: ReadPrec ScheduleGroupSummary
$creadPrec :: ReadPrec ScheduleGroupSummary
readList :: ReadS [ScheduleGroupSummary]
$creadList :: ReadS [ScheduleGroupSummary]
readsPrec :: Int -> ReadS ScheduleGroupSummary
$creadsPrec :: Int -> ReadS ScheduleGroupSummary
Prelude.Read, Int -> ScheduleGroupSummary -> ShowS
[ScheduleGroupSummary] -> ShowS
ScheduleGroupSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScheduleGroupSummary] -> ShowS
$cshowList :: [ScheduleGroupSummary] -> ShowS
show :: ScheduleGroupSummary -> String
$cshow :: ScheduleGroupSummary -> String
showsPrec :: Int -> ScheduleGroupSummary -> ShowS
$cshowsPrec :: Int -> ScheduleGroupSummary -> ShowS
Prelude.Show, forall x. Rep ScheduleGroupSummary x -> ScheduleGroupSummary
forall x. ScheduleGroupSummary -> Rep ScheduleGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScheduleGroupSummary x -> ScheduleGroupSummary
$cfrom :: forall x. ScheduleGroupSummary -> Rep ScheduleGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'ScheduleGroupSummary' 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', 'scheduleGroupSummary_arn' - The Amazon Resource Name (ARN) of the schedule group.
--
-- 'creationDate', 'scheduleGroupSummary_creationDate' - The time at which the schedule group was created.
--
-- 'lastModificationDate', 'scheduleGroupSummary_lastModificationDate' - The time at which the schedule group was last modified.
--
-- 'name', 'scheduleGroupSummary_name' - The name of the schedule group.
--
-- 'state', 'scheduleGroupSummary_state' - Specifies the state of the schedule group.
newScheduleGroupSummary ::
  ScheduleGroupSummary
newScheduleGroupSummary :: ScheduleGroupSummary
newScheduleGroupSummary =
  ScheduleGroupSummary'
    { $sel:arn:ScheduleGroupSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:ScheduleGroupSummary' :: Maybe POSIX
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationDate:ScheduleGroupSummary' :: Maybe POSIX
lastModificationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ScheduleGroupSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:ScheduleGroupSummary' :: Maybe ScheduleGroupState
state = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The time at which the schedule group was created.
scheduleGroupSummary_creationDate :: Lens.Lens' ScheduleGroupSummary (Prelude.Maybe Prelude.UTCTime)
scheduleGroupSummary_creationDate :: Lens' ScheduleGroupSummary (Maybe UTCTime)
scheduleGroupSummary_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleGroupSummary' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: ScheduleGroupSummary
s@ScheduleGroupSummary' {} Maybe POSIX
a -> ScheduleGroupSummary
s {$sel:creationDate:ScheduleGroupSummary' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: ScheduleGroupSummary) 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 time at which the schedule group was last modified.
scheduleGroupSummary_lastModificationDate :: Lens.Lens' ScheduleGroupSummary (Prelude.Maybe Prelude.UTCTime)
scheduleGroupSummary_lastModificationDate :: Lens' ScheduleGroupSummary (Maybe UTCTime)
scheduleGroupSummary_lastModificationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleGroupSummary' {Maybe POSIX
lastModificationDate :: Maybe POSIX
$sel:lastModificationDate:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe POSIX
lastModificationDate} -> Maybe POSIX
lastModificationDate) (\s :: ScheduleGroupSummary
s@ScheduleGroupSummary' {} Maybe POSIX
a -> ScheduleGroupSummary
s {$sel:lastModificationDate:ScheduleGroupSummary' :: Maybe POSIX
lastModificationDate = Maybe POSIX
a} :: ScheduleGroupSummary) 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 name of the schedule group.
scheduleGroupSummary_name :: Lens.Lens' ScheduleGroupSummary (Prelude.Maybe Prelude.Text)
scheduleGroupSummary_name :: Lens' ScheduleGroupSummary (Maybe Text)
scheduleGroupSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleGroupSummary' {Maybe Text
name :: Maybe Text
$sel:name:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ScheduleGroupSummary
s@ScheduleGroupSummary' {} Maybe Text
a -> ScheduleGroupSummary
s {$sel:name:ScheduleGroupSummary' :: Maybe Text
name = Maybe Text
a} :: ScheduleGroupSummary)

-- | Specifies the state of the schedule group.
scheduleGroupSummary_state :: Lens.Lens' ScheduleGroupSummary (Prelude.Maybe ScheduleGroupState)
scheduleGroupSummary_state :: Lens' ScheduleGroupSummary (Maybe ScheduleGroupState)
scheduleGroupSummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleGroupSummary' {Maybe ScheduleGroupState
state :: Maybe ScheduleGroupState
$sel:state:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe ScheduleGroupState
state} -> Maybe ScheduleGroupState
state) (\s :: ScheduleGroupSummary
s@ScheduleGroupSummary' {} Maybe ScheduleGroupState
a -> ScheduleGroupSummary
s {$sel:state:ScheduleGroupSummary' :: Maybe ScheduleGroupState
state = Maybe ScheduleGroupState
a} :: ScheduleGroupSummary)

instance Data.FromJSON ScheduleGroupSummary where
  parseJSON :: Value -> Parser ScheduleGroupSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ScheduleGroupSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ScheduleGroupState
-> ScheduleGroupSummary
ScheduleGroupSummary'
            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
"Arn")
            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
"CreationDate")
            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
"LastModificationDate")
            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")
            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
"State")
      )

instance Prelude.Hashable ScheduleGroupSummary where
  hashWithSalt :: Int -> ScheduleGroupSummary -> Int
hashWithSalt Int
_salt ScheduleGroupSummary' {Maybe Text
Maybe POSIX
Maybe ScheduleGroupState
state :: Maybe ScheduleGroupState
name :: Maybe Text
lastModificationDate :: Maybe POSIX
creationDate :: Maybe POSIX
arn :: Maybe Text
$sel:state:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe ScheduleGroupState
$sel:name:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe Text
$sel:lastModificationDate:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe POSIX
$sel:creationDate:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe POSIX
$sel:arn:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModificationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScheduleGroupState
state

instance Prelude.NFData ScheduleGroupSummary where
  rnf :: ScheduleGroupSummary -> ()
rnf ScheduleGroupSummary' {Maybe Text
Maybe POSIX
Maybe ScheduleGroupState
state :: Maybe ScheduleGroupState
name :: Maybe Text
lastModificationDate :: Maybe POSIX
creationDate :: Maybe POSIX
arn :: Maybe Text
$sel:state:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe ScheduleGroupState
$sel:name:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe Text
$sel:lastModificationDate:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe POSIX
$sel:creationDate:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe POSIX
$sel:arn:ScheduleGroupSummary' :: ScheduleGroupSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModificationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ScheduleGroupState
state