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

import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types.Counters
import Amazonka.DeviceFarm.Types.Device
import Amazonka.DeviceFarm.Types.DeviceMinutes
import Amazonka.DeviceFarm.Types.ExecutionResult
import Amazonka.DeviceFarm.Types.ExecutionStatus
import Amazonka.DeviceFarm.Types.TestType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a device.
--
-- /See:/ 'newJob' smart constructor.
data Job = Job'
  { -- | The ARN of the instance.
    Job -> Maybe Text
instanceArn :: Prelude.Maybe Prelude.Text,
    -- | The job\'s status.
    --
    -- Allowed values include:
    --
    -- -   PENDING
    --
    -- -   PENDING_CONCURRENCY
    --
    -- -   PENDING_DEVICE
    --
    -- -   PROCESSING
    --
    -- -   SCHEDULING
    --
    -- -   PREPARING
    --
    -- -   RUNNING
    --
    -- -   COMPLETED
    --
    -- -   STOPPING
    Job -> Maybe ExecutionStatus
status :: Prelude.Maybe ExecutionStatus,
    -- | The job\'s result counters.
    Job -> Maybe Counters
counters :: Prelude.Maybe Counters,
    -- | The job\'s ARN.
    Job -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | When the job was created.
    Job -> Maybe POSIX
created :: Prelude.Maybe Core.POSIX,
    -- | The device (phone or tablet).
    Job -> Maybe Device
device :: Prelude.Maybe Device,
    -- | The job\'s stop time.
    Job -> Maybe POSIX
stopped :: Prelude.Maybe Core.POSIX,
    -- | The job\'s result.
    --
    -- Allowed values include:
    --
    -- -   PENDING
    --
    -- -   PASSED
    --
    -- -   WARNED
    --
    -- -   FAILED
    --
    -- -   SKIPPED
    --
    -- -   ERRORED
    --
    -- -   STOPPED
    Job -> Maybe ExecutionResult
result :: Prelude.Maybe ExecutionResult,
    -- | The job\'s name.
    Job -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The endpoint for streaming device video.
    Job -> Maybe Text
videoEndpoint :: Prelude.Maybe Prelude.Text,
    -- | Represents the total (metered or unmetered) minutes used by the job.
    Job -> Maybe DeviceMinutes
deviceMinutes :: Prelude.Maybe DeviceMinutes,
    -- | This value is set to true if video capture is enabled. Otherwise, it is
    -- set to false.
    Job -> Maybe Bool
videoCapture :: Prelude.Maybe Prelude.Bool,
    -- | The job\'s type.
    --
    -- Allowed values include the following:
    --
    -- -   BUILTIN_FUZZ
    --
    -- -   BUILTIN_EXPLORER. For Android, an app explorer that traverses an
    --     Android app, interacting with it and capturing screenshots at the
    --     same time.
    --
    -- -   APPIUM_JAVA_JUNIT
    --
    -- -   APPIUM_JAVA_TESTNG
    --
    -- -   APPIUM_PYTHON
    --
    -- -   APPIUM_NODE
    --
    -- -   APPIUM_RUBY
    --
    -- -   APPIUM_WEB_JAVA_JUNIT
    --
    -- -   APPIUM_WEB_JAVA_TESTNG
    --
    -- -   APPIUM_WEB_PYTHON
    --
    -- -   APPIUM_WEB_NODE
    --
    -- -   APPIUM_WEB_RUBY
    --
    -- -   CALABASH
    --
    -- -   INSTRUMENTATION
    --
    -- -   UIAUTOMATION
    --
    -- -   UIAUTOMATOR
    --
    -- -   XCTEST
    --
    -- -   XCTEST_UI
    Job -> Maybe TestType
type' :: Prelude.Maybe TestType,
    -- | A message about the job\'s result.
    Job -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The job\'s start time.
    Job -> Maybe POSIX
started :: Prelude.Maybe Core.POSIX
  }
  deriving (Job -> Job -> Bool
(Job -> Job -> Bool) -> (Job -> Job -> Bool) -> Eq Job
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Job -> Job -> Bool
$c/= :: Job -> Job -> Bool
== :: Job -> Job -> Bool
$c== :: Job -> Job -> Bool
Prelude.Eq, ReadPrec [Job]
ReadPrec Job
Int -> ReadS Job
ReadS [Job]
(Int -> ReadS Job)
-> ReadS [Job] -> ReadPrec Job -> ReadPrec [Job] -> Read Job
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Job]
$creadListPrec :: ReadPrec [Job]
readPrec :: ReadPrec Job
$creadPrec :: ReadPrec Job
readList :: ReadS [Job]
$creadList :: ReadS [Job]
readsPrec :: Int -> ReadS Job
$creadsPrec :: Int -> ReadS Job
Prelude.Read, Int -> Job -> ShowS
[Job] -> ShowS
Job -> String
(Int -> Job -> ShowS)
-> (Job -> String) -> ([Job] -> ShowS) -> Show Job
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Job] -> ShowS
$cshowList :: [Job] -> ShowS
show :: Job -> String
$cshow :: Job -> String
showsPrec :: Int -> Job -> ShowS
$cshowsPrec :: Int -> Job -> ShowS
Prelude.Show, (forall x. Job -> Rep Job x)
-> (forall x. Rep Job x -> Job) -> Generic Job
forall x. Rep Job x -> Job
forall x. Job -> Rep Job x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Job x -> Job
$cfrom :: forall x. Job -> Rep Job x
Prelude.Generic)

