{-# 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.CodeCommit.TestRepositoryTriggers
-- 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)
--
-- Tests the functionality of repository triggers by sending information to
-- the trigger target. If real data is available in the repository, the
-- test sends data from the last commit. If no data is available, sample
-- data is generated.
module Amazonka.CodeCommit.TestRepositoryTriggers
  ( -- * Creating a Request
    TestRepositoryTriggers (..),
    newTestRepositoryTriggers,

    -- * Request Lenses
    testRepositoryTriggers_repositoryName,
    testRepositoryTriggers_triggers,

    -- * Destructuring the Response
    TestRepositoryTriggersResponse (..),
    newTestRepositoryTriggersResponse,

    -- * Response Lenses
    testRepositoryTriggersResponse_failedExecutions,
    testRepositoryTriggersResponse_successfulExecutions,
    testRepositoryTriggersResponse_httpStatus,
  )
where

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

-- | Represents the input of a test repository triggers operation.
--
-- /See:/ 'newTestRepositoryTriggers' smart constructor.
data TestRepositoryTriggers = TestRepositoryTriggers'
  { -- | The name of the repository in which to test the triggers.
    TestRepositoryTriggers -> Text
repositoryName :: Prelude.Text,
    -- | The list of triggers to test.
    TestRepositoryTriggers -> [RepositoryTrigger]
triggers :: [RepositoryTrigger]
  }
  deriving (TestRepositoryTriggers -> TestRepositoryTriggers -> Bool
(TestRepositoryTriggers -> TestRepositoryTriggers -> Bool)
-> (TestRepositoryTriggers -> TestRepositoryTriggers -> Bool)
-> Eq TestRepositoryTriggers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestRepositoryTriggers -> TestRepositoryTriggers -> Bool
$c/= :: TestRepositoryTriggers -> TestRepositoryTriggers -> Bool
== :: TestRepositoryTriggers -> TestRepositoryTriggers -> Bool
$c== :: TestRepositoryTriggers -> TestRepositoryTriggers -> Bool
Prelude.Eq, ReadPrec [TestRepositoryTriggers]
ReadPrec TestRepositoryTriggers
Int -> ReadS TestRepositoryTriggers
ReadS [TestRepositoryTriggers]
(Int -> ReadS TestRepositoryTriggers)
-> ReadS [TestRepositoryTriggers]
-> ReadPrec TestRepositoryTriggers
-> ReadPrec [TestRepositoryTriggers]
-> Read TestRepositoryTriggers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestRepositoryTriggers]
$creadListPrec :: ReadPrec [TestRepositoryTriggers]
readPrec :: ReadPrec TestRepositoryTriggers
$creadPrec :: ReadPrec TestRepositoryTriggers
readList :: ReadS [TestRepositoryTriggers]
$creadList :: ReadS [TestRepositoryTriggers]
readsPrec :: Int -> ReadS TestRepositoryTriggers
$creadsPrec :: Int -> ReadS TestRepositoryTriggers
Prelude.Read, Int -> TestRepositoryTriggers -> ShowS
[TestRepositoryTriggers] -> ShowS
TestRepositoryTriggers -> String
(Int -> TestRepositoryTriggers -> ShowS)
-> (TestRepositoryTriggers -> String)
-> ([TestRepositoryTriggers] -> ShowS)
-> Show TestRepositoryTriggers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestRepositoryTriggers] -> ShowS
$cshowList :: [TestRepositoryTriggers] -> ShowS
show :: TestRepositoryTriggers -> String
$cshow :: TestRepositoryTriggers -> String
showsPrec :: Int -> TestRepositoryTriggers -> ShowS
$cshowsPrec :: Int -> TestRepositoryTriggers -> ShowS
Prelude.Show, (forall x. TestRepositoryTriggers -> Rep TestRepositoryTriggers x)
-> (forall x.
    Rep TestRepositoryTriggers x -> TestRepositoryTriggers)
-> Generic TestRepositoryTriggers
forall x. Rep TestRepositoryTriggers x -> TestRepositoryTriggers
forall x. TestRepositoryTriggers -> Rep TestRepositoryTriggers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestRepositoryTriggers x -> TestRepositoryTriggers
$cfrom :: forall x. TestRepositoryTriggers -> Rep TestRepositoryTriggers x
Prelude.Generic)

-- |
-- Create a value of 'TestRepositoryTriggers' 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:
--
-- 'repositoryName', 'testRepositoryTriggers_repositoryName' - The name of the repository in which to test the triggers.
--
-- 'triggers', 'testRepositoryTriggers_triggers' - The list of triggers to test.
newTestRepositoryTriggers ::
  -- | 'repositoryName'
  Prelude.Text ->
  TestRepositoryTriggers
newTestRepositoryTriggers :: Text -> TestRepositoryTriggers
newTestRepositoryTriggers Text
pRepositoryName_ =
  TestRepositoryTriggers' :: Text -> [RepositoryTrigger] -> TestRepositoryTriggers
TestRepositoryTriggers'
    { $sel:repositoryName:TestRepositoryTriggers' :: Text
repositoryName =
        Text
pRepositoryName_,
      $sel:triggers:TestRepositoryTriggers' :: [RepositoryTrigger]
triggers = [RepositoryTrigger]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The name of the repository in which to test the triggers.
testRepositoryTriggers_repositoryName :: Lens.Lens' TestRepositoryTriggers Prelude.Text
testRepositoryTriggers_repositoryName :: (Text -> f Text)
-> TestRepositoryTriggers -> f TestRepositoryTriggers
testRepositoryTriggers_repositoryName = (TestRepositoryTriggers -> Text)
-> (TestRepositoryTriggers -> Text -> TestRepositoryTriggers)
-> Lens TestRepositoryTriggers TestRepositoryTriggers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestRepositoryTriggers' {Text
repositoryName :: Text
$sel:repositoryName:TestRepositoryTriggers' :: TestRepositoryTriggers -> Text
repositoryName} -> Text
repositoryName) (\s :: TestRepositoryTriggers
s@TestRepositoryTriggers' {} Text
a -> TestRepositoryTriggers
s {$sel:repositoryName:TestRepositoryTriggers' :: Text
repositoryName = Text
a} :: TestRepositoryTriggers)

-- | The list of triggers to test.
testRepositoryTriggers_triggers :: Lens.Lens' TestRepositoryTriggers [RepositoryTrigger]
testRepositoryTriggers_triggers :: ([RepositoryTrigger] -> f [RepositoryTrigger])
-> TestRepositoryTriggers -> f TestRepositoryTriggers
testRepositoryTriggers_triggers = (TestRepositoryTriggers -> [RepositoryTrigger])
-> (TestRepositoryTriggers
    -> [RepositoryTrigger] -> TestRepositoryTriggers)
-> Lens
     TestRepositoryTriggers
     TestRepositoryTriggers
     [RepositoryTrigger]
     [RepositoryTrigger]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestRepositoryTriggers' {[RepositoryTrigger]
triggers :: [RepositoryTrigger]
$sel:triggers:TestRepositoryTriggers' :: TestRepositoryTriggers -> [RepositoryTrigger]
triggers} -> [RepositoryTrigger]
triggers) (\s :: TestRepositoryTriggers
s@TestRepositoryTriggers' {} [RepositoryTrigger]
a -> TestRepositoryTriggers
s {$sel:triggers:TestRepositoryTriggers' :: [RepositoryTrigger]
triggers = [RepositoryTrigger]
a} :: TestRepositoryTriggers) (([RepositoryTrigger] -> f [RepositoryTrigger])
 -> TestRepositoryTriggers -> f TestRepositoryTriggers)
-> (([RepositoryTrigger] -> f [RepositoryTrigger])
    -> [RepositoryTrigger] -> f [RepositoryTrigger])
-> ([RepositoryTrigger] -> f [RepositoryTrigger])
-> TestRepositoryTriggers
-> f TestRepositoryTriggers
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RepositoryTrigger] -> f [RepositoryTrigger])
-> [RepositoryTrigger] -> f [RepositoryTrigger]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest TestRepositoryTriggers where
  type
    AWSResponse TestRepositoryTriggers =
      TestRepositoryTriggersResponse
  request :: TestRepositoryTriggers -> Request TestRepositoryTriggers
request = Service -> TestRepositoryTriggers -> Request TestRepositoryTriggers
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy TestRepositoryTriggers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TestRepositoryTriggers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse TestRepositoryTriggers))
-> Logger
-> Service
-> Proxy TestRepositoryTriggers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TestRepositoryTriggers)))
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 [RepositoryTriggerExecutionFailure]
-> Maybe [Text] -> Int -> TestRepositoryTriggersResponse
TestRepositoryTriggersResponse'
            (Maybe [RepositoryTriggerExecutionFailure]
 -> Maybe [Text] -> Int -> TestRepositoryTriggersResponse)
-> Either String (Maybe [RepositoryTriggerExecutionFailure])
-> Either
     String (Maybe [Text] -> Int -> TestRepositoryTriggersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either
     String (Maybe (Maybe [RepositoryTriggerExecutionFailure]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failedExecutions"
                            Either String (Maybe (Maybe [RepositoryTriggerExecutionFailure]))
-> Maybe [RepositoryTriggerExecutionFailure]
-> Either String (Maybe [RepositoryTriggerExecutionFailure])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RepositoryTriggerExecutionFailure]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String (Maybe [Text] -> Int -> TestRepositoryTriggersResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> TestRepositoryTriggersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"successfulExecutions"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> TestRepositoryTriggersResponse)
-> Either String Int
-> Either String TestRepositoryTriggersResponse
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 TestRepositoryTriggers

instance Prelude.NFData TestRepositoryTriggers

instance Core.ToHeaders TestRepositoryTriggers where
  toHeaders :: TestRepositoryTriggers -> ResponseHeaders
toHeaders =
    ResponseHeaders -> TestRepositoryTriggers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeCommit_20150413.TestRepositoryTriggers" ::
                          Prelude.ByteString
                      ),
            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 TestRepositoryTriggers where
  toJSON :: TestRepositoryTriggers -> Value
toJSON TestRepositoryTriggers' {[RepositoryTrigger]
Text
triggers :: [RepositoryTrigger]
repositoryName :: Text
$sel:triggers:TestRepositoryTriggers' :: TestRepositoryTriggers -> [RepositoryTrigger]
$sel:repositoryName:TestRepositoryTriggers' :: TestRepositoryTriggers -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"triggers" Text -> [RepositoryTrigger] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [RepositoryTrigger]
triggers)
          ]
      )

instance Core.ToPath TestRepositoryTriggers where
  toPath :: TestRepositoryTriggers -> ByteString
toPath = ByteString -> TestRepositoryTriggers -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | Represents the output of a test repository triggers operation.
--
-- /See:/ 'newTestRepositoryTriggersResponse' smart constructor.
data TestRepositoryTriggersResponse = TestRepositoryTriggersResponse'
  { -- | The list of triggers that were not tested. This list provides the names
    -- of the triggers that could not be tested, separated by commas.
    TestRepositoryTriggersResponse
-> Maybe [RepositoryTriggerExecutionFailure]
failedExecutions :: Prelude.Maybe [RepositoryTriggerExecutionFailure],
    -- | The list of triggers that were successfully tested. This list provides
    -- the names of the triggers that were successfully tested, separated by
    -- commas.
    TestRepositoryTriggersResponse -> Maybe [Text]
successfulExecutions :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    TestRepositoryTriggersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (TestRepositoryTriggersResponse
-> TestRepositoryTriggersResponse -> Bool
(TestRepositoryTriggersResponse
 -> TestRepositoryTriggersResponse -> Bool)
-> (TestRepositoryTriggersResponse
    -> TestRepositoryTriggersResponse -> Bool)
-> Eq TestRepositoryTriggersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestRepositoryTriggersResponse
-> TestRepositoryTriggersResponse -> Bool
$c/= :: TestRepositoryTriggersResponse
-> TestRepositoryTriggersResponse -> Bool
== :: TestRepositoryTriggersResponse
-> TestRepositoryTriggersResponse -> Bool
$c== :: TestRepositoryTriggersResponse
-> TestRepositoryTriggersResponse -> Bool
Prelude.Eq, ReadPrec [TestRepositoryTriggersResponse]
ReadPrec TestRepositoryTriggersResponse
Int -> ReadS TestRepositoryTriggersResponse
ReadS [TestRepositoryTriggersResponse]
(Int -> ReadS TestRepositoryTriggersResponse)
-> ReadS [TestRepositoryTriggersResponse]
-> ReadPrec TestRepositoryTriggersResponse
-> ReadPrec [TestRepositoryTriggersResponse]
-> Read TestRepositoryTriggersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestRepositoryTriggersResponse]
$creadListPrec :: ReadPrec [TestRepositoryTriggersResponse]
readPrec :: ReadPrec TestRepositoryTriggersResponse
$creadPrec :: ReadPrec TestRepositoryTriggersResponse
readList :: ReadS [TestRepositoryTriggersResponse]
$creadList :: ReadS [TestRepositoryTriggersResponse]
readsPrec :: Int -> ReadS TestRepositoryTriggersResponse
$creadsPrec :: Int -> ReadS TestRepositoryTriggersResponse
Prelude.Read, Int -> TestRepositoryTriggersResponse -> ShowS
[TestRepositoryTriggersResponse] -> ShowS
TestRepositoryTriggersResponse -> String
(Int -> TestRepositoryTriggersResponse -> ShowS)
-> (TestRepositoryTriggersResponse -> String)
-> ([TestRepositoryTriggersResponse] -> ShowS)
-> Show TestRepositoryTriggersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestRepositoryTriggersResponse] -> ShowS
$cshowList :: [TestRepositoryTriggersResponse] -> ShowS
show :: TestRepositoryTriggersResponse -> String
$cshow :: TestRepositoryTriggersResponse -> String
showsPrec :: Int -> TestRepositoryTriggersResponse -> ShowS
$cshowsPrec :: Int -> TestRepositoryTriggersResponse -> ShowS
Prelude.Show, (forall x.
 TestRepositoryTriggersResponse
 -> Rep TestRepositoryTriggersResponse x)
-> (forall x.
    Rep TestRepositoryTriggersResponse x
    -> TestRepositoryTriggersResponse)
-> Generic TestRepositoryTriggersResponse
forall x.
Rep TestRepositoryTriggersResponse x
-> TestRepositoryTriggersResponse
forall x.
TestRepositoryTriggersResponse
-> Rep TestRepositoryTriggersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TestRepositoryTriggersResponse x
-> TestRepositoryTriggersResponse
$cfrom :: forall x.
TestRepositoryTriggersResponse
-> Rep TestRepositoryTriggersResponse x
Prelude.Generic)

-- |
-- Create a value of 'TestRepositoryTriggersResponse' 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:
--
-- 'failedExecutions', 'testRepositoryTriggersResponse_failedExecutions' - The list of triggers that were not tested. This list provides the names
-- of the triggers that could not be tested, separated by commas.
--
-- 'successfulExecutions', 'testRepositoryTriggersResponse_successfulExecutions' - The list of triggers that were successfully tested. This list provides
-- the names of the triggers that were successfully tested, separated by
-- commas.
--
-- 'httpStatus', 'testRepositoryTriggersResponse_httpStatus' - The response's http status code.
newTestRepositoryTriggersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TestRepositoryTriggersResponse
newTestRepositoryTriggersResponse :: Int -> TestRepositoryTriggersResponse
newTestRepositoryTriggersResponse Int
pHttpStatus_ =
  TestRepositoryTriggersResponse' :: Maybe [RepositoryTriggerExecutionFailure]
-> Maybe [Text] -> Int -> TestRepositoryTriggersResponse
TestRepositoryTriggersResponse'
    { $sel:failedExecutions:TestRepositoryTriggersResponse' :: Maybe [RepositoryTriggerExecutionFailure]
failedExecutions =
        Maybe [RepositoryTriggerExecutionFailure]
forall a. Maybe a
Prelude.Nothing,
      $sel:successfulExecutions:TestRepositoryTriggersResponse' :: Maybe [Text]
successfulExecutions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:TestRepositoryTriggersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of triggers that were not tested. This list provides the names
-- of the triggers that could not be tested, separated by commas.
testRepositoryTriggersResponse_failedExecutions :: Lens.Lens' TestRepositoryTriggersResponse (Prelude.Maybe [RepositoryTriggerExecutionFailure])
testRepositoryTriggersResponse_failedExecutions :: (Maybe [RepositoryTriggerExecutionFailure]
 -> f (Maybe [RepositoryTriggerExecutionFailure]))
-> TestRepositoryTriggersResponse
-> f TestRepositoryTriggersResponse
testRepositoryTriggersResponse_failedExecutions = (TestRepositoryTriggersResponse
 -> Maybe [RepositoryTriggerExecutionFailure])
-> (TestRepositoryTriggersResponse
    -> Maybe [RepositoryTriggerExecutionFailure]
    -> TestRepositoryTriggersResponse)
-> Lens
     TestRepositoryTriggersResponse
     TestRepositoryTriggersResponse
     (Maybe [RepositoryTriggerExecutionFailure])
     (Maybe [RepositoryTriggerExecutionFailure])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestRepositoryTriggersResponse' {Maybe [RepositoryTriggerExecutionFailure]
failedExecutions :: Maybe [RepositoryTriggerExecutionFailure]
$sel:failedExecutions:TestRepositoryTriggersResponse' :: TestRepositoryTriggersResponse
-> Maybe [RepositoryTriggerExecutionFailure]
failedExecutions} -> Maybe [RepositoryTriggerExecutionFailure]
failedExecutions) (\s :: TestRepositoryTriggersResponse
s@TestRepositoryTriggersResponse' {} Maybe [RepositoryTriggerExecutionFailure]
a -> TestRepositoryTriggersResponse
s {$sel:failedExecutions:TestRepositoryTriggersResponse' :: Maybe [RepositoryTriggerExecutionFailure]
failedExecutions = Maybe [RepositoryTriggerExecutionFailure]
a} :: TestRepositoryTriggersResponse) ((Maybe [RepositoryTriggerExecutionFailure]
  -> f (Maybe [RepositoryTriggerExecutionFailure]))
 -> TestRepositoryTriggersResponse
 -> f TestRepositoryTriggersResponse)
-> ((Maybe [RepositoryTriggerExecutionFailure]
     -> f (Maybe [RepositoryTriggerExecutionFailure]))
    -> Maybe [RepositoryTriggerExecutionFailure]
    -> f (Maybe [RepositoryTriggerExecutionFailure]))
-> (Maybe [RepositoryTriggerExecutionFailure]
    -> f (Maybe [RepositoryTriggerExecutionFailure]))
-> TestRepositoryTriggersResponse
-> f TestRepositoryTriggersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RepositoryTriggerExecutionFailure]
  [RepositoryTriggerExecutionFailure]
  [RepositoryTriggerExecutionFailure]
  [RepositoryTriggerExecutionFailure]
-> Iso
     (Maybe [RepositoryTriggerExecutionFailure])
     (Maybe [RepositoryTriggerExecutionFailure])
     (Maybe [RepositoryTriggerExecutionFailure])
     (Maybe [RepositoryTriggerExecutionFailure])
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
  [RepositoryTriggerExecutionFailure]
  [RepositoryTriggerExecutionFailure]
  [RepositoryTriggerExecutionFailure]
  [RepositoryTriggerExecutionFailure]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of triggers that were successfully tested. This list provides
-- the names of the triggers that were successfully tested, separated by
-- commas.
testRepositoryTriggersResponse_successfulExecutions :: Lens.Lens' TestRepositoryTriggersResponse (Prelude.Maybe [Prelude.Text])
testRepositoryTriggersResponse_successfulExecutions :: (Maybe [Text] -> f (Maybe [Text]))
-> TestRepositoryTriggersResponse
-> f TestRepositoryTriggersResponse
testRepositoryTriggersResponse_successfulExecutions = (TestRepositoryTriggersResponse -> Maybe [Text])
-> (TestRepositoryTriggersResponse
    -> Maybe [Text] -> TestRepositoryTriggersResponse)
-> Lens
     TestRepositoryTriggersResponse
     TestRepositoryTriggersResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestRepositoryTriggersResponse' {Maybe [Text]
successfulExecutions :: Maybe [Text]
$sel:successfulExecutions:TestRepositoryTriggersResponse' :: TestRepositoryTriggersResponse -> Maybe [Text]
successfulExecutions} -> Maybe [Text]
successfulExecutions) (\s :: TestRepositoryTriggersResponse
s@TestRepositoryTriggersResponse' {} Maybe [Text]
a -> TestRepositoryTriggersResponse
s {$sel:successfulExecutions:TestRepositoryTriggersResponse' :: Maybe [Text]
successfulExecutions = Maybe [Text]
a} :: TestRepositoryTriggersResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> TestRepositoryTriggersResponse
 -> f TestRepositoryTriggersResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> TestRepositoryTriggersResponse
-> f TestRepositoryTriggersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    TestRepositoryTriggersResponse