{-# 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.Greengrass.Types.GroupInformation
-- 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.Greengrass.Types.GroupInformation 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 group.
--
-- /See:/ 'newGroupInformation' smart constructor.
data GroupInformation = GroupInformation'
  { -- | The ARN of the group.
    GroupInformation -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the group was created.
    GroupInformation -> Maybe Text
creationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The ID of the group.
    GroupInformation -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the group was last
    -- updated.
    GroupInformation -> Maybe Text
lastUpdatedTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The ID of the latest version associated with the group.
    GroupInformation -> Maybe Text
latestVersion :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the latest version associated with the group.
    GroupInformation -> Maybe Text
latestVersionArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the group.
    GroupInformation -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (GroupInformation -> GroupInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupInformation -> GroupInformation -> Bool
$c/= :: GroupInformation -> GroupInformation -> Bool
== :: GroupInformation -> GroupInformation -> Bool
$c== :: GroupInformation -> GroupInformation -> Bool
Prelude.Eq, ReadPrec [GroupInformation]
ReadPrec GroupInformation
Int -> ReadS GroupInformation
ReadS [GroupInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupInformation]
$creadListPrec :: ReadPrec [GroupInformation]
readPrec :: ReadPrec GroupInformation
$creadPrec :: ReadPrec GroupInformation
readList :: ReadS [GroupInformation]
$creadList :: ReadS [GroupInformation]
readsPrec :: Int -> ReadS GroupInformation
$creadsPrec :: Int -> ReadS GroupInformation
Prelude.Read, Int -> GroupInformation -> ShowS
[GroupInformation] -> ShowS
GroupInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupInformation] -> ShowS
$cshowList :: [GroupInformation] -> ShowS
show :: GroupInformation -> String
$cshow :: GroupInformation -> String
showsPrec :: Int -> GroupInformation -> ShowS
$cshowsPrec :: Int -> GroupInformation -> ShowS
Prelude.Show, forall x. Rep GroupInformation x -> GroupInformation
forall x. GroupInformation -> Rep GroupInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupInformation x -> GroupInformation
$cfrom :: forall x. GroupInformation -> Rep GroupInformation x
Prelude.Generic)

-- |
-- Create a value of 'GroupInformation' 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', 'groupInformation_arn' - The ARN of the group.
--
-- 'creationTimestamp', 'groupInformation_creationTimestamp' - The time, in milliseconds since the epoch, when the group was created.
--
-- 'id', 'groupInformation_id' - The ID of the group.
--
-- 'lastUpdatedTimestamp', 'groupInformation_lastUpdatedTimestamp' - The time, in milliseconds since the epoch, when the group was last
-- updated.
--
-- 'latestVersion', 'groupInformation_latestVersion' - The ID of the latest version associated with the group.
--
-- 'latestVersionArn', 'groupInformation_latestVersionArn' - The ARN of the latest version associated with the group.
--
-- 'name', 'groupInformation_name' - The name of the group.
newGroupInformation ::
  GroupInformation
newGroupInformation :: GroupInformation
newGroupInformation =
  GroupInformation'
    { $sel:arn:GroupInformation' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GroupInformation' :: Maybe Text
creationTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:id:GroupInformation' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTimestamp:GroupInformation' :: Maybe Text
lastUpdatedTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersion:GroupInformation' :: Maybe Text
latestVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersionArn:GroupInformation' :: Maybe Text
latestVersionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:name:GroupInformation' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the group.
groupInformation_arn :: Lens.Lens' GroupInformation (Prelude.Maybe Prelude.Text)
groupInformation_arn :: Lens' GroupInformation (Maybe Text)
groupInformation_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupInformation' {Maybe Text
arn :: Maybe Text
$sel:arn:GroupInformation' :: GroupInformation -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GroupInformation
s@GroupInformation' {} Maybe Text
a -> GroupInformation
s {$sel:arn:GroupInformation' :: Maybe Text
arn = Maybe Text
a} :: GroupInformation)

-- | The time, in milliseconds since the epoch, when the group was created.
groupInformation_creationTimestamp :: Lens.Lens' GroupInformation (Prelude.Maybe Prelude.Text)
groupInformation_creationTimestamp :: Lens' GroupInformation (Maybe Text)
groupInformation_creationTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupInformation' {Maybe Text
creationTimestamp :: Maybe Text
$sel:creationTimestamp:GroupInformation' :: GroupInformation -> Maybe Text
creationTimestamp} -> Maybe Text
creationTimestamp) (\s :: GroupInformation
s@GroupInformation' {} Maybe Text
a -> GroupInformation
s {$sel:creationTimestamp:GroupInformation' :: Maybe Text
creationTimestamp = Maybe Text
a} :: GroupInformation)

-- | The ID of the group.
groupInformation_id :: Lens.Lens' GroupInformation (Prelude.Maybe Prelude.Text)
groupInformation_id :: Lens' GroupInformation (Maybe Text)
groupInformation_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupInformation' {Maybe Text
id :: Maybe Text
$sel:id:GroupInformation' :: GroupInformation -> Maybe Text
id} -> Maybe Text
id) (\s :: GroupInformation
s@GroupInformation' {} Maybe Text
a -> GroupInformation
s {$sel:id:GroupInformation' :: Maybe Text
id = Maybe Text
a} :: GroupInformation)