-- |
-- Create a value of 'Job' 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:
--
-- 'instanceArn', 'job_instanceArn' - The ARN of the instance.
--
-- 'status', 'job_status' - The job\'s status.
--
-- Allowed values include:
--
-- -   PENDING
--
-- -   PENDING_CONCURRENCY
--
-- -   PENDING_DEVICE
--
-- -   PROCESSING
--
-- -   SCHEDULING
--
-- -   PREPARING
--
-- -   RUNNING
--
-- -   COMPLETED
--
-- -   STOPPING
--
-- 'counters', 'job_counters' - The job\'s result counters.
--
-- 'arn', 'job_arn' - The job\'s ARN.
--
-- 'created', 'job_created' - When the job was created.
--
-- 'device', 'job_device' - The device (phone or tablet).
--
-- 'stopped', 'job_stopped' - The job\'s stop time.
--
-- 'result', 'job_result' - The job\'s result.
--
-- Allowed values include:
--
-- -   PENDING
--
-- -   PASSED
--
-- -   WARNED
--
-- -   FAILED
--
-- -   SKIPPED
--
-- -   ERRORED
--
-- -   STOPPED
--
-- 'name', 'job_name' - The job\'s name.
--
-- 'videoEndpoint', 'job_videoEndpoint' - The endpoint for streaming device video.
--
-- 'deviceMinutes', 'job_deviceMinutes' - Represents the total (metered or unmetered) minutes used by the job.
--
-- 'videoCapture', 'job_videoCapture' - This value is set to true if video capture is enabled. Otherwise, it is
-- set to false.
--
-- 'type'', 'job_type' - The job\'s type.
--
-- Allowed values include the following:
--
-- -   BUILTIN_FUZZ
--
-- -   BUILTIN_EXPLORER. For Android, an app explorer that traverses an
--     Android app, interacting with it and capturing screenshots at the
--     same time.
--
-- -   APPIUM_JAVA_JUNIT
--
-- -   APPIUM_JAVA_TESTNG
--
-- -   APPIUM_PYTHON
--
-- -   APPIUM_NODE
--
-- -   APPIUM_RUBY
--
-- -   APPIUM_WEB_JAVA_JUNIT
--
-- -   APPIUM_WEB_JAVA_TESTNG
--
-- -   APPIUM_WEB_PYTHON
--
-- -   APPIUM_WEB_NODE
--
-- -   APPIUM_WEB_RUBY
--
-- -   CALABASH
--
-- -   INSTRUMENTATION
--
-- -   UIAUTOMATION
--
-- -   UIAUTOMATOR
--
-- -   XCTEST
--
-- -   XCTEST_UI
--
-- 'message', 'job_message' - A message about the job\'s result.
--
-- 'started', 'job_started' - The job\'s start time.
newJob ::
  Job
