{-# 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.Rum.Types.AppMonitorConfiguration
-- 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.Rum.Types.AppMonitorConfiguration 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.Rum.Types.Telemetry

-- | This structure contains much of the configuration data for the app
-- monitor.
--
-- /See:/ 'newAppMonitorConfiguration' smart constructor.
data AppMonitorConfiguration = AppMonitorConfiguration'
  { -- | If you set this to @true@, the RUM web client sets two cookies, a
    -- session cookie and a user cookie. The cookies allow the RUM web client
    -- to collect data relating to the number of users an application has and
    -- the behavior of the application across a sequence of events. Cookies are
    -- stored in the top-level domain of the current page.
    AppMonitorConfiguration -> Maybe Bool
allowCookies :: Prelude.Maybe Prelude.Bool,
    -- | If you set this to @true@, RUM enables X-Ray tracing for the user
    -- sessions that RUM samples. RUM adds an X-Ray trace header to allowed
    -- HTTP requests. It also records an X-Ray segment for allowed HTTP
    -- requests. You can see traces and segments from these user sessions in
    -- the X-Ray console and the CloudWatch ServiceLens console. For more
    -- information, see
    -- <https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html What is X-Ray?>
    AppMonitorConfiguration -> Maybe Bool
enableXRay :: Prelude.Maybe Prelude.Bool,
    -- | A list of URLs in your website or application to exclude from RUM data
    -- collection.
    --
    -- You can\'t include both @ExcludedPages@ and @IncludedPages@ in the same
    -- operation.
    AppMonitorConfiguration -> Maybe [Text]
excludedPages :: Prelude.Maybe [Prelude.Text],
    -- | A list of pages in your application that are to be displayed with a
    -- \"favorite\" icon in the CloudWatch RUM console.
    AppMonitorConfiguration -> Maybe [Text]
favoritePages :: Prelude.Maybe [Prelude.Text],
    -- | The ARN of the guest IAM role that is attached to the Amazon Cognito
    -- identity pool that is used to authorize the sending of data to RUM.
    AppMonitorConfiguration -> Maybe Text
guestRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Cognito identity pool that is used to authorize the
    -- sending of data to RUM.
    AppMonitorConfiguration -> Maybe Text
identityPoolId :: Prelude.Maybe Prelude.Text,
    -- | If this app monitor is to collect data from only certain pages in your
    -- application, this structure lists those pages.
    --
    -- You can\'t include both @ExcludedPages@ and @IncludedPages@ in the same
    -- operation.
    AppMonitorConfiguration -> Maybe [Text]
includedPages :: Prelude.Maybe [Prelude.Text],
    -- | Specifies the portion of user sessions to use for RUM data collection.
    -- Choosing a higher portion gives you more data but also incurs more
    -- costs.
    --
    -- The range for this value is 0 to 1 inclusive. Setting this to 1 means
    -- that 100% of user sessions are sampled, and setting it to 0.1 means that
    -- 10% of user sessions are sampled.
    --
    -- If you omit this parameter, the default of 0.1 is used, and 10% of
    -- sessions will be sampled.
    AppMonitorConfiguration -> Maybe Double
sessionSampleRate :: Prelude.Maybe Prelude.Double,
    -- | An array that lists the types of telemetry data that this app monitor is
    -- to collect.
    --
    -- -   @errors@ indicates that RUM collects data about unhandled JavaScript
    --     errors raised by your application.
    --
    -- -   @performance@ indicates that RUM collects performance data about how
    --     your application and its resources are loaded and rendered. This
    --     includes Core Web Vitals.
    --
    -- -   @http@ indicates that RUM collects data about HTTP errors thrown by
    --     your application.
    AppMonitorConfiguration -> Maybe [Telemetry]
telemetries :: Prelude.Maybe [Telemetry]
  }
  deriving (AppMonitorConfiguration -> AppMonitorConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppMonitorConfiguration -> AppMonitorConfiguration -> Bool
$c/= :: AppMonitorConfiguration -> AppMonitorConfiguration -> Bool
== :: AppMonitorConfiguration -> AppMonitorConfiguration -> Bool
$c== :: AppMonitorConfiguration -> AppMonitorConfiguration -> Bool
Prelude.Eq, ReadPrec [AppMonitorConfiguration]
ReadPrec AppMonitorConfiguration
Int -> ReadS AppMonitorConfiguration
ReadS [AppMonitorConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppMonitorConfiguration]
$creadListPrec :: ReadPrec [AppMonitorConfiguration]
readPrec :: ReadPrec AppMonitorConfiguration
$creadPrec :: ReadPrec AppMonitorConfiguration
readList :: ReadS [AppMonitorConfiguration]
$creadList :: ReadS [AppMonitorConfiguration]
readsPrec :: Int -> ReadS AppMonitorConfiguration
$creadsPrec :: Int -> ReadS AppMonitorConfiguration
Prelude.Read, Int -> AppMonitorConfiguration -> ShowS
[AppMonitorConfiguration] -> ShowS
AppMonitorConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppMonitorConfiguration] -> ShowS
$cshowList :: [AppMonitorConfiguration] -> ShowS
show :: AppMonitorConfiguration -> String
$cshow :: AppMonitorConfiguration -> String
showsPrec :: Int -> AppMonitorConfiguration -> ShowS
$cshowsPrec :: Int -> AppMonitorConfiguration -> ShowS
Prelude.Show, forall x. Rep AppMonitorConfiguration x -> AppMonitorConfiguration
forall x. AppMonitorConfiguration -> Rep AppMonitorConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppMonitorConfiguration x -> AppMonitorConfiguration
$cfrom :: forall x. AppMonitorConfiguration -> Rep AppMonitorConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AppMonitorConfiguration' 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:
--
-- 'allowCookies', 'appMonitorConfiguration_allowCookies' - If you set this to @true@, the RUM web client sets two cookies, a
-- session cookie and a user cookie. The cookies allow the RUM web client
-- to collect data relating to the number of users an application has and
-- the behavior of the application across a sequence of events. Cookies are
-- stored in the top-level domain of the current page.
--
-- 'enableXRay', 'appMonitorConfiguration_enableXRay' - If you set this to @true@, RUM enables X-Ray tracing for the user
-- sessions that RUM samples. RUM adds an X-Ray trace header to allowed
-- HTTP requests. It also records an X-Ray segment for allowed HTTP
-- requests. You can see traces and segments from these user sessions in
-- the X-Ray console and the CloudWatch ServiceLens console. For more
-- information, see
-- <https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html What is X-Ray?>
--
-- 'excludedPages', 'appMonitorConfiguration_excludedPages' - A list of URLs in your website or application to exclude from RUM data
-- collection.
--
-- You can\'t include both @ExcludedPages@ and @IncludedPages@ in the same
-- operation.
--
-- 'favoritePages', 'appMonitorConfiguration_favoritePages' - A list of pages in your application that are to be displayed with a
-- \"favorite\" icon in the CloudWatch RUM console.
--
-- 'guestRoleArn', 'appMonitorConfiguration_guestRoleArn' - The ARN of the guest IAM role that is attached to the Amazon Cognito
-- identity pool that is used to authorize the sending of data to RUM.
--
-- 'identityPoolId', 'appMonitorConfiguration_identityPoolId' - The ID of the Amazon Cognito identity pool that is used to authorize the
-- sending of data to RUM.
--
-- 'includedPages', 'appMonitorConfiguration_includedPages' - If this app monitor is to collect data from only certain pages in your
-- application, this structure lists those pages.
--
-- You can\'t include both @ExcludedPages@ and @IncludedPages@ in the same
-- operation.
--
-- 'sessionSampleRate', 'appMonitorConfiguration_sessionSampleRate' - Specifies the portion of user sessions to use for RUM data collection.
-- Choosing a higher portion gives you more data but also incurs more
-- costs.
--
-- The range for this value is 0 to 1 inclusive. Setting this to 1 means
-- that 100% of user sessions are sampled, and setting it to 0.1 means that
-- 10% of user sessions are sampled.
--
-- If you omit this parameter, the default of 0.1 is used, and 10% of
-- sessions will be sampled.
--
-- 'telemetries', 'appMonitorConfiguration_telemetries' - An array that lists the types of telemetry data that this app monitor is
-- to collect.
--
-- -   @errors@ indicates that RUM collects data about unhandled JavaScript
--     errors raised by your application.
--
-- -   @performance@ indicates that RUM collects performance data about how
--     your application and its resources are loaded and rendered. This
--     includes Core Web Vitals.
--
-- -   @http@ indicates that RUM collects data about HTTP errors thrown by
--     your application.
newAppMonitorConfiguration ::
  AppMonitorConfiguration
newAppMonitorConfiguration :: AppMonitorConfiguration
newAppMonitorConfiguration =
  AppMonitorConfiguration'
    { $sel:allowCookies:AppMonitorConfiguration' :: Maybe Bool
allowCookies =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enableXRay:AppMonitorConfiguration' :: Maybe Bool
enableXRay = forall a. Maybe a
Prelude.Nothing,
      $sel:excludedPages:AppMonitorConfiguration' :: Maybe [Text]
excludedPages = forall a. Maybe a
Prelude.Nothing,
      $sel:favoritePages:AppMonitorConfiguration' :: Maybe [Text]
favoritePages = forall a. Maybe a
Prelude.Nothing,
      $sel:guestRoleArn:AppMonitorConfiguration' :: Maybe Text
guestRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:identityPoolId:AppMonitorConfiguration' :: Maybe Text
identityPoolId = forall a. Maybe a
Prelude.Nothing,
      $sel:includedPages:AppMonitorConfiguration' :: Maybe [Text]
includedPages = forall a. Maybe a
Prelude.Nothing,
      $sel:sessionSampleRate:AppMonitorConfiguration' :: Maybe Double
sessionSampleRate = forall a. Maybe a
Prelude.Nothing,
      $sel:telemetries:AppMonitorConfiguration' :: Maybe [Telemetry]
telemetries = forall a. Maybe a
Prelude.Nothing
    }

-- | If you set this to @true@, the RUM web client sets two cookies, a
-- session cookie and a user cookie. The cookies allow the RUM web client
-- to collect data relating to the number of users an application has and
-- the behavior of the application across a sequence of events. Cookies are
-- stored in the top-level domain of the current page.
appMonitorConfiguration_allowCookies :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe Prelude.Bool)
appMonitorConfiguration_allowCookies :: Lens' AppMonitorConfiguration (Maybe Bool)
appMonitorConfiguration_allowCookies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe Bool
allowCookies :: Maybe Bool
$sel:allowCookies:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
allowCookies} -> Maybe Bool
allowCookies) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe Bool
a -> AppMonitorConfiguration
s {$sel:allowCookies:AppMonitorConfiguration' :: Maybe Bool
allowCookies = Maybe Bool
a} :: AppMonitorConfiguration)

-- | If you set this to @true@, RUM enables X-Ray tracing for the user
-- sessions that RUM samples. RUM adds an X-Ray trace header to allowed
-- HTTP requests. It also records an X-Ray segment for allowed HTTP
-- requests. You can see traces and segments from these user sessions in
-- the X-Ray console and the CloudWatch ServiceLens console. For more
-- information, see
-- <https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html What is X-Ray?>
appMonitorConfiguration_enableXRay :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe Prelude.Bool)
appMonitorConfiguration_enableXRay :: Lens' AppMonitorConfiguration (Maybe Bool)
appMonitorConfiguration_enableXRay = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe Bool
enableXRay :: Maybe Bool
$sel:enableXRay:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
enableXRay} -> Maybe Bool
enableXRay) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe Bool
a -> AppMonitorConfiguration
s {$sel:enableXRay:AppMonitorConfiguration' :: Maybe Bool
enableXRay = Maybe Bool
a} :: AppMonitorConfiguration)

-- | A list of URLs in your website or application to exclude from RUM data
-- collection.
--
-- You can\'t include both @ExcludedPages@ and @IncludedPages@ in the same
-- operation.
appMonitorConfiguration_excludedPages :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe [Prelude.Text])
appMonitorConfiguration_excludedPages :: Lens' AppMonitorConfiguration (Maybe [Text])
appMonitorConfiguration_excludedPages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe [Text]
excludedPages :: Maybe [Text]
$sel:excludedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
excludedPages} -> Maybe [Text]
excludedPages) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe [Text]
a -> AppMonitorConfiguration
s {$sel:excludedPages:AppMonitorConfiguration' :: Maybe [Text]
excludedPages = Maybe [Text]
a} :: AppMonitorConfiguration) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of pages in your application that are to be displayed with a
-- \"favorite\" icon in the CloudWatch RUM console.
appMonitorConfiguration_favoritePages :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe [Prelude.Text])
appMonitorConfiguration_favoritePages :: Lens' AppMonitorConfiguration (Maybe [Text])
appMonitorConfiguration_favoritePages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe [Text]
favoritePages :: Maybe [Text]
$sel:favoritePages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
favoritePages} -> Maybe [Text]
favoritePages) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe [Text]
a -> AppMonitorConfiguration
s {$sel:favoritePages:AppMonitorConfiguration' :: Maybe [Text]
favoritePages = Maybe [Text]
a} :: AppMonitorConfiguration) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the guest IAM role that is attached to the Amazon Cognito
-- identity pool that is used to authorize the sending of data to RUM.
appMonitorConfiguration_guestRoleArn :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe Prelude.Text)
appMonitorConfiguration_guestRoleArn :: Lens' AppMonitorConfiguration (Maybe Text)
appMonitorConfiguration_guestRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe Text
guestRoleArn :: Maybe Text
$sel:guestRoleArn:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
guestRoleArn} -> Maybe Text
guestRoleArn) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe Text
a -> AppMonitorConfiguration
s {$sel:guestRoleArn:AppMonitorConfiguration' :: Maybe Text
guestRoleArn = Maybe Text
a} :: AppMonitorConfiguration)

-- | The ID of the Amazon Cognito identity pool that is used to authorize the
-- sending of data to RUM.
appMonitorConfiguration_identityPoolId :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe Prelude.Text)
appMonitorConfiguration_identityPoolId :: Lens' AppMonitorConfiguration (Maybe Text)
appMonitorConfiguration_identityPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe Text
identityPoolId :: Maybe Text
$sel:identityPoolId:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
identityPoolId} -> Maybe Text
identityPoolId) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe Text
a -> AppMonitorConfiguration
s {$sel:identityPoolId:AppMonitorConfiguration' :: Maybe Text
identityPoolId = Maybe Text
a} :: AppMonitorConfiguration)

-- | If this app monitor is to collect data from only certain pages in your
-- application, this structure lists those pages.
--
-- You can\'t include both @ExcludedPages@ and @IncludedPages@ in the same
-- operation.
appMonitorConfiguration_includedPages :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe [Prelude.Text])
appMonitorConfiguration_includedPages :: Lens' AppMonitorConfiguration (Maybe [Text])
appMonitorConfiguration_includedPages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe [Text]
includedPages :: Maybe [Text]
$sel:includedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
includedPages} -> Maybe [Text]
includedPages) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe [Text]
a -> AppMonitorConfiguration
s {$sel:includedPages:AppMonitorConfiguration' :: Maybe [Text]
includedPages = Maybe [Text]
a} :: AppMonitorConfiguration) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the portion of user sessions to use for RUM data collection.
-- Choosing a higher portion gives you more data but also incurs more
-- costs.
--
-- The range for this value is 0 to 1 inclusive. Setting this to 1 means
-- that 100% of user sessions are sampled, and setting it to 0.1 means that
-- 10% of user sessions are sampled.
--
-- If you omit this parameter, the default of 0.1 is used, and 10% of
-- sessions will be sampled.
appMonitorConfiguration_sessionSampleRate :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe Prelude.Double)
appMonitorConfiguration_sessionSampleRate :: Lens' AppMonitorConfiguration (Maybe Double)
appMonitorConfiguration_sessionSampleRate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe Double
sessionSampleRate :: Maybe Double
$sel:sessionSampleRate:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Double
sessionSampleRate} -> Maybe Double
sessionSampleRate) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe Double
a -> AppMonitorConfiguration
s {$sel:sessionSampleRate:AppMonitorConfiguration' :: Maybe Double
sessionSampleRate = Maybe Double
a} :: AppMonitorConfiguration)