-- | The time, in milliseconds since the epoch, when the group was last
-- updated.
groupInformation_lastUpdatedTimestamp :: Lens.Lens' GroupInformation (Prelude.Maybe Prelude.Text)
groupInformation_lastUpdatedTimestamp :: Lens' GroupInformation (Maybe Text)
groupInformation_lastUpdatedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupInformation' {Maybe Text
lastUpdatedTimestamp :: Maybe Text
$sel:lastUpdatedTimestamp:GroupInformation' :: GroupInformation -> Maybe Text
lastUpdatedTimestamp} -> Maybe Text
lastUpdatedTimestamp) (\s :: GroupInformation
s@GroupInformation' {} Maybe Text
a -> GroupInformation
s {$sel:lastUpdatedTimestamp:GroupInformation' :: Maybe Text
lastUpdatedTimestamp = Maybe Text
a} :: GroupInformation)

-- | The ID of the latest version associated with the group.
groupInformation_latestVersion :: Lens.Lens' GroupInformation (Prelude.Maybe Prelude.Text)
groupInformation_latestVersion :: Lens' GroupInformation (Maybe Text)
groupInformation_latestVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupInformation' {Maybe Text
latestVersion :: Maybe Text
$sel:latestVersion:GroupInformation' :: GroupInformation -> Maybe Text
latestVersion} -> Maybe Text
latestVersion) (\s :: GroupInformation
s@GroupInformation' {} Maybe Text
a -> GroupInformation
s {$sel:latestVersion:GroupInformation' :: Maybe Text
latestVersion = Maybe Text
a} :: GroupInformation)

-- | The ARN of the latest version associated with the group.
groupInformation_latestVersionArn :: Lens.Lens' GroupInformation (Prelude.Maybe Prelude.Text)
groupInformation_latestVersionArn :: Lens' GroupInformation (Maybe Text)
groupInformation_latestVersionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupInformation' {Maybe Text
latestVersionArn :: Maybe Text
$sel:latestVersionArn:GroupInformation' :: GroupInformation -> Maybe Text
latestVersionArn} -> Maybe Text
latestVersionArn) (\s :: GroupInformation
s@GroupInformation' {} Maybe Text
a -> GroupInformation
s {$sel:latestVersionArn:GroupInformation' :: Maybe Text
latestVersionArn = Maybe Text
a} :: GroupInformation)

-- | The name of the group.
groupInformation_name :: Lens.Lens' GroupInformation (Prelude.Maybe Prelude.Text)
groupInformation_name :: Lens' GroupInformation (Maybe Text)
groupInformation_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupInformation' {Maybe Text
name :: Maybe Text
$sel:name:GroupInformation' :: GroupInformation -> Maybe Text
name} -> Maybe Text
name) (\s :: GroupInformation
s@GroupInformation' {} Maybe Text
a -> GroupInformation
s {$sel:name:GroupInformation' :: Maybe Text
name = Maybe Text
a} :: GroupInformation)

instance Data.FromJSON GroupInformation where
  parseJSON :: Value -> Parser GroupInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GroupInformation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GroupInformation
GroupInformation'
            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
"CreationTimestamp")
            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
"LastUpdatedTimestamp")
            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
"LatestVersion")
            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
"LatestVersionArn")
            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 GroupInformation where
  hashWithSalt :: Int -> GroupInformation -> Int
hashWithSalt Int
_salt GroupInformation' {Maybe Text
name :: Maybe Text
latestVersionArn :: Maybe Text
latestVersion :: Maybe Text
lastUpdatedTimestamp :: Maybe Text
id :: Maybe Text
creationTimestamp :: Maybe Text
arn :: Maybe Text
$sel:name:GroupInformation' :: GroupInformation -> Maybe Text
$sel:latestVersionArn:GroupInformation' :: GroupInformation -> Maybe Text
$sel:latestVersion:GroupInformation' :: GroupInformation -> Maybe Text
$sel:lastUpdatedTimestamp:GroupInformation' :: GroupInformation -> Maybe Text
$sel:id:GroupInformation' :: GroupInformation -> Maybe Text
$sel:creationTimestamp:GroupInformation' :: GroupInformation -> Maybe Text
$sel:arn:GroupInformation' :: GroupInformation -> 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 Text
creationTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUpdatedTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
latestVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
latestVersionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData GroupInformation where
  rnf :: GroupInformation -> ()
rnf GroupInformation' {Maybe Text
name :: Maybe Text
latestVersionArn :: Maybe Text
latestVersion :: Maybe Text
lastUpdatedTimestamp :: Maybe Text
id :: Maybe Text
creationTimestamp :: Maybe Text
arn :: Maybe Text
$sel:name:GroupInformation' :: GroupInformation -> Maybe Text
$sel:latestVersionArn:GroupInformation' :: GroupInformation -> Maybe Text
$sel:latestVersion:GroupInformation' :: GroupInformation -> Maybe Text
$sel:lastUpdatedTimestamp:GroupInformation' :: GroupInformation -> Maybe Text
$sel:id:GroupInformation' :: GroupInformation -> Maybe Text
$sel:creationTimestamp:GroupInformation' :: GroupInformation -> Maybe Text
$sel:arn:GroupInformation' :: GroupInformation -> 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 Text
creationTimestamp
      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 Text
lastUpdatedTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
latestVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
latestVersionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name