newJob :: Job
newJob =
  Job' :: Maybe Text
-> Maybe ExecutionStatus
-> Maybe Counters
-> Maybe Text
-> Maybe POSIX
-> Maybe Device
-> Maybe POSIX
-> Maybe ExecutionResult
-> Maybe Text
-> Maybe Text
-> Maybe DeviceMinutes
-> Maybe Bool
-> Maybe TestType
-> Maybe Text
-> Maybe POSIX
-> Job
Job'
    { $sel:instanceArn:Job' :: Maybe Text
instanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:Job' :: Maybe ExecutionStatus
status = Maybe ExecutionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:counters:Job' :: Maybe Counters
counters = Maybe Counters
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Job' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:created:Job' :: Maybe POSIX
created = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:device:Job' :: Maybe Device
device = Maybe Device
forall a. Maybe a
Prelude.Nothing,
      $sel:stopped:Job' :: Maybe POSIX
stopped = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:result:Job' :: Maybe ExecutionResult
result = Maybe ExecutionResult
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Job' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:videoEndpoint:Job' :: Maybe Text
videoEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceMinutes:Job' :: Maybe DeviceMinutes
deviceMinutes = Maybe DeviceMinutes
forall a. Maybe a
Prelude.Nothing,
      $sel:videoCapture:Job' :: Maybe Bool
videoCapture = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Job' :: Maybe TestType
type' = Maybe TestType
forall a. Maybe a
Prelude.Nothing,
      $sel:message:Job' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:started:Job' :: Maybe POSIX
started = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the instance.
job_instanceArn :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_instanceArn :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_instanceArn = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
instanceArn :: Maybe Text
$sel:instanceArn:Job' :: Job -> Maybe Text
instanceArn} -> Maybe Text
instanceArn) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:instanceArn:Job' :: Maybe Text
instanceArn = Maybe Text
a} :: Job)

-- | The job\'s status.
--
-- Allowed values include:
--
-- -   PENDING
--
-- -   PENDING_CONCURRENCY
--
-- -   PENDING_DEVICE
--
-- -   PROCESSING
--
-- -   SCHEDULING
--
-- -   PREPARING
--
-- -   RUNNING
--
-- -   COMPLETED
--
-- -   STOPPING
job_status :: Lens.Lens' Job (Prelude.Maybe ExecutionStatus)
job_status :: (Maybe ExecutionStatus -> f (Maybe ExecutionStatus))
-> Job -> f Job
job_status = (Job -> Maybe ExecutionStatus)
-> (Job -> Maybe ExecutionStatus -> Job)
-> Lens Job Job (Maybe ExecutionStatus) (Maybe ExecutionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe ExecutionStatus
status :: Maybe ExecutionStatus
$sel:status:Job' :: Job -> Maybe ExecutionStatus
status} -> Maybe ExecutionStatus
status) (\s :: Job
s@Job' {} Maybe ExecutionStatus
a -> Job
s {$sel:status:Job' :: Maybe ExecutionStatus
status = Maybe ExecutionStatus
a} :: Job)

-- | The job\'s result counters.
job_counters :: Lens.Lens' Job (Prelude.Maybe Counters)
job_counters :: (Maybe Counters -> f (Maybe Counters)) -> Job -> f Job
job_counters = (Job -> Maybe Counters)
-> (Job -> Maybe Counters -> Job)
-> Lens Job Job (Maybe Counters) (Maybe Counters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Counters
counters :: Maybe Counters
$sel:counters:Job' :: Job -> Maybe Counters
counters} -> Maybe Counters
counters) (\s :: Job
s@Job' {} Maybe Counters
a -> Job
s {$sel:counters:Job' :: Maybe Counters
counters = Maybe Counters
a} :: Job)

-- | The job\'s ARN.
job_arn :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_arn :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_arn = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
arn :: Maybe Text
$sel:arn:Job' :: Job -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:arn:Job' :: Maybe Text
arn = Maybe Text
a} :: Job)

-- | When the job was created.
job_created :: Lens.Lens' Job (Prelude.Maybe Prelude.UTCTime)
job_created :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Job -> f Job
job_created = (Job -> Maybe POSIX)
-> (Job -> Maybe POSIX -> Job)
-> Lens Job Job (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe POSIX
created :: Maybe POSIX
$sel:created:Job' :: Job -> Maybe POSIX
created} -> Maybe POSIX
created) (\s :: Job
s@Job' {} Maybe POSIX
a -> Job
s {$sel:created:Job' :: Maybe POSIX
created = Maybe POSIX
a} :: Job) ((Maybe POSIX -> f (Maybe POSIX)) -> Job -> f Job)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The device (phone or tablet).
job_device :: Lens.Lens' Job (Prelude.Maybe Device)
job_device :: (Maybe Device -> f (Maybe Device)) -> Job -> f Job
job_device = (Job -> Maybe Device)
-> (Job -> Maybe Device -> Job)
-> Lens Job Job (Maybe Device) (Maybe Device)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Device
device :: Maybe Device
$sel:device:Job' :: Job -> Maybe Device
device} -> Maybe Device
device) (\s :: Job
s@Job' {} Maybe Device
a -> Job
s {$sel:device:Job' :: Maybe Device
device = Maybe Device
a} :: Job)

-- | The job\'s stop time.
job_stopped :: Lens.Lens' Job (Prelude.Maybe Prelude.UTCTime)
job_stopped :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Job -> f Job
job_stopped = (Job -> Maybe POSIX)
-> (Job -> Maybe POSIX -> Job)
-> Lens Job Job (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe POSIX
stopped :: Maybe POSIX
$sel:stopped:Job' :: Job -> Maybe POSIX
stopped} -> Maybe POSIX
stopped) (\s :: Job
s@Job' {} Maybe POSIX
a -> Job
s {$sel:stopped:Job' :: Maybe POSIX
stopped = Maybe POSIX
a} :: Job) ((Maybe POSIX -> f (Maybe POSIX)) -> Job -> f Job)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The job\'s result.
--
-- Allowed values include:
--
-- -   PENDING
--
-- -   PASSED
--
-- -   WARNED
--
-- -   FAILED
--
-- -   SKIPPED
--
-- -   ERRORED
--
-- -   STOPPED
job_result :: Lens.Lens' Job (Prelude.Maybe ExecutionResult)
job_result :: (Maybe ExecutionResult -> f (Maybe ExecutionResult))
-> Job -> f Job
job_result = (Job -> Maybe ExecutionResult)
-> (Job -> Maybe ExecutionResult -> Job)
-> Lens Job Job (Maybe ExecutionResult) (Maybe ExecutionResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe ExecutionResult
result :: Maybe ExecutionResult
$sel:result:Job' :: Job -> Maybe ExecutionResult
result} -> Maybe ExecutionResult
result) (\s :: Job
s@Job' {} Maybe ExecutionResult
a -> Job
s {$sel:result:Job' :: Maybe ExecutionResult
result = Maybe ExecutionResult
a} :: Job)

-- | The job\'s name.
job_name :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_name :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_name = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
name :: Maybe Text
$sel:name:Job' :: Job -> Maybe Text
name} -> Maybe Text
name) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:name:Job' :: Maybe Text
name = Maybe Text
a} :: Job)

-- | The endpoint for streaming device video.
job_videoEndpoint :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_videoEndpoint :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_videoEndpoint = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
videoEndpoint :: Maybe Text
$sel:videoEndpoint:Job' :: Job -> Maybe Text
videoEndpoint} -> Maybe Text
videoEndpoint) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:videoEndpoint:Job' :: Maybe Text
videoEndpoint = Maybe Text
a} :: Job)

