{-# 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.Synthetics.Types.CanaryRunConfigOutput
-- 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.Synthetics.Types.CanaryRunConfigOutput 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

-- | A structure that contains information about a canary run.
--
-- /See:/ 'newCanaryRunConfigOutput' smart constructor.
data CanaryRunConfigOutput = CanaryRunConfigOutput'
  { -- | Displays whether this canary run used active X-Ray tracing.
    CanaryRunConfigOutput -> Maybe Bool
activeTracing :: Prelude.Maybe Prelude.Bool,
    -- | The maximum amount of memory available to the canary while it is
    -- running, in MB. This value must be a multiple of 64.
    CanaryRunConfigOutput -> Maybe Natural
memoryInMB :: Prelude.Maybe Prelude.Natural,
    -- | How long the canary is allowed to run before it must stop.
    CanaryRunConfigOutput -> Maybe Natural
timeoutInSeconds :: Prelude.Maybe Prelude.Natural
  }
  deriving (CanaryRunConfigOutput -> CanaryRunConfigOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CanaryRunConfigOutput -> CanaryRunConfigOutput -> Bool
$c/= :: CanaryRunConfigOutput -> CanaryRunConfigOutput -> Bool
== :: CanaryRunConfigOutput -> CanaryRunConfigOutput -> Bool
$c== :: CanaryRunConfigOutput -> CanaryRunConfigOutput -> Bool
Prelude.Eq, ReadPrec [CanaryRunConfigOutput]
ReadPrec CanaryRunConfigOutput
Int -> ReadS CanaryRunConfigOutput
ReadS [CanaryRunConfigOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CanaryRunConfigOutput]
$creadListPrec :: ReadPrec [CanaryRunConfigOutput]
readPrec :: ReadPrec CanaryRunConfigOutput
$creadPrec :: ReadPrec CanaryRunConfigOutput
readList :: ReadS [CanaryRunConfigOutput]
$creadList :: ReadS [CanaryRunConfigOutput]
readsPrec :: Int -> ReadS CanaryRunConfigOutput
$creadsPrec :: Int -> ReadS CanaryRunConfigOutput
Prelude.Read, Int -> CanaryRunConfigOutput -> ShowS
[CanaryRunConfigOutput] -> ShowS
CanaryRunConfigOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CanaryRunConfigOutput] -> ShowS
$cshowList :: [CanaryRunConfigOutput] -> ShowS
show :: CanaryRunConfigOutput -> String
$cshow :: CanaryRunConfigOutput -> String
showsPrec :: Int -> CanaryRunConfigOutput -> ShowS
$cshowsPrec :: Int -> CanaryRunConfigOutput -> ShowS
Prelude.Show, forall x. Rep CanaryRunConfigOutput x -> CanaryRunConfigOutput
forall x. CanaryRunConfigOutput -> Rep CanaryRunConfigOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CanaryRunConfigOutput x -> CanaryRunConfigOutput
$cfrom :: forall x. CanaryRunConfigOutput -> Rep CanaryRunConfigOutput x
Prelude.Generic)

-- |
-- Create a value of 'CanaryRunConfigOutput' 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:
--
-- 'activeTracing', 'canaryRunConfigOutput_activeTracing' - Displays whether this canary run used active X-Ray tracing.
--
-- 'memoryInMB', 'canaryRunConfigOutput_memoryInMB' - The maximum amount of memory available to the canary while it is
-- running, in MB. This value must be a multiple of 64.
--
-- 'timeoutInSeconds', 'canaryRunConfigOutput_timeoutInSeconds' - How long the canary is allowed to run before it must stop.
newCanaryRunConfigOutput ::
  CanaryRunConfigOutput
newCanaryRunConfigOutput :: CanaryRunConfigOutput
newCanaryRunConfigOutput =
  CanaryRunConfigOutput'
    { $sel:activeTracing:CanaryRunConfigOutput' :: Maybe Bool
activeTracing =
        forall a. Maybe a
Prelude.Nothing,
      $sel:memoryInMB:CanaryRunConfigOutput' :: Maybe Natural
memoryInMB = forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInSeconds:CanaryRunConfigOutput' :: Maybe Natural
timeoutInSeconds = forall a. Maybe a
Prelude.Nothing
    }

-- | Displays whether this canary run used active X-Ray tracing.
canaryRunConfigOutput_activeTracing :: Lens.Lens' CanaryRunConfigOutput (Prelude.Maybe Prelude.Bool)
canaryRunConfigOutput_activeTracing :: Lens' CanaryRunConfigOutput (Maybe Bool)
canaryRunConfigOutput_activeTracing = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRunConfigOutput' {Maybe Bool
activeTracing :: Maybe Bool
$sel:activeTracing:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Bool
activeTracing} -> Maybe Bool
activeTracing) (\s :: CanaryRunConfigOutput
s@CanaryRunConfigOutput' {} Maybe Bool
a -> CanaryRunConfigOutput
s {$sel:activeTracing:CanaryRunConfigOutput' :: Maybe Bool
activeTracing = Maybe Bool
a} :: CanaryRunConfigOutput)

-- | The maximum amount of memory available to the canary while it is
-- running, in MB. This value must be a multiple of 64.
canaryRunConfigOutput_memoryInMB :: Lens.Lens' CanaryRunConfigOutput (Prelude.Maybe Prelude.Natural)
canaryRunConfigOutput_memoryInMB :: Lens' CanaryRunConfigOutput (Maybe Natural)
canaryRunConfigOutput_memoryInMB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRunConfigOutput' {Maybe Natural
memoryInMB :: Maybe Natural
$sel:memoryInMB:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Natural
memoryInMB} -> Maybe Natural
memoryInMB) (\s :: CanaryRunConfigOutput
s@CanaryRunConfigOutput' {} Maybe Natural
a -> CanaryRunConfigOutput
s {$sel:memoryInMB:CanaryRunConfigOutput' :: Maybe Natural
memoryInMB = Maybe Natural
a} :: CanaryRunConfigOutput)

-- | How long the canary is allowed to run before it must stop.
canaryRunConfigOutput_timeoutInSeconds :: Lens.Lens' CanaryRunConfigOutput (Prelude.Maybe Prelude.Natural)
canaryRunConfigOutput_timeoutInSeconds :: Lens' CanaryRunConfigOutput (Maybe Natural)
canaryRunConfigOutput_timeoutInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CanaryRunConfigOutput' {Maybe Natural
timeoutInSeconds :: Maybe Natural
$sel:timeoutInSeconds:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Natural
timeoutInSeconds} -> Maybe Natural
timeoutInSeconds) (\s :: CanaryRunConfigOutput
s@CanaryRunConfigOutput' {} Maybe Natural
a -> CanaryRunConfigOutput
s {$sel:timeoutInSeconds:CanaryRunConfigOutput' :: Maybe Natural
timeoutInSeconds = Maybe Natural
a} :: CanaryRunConfigOutput)

instance Data.FromJSON CanaryRunConfigOutput where
  parseJSON :: Value -> Parser CanaryRunConfigOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CanaryRunConfigOutput"
      ( \Object
x ->
          Maybe Bool
-> Maybe Natural -> Maybe Natural -> CanaryRunConfigOutput
CanaryRunConfigOutput'
            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
"ActiveTracing")
            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
"MemoryInMB")
            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
"TimeoutInSeconds")
      )

instance Prelude.Hashable CanaryRunConfigOutput where
  hashWithSalt :: Int -> CanaryRunConfigOutput -> Int
hashWithSalt Int
_salt CanaryRunConfigOutput' {Maybe Bool
Maybe Natural
timeoutInSeconds :: Maybe Natural
memoryInMB :: Maybe Natural
activeTracing :: Maybe Bool
$sel:timeoutInSeconds:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Natural
$sel:memoryInMB:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Natural
$sel:activeTracing:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
activeTracing
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
memoryInMB
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeoutInSeconds

instance Prelude.NFData CanaryRunConfigOutput where
  rnf :: CanaryRunConfigOutput -> ()
rnf CanaryRunConfigOutput' {Maybe Bool
Maybe Natural
timeoutInSeconds :: Maybe Natural
memoryInMB :: Maybe Natural
activeTracing :: Maybe Bool
$sel:timeoutInSeconds:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Natural
$sel:memoryInMB:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Natural
$sel:activeTracing:CanaryRunConfigOutput' :: CanaryRunConfigOutput -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
activeTracing
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
memoryInMB
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeoutInSeconds