{-# 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.WorkMail.TestAvailabilityConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Performs a test on an availability provider to ensure that access is
-- allowed. For EWS, it verifies the provided credentials can be used to
-- successfully log in. For Lambda, it verifies that the Lambda function
-- can be invoked and that the resource access policy was configured to
-- deny anonymous access. An anonymous invocation is one done without
-- providing either a @SourceArn@ or @SourceAccount@ header.
--
-- The request must contain either one provider definition (@EwsProvider@
-- or @LambdaProvider@) or the @DomainName@ parameter. If the @DomainName@
-- parameter is provided, the configuration stored under the @DomainName@
-- will be tested.
module Amazonka.WorkMail.TestAvailabilityConfiguration
  ( -- * Creating a Request
    TestAvailabilityConfiguration (..),
    newTestAvailabilityConfiguration,

    -- * Request Lenses
    testAvailabilityConfiguration_domainName,
    testAvailabilityConfiguration_ewsProvider,
    testAvailabilityConfiguration_lambdaProvider,
    testAvailabilityConfiguration_organizationId,

    -- * Destructuring the Response
    TestAvailabilityConfigurationResponse (..),
    newTestAvailabilityConfigurationResponse,

    -- * Response Lenses
    testAvailabilityConfigurationResponse_failureReason,
    testAvailabilityConfigurationResponse_testPassed,
    testAvailabilityConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkMail.Types

-- | /See:/ 'newTestAvailabilityConfiguration' smart constructor.
data TestAvailabilityConfiguration = TestAvailabilityConfiguration'
  { -- | The domain to which the provider applies. If this field is provided, a
    -- stored availability provider associated to this domain name will be
    -- tested.
    TestAvailabilityConfiguration -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    TestAvailabilityConfiguration -> Maybe EwsAvailabilityProvider
ewsProvider :: Prelude.Maybe EwsAvailabilityProvider,
    TestAvailabilityConfiguration -> Maybe LambdaAvailabilityProvider
lambdaProvider :: Prelude.Maybe LambdaAvailabilityProvider,
    -- | The WorkMail organization where the availability provider will be
    -- tested.
    TestAvailabilityConfiguration -> Text
organizationId :: Prelude.Text
  }
  deriving (TestAvailabilityConfiguration
-> TestAvailabilityConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestAvailabilityConfiguration
-> TestAvailabilityConfiguration -> Bool
$c/= :: TestAvailabilityConfiguration
-> TestAvailabilityConfiguration -> Bool
== :: TestAvailabilityConfiguration
-> TestAvailabilityConfiguration -> Bool
$c== :: TestAvailabilityConfiguration
-> TestAvailabilityConfiguration -> Bool
Prelude.Eq, Int -> TestAvailabilityConfiguration -> ShowS
[TestAvailabilityConfiguration] -> ShowS
TestAvailabilityConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestAvailabilityConfiguration] -> ShowS
$cshowList :: [TestAvailabilityConfiguration] -> ShowS
show :: TestAvailabilityConfiguration -> String
$cshow :: TestAvailabilityConfiguration -> String
showsPrec :: Int -> TestAvailabilityConfiguration -> ShowS
$cshowsPrec :: Int -> TestAvailabilityConfiguration -> ShowS
Prelude.Show, forall x.
Rep TestAvailabilityConfiguration x
-> TestAvailabilityConfiguration
forall x.
TestAvailabilityConfiguration
-> Rep TestAvailabilityConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TestAvailabilityConfiguration x
-> TestAvailabilityConfiguration
$cfrom :: forall x.
TestAvailabilityConfiguration
-> Rep TestAvailabilityConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'TestAvailabilityConfiguration' 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:
--
-- 'domainName', 'testAvailabilityConfiguration_domainName' - The domain to which the provider applies. If this field is provided, a
-- stored availability provider associated to this domain name will be
-- tested.
--
-- 'ewsProvider', 'testAvailabilityConfiguration_ewsProvider' - Undocumented member.
--
-- 'lambdaProvider', 'testAvailabilityConfiguration_lambdaProvider' - Undocumented member.
--
-- 'organizationId', 'testAvailabilityConfiguration_organizationId' - The WorkMail organization where the availability provider will be
-- tested.
newTestAvailabilityConfiguration ::
  -- | 'organizationId'
  Prelude.Text ->
  TestAvailabilityConfiguration
newTestAvailabilityConfiguration :: Text -> TestAvailabilityConfiguration
newTestAvailabilityConfiguration Text
pOrganizationId_ =
  TestAvailabilityConfiguration'
    { $sel:domainName:TestAvailabilityConfiguration' :: Maybe Text
domainName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ewsProvider:TestAvailabilityConfiguration' :: Maybe EwsAvailabilityProvider
ewsProvider = forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaProvider:TestAvailabilityConfiguration' :: Maybe LambdaAvailabilityProvider
lambdaProvider = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationId:TestAvailabilityConfiguration' :: Text
organizationId = Text
pOrganizationId_
    }

-- | The domain to which the provider applies. If this field is provided, a
-- stored availability provider associated to this domain name will be
-- tested.
testAvailabilityConfiguration_domainName :: Lens.Lens' TestAvailabilityConfiguration (Prelude.Maybe Prelude.Text)
testAvailabilityConfiguration_domainName :: Lens' TestAvailabilityConfiguration (Maybe Text)
testAvailabilityConfiguration_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestAvailabilityConfiguration' {Maybe Text
domainName :: Maybe Text
$sel:domainName:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: TestAvailabilityConfiguration
s@TestAvailabilityConfiguration' {} Maybe Text
a -> TestAvailabilityConfiguration
s {$sel:domainName:TestAvailabilityConfiguration' :: Maybe Text
domainName = Maybe Text
a} :: TestAvailabilityConfiguration)

-- | Undocumented member.
testAvailabilityConfiguration_ewsProvider :: Lens.Lens' TestAvailabilityConfiguration (Prelude.Maybe EwsAvailabilityProvider)
testAvailabilityConfiguration_ewsProvider :: Lens' TestAvailabilityConfiguration (Maybe EwsAvailabilityProvider)
testAvailabilityConfiguration_ewsProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestAvailabilityConfiguration' {Maybe EwsAvailabilityProvider
ewsProvider :: Maybe EwsAvailabilityProvider
$sel:ewsProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe EwsAvailabilityProvider
ewsProvider} -> Maybe EwsAvailabilityProvider
ewsProvider) (\s :: TestAvailabilityConfiguration
s@TestAvailabilityConfiguration' {} Maybe EwsAvailabilityProvider
a -> TestAvailabilityConfiguration
s {$sel:ewsProvider:TestAvailabilityConfiguration' :: Maybe EwsAvailabilityProvider
ewsProvider = Maybe EwsAvailabilityProvider
a} :: TestAvailabilityConfiguration)