-- | Represents the total (metered or unmetered) minutes used by the job.
job_deviceMinutes :: Lens.Lens' Job (Prelude.Maybe DeviceMinutes)
job_deviceMinutes :: (Maybe DeviceMinutes -> f (Maybe DeviceMinutes)) -> Job -> f Job
job_deviceMinutes = (Job -> Maybe DeviceMinutes)
-> (Job -> Maybe DeviceMinutes -> Job)
-> Lens Job Job (Maybe DeviceMinutes) (Maybe DeviceMinutes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe DeviceMinutes
deviceMinutes :: Maybe DeviceMinutes
$sel:deviceMinutes:Job' :: Job -> Maybe DeviceMinutes
deviceMinutes} -> Maybe DeviceMinutes
deviceMinutes) (\s :: Job
s@Job' {} Maybe DeviceMinutes
a -> Job
s {$sel:deviceMinutes:Job' :: Maybe DeviceMinutes
deviceMinutes = Maybe DeviceMinutes
a} :: Job)

-- | This value is set to true if video capture is enabled. Otherwise, it is
-- set to false.
job_videoCapture :: Lens.Lens' Job (Prelude.Maybe Prelude.Bool)
job_videoCapture :: (Maybe Bool -> f (Maybe Bool)) -> Job -> f Job
job_videoCapture = (Job -> Maybe Bool)
-> (Job -> Maybe Bool -> Job)
-> Lens Job Job (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Bool
videoCapture :: Maybe Bool
$sel:videoCapture:Job' :: Job -> Maybe Bool
videoCapture} -> Maybe Bool
videoCapture) (\s :: Job
s@Job' {} Maybe Bool
a -> Job
s {$sel:videoCapture:Job' :: Maybe Bool
videoCapture = Maybe Bool
a} :: Job)

-- | The job\'s type.
--
-- Allowed values include the following:
--
-- -   BUILTIN_FUZZ
--
-- -   BUILTIN_EXPLORER. For Android, an app explorer that traverses an
--     Android app, interacting with it and capturing screenshots at the
--     same time.
--
-- -   APPIUM_JAVA_JUNIT
--
-- -   APPIUM_JAVA_TESTNG
--
-- -   APPIUM_PYTHON
--
-- -   APPIUM_NODE
--
-- -   APPIUM_RUBY
--
-- -   APPIUM_WEB_JAVA_JUNIT
--
-- -   APPIUM_WEB_JAVA_TESTNG
--
-- -   APPIUM_WEB_PYTHON
--
-- -   APPIUM_WEB_NODE
--
-- -   APPIUM_WEB_RUBY
--
-- -   CALABASH
--
-- -   INSTRUMENTATION
--
-- -   UIAUTOMATION
--
-- -   UIAUTOMATOR
--
-- -   XCTEST
--
-- -   XCTEST_UI
job_type :: Lens.Lens' Job (Prelude.Maybe TestType)
job_type :: (Maybe TestType -> f (Maybe TestType)) -> Job -> f Job
job_type = (Job -> Maybe TestType)
-> (Job -> Maybe TestType -> Job)
-> Lens Job Job (Maybe TestType) (Maybe TestType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe TestType
type' :: Maybe TestType
$sel:type':Job' :: Job -> Maybe TestType
type'} -> Maybe TestType
type') (\s :: Job
s@Job' {} Maybe TestType
a -> Job
s {$sel:type':Job' :: Maybe TestType
type' = Maybe TestType
a} :: Job)

-- | A message about the job\'s result.
job_message :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_message :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_message = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
message :: Maybe Text
$sel:message:Job' :: Job -> Maybe Text
message} -> Maybe Text
message) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:message:Job' :: Maybe Text
message = Maybe Text
a} :: Job)

-- | The job\'s start time.
job_started :: Lens.Lens' Job (Prelude.Maybe Prelude.UTCTime)
job_started :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Job -> f Job
job_started = (Job -> Maybe POSIX)
-> (Job -> Maybe POSIX -> Job)
-> Lens Job Job (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe POSIX
started :: Maybe POSIX
$sel:started:Job' :: Job -> Maybe POSIX
started} -> Maybe POSIX
started) (\s :: Job
s@Job' {} Maybe POSIX
a -> Job
s {$sel:started:Job' :: Maybe POSIX
started = Maybe POSIX
a} :: Job) ((Maybe POSIX -> f (Maybe POSIX)) -> Job -> f Job)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON Job where
  parseJSON :: Value -> Parser Job
parseJSON =
    String -> (Object -> Parser Job) -> Value -> Parser Job
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Job"
      ( \Object
x ->
          Maybe Text
-> Maybe ExecutionStatus
-> Maybe Counters
-> Maybe Text
-> Maybe POSIX
-> Maybe Device
-> Maybe POSIX
-> Maybe ExecutionResult
-> Maybe Text
-> Maybe Text
-> Maybe DeviceMinutes
-> Maybe Bool
-> Maybe TestType
-> Maybe Text
-> Maybe POSIX
-> Job
Job'
            (Maybe Text
 -> Maybe ExecutionStatus
 -> Maybe Counters
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Device
 -> Maybe POSIX
 -> Maybe ExecutionResult
 -> Maybe Text
 -> Maybe Text
 -> Maybe DeviceMinutes
 -> Maybe Bool
 -> Maybe TestType
 -> Maybe Text
 -> Maybe POSIX
 -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe ExecutionStatus
      -> Maybe Counters
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Device
      -> Maybe POSIX
      -> Maybe ExecutionResult
      -> Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
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
"instanceArn")
            Parser
  (Maybe ExecutionStatus
   -> Maybe Counters
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Device
   -> Maybe POSIX
   -> Maybe ExecutionResult
   -> Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe ExecutionStatus)
-> Parser
     (Maybe Counters
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Device
      -> Maybe POSIX
      -> Maybe ExecutionResult
      -> Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExecutionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Counters
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Device
   -> Maybe POSIX
   -> Maybe ExecutionResult
   -> Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe Counters)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Device
      -> Maybe POSIX
      -> Maybe ExecutionResult
      -> Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Counters)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"counters")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Device
   -> Maybe POSIX
   -> Maybe ExecutionResult
   -> Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Device
      -> Maybe POSIX
      -> Maybe ExecutionResult
      -> Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe Device
   -> Maybe POSIX
   -> Maybe ExecutionResult
   -> Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Device
      -> Maybe POSIX
      -> Maybe ExecutionResult
      -> Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"created")
            Parser
  (Maybe Device
   -> Maybe POSIX
   -> Maybe ExecutionResult
   -> Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe Device)
-> Parser
     (Maybe POSIX
      -> Maybe ExecutionResult
      -> Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Device)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"device")
            Parser
  (Maybe POSIX
   -> Maybe ExecutionResult
   -> Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ExecutionResult
      -> Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stopped")
            Parser
  (Maybe ExecutionResult
   -> Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe ExecutionResult)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExecutionResult)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"result")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
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
"name")
            Parser
  (Maybe Text
   -> Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe DeviceMinutes
      -> Maybe Bool
      -> Maybe TestType
      -> Maybe Text
      -> Maybe POSIX
      -> Job)
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
"videoEndpoint")
            Parser
  (Maybe DeviceMinutes
   -> Maybe Bool
   -> Maybe TestType
   -> Maybe Text
   -> Maybe POSIX
   -> Job)
-> Parser (Maybe DeviceMinutes)
-> Parser
     (Maybe Bool -> Maybe TestType -> Maybe Text -> Maybe POSIX -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeviceMinutes)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deviceMinutes")
            Parser
  (Maybe Bool -> Maybe TestType -> Maybe Text -> Maybe POSIX -> Job)
-> Parser (Maybe Bool)
-> Parser (Maybe TestType -> Maybe Text -> Maybe POSIX -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"videoCapture")
            Parser (Maybe TestType -> Maybe Text -> Maybe POSIX -> Job)
-> Parser (Maybe TestType)
-> Parser (Maybe Text -> Maybe POSIX -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TestType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Text -> Maybe POSIX -> Job)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> Job)
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
"message")
            Parser (Maybe POSIX -> Job) -> Parser (Maybe POSIX) -> Parser Job
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"started")
      )

instance Prelude.Hashable Job

instance Prelude.NFData Job