{-# 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.Kendra.Types.GroupSummary
-- 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.Kendra.Types.GroupSummary 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

-- | Summary information for groups.
--
-- /See:/ 'newGroupSummary' smart constructor.
data GroupSummary = GroupSummary'
  { -- | The identifier of the group you want group summary information on.
    GroupSummary -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp identifier used for the latest @PUT@ or @DELETE@ action.
    GroupSummary -> Maybe Natural
orderingId :: Prelude.Maybe Prelude.Natural
  }
  deriving (GroupSummary -> GroupSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupSummary -> GroupSummary -> Bool
$c/= :: GroupSummary -> GroupSummary -> Bool
== :: GroupSummary -> GroupSummary -> Bool
$c== :: GroupSummary -> GroupSummary -> Bool
Prelude.Eq, ReadPrec [GroupSummary]
ReadPrec GroupSummary
Int -> ReadS GroupSummary
ReadS [GroupSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupSummary]
$creadListPrec :: ReadPrec [GroupSummary]
readPrec :: ReadPrec GroupSummary
$creadPrec :: ReadPrec GroupSummary
readList :: ReadS [GroupSummary]
$creadList :: ReadS [GroupSummary]
readsPrec :: Int -> ReadS GroupSummary
$creadsPrec :: Int -> ReadS GroupSummary
Prelude.Read, Int -> GroupSummary -> ShowS
[GroupSummary] -> ShowS
GroupSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupSummary] -> ShowS
$cshowList :: [GroupSummary] -> ShowS
show :: GroupSummary -> String
$cshow :: GroupSummary -> String
showsPrec :: Int -> GroupSummary -> ShowS
$cshowsPrec :: Int -> GroupSummary -> ShowS
Prelude.Show, forall x. Rep GroupSummary x -> GroupSummary
forall x. GroupSummary -> Rep GroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupSummary x -> GroupSummary
$cfrom :: forall x. GroupSummary -> Rep GroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'GroupSummary' 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:
--
-- 'groupId', 'groupSummary_groupId' - The identifier of the group you want group summary information on.
--
-- 'orderingId', 'groupSummary_orderingId' - The timestamp identifier used for the latest @PUT@ or @DELETE@ action.
newGroupSummary ::
  GroupSummary
newGroupSummary :: GroupSummary
newGroupSummary =
  GroupSummary'
    { $sel:groupId:GroupSummary' :: Maybe Text
groupId = forall a. Maybe a
Prelude.Nothing,
      $sel:orderingId:GroupSummary' :: Maybe Natural
orderingId = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the group you want group summary information on.
groupSummary_groupId :: Lens.Lens' GroupSummary (Prelude.Maybe Prelude.Text)
groupSummary_groupId :: Lens' GroupSummary (Maybe Text)
groupSummary_groupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupSummary' {Maybe Text
groupId :: Maybe Text
$sel:groupId:GroupSummary' :: GroupSummary -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: GroupSummary
s@GroupSummary' {} Maybe Text
a -> GroupSummary
s {$sel:groupId:GroupSummary' :: Maybe Text
groupId = Maybe Text
a} :: GroupSummary)

-- | The timestamp identifier used for the latest @PUT@ or @DELETE@ action.
groupSummary_orderingId :: Lens.Lens' GroupSummary (Prelude.Maybe Prelude.Natural)
groupSummary_orderingId :: Lens' GroupSummary (Maybe Natural)
groupSummary_orderingId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupSummary' {Maybe Natural
orderingId :: Maybe Natural
$sel:orderingId:GroupSummary' :: GroupSummary -> Maybe Natural
orderingId} -> Maybe Natural
orderingId) (\s :: GroupSummary
s@GroupSummary' {} Maybe Natural
a -> GroupSummary
s {$sel:orderingId:GroupSummary' :: Maybe Natural
orderingId = Maybe Natural
a} :: GroupSummary)

instance Data.FromJSON GroupSummary where
  parseJSON :: Value -> Parser GroupSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GroupSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Natural -> GroupSummary
GroupSummary'
            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
"GroupId")
            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
"OrderingId")
      )

instance Prelude.Hashable GroupSummary where
  hashWithSalt :: Int -> GroupSummary -> Int
hashWithSalt Int
_salt GroupSummary' {Maybe Natural
Maybe Text
orderingId :: Maybe Natural
groupId :: Maybe Text
$sel:orderingId:GroupSummary' :: GroupSummary -> Maybe Natural
$sel:groupId:GroupSummary' :: GroupSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
orderingId

instance Prelude.NFData GroupSummary where
  rnf :: GroupSummary -> ()
rnf GroupSummary' {Maybe Natural
Maybe Text
orderingId :: Maybe Natural
groupId :: Maybe Text
$sel:orderingId:GroupSummary' :: GroupSummary -> Maybe Natural
$sel:groupId:GroupSummary' :: GroupSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
orderingId