-- | Undocumented member.
testAvailabilityConfiguration_lambdaProvider :: Lens.Lens' TestAvailabilityConfiguration (Prelude.Maybe LambdaAvailabilityProvider)
testAvailabilityConfiguration_lambdaProvider :: Lens'
  TestAvailabilityConfiguration (Maybe LambdaAvailabilityProvider)
testAvailabilityConfiguration_lambdaProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestAvailabilityConfiguration' {Maybe LambdaAvailabilityProvider
lambdaProvider :: Maybe LambdaAvailabilityProvider
$sel:lambdaProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe LambdaAvailabilityProvider
lambdaProvider} -> Maybe LambdaAvailabilityProvider
lambdaProvider) (\s :: TestAvailabilityConfiguration
s@TestAvailabilityConfiguration' {} Maybe LambdaAvailabilityProvider
a -> TestAvailabilityConfiguration
s {$sel:lambdaProvider:TestAvailabilityConfiguration' :: Maybe LambdaAvailabilityProvider
lambdaProvider = Maybe LambdaAvailabilityProvider
a} :: TestAvailabilityConfiguration)

-- | The WorkMail organization where the availability provider will be
-- tested.
testAvailabilityConfiguration_organizationId :: Lens.Lens' TestAvailabilityConfiguration Prelude.Text
testAvailabilityConfiguration_organizationId :: Lens' TestAvailabilityConfiguration Text
testAvailabilityConfiguration_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestAvailabilityConfiguration' {Text
organizationId :: Text
$sel:organizationId:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Text
organizationId} -> Text
organizationId) (\s :: TestAvailabilityConfiguration
s@TestAvailabilityConfiguration' {} Text
a -> TestAvailabilityConfiguration
s {$sel:organizationId:TestAvailabilityConfiguration' :: Text
organizationId = Text
a} :: TestAvailabilityConfiguration)

instance
  Core.AWSRequest
    TestAvailabilityConfiguration
  where
  type
    AWSResponse TestAvailabilityConfiguration =
      TestAvailabilityConfigurationResponse
  request :: (Service -> Service)
-> TestAvailabilityConfiguration
-> Request TestAvailabilityConfiguration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy TestAvailabilityConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TestAvailabilityConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Bool -> Int -> TestAvailabilityConfigurationResponse
TestAvailabilityConfigurationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FailureReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TestPassed")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    TestAvailabilityConfiguration
  where
  hashWithSalt :: Int -> TestAvailabilityConfiguration -> Int
