{-# 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.XRay.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.XRay.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
import Amazonka.XRay.Types.InsightsConfiguration

-- | Details for a group without metadata.
--
-- /See:/ 'newGroupSummary' smart constructor.
data GroupSummary = GroupSummary'
  { -- | The filter expression defining the parameters to include traces.
    GroupSummary -> Maybe Text
filterExpression :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the group generated based on the GroupName.
    GroupSummary -> Maybe Text
groupARN :: Prelude.Maybe Prelude.Text,
    -- | The unique case-sensitive name of the group.
    GroupSummary -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The structure containing configurations related to insights.
    --
    -- -   The InsightsEnabled boolean can be set to true to enable insights
    --     for the group or false to disable insights for the group.
    --
    -- -   The NotificationsEnabled boolean can be set to true to enable
    --     insights notifications. Notifications can only be enabled on a group
    --     with InsightsEnabled set to true.
    GroupSummary -> Maybe InsightsConfiguration
insightsConfiguration :: Prelude.Maybe InsightsConfiguration
  }
  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:
--
-- 'filterExpression', 'groupSummary_filterExpression' - The filter expression defining the parameters to include traces.
--
-- 'groupARN', 'groupSummary_groupARN' - The ARN of the group generated based on the GroupName.
--
-- 'groupName', 'groupSummary_groupName' - The unique case-sensitive name of the group.
--
-- 'insightsConfiguration', 'groupSummary_insightsConfiguration' - The structure containing configurations related to insights.
--
-- -   The InsightsEnabled boolean can be set to true to enable insights
--     for the group or false to disable insights for the group.
--
-- -   The NotificationsEnabled boolean can be set to true to enable
--     insights notifications. Notifications can only be enabled on a group
--     with InsightsEnabled set to true.
newGroupSummary ::
  GroupSummary
newGroupSummary :: GroupSummary
newGroupSummary =
  GroupSummary'
    { $sel:filterExpression:GroupSummary' :: Maybe Text
filterExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:groupARN:GroupSummary' :: Maybe Text
groupARN = forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:GroupSummary' :: Maybe Text
groupName = forall a. Maybe a
Prelude.Nothing,
      $sel:insightsConfiguration:GroupSummary' :: Maybe InsightsConfiguration
insightsConfiguration = forall a. Maybe a
Prelude.Nothing
    }

-- | The filter expression defining the parameters to include traces.
groupSummary_filterExpression :: Lens.Lens' GroupSummary (Prelude.Maybe Prelude.Text)
groupSummary_filterExpression :: Lens' GroupSummary (Maybe Text)
groupSummary_filterExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupSummary' {Maybe Text
filterExpression :: Maybe Text
$sel:filterExpression:GroupSummary' :: GroupSummary -> Maybe Text
filterExpression} -> Maybe Text
filterExpression) (\s :: GroupSummary
s@GroupSummary' {} Maybe Text
a -> GroupSummary
s {$sel:filterExpression:GroupSummary' :: Maybe Text
filterExpression = Maybe Text
a} :: GroupSummary)

-- | The ARN of the group generated based on the GroupName.
groupSummary_groupARN :: Lens.Lens' GroupSummary (Prelude.Maybe Prelude.Text)
groupSummary_groupARN :: Lens' GroupSummary (Maybe Text)
groupSummary_groupARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupSummary' {Maybe Text
groupARN :: Maybe Text
$sel:groupARN:GroupSummary' :: GroupSummary -> Maybe Text
groupARN} -> Maybe Text
groupARN) (\s :: GroupSummary
s@GroupSummary' {} Maybe Text
a -> GroupSummary
s {$sel:groupARN:GroupSummary' :: Maybe Text
groupARN = Maybe Text
a} :: GroupSummary)

-- | The unique case-sensitive name of the group.
groupSummary_groupName :: Lens.Lens' GroupSummary (Prelude.Maybe Prelude.Text)
groupSummary_groupName :: Lens' GroupSummary (Maybe Text)
groupSummary_groupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupSummary' {Maybe Text
groupName :: Maybe Text
$sel:groupName:GroupSummary' :: GroupSummary -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: GroupSummary
s@GroupSummary' {} Maybe Text
a -> GroupSummary
s {$sel:groupName:GroupSummary' :: Maybe Text
groupName = Maybe Text
a} :: GroupSummary)

-- | The structure containing configurations related to insights.
--
-- -   The InsightsEnabled boolean can be set to true to enable insights
--     for the group or false to disable insights for the group.
--
-- -   The NotificationsEnabled boolean can be set to true to enable
--     insights notifications. Notifications can only be enabled on a group
--     with InsightsEnabled set to true.
groupSummary_insightsConfiguration :: Lens.Lens' GroupSummary (Prelude.Maybe InsightsConfiguration)
groupSummary_insightsConfiguration :: Lens' GroupSummary (Maybe InsightsConfiguration)
groupSummary_insightsConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupSummary' {Maybe InsightsConfiguration
insightsConfiguration :: Maybe InsightsConfiguration
$sel:insightsConfiguration:GroupSummary' :: GroupSummary -> Maybe InsightsConfiguration
insightsConfiguration} -> Maybe InsightsConfiguration
insightsConfiguration) (\s :: GroupSummary
s@GroupSummary' {} Maybe InsightsConfiguration
a -> GroupSummary
s {$sel:insightsConfiguration:GroupSummary' :: Maybe InsightsConfiguration
insightsConfiguration = Maybe InsightsConfiguration
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 Text
-> Maybe Text
-> Maybe InsightsConfiguration
-> 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
"FilterExpression")
            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
"GroupARN")
            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
"GroupName")
            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
"InsightsConfiguration")
      )

instance Prelude.Hashable GroupSummary where
  hashWithSalt :: Int -> GroupSummary -> Int
hashWithSalt Int
_salt GroupSummary' {Maybe Text
Maybe InsightsConfiguration
insightsConfiguration :: Maybe InsightsConfiguration
groupName :: Maybe Text
groupARN :: Maybe Text
filterExpression :: Maybe Text
$sel:insightsConfiguration:GroupSummary' :: GroupSummary -> Maybe InsightsConfiguration
$sel:groupName:GroupSummary' :: GroupSummary -> Maybe Text
$sel:groupARN:GroupSummary' :: GroupSummary -> Maybe Text
$sel:filterExpression:GroupSummary' :: GroupSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
filterExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InsightsConfiguration
insightsConfiguration

instance Prelude.NFData GroupSummary where
  rnf :: GroupSummary -> ()
rnf GroupSummary' {Maybe Text
Maybe InsightsConfiguration
insightsConfiguration :: Maybe InsightsConfiguration
groupName :: Maybe Text
groupARN :: Maybe Text
filterExpression :: Maybe Text
$sel:insightsConfiguration:GroupSummary' :: GroupSummary -> Maybe InsightsConfiguration
$sel:groupName:GroupSummary' :: GroupSummary -> Maybe Text
$sel:groupARN:GroupSummary' :: GroupSummary -> Maybe Text
$sel:filterExpression:GroupSummary' :: GroupSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
filterExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InsightsConfiguration
insightsConfiguration