{-# 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.CloudFront.TestFunction
-- 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 a CloudFront function.
--
-- To test a function, you provide an /event object/ that represents an
-- HTTP request or response that your CloudFront distribution could receive
-- in production. CloudFront runs the function, passing it the event object
-- that you provided, and returns the function’s result (the modified event
-- object) in the response. The response also contains function logs and
-- error messages, if any exist. For more information about testing
-- functions, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/managing-functions.html#test-function Testing functions>
-- in the /Amazon CloudFront Developer Guide/.
--
-- To test a function, you provide the function’s name and version (@ETag@
-- value) along with the event object. To get the function’s name and
-- version, you can use @ListFunctions@ and @DescribeFunction@.
module Amazonka.CloudFront.TestFunction
  ( -- * Creating a Request
    TestFunction (..),
    newTestFunction,

    -- * Request Lenses
    testFunction_stage,
    testFunction_name,
    testFunction_ifMatch,
    testFunction_eventObject,

    -- * Destructuring the Response
    TestFunctionResponse (..),
    newTestFunctionResponse,

    -- * Response Lenses
    testFunctionResponse_testResult,
    testFunctionResponse_httpStatus,
  )
where

import Amazonka.CloudFront.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

-- | /See:/ 'newTestFunction' smart constructor.
data TestFunction = TestFunction'
  { -- | The stage of the function that you are testing, either @DEVELOPMENT@ or
    -- @LIVE@.
    TestFunction -> Maybe FunctionStage
stage :: Prelude.Maybe FunctionStage,
    -- | The name of the function that you are testing.
    TestFunction -> Text
name :: Prelude.Text,
    -- | The current version (@ETag@ value) of the function that you are testing,
    -- which you can get using @DescribeFunction@.
    TestFunction -> Text
ifMatch :: Prelude.Text,
    -- | The event object to test the function with. For more information about
    -- the structure of the event object, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/managing-functions.html#test-function Testing functions>
    -- in the /Amazon CloudFront Developer Guide/.
    TestFunction -> Sensitive Base64
eventObject :: Core.Sensitive Core.Base64
  }
  deriving (TestFunction -> TestFunction -> Bool
(TestFunction -> TestFunction -> Bool)
-> (TestFunction -> TestFunction -> Bool) -> Eq TestFunction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestFunction -> TestFunction -> Bool
$c/= :: TestFunction -> TestFunction -> Bool
== :: TestFunction -> TestFunction -> Bool
$c== :: TestFunction -> TestFunction -> Bool
Prelude.Eq, Int -> TestFunction -> ShowS
[TestFunction] -> ShowS
TestFunction -> String
(Int -> TestFunction -> ShowS)
-> (TestFunction -> String)
-> ([TestFunction] -> ShowS)
-> Show TestFunction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestFunction] -> ShowS
$cshowList :: [TestFunction] -> ShowS
show :: TestFunction -> String
$cshow :: TestFunction -> String
showsPrec :: Int -> TestFunction -> ShowS
$cshowsPrec :: Int -> TestFunction -> ShowS
Prelude.Show, (forall x. TestFunction -> Rep TestFunction x)
-> (forall x. Rep TestFunction x -> TestFunction)
-> Generic TestFunction
forall x. Rep TestFunction x -> TestFunction
forall x. TestFunction -> Rep TestFunction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestFunction x -> TestFunction
$cfrom :: forall x. TestFunction -> Rep TestFunction x
Prelude.Generic)

-- |
-- Create a value of 'TestFunction' 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:
--
-- 'stage', 'testFunction_stage' - The stage of the function that you are testing, either @DEVELOPMENT@ or
-- @LIVE@.
--
-- 'name', 'testFunction_name' - The name of the function that you are testing.
--
-- 'ifMatch', 'testFunction_ifMatch' - The current version (@ETag@ value) of the function that you are testing,
-- which you can get using @DescribeFunction@.
--
-- 'eventObject', 'testFunction_eventObject' - The event object to test the function with. For more information about
-- the structure of the event object, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/managing-functions.html#test-function Testing functions>
-- in the /Amazon CloudFront Developer Guide/.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
newTestFunction ::
  -- | 'name'
  Prelude.Text ->
  -- | 'ifMatch'
  Prelude.Text ->
  -- | 'eventObject'
  Prelude.ByteString ->
  TestFunction
newTestFunction :: Text -> Text -> ByteString -> TestFunction
newTestFunction Text
pName_ Text
pIfMatch_ ByteString
pEventObject_ =
  TestFunction' :: Maybe FunctionStage
-> Text -> Text -> Sensitive Base64 -> TestFunction
TestFunction'
    { $sel:stage:TestFunction' :: Maybe FunctionStage
stage = Maybe FunctionStage
forall a. Maybe a
Prelude.Nothing,
      $sel:name:TestFunction' :: Text
name = Text
pName_,
      $sel:ifMatch:TestFunction' :: Text
ifMatch = Text
pIfMatch_,
      $sel:eventObject:TestFunction' :: Sensitive Base64
eventObject =
        Tagged Base64 (Identity Base64)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Base64 (Identity Base64)
 -> Tagged (Sensitive Base64) (Identity (Sensitive Base64)))
-> (Tagged ByteString (Identity ByteString)
    -> Tagged Base64 (Identity Base64))
-> Tagged ByteString (Identity ByteString)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64
          (Tagged ByteString (Identity ByteString)
 -> Tagged (Sensitive Base64) (Identity (Sensitive Base64)))
-> ByteString -> Sensitive Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pEventObject_
    }

-- | The stage of the function that you are testing, either @DEVELOPMENT@ or
-- @LIVE@.
testFunction_stage :: Lens.Lens' TestFunction (Prelude.Maybe FunctionStage)
testFunction_stage :: (Maybe FunctionStage -> f (Maybe FunctionStage))
-> TestFunction -> f TestFunction
testFunction_stage = (TestFunction -> Maybe FunctionStage)
-> (TestFunction -> Maybe FunctionStage -> TestFunction)
-> Lens
     TestFunction
     TestFunction
     (Maybe FunctionStage)
     (Maybe FunctionStage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestFunction' {Maybe FunctionStage
stage :: Maybe FunctionStage
$sel:stage:TestFunction' :: TestFunction -> Maybe FunctionStage
stage} -> Maybe FunctionStage
stage) (\s :: TestFunction
s@TestFunction' {} Maybe FunctionStage
a -> TestFunction
s {$sel:stage:TestFunction' :: Maybe FunctionStage
stage = Maybe FunctionStage
a} :: TestFunction)

-- | The name of the function that you are testing.
testFunction_name :: Lens.Lens' TestFunction Prelude.Text
testFunction_name :: (Text -> f Text) -> TestFunction -> f TestFunction
testFunction_name = (TestFunction -> Text)
-> (TestFunction -> Text -> TestFunction)
-> Lens TestFunction TestFunction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestFunction' {Text
name :: Text
$sel:name:TestFunction' :: TestFunction -> Text
name} -> Text
name) (\s :: TestFunction
s@TestFunction' {} Text
a -> TestFunction
s {$sel:name:TestFunction' :: Text
name = Text
a} :: TestFunction)

-- | The current version (@ETag@ value) of the function that you are testing,
-- which you can get using @DescribeFunction@.
testFunction_ifMatch :: Lens.Lens' TestFunction Prelude.Text
testFunction_ifMatch :: (Text -> f Text) -> TestFunction -> f TestFunction
testFunction_ifMatch = (TestFunction -> Text)
-> (TestFunction -> Text -> TestFunction)
-> Lens TestFunction TestFunction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestFunction' {Text
ifMatch :: Text
$sel:ifMatch:TestFunction' :: TestFunction -> Text
ifMatch} -> Text
ifMatch) (\s :: TestFunction
s@TestFunction' {} Text
a -> TestFunction
s {$sel:ifMatch:TestFunction' :: Text
ifMatch = Text
a} :: TestFunction)

-- | The event object to test the function with. For more information about
-- the structure of the event object, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/managing-functions.html#test-function Testing functions>
-- in the /Amazon CloudFront Developer Guide/.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
testFunction_eventObject :: Lens.Lens' TestFunction Prelude.ByteString
testFunction_eventObject :: (ByteString -> f ByteString) -> TestFunction -> f TestFunction
testFunction_eventObject = (TestFunction -> Sensitive Base64)
-> (TestFunction -> Sensitive Base64 -> TestFunction)
-> Lens
     TestFunction TestFunction (Sensitive Base64) (Sensitive Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestFunction' {Sensitive Base64
eventObject :: Sensitive Base64
$sel:eventObject:TestFunction' :: TestFunction -> Sensitive Base64
eventObject} -> Sensitive Base64
eventObject) (\s :: TestFunction
s@TestFunction' {} Sensitive Base64
a -> TestFunction
s {$sel:eventObject:TestFunction' :: Sensitive Base64
eventObject = Sensitive Base64
a} :: TestFunction) ((Sensitive Base64 -> f (Sensitive Base64))
 -> TestFunction -> f TestFunction)
-> ((ByteString -> f ByteString)
    -> Sensitive Base64 -> f (Sensitive Base64))
-> (ByteString -> f ByteString)
-> TestFunction
-> f TestFunction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Base64 -> f Base64) -> Sensitive Base64 -> f (Sensitive Base64)
forall a. Iso' (Sensitive a) a
Core._Sensitive ((Base64 -> f Base64) -> Sensitive Base64 -> f (Sensitive Base64))
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> Sensitive Base64
-> f (Sensitive Base64)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64

instance Core.AWSRequest TestFunction where
  type AWSResponse TestFunction = TestFunctionResponse
  request :: TestFunction -> Request TestFunction
request = Service -> TestFunction -> Request TestFunction
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy TestFunction
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TestFunction)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse TestFunction))
-> Logger
-> Service
-> Proxy TestFunction
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TestFunction)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe TestResult -> Int -> TestFunctionResponse
TestFunctionResponse'
            (Maybe TestResult -> Int -> TestFunctionResponse)
-> Either String (Maybe TestResult)
-> Either String (Int -> TestFunctionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe TestResult)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either String (Int -> TestFunctionResponse)
-> Either String Int -> Either String TestFunctionResponse
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 TestFunction

instance Prelude.NFData TestFunction

instance Core.ToElement TestFunction where
  toElement :: TestFunction -> Element
toElement =
    Name -> TestFunction -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{http://cloudfront.amazonaws.com/doc/2020-05-31/}TestFunctionRequest"

instance Core.ToHeaders TestFunction where
  toHeaders :: TestFunction -> ResponseHeaders
toHeaders TestFunction' {Maybe FunctionStage
Text
Sensitive Base64
eventObject :: Sensitive Base64
ifMatch :: Text
name :: Text
stage :: Maybe FunctionStage
$sel:eventObject:TestFunction' :: TestFunction -> Sensitive Base64
$sel:ifMatch:TestFunction' :: TestFunction -> Text
$sel:name:TestFunction' :: TestFunction -> Text
$sel:stage:TestFunction' :: TestFunction -> Maybe FunctionStage
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat [HeaderName
"If-Match" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
ifMatch]

instance Core.ToPath TestFunction where
  toPath :: TestFunction -> ByteString
toPath TestFunction' {Maybe FunctionStage
Text
Sensitive Base64
eventObject :: Sensitive Base64
ifMatch :: Text
name :: Text
stage :: Maybe FunctionStage
$sel:eventObject:TestFunction' :: TestFunction -> Sensitive Base64
$sel:ifMatch:TestFunction' :: TestFunction -> Text
$sel:name:TestFunction' :: TestFunction -> Text
$sel:stage:TestFunction' :: TestFunction -> Maybe FunctionStage
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2020-05-31/function/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name, ByteString
"/test"]

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

instance Core.ToXML TestFunction where
  toXML :: TestFunction -> XML
toXML TestFunction' {Maybe FunctionStage
Text
Sensitive Base64
eventObject :: Sensitive Base64
ifMatch :: Text
name :: Text
stage :: Maybe FunctionStage
$sel:eventObject:TestFunction' :: TestFunction -> Sensitive Base64
$sel:ifMatch:TestFunction' :: TestFunction -> Text
$sel:name:TestFunction' :: TestFunction -> Text
$sel:stage:TestFunction' :: TestFunction -> Maybe FunctionStage
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"Stage" Name -> Maybe FunctionStage -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe FunctionStage
stage,
        Name
"EventObject" Name -> Sensitive Base64 -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Sensitive Base64
eventObject
      ]