hashWithSalt Int
_salt TestAvailabilityConfiguration' {Maybe Text
Maybe EwsAvailabilityProvider
Maybe LambdaAvailabilityProvider
Text
organizationId :: Text
lambdaProvider :: Maybe LambdaAvailabilityProvider
ewsProvider :: Maybe EwsAvailabilityProvider
domainName :: Maybe Text
$sel:organizationId:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Text
$sel:lambdaProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe LambdaAvailabilityProvider
$sel:ewsProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe EwsAvailabilityProvider
$sel:domainName:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EwsAvailabilityProvider
ewsProvider
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LambdaAvailabilityProvider
lambdaProvider
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId

instance Prelude.NFData TestAvailabilityConfiguration where
  rnf :: TestAvailabilityConfiguration -> ()
rnf TestAvailabilityConfiguration' {Maybe Text
Maybe EwsAvailabilityProvider
Maybe LambdaAvailabilityProvider
Text
organizationId :: Text
lambdaProvider :: Maybe LambdaAvailabilityProvider
ewsProvider :: Maybe EwsAvailabilityProvider
domainName :: Maybe Text
$sel:organizationId:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Text
$sel:lambdaProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe LambdaAvailabilityProvider
$sel:ewsProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe EwsAvailabilityProvider
$sel:domainName:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EwsAvailabilityProvider
ewsProvider
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LambdaAvailabilityProvider
lambdaProvider
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId

instance Data.ToHeaders TestAvailabilityConfiguration where
  toHeaders :: TestAvailabilityConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.TestAvailabilityConfiguration" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON TestAvailabilityConfiguration where
  toJSON :: TestAvailabilityConfiguration -> Value
toJSON TestAvailabilityConfiguration' {Maybe Text
Maybe EwsAvailabilityProvider
Maybe LambdaAvailabilityProvider
Text
organizationId :: Text
lambdaProvider :: Maybe LambdaAvailabilityProvider
ewsProvider :: Maybe EwsAvailabilityProvider
domainName :: Maybe Text
$sel:organizationId:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Text
$sel:lambdaProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe LambdaAvailabilityProvider
$sel:ewsProvider:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe EwsAvailabilityProvider
$sel:domainName:TestAvailabilityConfiguration' :: TestAvailabilityConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DomainName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
domainName,
            (Key
"EwsProvider" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EwsAvailabilityProvider
ewsProvider,
            (Key
"LambdaProvider" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaAvailabilityProvider
lambdaProvider,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId)
          ]
      )

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

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

