{-# 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.DeviceFarm.Types.ExecutionConfiguration
-- 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.DeviceFarm.Types.ExecutionConfiguration 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

-- | Represents configuration information about a test run, such as the
-- execution timeout (in minutes).
--
-- /See:/ 'newExecutionConfiguration' smart constructor.
data ExecutionConfiguration = ExecutionConfiguration'
  { -- | True if account cleanup is enabled at the beginning of the test.
    -- Otherwise, false.
    ExecutionConfiguration -> Maybe Bool
accountsCleanup :: Prelude.Maybe Prelude.Bool,
    -- | True if app package cleanup is enabled at the beginning of the test.
    -- Otherwise, false.
    ExecutionConfiguration -> Maybe Bool
appPackagesCleanup :: Prelude.Maybe Prelude.Bool,
    -- | The number of minutes a test run executes before it times out.
    ExecutionConfiguration -> Maybe Int
jobTimeoutMinutes :: Prelude.Maybe Prelude.Int,
    -- | When set to @true@, for private devices, Device Farm does not sign your
    -- app again. For public devices, Device Farm always signs your apps again.
    --
    -- For more information about how Device Farm re-signs your apps, see
    -- <http://aws.amazon.com/device-farm/faqs/ Do you modify my app?> in the
    -- /AWS Device Farm FAQs/.
    ExecutionConfiguration -> Maybe Bool
skipAppResign :: Prelude.Maybe Prelude.Bool,
    -- | Set to true to enable video capture. Otherwise, set to false. The
    -- default is true.
    ExecutionConfiguration -> Maybe Bool
videoCapture :: Prelude.Maybe Prelude.Bool
  }
  deriving (ExecutionConfiguration -> ExecutionConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecutionConfiguration -> ExecutionConfiguration -> Bool
$c/= :: ExecutionConfiguration -> ExecutionConfiguration -> Bool
== :: ExecutionConfiguration -> ExecutionConfiguration -> Bool
$c== :: ExecutionConfiguration -> ExecutionConfiguration -> Bool
Prelude.Eq, ReadPrec [ExecutionConfiguration]
ReadPrec ExecutionConfiguration
Int -> ReadS ExecutionConfiguration
ReadS [ExecutionConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExecutionConfiguration]
$creadListPrec :: ReadPrec [ExecutionConfiguration]
readPrec :: ReadPrec ExecutionConfiguration
$creadPrec :: ReadPrec ExecutionConfiguration
readList :: ReadS [ExecutionConfiguration]
$creadList :: ReadS [ExecutionConfiguration]
readsPrec :: Int -> ReadS ExecutionConfiguration
$creadsPrec :: Int -> ReadS ExecutionConfiguration
Prelude.Read, Int -> ExecutionConfiguration -> ShowS
[ExecutionConfiguration] -> ShowS
ExecutionConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecutionConfiguration] -> ShowS
$cshowList :: [ExecutionConfiguration] -> ShowS
show :: ExecutionConfiguration -> String
$cshow :: ExecutionConfiguration -> String
showsPrec :: Int -> ExecutionConfiguration -> ShowS
$cshowsPrec :: Int -> ExecutionConfiguration -> ShowS
Prelude.Show, forall x. Rep ExecutionConfiguration x -> ExecutionConfiguration
forall x. ExecutionConfiguration -> Rep ExecutionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExecutionConfiguration x -> ExecutionConfiguration
$cfrom :: forall x. ExecutionConfiguration -> Rep ExecutionConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ExecutionConfiguration' 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:
--
-- 'accountsCleanup', 'executionConfiguration_accountsCleanup' - True if account cleanup is enabled at the beginning of the test.
-- Otherwise, false.
--
-- 'appPackagesCleanup', 'executionConfiguration_appPackagesCleanup' - True if app package cleanup is enabled at the beginning of the test.
-- Otherwise, false.
--
-- 'jobTimeoutMinutes', 'executionConfiguration_jobTimeoutMinutes' - The number of minutes a test run executes before it times out.
--
-- 'skipAppResign', 'executionConfiguration_skipAppResign' - When set to @true@, for private devices, Device Farm does not sign your
-- app again. For public devices, Device Farm always signs your apps again.
--
-- For more information about how Device Farm re-signs your apps, see
-- <http://aws.amazon.com/device-farm/faqs/ Do you modify my app?> in the
-- /AWS Device Farm FAQs/.
--
-- 'videoCapture', 'executionConfiguration_videoCapture' - Set to true to enable video capture. Otherwise, set to false. The
-- default is true.
newExecutionConfiguration ::
  ExecutionConfiguration
newExecutionConfiguration :: ExecutionConfiguration
newExecutionConfiguration =
  ExecutionConfiguration'
    { $sel:accountsCleanup:ExecutionConfiguration' :: Maybe Bool
accountsCleanup =
        forall a. Maybe a
Prelude.Nothing,
      $sel:appPackagesCleanup:ExecutionConfiguration' :: Maybe Bool
appPackagesCleanup = forall a. Maybe a
Prelude.Nothing,
      $sel:jobTimeoutMinutes:ExecutionConfiguration' :: Maybe Int
jobTimeoutMinutes = forall a. Maybe a
Prelude.Nothing,
      $sel:skipAppResign:ExecutionConfiguration' :: Maybe Bool
skipAppResign = forall a. Maybe a
Prelude.Nothing,
      $sel:videoCapture:ExecutionConfiguration' :: Maybe Bool
videoCapture = forall a. Maybe a
Prelude.Nothing
    }

-- | True if account cleanup is enabled at the beginning of the test.
-- Otherwise, false.
executionConfiguration_accountsCleanup :: Lens.Lens' ExecutionConfiguration (Prelude.Maybe Prelude.Bool)
executionConfiguration_accountsCleanup :: Lens' ExecutionConfiguration (Maybe Bool)
executionConfiguration_accountsCleanup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionConfiguration' {Maybe Bool
accountsCleanup :: Maybe Bool
$sel:accountsCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
accountsCleanup} -> Maybe Bool
accountsCleanup) (\s :: ExecutionConfiguration
s@ExecutionConfiguration' {} Maybe Bool
a -> ExecutionConfiguration
s {$sel:accountsCleanup:ExecutionConfiguration' :: Maybe Bool
accountsCleanup = Maybe Bool
a} :: ExecutionConfiguration)

-- | True if app package cleanup is enabled at the beginning of the test.
-- Otherwise, false.
executionConfiguration_appPackagesCleanup :: Lens.Lens' ExecutionConfiguration (Prelude.Maybe Prelude.Bool)
executionConfiguration_appPackagesCleanup :: Lens' ExecutionConfiguration (Maybe Bool)
executionConfiguration_appPackagesCleanup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionConfiguration' {Maybe Bool
appPackagesCleanup :: Maybe Bool
$sel:appPackagesCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
appPackagesCleanup} -> Maybe Bool
appPackagesCleanup) (\s :: ExecutionConfiguration
s@ExecutionConfiguration' {} Maybe Bool
a -> ExecutionConfiguration
s {$sel:appPackagesCleanup:ExecutionConfiguration' :: Maybe Bool
appPackagesCleanup = Maybe Bool
a} :: ExecutionConfiguration)

-- | The number of minutes a test run executes before it times out.
executionConfiguration_jobTimeoutMinutes :: Lens.Lens' ExecutionConfiguration (Prelude.Maybe Prelude.Int)
executionConfiguration_jobTimeoutMinutes :: Lens' ExecutionConfiguration (Maybe Int)
executionConfiguration_jobTimeoutMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionConfiguration' {Maybe Int
jobTimeoutMinutes :: Maybe Int
$sel:jobTimeoutMinutes:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Int
jobTimeoutMinutes} -> Maybe Int
jobTimeoutMinutes) (\s :: ExecutionConfiguration
s@ExecutionConfiguration' {} Maybe Int
a -> ExecutionConfiguration
s {$sel:jobTimeoutMinutes:ExecutionConfiguration' :: Maybe Int
jobTimeoutMinutes = Maybe Int
a} :: ExecutionConfiguration)

-- | When set to @true@, for private devices, Device Farm does not sign your
-- app again. For public devices, Device Farm always signs your apps again.
--
-- For more information about how Device Farm re-signs your apps, see
-- <http://aws.amazon.com/device-farm/faqs/ Do you modify my app?> in the
-- /AWS Device Farm FAQs/.
executionConfiguration_skipAppResign :: Lens.Lens' ExecutionConfiguration (Prelude.Maybe Prelude.Bool)
executionConfiguration_skipAppResign :: Lens' ExecutionConfiguration (Maybe Bool)
executionConfiguration_skipAppResign = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionConfiguration' {Maybe Bool
skipAppResign :: Maybe Bool
$sel:skipAppResign:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
skipAppResign} -> Maybe Bool
skipAppResign) (\s :: ExecutionConfiguration
s@ExecutionConfiguration' {} Maybe Bool
a -> ExecutionConfiguration
s {$sel:skipAppResign:ExecutionConfiguration' :: Maybe Bool
skipAppResign = Maybe Bool
a} :: ExecutionConfiguration)

-- | Set to true to enable video capture. Otherwise, set to false. The
-- default is true.
executionConfiguration_videoCapture :: Lens.Lens' ExecutionConfiguration (Prelude.Maybe Prelude.Bool)
executionConfiguration_videoCapture :: Lens' ExecutionConfiguration (Maybe Bool)
executionConfiguration_videoCapture = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecutionConfiguration' {Maybe Bool
videoCapture :: Maybe Bool
$sel:videoCapture:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
videoCapture} -> Maybe Bool
videoCapture) (\s :: ExecutionConfiguration
s@ExecutionConfiguration' {} Maybe Bool
a -> ExecutionConfiguration
s {$sel:videoCapture:ExecutionConfiguration' :: Maybe Bool
videoCapture = Maybe Bool
a} :: ExecutionConfiguration)

instance Prelude.Hashable ExecutionConfiguration where
  hashWithSalt :: Int -> ExecutionConfiguration -> Int
hashWithSalt Int
_salt ExecutionConfiguration' {Maybe Bool
Maybe Int
videoCapture :: Maybe Bool
skipAppResign :: Maybe Bool
jobTimeoutMinutes :: Maybe Int
appPackagesCleanup :: Maybe Bool
accountsCleanup :: Maybe Bool
$sel:videoCapture:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:skipAppResign:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:jobTimeoutMinutes:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Int
$sel:appPackagesCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:accountsCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
accountsCleanup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
appPackagesCleanup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
jobTimeoutMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
skipAppResign
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
videoCapture

instance Prelude.NFData ExecutionConfiguration where
  rnf :: ExecutionConfiguration -> ()
rnf ExecutionConfiguration' {Maybe Bool
Maybe Int
videoCapture :: Maybe Bool
skipAppResign :: Maybe Bool
jobTimeoutMinutes :: Maybe Int
appPackagesCleanup :: Maybe Bool
accountsCleanup :: Maybe Bool
$sel:videoCapture:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:skipAppResign:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:jobTimeoutMinutes:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Int
$sel:appPackagesCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:accountsCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
accountsCleanup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
appPackagesCleanup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
jobTimeoutMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
skipAppResign
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
videoCapture

instance Data.ToJSON ExecutionConfiguration where
  toJSON :: ExecutionConfiguration -> Value
toJSON ExecutionConfiguration' {Maybe Bool
Maybe Int
videoCapture :: Maybe Bool
skipAppResign :: Maybe Bool
jobTimeoutMinutes :: Maybe Int
appPackagesCleanup :: Maybe Bool
accountsCleanup :: Maybe Bool
$sel:videoCapture:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:skipAppResign:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:jobTimeoutMinutes:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Int
$sel:appPackagesCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
$sel:accountsCleanup:ExecutionConfiguration' :: ExecutionConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"accountsCleanup" 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
accountsCleanup,
            (Key
"appPackagesCleanup" 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
appPackagesCleanup,
            (Key
"jobTimeoutMinutes" 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 Int
jobTimeoutMinutes,
            (Key
"skipAppResign" 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
skipAppResign,
            (Key
"videoCapture" 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
videoCapture
          ]
      )