-- | /See:/ 'newTestFunctionResponse' smart constructor.
data TestFunctionResponse = TestFunctionResponse'
  { -- | An object that represents the result of running the function with the
    -- provided event object.
    TestFunctionResponse -> Maybe TestResult
testResult :: Prelude.Maybe TestResult,
    -- | The response's http status code.
    TestFunctionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (TestFunctionResponse -> TestFunctionResponse -> Bool
(TestFunctionResponse -> TestFunctionResponse -> Bool)
-> (TestFunctionResponse -> TestFunctionResponse -> Bool)
-> Eq TestFunctionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestFunctionResponse -> TestFunctionResponse -> Bool
$c/= :: TestFunctionResponse -> TestFunctionResponse -> Bool
== :: TestFunctionResponse -> TestFunctionResponse -> Bool
$c== :: TestFunctionResponse -> TestFunctionResponse -> Bool
Prelude.Eq, ReadPrec [TestFunctionResponse]
ReadPrec TestFunctionResponse
Int -> ReadS TestFunctionResponse
ReadS [TestFunctionResponse]
(Int -> ReadS TestFunctionResponse)
-> ReadS [TestFunctionResponse]
-> ReadPrec TestFunctionResponse
-> ReadPrec [TestFunctionResponse]
-> Read TestFunctionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestFunctionResponse]
$creadListPrec :: ReadPrec [TestFunctionResponse]
readPrec :: ReadPrec TestFunctionResponse
$creadPrec :: ReadPrec TestFunctionResponse
readList :: ReadS [TestFunctionResponse]
$creadList :: ReadS [TestFunctionResponse]
readsPrec :: Int -> ReadS TestFunctionResponse
$creadsPrec :: Int -> ReadS TestFunctionResponse
Prelude.Read, Int -> TestFunctionResponse -> ShowS
[TestFunctionResponse] -> ShowS
TestFunctionResponse -> String
(Int -> TestFunctionResponse -> ShowS)
-> (TestFunctionResponse -> String)
-> ([TestFunctionResponse] -> ShowS)
-> Show TestFunctionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestFunctionResponse] -> ShowS
$cshowList :: [TestFunctionResponse] -> ShowS
show :: TestFunctionResponse -> String
$cshow :: TestFunctionResponse -> String
showsPrec :: Int -> TestFunctionResponse -> ShowS
$cshowsPrec :: Int -> TestFunctionResponse -> ShowS
Prelude.Show, (forall x. TestFunctionResponse -> Rep TestFunctionResponse x)
-> (forall x. Rep TestFunctionResponse x -> TestFunctionResponse)
-> Generic TestFunctionResponse
forall x. Rep TestFunctionResponse x -> TestFunctionResponse
forall x. TestFunctionResponse -> Rep TestFunctionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestFunctionResponse x -> TestFunctionResponse
$cfrom :: forall x. TestFunctionResponse -> Rep TestFunctionResponse x
Prelude.Generic)

-- |
-- Create a value of 'TestFunctionResponse' 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:
--
-- 'testResult', 'testFunctionResponse_testResult' - An object that represents the result of running the function with the
-- provided event object.
--
-- 'httpStatus', 'testFunctionResponse_httpStatus' - The response's http status code.
newTestFunctionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TestFunctionResponse
newTestFunctionResponse :: Int -> TestFunctionResponse
newTestFunctionResponse Int
pHttpStatus_ =
  TestFunctionResponse' :: Maybe TestResult -> Int -> TestFunctionResponse
TestFunctionResponse'
    { $sel:testResult:TestFunctionResponse' :: Maybe TestResult
testResult = Maybe TestResult
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:TestFunctionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An object that represents the result of running the function with the
-- provided event object.
testFunctionResponse_testResult :: Lens.Lens' TestFunctionResponse (Prelude.Maybe TestResult)
testFunctionResponse_testResult :: (Maybe TestResult -> f (Maybe TestResult))
-> TestFunctionResponse -> f TestFunctionResponse
testFunctionResponse_testResult = (TestFunctionResponse -> Maybe TestResult)
-> (TestFunctionResponse
    -> Maybe TestResult -> TestFunctionResponse)
-> Lens
     TestFunctionResponse
     TestFunctionResponse
     (Maybe TestResult)
     (Maybe TestResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestFunctionResponse' {Maybe TestResult
testResult :: Maybe TestResult
$sel:testResult:TestFunctionResponse' :: TestFunctionResponse -> Maybe TestResult
testResult} -> Maybe TestResult
testResult) (\s :: TestFunctionResponse
s@TestFunctionResponse' {} Maybe TestResult
a -> TestFunctionResponse
s {$sel:testResult:TestFunctionResponse' :: Maybe TestResult
testResult = Maybe TestResult
a} :: TestFunctionResponse)

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

instance Prelude.NFData TestFunctionResponse