-- | /See:/ 'newTestAvailabilityConfigurationResponse' smart constructor.
data TestAvailabilityConfigurationResponse = TestAvailabilityConfigurationResponse'
  { -- | String containing the reason for a failed test if @TestPassed@ is false.
    TestAvailabilityConfigurationResponse -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | Boolean indicating whether the test passed or failed.
    TestAvailabilityConfigurationResponse -> Maybe Bool
testPassed :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    TestAvailabilityConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (TestAvailabilityConfigurationResponse
-> TestAvailabilityConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestAvailabilityConfigurationResponse
-> TestAvailabilityConfigurationResponse -> Bool
$c/= :: TestAvailabilityConfigurationResponse
-> TestAvailabilityConfigurationResponse -> Bool
== :: TestAvailabilityConfigurationResponse
-> TestAvailabilityConfigurationResponse -> Bool
$c== :: TestAvailabilityConfigurationResponse
-> TestAvailabilityConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [TestAvailabilityConfigurationResponse]
ReadPrec TestAvailabilityConfigurationResponse
Int -> ReadS TestAvailabilityConfigurationResponse
ReadS [TestAvailabilityConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestAvailabilityConfigurationResponse]
$creadListPrec :: ReadPrec [TestAvailabilityConfigurationResponse]
readPrec :: ReadPrec TestAvailabilityConfigurationResponse
$creadPrec :: ReadPrec TestAvailabilityConfigurationResponse
readList :: ReadS [TestAvailabilityConfigurationResponse]
$creadList :: ReadS [TestAvailabilityConfigurationResponse]
readsPrec :: Int -> ReadS TestAvailabilityConfigurationResponse
$creadsPrec :: Int -> ReadS TestAvailabilityConfigurationResponse
Prelude.Read, Int -> TestAvailabilityConfigurationResponse -> ShowS
[TestAvailabilityConfigurationResponse] -> ShowS
TestAvailabilityConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestAvailabilityConfigurationResponse] -> ShowS
$cshowList :: [TestAvailabilityConfigurationResponse] -> ShowS
show :: TestAvailabilityConfigurationResponse -> String
$cshow :: TestAvailabilityConfigurationResponse -> String
showsPrec :: Int -> TestAvailabilityConfigurationResponse -> ShowS
$cshowsPrec :: Int -> TestAvailabilityConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep TestAvailabilityConfigurationResponse x
-> TestAvailabilityConfigurationResponse
forall x.
TestAvailabilityConfigurationResponse
-> Rep TestAvailabilityConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TestAvailabilityConfigurationResponse x
-> TestAvailabilityConfigurationResponse
$cfrom :: forall x.
TestAvailabilityConfigurationResponse
-> Rep TestAvailabilityConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'TestAvailabilityConfigurationResponse' 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:
--
-- 'failureReason', 'testAvailabilityConfigurationResponse_failureReason' - String containing the reason for a failed test if @TestPassed@ is false.
--
-- 'testPassed', 'testAvailabilityConfigurationResponse_testPassed' - Boolean indicating whether the test passed or failed.
--
-- 'httpStatus', 'testAvailabilityConfigurationResponse_httpStatus' - The response's http status code.
newTestAvailabilityConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TestAvailabilityConfigurationResponse
newTestAvailabilityConfigurationResponse :: Int -> TestAvailabilityConfigurationResponse
newTestAvailabilityConfigurationResponse Int
pHttpStatus_ =
  TestAvailabilityConfigurationResponse'
    { $sel:failureReason:TestAvailabilityConfigurationResponse' :: Maybe Text
failureReason =
        forall a. Maybe a
Prelude.Nothing,
      $sel:testPassed:TestAvailabilityConfigurationResponse' :: Maybe Bool
testPassed = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:TestAvailabilityConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | String containing the reason for a failed test if @TestPassed@ is false.
testAvailabilityConfigurationResponse_failureReason :: Lens.Lens' TestAvailabilityConfigurationResponse (Prelude.Maybe Prelude.Text)
testAvailabilityConfigurationResponse_failureReason :: Lens' TestAvailabilityConfigurationResponse (Maybe Text)
testAvailabilityConfigurationResponse_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestAvailabilityConfigurationResponse' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:TestAvailabilityConfigurationResponse' :: TestAvailabilityConfigurationResponse -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: TestAvailabilityConfigurationResponse
s@TestAvailabilityConfigurationResponse' {} Maybe Text
a -> TestAvailabilityConfigurationResponse
s {$sel:failureReason:TestAvailabilityConfigurationResponse' :: Maybe Text
failureReason = Maybe Text
a} :: TestAvailabilityConfigurationResponse)

-- | Boolean indicating whether the test passed or failed.
testAvailabilityConfigurationResponse_testPassed :: Lens.Lens' TestAvailabilityConfigurationResponse (Prelude.Maybe Prelude.Bool)
testAvailabilityConfigurationResponse_testPassed :: Lens' TestAvailabilityConfigurationResponse (Maybe Bool)
testAvailabilityConfigurationResponse_testPassed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestAvailabilityConfigurationResponse' {Maybe Bool
testPassed :: Maybe Bool
$sel:testPassed:TestAvailabilityConfigurationResponse' :: TestAvailabilityConfigurationResponse -> Maybe Bool
testPassed} -> Maybe Bool
testPassed) (\s :: TestAvailabilityConfigurationResponse
s@TestAvailabilityConfigurationResponse' {} Maybe Bool
a -> TestAvailabilityConfigurationResponse
s {$sel:testPassed:TestAvailabilityConfigurationResponse' :: Maybe Bool
testPassed = Maybe Bool
a} :: TestAvailabilityConfigurationResponse)

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

instance
  Prelude.NFData
    TestAvailabilityConfigurationResponse
  where
  rnf :: TestAvailabilityConfigurationResponse -> ()
rnf TestAvailabilityConfigurationResponse' {Int
Maybe Bool
Maybe Text
httpStatus :: Int
testPassed :: Maybe Bool
failureReason :: Maybe Text
$sel:httpStatus:TestAvailabilityConfigurationResponse' :: TestAvailabilityConfigurationResponse -> Int
$sel:testPassed:TestAvailabilityConfigurationResponse' :: TestAvailabilityConfigurationResponse -> Maybe Bool
$sel:failureReason:TestAvailabilityConfigurationResponse' :: TestAvailabilityConfigurationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
testPassed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus