{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.XRay.Types.GroupSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | 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
  }
  deriving (GroupSummary -> GroupSummary -> Bool
(GroupSummary -> GroupSummary -> Bool)
-> (GroupSummary -> GroupSummary -> Bool) -> Eq GroupSummary
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]
(Int -> ReadS GroupSummary)
-> ReadS [GroupSummary]
-> ReadPrec GroupSummary
-> ReadPrec [GroupSummary]
-> Read 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
(Int -> GroupSummary -> ShowS)
-> (GroupSummary -> String)
-> ([GroupSummary] -> ShowS)
-> Show GroupSummary
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. GroupSummary -> Rep GroupSummary x)
-> (forall x. Rep GroupSummary x -> GroupSummary)
-> Generic GroupSummary
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.
--
-- '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.
--
-- 'groupARN', 'groupSummary_groupARN' - The ARN of the group generated based on the GroupName.
--
-- 'groupName', 'groupSummary_groupName' - The unique case-sensitive name of the group.
newGroupSummary ::
  GroupSummary
newGroupSummary :: GroupSummary
newGroupSummary =
  GroupSummary' :: Maybe Text
-> Maybe InsightsConfiguration
-> Maybe Text
-> Maybe Text
-> GroupSummary
GroupSummary'
    { $sel:filterExpression:GroupSummary' :: Maybe Text
filterExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:insightsConfiguration:GroupSummary' :: Maybe InsightsConfiguration
insightsConfiguration = Maybe InsightsConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:groupARN:GroupSummary' :: Maybe Text
groupARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:GroupSummary' :: Maybe Text
groupName = Maybe Text
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 :: (Maybe Text -> f (Maybe Text)) -> GroupSummary -> f GroupSummary
groupSummary_filterExpression = (GroupSummary -> Maybe Text)
-> (GroupSummary -> Maybe Text -> GroupSummary)
-> Lens GroupSummary GroupSummary (Maybe Text) (Maybe Text)
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 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 :: (Maybe InsightsConfiguration -> f (Maybe InsightsConfiguration))
-> GroupSummary -> f GroupSummary
groupSummary_insightsConfiguration = (GroupSummary -> Maybe InsightsConfiguration)
-> (GroupSummary -> Maybe InsightsConfiguration -> GroupSummary)
-> Lens
     GroupSummary
     GroupSummary
     (Maybe InsightsConfiguration)
     (Maybe 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)

-- | The ARN of the group generated based on the GroupName.
groupSummary_groupARN :: Lens.Lens' GroupSummary (Prelude.Maybe Prelude.Text)
groupSummary_groupARN :: (Maybe Text -> f (Maybe Text)) -> GroupSummary -> f GroupSummary
groupSummary_groupARN = (GroupSummary -> Maybe Text)
-> (GroupSummary -> Maybe Text -> GroupSummary)
-> Lens GroupSummary GroupSummary (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> GroupSummary -> f GroupSummary
groupSummary_groupName = (GroupSummary -> Maybe Text)
-> (GroupSummary -> Maybe Text -> GroupSummary)
-> Lens GroupSummary GroupSummary (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON GroupSummary where
  parseJSON :: Value -> Parser GroupSummary
parseJSON =
    String
-> (Object -> Parser GroupSummary) -> Value -> Parser GroupSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GroupSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe InsightsConfiguration
-> Maybe Text
-> Maybe Text
-> GroupSummary
GroupSummary'
            (Maybe Text
 -> Maybe InsightsConfiguration
 -> Maybe Text
 -> Maybe Text
 -> GroupSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe InsightsConfiguration
      -> Maybe Text -> Maybe Text -> GroupSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FilterExpression")
            Parser
  (Maybe InsightsConfiguration
   -> Maybe Text -> Maybe Text -> GroupSummary)
-> Parser (Maybe InsightsConfiguration)
-> Parser (Maybe Text -> Maybe Text -> GroupSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InsightsConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InsightsConfiguration")
            Parser (Maybe Text -> Maybe Text -> GroupSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> GroupSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupARN")
            Parser (Maybe Text -> GroupSummary)
-> Parser (Maybe Text) -> Parser GroupSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupName")
      )

instance Prelude.Hashable GroupSummary

instance Prelude.NFData GroupSummary