-- | An array that lists the types of telemetry data that this app monitor is
-- to collect.
--
-- -   @errors@ indicates that RUM collects data about unhandled JavaScript
--     errors raised by your application.
--
-- -   @performance@ indicates that RUM collects performance data about how
--     your application and its resources are loaded and rendered. This
--     includes Core Web Vitals.
--
-- -   @http@ indicates that RUM collects data about HTTP errors thrown by
--     your application.
appMonitorConfiguration_telemetries :: Lens.Lens' AppMonitorConfiguration (Prelude.Maybe [Telemetry])
appMonitorConfiguration_telemetries :: Lens' AppMonitorConfiguration (Maybe [Telemetry])
appMonitorConfiguration_telemetries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorConfiguration' {Maybe [Telemetry]
telemetries :: Maybe [Telemetry]
$sel:telemetries:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Telemetry]
telemetries} -> Maybe [Telemetry]
telemetries) (\s :: AppMonitorConfiguration
s@AppMonitorConfiguration' {} Maybe [Telemetry]
a -> AppMonitorConfiguration
s {$sel:telemetries:AppMonitorConfiguration' :: Maybe [Telemetry]
telemetries = Maybe [Telemetry]
a} :: AppMonitorConfiguration) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON AppMonitorConfiguration where
  parseJSON :: Value -> Parser AppMonitorConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AppMonitorConfiguration"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Double
-> Maybe [Telemetry]
-> AppMonitorConfiguration
AppMonitorConfiguration'
            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
"AllowCookies")
            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
"EnableXRay")
            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
"ExcludedPages" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"FavoritePages" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"GuestRoleArn")
            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
"IdentityPoolId")
            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
"IncludedPages" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"SessionSampleRate")
            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
"Telemetries" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable AppMonitorConfiguration where
  hashWithSalt :: Int -> AppMonitorConfiguration -> Int
hashWithSalt Int
_salt AppMonitorConfiguration' {Maybe Bool
Maybe Double
Maybe [Text]
Maybe [Telemetry]
Maybe Text
telemetries :: Maybe [Telemetry]
sessionSampleRate :: Maybe Double
includedPages :: Maybe [Text]
identityPoolId :: Maybe Text
guestRoleArn :: Maybe Text
favoritePages :: Maybe [Text]
excludedPages :: Maybe [Text]
enableXRay :: Maybe Bool
allowCookies :: Maybe Bool
$sel:telemetries:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Telemetry]
$sel:sessionSampleRate:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Double
$sel:includedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:identityPoolId:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
$sel:guestRoleArn:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
$sel:favoritePages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:excludedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:enableXRay:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
$sel:allowCookies:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowCookies
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableXRay
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
excludedPages
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
favoritePages
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
guestRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
identityPoolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
includedPages
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
sessionSampleRate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Telemetry]
telemetries

instance Prelude.NFData AppMonitorConfiguration where
  rnf :: AppMonitorConfiguration -> ()
rnf AppMonitorConfiguration' {Maybe Bool
Maybe Double
Maybe [Text]
Maybe [Telemetry]
Maybe Text
telemetries :: Maybe [Telemetry]
sessionSampleRate :: Maybe Double
includedPages :: Maybe [Text]
identityPoolId :: Maybe Text
guestRoleArn :: Maybe Text
favoritePages :: Maybe [Text]
excludedPages :: Maybe [Text]
enableXRay :: Maybe Bool
allowCookies :: Maybe Bool
$sel:telemetries:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Telemetry]
$sel:sessionSampleRate:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Double
$sel:includedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:identityPoolId:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
$sel:guestRoleArn:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
$sel:favoritePages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:excludedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:enableXRay:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
$sel:allowCookies:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowCookies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableXRay
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
excludedPages
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
favoritePages
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
guestRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityPoolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
includedPages
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
sessionSampleRate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Telemetry]
telemetries

instance Data.ToJSON AppMonitorConfiguration where
  toJSON :: AppMonitorConfiguration -> Value
toJSON AppMonitorConfiguration' {Maybe Bool
Maybe Double
Maybe [Text]
Maybe [Telemetry]
Maybe Text
telemetries :: Maybe [Telemetry]
sessionSampleRate :: Maybe Double
includedPages :: Maybe [Text]
identityPoolId :: Maybe Text
guestRoleArn :: Maybe Text
favoritePages :: Maybe [Text]
excludedPages :: Maybe [Text]
enableXRay :: Maybe Bool
allowCookies :: Maybe Bool
$sel:telemetries:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Telemetry]
$sel:sessionSampleRate:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Double
$sel:includedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:identityPoolId:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
$sel:guestRoleArn:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Text
$sel:favoritePages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:excludedPages:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe [Text]
$sel:enableXRay:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
$sel:allowCookies:AppMonitorConfiguration' :: AppMonitorConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AllowCookies" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowCookies,
            (Key
"EnableXRay" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableXRay,
            (Key
"ExcludedPages" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
excludedPages,
            (Key
"FavoritePages" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
favoritePages,
            (Key
"GuestRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
guestRoleArn,
            (Key
"IdentityPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identityPoolId,
            (Key
"IncludedPages" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
includedPages,
            (Key
"SessionSampleRate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
sessionSampleRate,
            (Key
"Telemetries" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Telemetry]
telemetries
          ]
      )