{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTDeviceAdvisor.StartSuiteRun
-- 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)
--
-- Starts a Device Advisor test suite run.
module Amazonka.IoTDeviceAdvisor.StartSuiteRun
  ( -- * Creating a Request
    StartSuiteRun (..),
    newStartSuiteRun,

    -- * Request Lenses
    startSuiteRun_suiteRunConfiguration,
    startSuiteRun_suiteDefinitionVersion,
    startSuiteRun_tags,
    startSuiteRun_suiteDefinitionId,

    -- * Destructuring the Response
    StartSuiteRunResponse (..),
    newStartSuiteRunResponse,

    -- * Response Lenses
    startSuiteRunResponse_createdAt,
    startSuiteRunResponse_suiteRunArn,
    startSuiteRunResponse_suiteRunId,
    startSuiteRunResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTDeviceAdvisor.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newStartSuiteRun' smart constructor.
data StartSuiteRun = StartSuiteRun'
  { -- | Suite run configuration.
    StartSuiteRun -> Maybe SuiteRunConfiguration
suiteRunConfiguration :: Prelude.Maybe SuiteRunConfiguration,
    -- | Suite definition version of the test suite.
    StartSuiteRun -> Maybe Text
suiteDefinitionVersion :: Prelude.Maybe Prelude.Text,
    -- | The tags to be attached to the suite run.
    StartSuiteRun -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Suite definition Id of the test suite.
    StartSuiteRun -> Text
suiteDefinitionId :: Prelude.Text
  }
  deriving (StartSuiteRun -> StartSuiteRun -> Bool
(StartSuiteRun -> StartSuiteRun -> Bool)
-> (StartSuiteRun -> StartSuiteRun -> Bool) -> Eq StartSuiteRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSuiteRun -> StartSuiteRun -> Bool
$c/= :: StartSuiteRun -> StartSuiteRun -> Bool
== :: StartSuiteRun -> StartSuiteRun -> Bool
$c== :: StartSuiteRun -> StartSuiteRun -> Bool
Prelude.Eq, ReadPrec [StartSuiteRun]
ReadPrec StartSuiteRun
Int -> ReadS StartSuiteRun
ReadS [StartSuiteRun]
(Int -> ReadS StartSuiteRun)
-> ReadS [StartSuiteRun]
-> ReadPrec StartSuiteRun
-> ReadPrec [StartSuiteRun]
-> Read StartSuiteRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSuiteRun]
$creadListPrec :: ReadPrec [StartSuiteRun]
readPrec :: ReadPrec StartSuiteRun
$creadPrec :: ReadPrec StartSuiteRun
readList :: ReadS [StartSuiteRun]
$creadList :: ReadS [StartSuiteRun]
readsPrec :: Int -> ReadS StartSuiteRun
$creadsPrec :: Int -> ReadS StartSuiteRun
Prelude.Read, Int -> StartSuiteRun -> ShowS
[StartSuiteRun] -> ShowS
StartSuiteRun -> String
(Int -> StartSuiteRun -> ShowS)
-> (StartSuiteRun -> String)
-> ([StartSuiteRun] -> ShowS)
-> Show StartSuiteRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSuiteRun] -> ShowS
$cshowList :: [StartSuiteRun] -> ShowS
show :: StartSuiteRun -> String
$cshow :: StartSuiteRun -> String
showsPrec :: Int -> StartSuiteRun -> ShowS
$cshowsPrec :: Int -> StartSuiteRun -> ShowS
Prelude.Show, (forall x. StartSuiteRun -> Rep StartSuiteRun x)
-> (forall x. Rep StartSuiteRun x -> StartSuiteRun)
-> Generic StartSuiteRun
forall x. Rep StartSuiteRun x -> StartSuiteRun
forall x. StartSuiteRun -> Rep StartSuiteRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSuiteRun x -> StartSuiteRun
$cfrom :: forall x. StartSuiteRun -> Rep StartSuiteRun x
Prelude.Generic)

-- |
-- Create a value of 'StartSuiteRun' 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:
--
-- 'suiteRunConfiguration', 'startSuiteRun_suiteRunConfiguration' - Suite run configuration.
--
-- 'suiteDefinitionVersion', 'startSuiteRun_suiteDefinitionVersion' - Suite definition version of the test suite.
--
-- 'tags', 'startSuiteRun_tags' - The tags to be attached to the suite run.
--
-- 'suiteDefinitionId', 'startSuiteRun_suiteDefinitionId' - Suite definition Id of the test suite.
newStartSuiteRun ::
  -- | 'suiteDefinitionId'
  Prelude.Text ->
  StartSuiteRun
newStartSuiteRun :: Text -> StartSuiteRun
newStartSuiteRun Text
pSuiteDefinitionId_ =
  StartSuiteRun' :: Maybe SuiteRunConfiguration
-> Maybe Text -> Maybe (HashMap Text Text) -> Text -> StartSuiteRun
StartSuiteRun'
    { $sel:suiteRunConfiguration:StartSuiteRun' :: Maybe SuiteRunConfiguration
suiteRunConfiguration =
        Maybe SuiteRunConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:suiteDefinitionVersion:StartSuiteRun' :: Maybe Text
suiteDefinitionVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StartSuiteRun' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:suiteDefinitionId:StartSuiteRun' :: Text
suiteDefinitionId = Text
pSuiteDefinitionId_
    }

-- | Suite run configuration.
startSuiteRun_suiteRunConfiguration :: Lens.Lens' StartSuiteRun (Prelude.Maybe SuiteRunConfiguration)
startSuiteRun_suiteRunConfiguration :: (Maybe SuiteRunConfiguration -> f (Maybe SuiteRunConfiguration))
-> StartSuiteRun -> f StartSuiteRun
startSuiteRun_suiteRunConfiguration = (StartSuiteRun -> Maybe SuiteRunConfiguration)
-> (StartSuiteRun -> Maybe SuiteRunConfiguration -> StartSuiteRun)
-> Lens
     StartSuiteRun
     StartSuiteRun
     (Maybe SuiteRunConfiguration)
     (Maybe SuiteRunConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRun' {Maybe SuiteRunConfiguration
suiteRunConfiguration :: Maybe SuiteRunConfiguration
$sel:suiteRunConfiguration:StartSuiteRun' :: StartSuiteRun -> Maybe SuiteRunConfiguration
suiteRunConfiguration} -> Maybe SuiteRunConfiguration
suiteRunConfiguration) (\s :: StartSuiteRun
s@StartSuiteRun' {} Maybe SuiteRunConfiguration
a -> StartSuiteRun
s {$sel:suiteRunConfiguration:StartSuiteRun' :: Maybe SuiteRunConfiguration
suiteRunConfiguration = Maybe SuiteRunConfiguration
a} :: StartSuiteRun)

-- | Suite definition version of the test suite.
startSuiteRun_suiteDefinitionVersion :: Lens.Lens' StartSuiteRun (Prelude.Maybe Prelude.Text)
startSuiteRun_suiteDefinitionVersion :: (Maybe Text -> f (Maybe Text)) -> StartSuiteRun -> f StartSuiteRun
startSuiteRun_suiteDefinitionVersion = (StartSuiteRun -> Maybe Text)
-> (StartSuiteRun -> Maybe Text -> StartSuiteRun)
-> Lens StartSuiteRun StartSuiteRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRun' {Maybe Text
suiteDefinitionVersion :: Maybe Text
$sel:suiteDefinitionVersion:StartSuiteRun' :: StartSuiteRun -> Maybe Text
suiteDefinitionVersion} -> Maybe Text
suiteDefinitionVersion) (\s :: StartSuiteRun
s@StartSuiteRun' {} Maybe Text
a -> StartSuiteRun
s {$sel:suiteDefinitionVersion:StartSuiteRun' :: Maybe Text
suiteDefinitionVersion = Maybe Text
a} :: StartSuiteRun)

-- | The tags to be attached to the suite run.
startSuiteRun_tags :: Lens.Lens' StartSuiteRun (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startSuiteRun_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartSuiteRun -> f StartSuiteRun
startSuiteRun_tags = (StartSuiteRun -> Maybe (HashMap Text Text))
-> (StartSuiteRun -> Maybe (HashMap Text Text) -> StartSuiteRun)
-> Lens
     StartSuiteRun
     StartSuiteRun
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRun' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:StartSuiteRun' :: StartSuiteRun -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: StartSuiteRun
s@StartSuiteRun' {} Maybe (HashMap Text Text)
a -> StartSuiteRun
s {$sel:tags:StartSuiteRun' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: StartSuiteRun) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> StartSuiteRun -> f StartSuiteRun)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartSuiteRun
-> f StartSuiteRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Suite definition Id of the test suite.
startSuiteRun_suiteDefinitionId :: Lens.Lens' StartSuiteRun Prelude.Text
startSuiteRun_suiteDefinitionId :: (Text -> f Text) -> StartSuiteRun -> f StartSuiteRun
startSuiteRun_suiteDefinitionId = (StartSuiteRun -> Text)
-> (StartSuiteRun -> Text -> StartSuiteRun)
-> Lens StartSuiteRun StartSuiteRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRun' {Text
suiteDefinitionId :: Text
$sel:suiteDefinitionId:StartSuiteRun' :: StartSuiteRun -> Text
suiteDefinitionId} -> Text
suiteDefinitionId) (\s :: StartSuiteRun
s@StartSuiteRun' {} Text
a -> StartSuiteRun
s {$sel:suiteDefinitionId:StartSuiteRun' :: Text
suiteDefinitionId = Text
a} :: StartSuiteRun)

instance Core.AWSRequest StartSuiteRun where
  type
    AWSResponse StartSuiteRun =
      StartSuiteRunResponse
  request :: StartSuiteRun -> Request StartSuiteRun
request = Service -> StartSuiteRun -> Request StartSuiteRun
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartSuiteRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSuiteRun)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartSuiteRun))
-> Logger
-> Service
-> Proxy StartSuiteRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartSuiteRun)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe Text -> Maybe Text -> Int -> StartSuiteRunResponse
StartSuiteRunResponse'
            (Maybe POSIX
 -> Maybe Text -> Maybe Text -> Int -> StartSuiteRunResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> StartSuiteRunResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createdAt")
            Either
  String (Maybe Text -> Maybe Text -> Int -> StartSuiteRunResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> StartSuiteRunResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"suiteRunArn")
            Either String (Maybe Text -> Int -> StartSuiteRunResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartSuiteRunResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"suiteRunId")
            Either String (Int -> StartSuiteRunResponse)
-> Either String Int -> Either String StartSuiteRunResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable StartSuiteRun

instance Prelude.NFData StartSuiteRun

instance Core.ToHeaders StartSuiteRun where
  toHeaders :: StartSuiteRun -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartSuiteRun -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON StartSuiteRun where
  toJSON :: StartSuiteRun -> Value
toJSON StartSuiteRun' {Maybe Text
Maybe (HashMap Text Text)
Maybe SuiteRunConfiguration
Text
suiteDefinitionId :: Text
tags :: Maybe (HashMap Text Text)
suiteDefinitionVersion :: Maybe Text
suiteRunConfiguration :: Maybe SuiteRunConfiguration
$sel:suiteDefinitionId:StartSuiteRun' :: StartSuiteRun -> Text
$sel:tags:StartSuiteRun' :: StartSuiteRun -> Maybe (HashMap Text Text)
$sel:suiteDefinitionVersion:StartSuiteRun' :: StartSuiteRun -> Maybe Text
$sel:suiteRunConfiguration:StartSuiteRun' :: StartSuiteRun -> Maybe SuiteRunConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"suiteRunConfiguration" Text -> SuiteRunConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SuiteRunConfiguration -> Pair)
-> Maybe SuiteRunConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SuiteRunConfiguration
suiteRunConfiguration,
            (Text
"suiteDefinitionVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
suiteDefinitionVersion,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
          ]
      )

instance Core.ToPath StartSuiteRun where
  toPath :: StartSuiteRun -> ByteString
toPath StartSuiteRun' {Maybe Text
Maybe (HashMap Text Text)
Maybe SuiteRunConfiguration
Text
suiteDefinitionId :: Text
tags :: Maybe (HashMap Text Text)
suiteDefinitionVersion :: Maybe Text
suiteRunConfiguration :: Maybe SuiteRunConfiguration
$sel:suiteDefinitionId:StartSuiteRun' :: StartSuiteRun -> Text
$sel:tags:StartSuiteRun' :: StartSuiteRun -> Maybe (HashMap Text Text)
$sel:suiteDefinitionVersion:StartSuiteRun' :: StartSuiteRun -> Maybe Text
$sel:suiteRunConfiguration:StartSuiteRun' :: StartSuiteRun -> Maybe SuiteRunConfiguration
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/suiteDefinitions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
suiteDefinitionId,
        ByteString
"/suiteRuns"
      ]

instance Core.ToQuery StartSuiteRun where
  toQuery :: StartSuiteRun -> QueryString
toQuery = QueryString -> StartSuiteRun -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newStartSuiteRunResponse' smart constructor.
data StartSuiteRunResponse = StartSuiteRunResponse'
  { -- | Date (in Unix epoch time) when the suite run was created.
    StartSuiteRunResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Amazon resource name of the started suite run.
    StartSuiteRunResponse -> Maybe Text
suiteRunArn :: Prelude.Maybe Prelude.Text,
    -- | Suite Run Id of the started suite run.
    StartSuiteRunResponse -> Maybe Text
suiteRunId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartSuiteRunResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartSuiteRunResponse -> StartSuiteRunResponse -> Bool
(StartSuiteRunResponse -> StartSuiteRunResponse -> Bool)
-> (StartSuiteRunResponse -> StartSuiteRunResponse -> Bool)
-> Eq StartSuiteRunResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSuiteRunResponse -> StartSuiteRunResponse -> Bool
$c/= :: StartSuiteRunResponse -> StartSuiteRunResponse -> Bool
== :: StartSuiteRunResponse -> StartSuiteRunResponse -> Bool
$c== :: StartSuiteRunResponse -> StartSuiteRunResponse -> Bool
Prelude.Eq, ReadPrec [StartSuiteRunResponse]
ReadPrec StartSuiteRunResponse
Int -> ReadS StartSuiteRunResponse
ReadS [StartSuiteRunResponse]
(Int -> ReadS StartSuiteRunResponse)
-> ReadS [StartSuiteRunResponse]
-> ReadPrec StartSuiteRunResponse
-> ReadPrec [StartSuiteRunResponse]
-> Read StartSuiteRunResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSuiteRunResponse]
$creadListPrec :: ReadPrec [StartSuiteRunResponse]
readPrec :: ReadPrec StartSuiteRunResponse
$creadPrec :: ReadPrec StartSuiteRunResponse
readList :: ReadS [StartSuiteRunResponse]
$creadList :: ReadS [StartSuiteRunResponse]
readsPrec :: Int -> ReadS StartSuiteRunResponse
$creadsPrec :: Int -> ReadS StartSuiteRunResponse
Prelude.Read, Int -> StartSuiteRunResponse -> ShowS
[StartSuiteRunResponse] -> ShowS
StartSuiteRunResponse -> String
(Int -> StartSuiteRunResponse -> ShowS)
-> (StartSuiteRunResponse -> String)
-> ([StartSuiteRunResponse] -> ShowS)
-> Show StartSuiteRunResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSuiteRunResponse] -> ShowS
$cshowList :: [StartSuiteRunResponse] -> ShowS
show :: StartSuiteRunResponse -> String
$cshow :: StartSuiteRunResponse -> String
showsPrec :: Int -> StartSuiteRunResponse -> ShowS
$cshowsPrec :: Int -> StartSuiteRunResponse -> ShowS
Prelude.Show, (forall x. StartSuiteRunResponse -> Rep StartSuiteRunResponse x)
-> (forall x. Rep StartSuiteRunResponse x -> StartSuiteRunResponse)
-> Generic StartSuiteRunResponse
forall x. Rep StartSuiteRunResponse x -> StartSuiteRunResponse
forall x. StartSuiteRunResponse -> Rep StartSuiteRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSuiteRunResponse x -> StartSuiteRunResponse
$cfrom :: forall x. StartSuiteRunResponse -> Rep StartSuiteRunResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartSuiteRunResponse' 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:
--
-- 'createdAt', 'startSuiteRunResponse_createdAt' - Date (in Unix epoch time) when the suite run was created.
--
-- 'suiteRunArn', 'startSuiteRunResponse_suiteRunArn' - Amazon resource name of the started suite run.
--
-- 'suiteRunId', 'startSuiteRunResponse_suiteRunId' - Suite Run Id of the started suite run.
--
-- 'httpStatus', 'startSuiteRunResponse_httpStatus' - The response's http status code.
newStartSuiteRunResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartSuiteRunResponse
newStartSuiteRunResponse :: Int -> StartSuiteRunResponse
newStartSuiteRunResponse Int
pHttpStatus_ =
  StartSuiteRunResponse' :: Maybe POSIX
-> Maybe Text -> Maybe Text -> Int -> StartSuiteRunResponse
StartSuiteRunResponse'
    { $sel:createdAt:StartSuiteRunResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:suiteRunArn:StartSuiteRunResponse' :: Maybe Text
suiteRunArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:suiteRunId:StartSuiteRunResponse' :: Maybe Text
suiteRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartSuiteRunResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Date (in Unix epoch time) when the suite run was created.
startSuiteRunResponse_createdAt :: Lens.Lens' StartSuiteRunResponse (Prelude.Maybe Prelude.UTCTime)
startSuiteRunResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StartSuiteRunResponse -> f StartSuiteRunResponse
startSuiteRunResponse_createdAt = (StartSuiteRunResponse -> Maybe POSIX)
-> (StartSuiteRunResponse -> Maybe POSIX -> StartSuiteRunResponse)
-> Lens
     StartSuiteRunResponse
     StartSuiteRunResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRunResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:StartSuiteRunResponse' :: StartSuiteRunResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: StartSuiteRunResponse
s@StartSuiteRunResponse' {} Maybe POSIX
a -> StartSuiteRunResponse
s {$sel:createdAt:StartSuiteRunResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: StartSuiteRunResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> StartSuiteRunResponse -> f StartSuiteRunResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StartSuiteRunResponse
-> f StartSuiteRunResponse
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

-- | Amazon resource name of the started suite run.
startSuiteRunResponse_suiteRunArn :: Lens.Lens' StartSuiteRunResponse (Prelude.Maybe Prelude.Text)
startSuiteRunResponse_suiteRunArn :: (Maybe Text -> f (Maybe Text))
-> StartSuiteRunResponse -> f StartSuiteRunResponse
startSuiteRunResponse_suiteRunArn = (StartSuiteRunResponse -> Maybe Text)
-> (StartSuiteRunResponse -> Maybe Text -> StartSuiteRunResponse)
-> Lens
     StartSuiteRunResponse
     StartSuiteRunResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRunResponse' {Maybe Text
suiteRunArn :: Maybe Text
$sel:suiteRunArn:StartSuiteRunResponse' :: StartSuiteRunResponse -> Maybe Text
suiteRunArn} -> Maybe Text
suiteRunArn) (\s :: StartSuiteRunResponse
s@StartSuiteRunResponse' {} Maybe Text
a -> StartSuiteRunResponse
s {$sel:suiteRunArn:StartSuiteRunResponse' :: Maybe Text
suiteRunArn = Maybe Text
a} :: StartSuiteRunResponse)

-- | Suite Run Id of the started suite run.
startSuiteRunResponse_suiteRunId :: Lens.Lens' StartSuiteRunResponse (Prelude.Maybe Prelude.Text)
startSuiteRunResponse_suiteRunId :: (Maybe Text -> f (Maybe Text))
-> StartSuiteRunResponse -> f StartSuiteRunResponse
startSuiteRunResponse_suiteRunId = (StartSuiteRunResponse -> Maybe Text)
-> (StartSuiteRunResponse -> Maybe Text -> StartSuiteRunResponse)
-> Lens
     StartSuiteRunResponse
     StartSuiteRunResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRunResponse' {Maybe Text
suiteRunId :: Maybe Text
$sel:suiteRunId:StartSuiteRunResponse' :: StartSuiteRunResponse -> Maybe Text
suiteRunId} -> Maybe Text
suiteRunId) (\s :: StartSuiteRunResponse
s@StartSuiteRunResponse' {} Maybe Text
a -> StartSuiteRunResponse
s {$sel:suiteRunId:StartSuiteRunResponse' :: Maybe Text
suiteRunId = Maybe Text
a} :: StartSuiteRunResponse)

-- | The response's http status code.
startSuiteRunResponse_httpStatus :: Lens.Lens' StartSuiteRunResponse Prelude.Int
startSuiteRunResponse_httpStatus :: (Int -> f Int) -> StartSuiteRunResponse -> f StartSuiteRunResponse
startSuiteRunResponse_httpStatus = (StartSuiteRunResponse -> Int)
-> (StartSuiteRunResponse -> Int -> StartSuiteRunResponse)
-> Lens StartSuiteRunResponse StartSuiteRunResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSuiteRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartSuiteRunResponse' :: StartSuiteRunResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartSuiteRunResponse
s@StartSuiteRunResponse' {} Int
a -> StartSuiteRunResponse
s {$sel:httpStatus:StartSuiteRunResponse' :: Int
httpStatus = Int
a} :: StartSuiteRunResponse)

instance Prelude.NFData StartSuiteRunResponse