{-# 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.PinpointEmail.CreateDeliverabilityTestReport
-- 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)
--
-- Create a new predictive inbox placement test. Predictive inbox placement
-- tests can help you predict how your messages will be handled by various
-- email providers around the world. When you perform a predictive inbox
-- placement test, you provide a sample message that contains the content
-- that you plan to send to your customers. Amazon Pinpoint then sends that
-- message to special email addresses spread across several major email
-- providers. After about 24 hours, the test is complete, and you can use
-- the @GetDeliverabilityTestReport@ operation to view the results of the
-- test.
module Amazonka.PinpointEmail.CreateDeliverabilityTestReport
  ( -- * Creating a Request
    CreateDeliverabilityTestReport (..),
    newCreateDeliverabilityTestReport,

    -- * Request Lenses
    createDeliverabilityTestReport_reportName,
    createDeliverabilityTestReport_tags,
    createDeliverabilityTestReport_fromEmailAddress,
    createDeliverabilityTestReport_content,

    -- * Destructuring the Response
    CreateDeliverabilityTestReportResponse (..),
    newCreateDeliverabilityTestReportResponse,

    -- * Response Lenses
    createDeliverabilityTestReportResponse_httpStatus,
    createDeliverabilityTestReportResponse_reportId,
    createDeliverabilityTestReportResponse_deliverabilityTestStatus,
  )
where

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

-- | A request to perform a predictive inbox placement test. Predictive inbox
-- placement tests can help you predict how your messages will be handled
-- by various email providers around the world. When you perform a
-- predictive inbox placement test, you provide a sample message that
-- contains the content that you plan to send to your customers. Amazon
-- Pinpoint then sends that message to special email addresses spread
-- across several major email providers. After about 24 hours, the test is
-- complete, and you can use the @GetDeliverabilityTestReport@ operation to
-- view the results of the test.
--
-- /See:/ 'newCreateDeliverabilityTestReport' smart constructor.
data CreateDeliverabilityTestReport = CreateDeliverabilityTestReport'
  { -- | A unique name that helps you to identify the predictive inbox placement
    -- test when you retrieve the results.
    CreateDeliverabilityTestReport -> Maybe Text
reportName :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that define the tags (keys and values) that you want
    -- to associate with the predictive inbox placement test.
    CreateDeliverabilityTestReport -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The email address that the predictive inbox placement test email was
    -- sent from.
    CreateDeliverabilityTestReport -> Text
fromEmailAddress :: Prelude.Text,
    -- | The HTML body of the message that you sent when you performed the
    -- predictive inbox placement test.
    CreateDeliverabilityTestReport -> EmailContent
content :: EmailContent
  }
  deriving (CreateDeliverabilityTestReport
-> CreateDeliverabilityTestReport -> Bool
(CreateDeliverabilityTestReport
 -> CreateDeliverabilityTestReport -> Bool)
-> (CreateDeliverabilityTestReport
    -> CreateDeliverabilityTestReport -> Bool)
-> Eq CreateDeliverabilityTestReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeliverabilityTestReport
-> CreateDeliverabilityTestReport -> Bool
$c/= :: CreateDeliverabilityTestReport
-> CreateDeliverabilityTestReport -> Bool
== :: CreateDeliverabilityTestReport
-> CreateDeliverabilityTestReport -> Bool
$c== :: CreateDeliverabilityTestReport
-> CreateDeliverabilityTestReport -> Bool
Prelude.Eq, ReadPrec [CreateDeliverabilityTestReport]
ReadPrec CreateDeliverabilityTestReport
Int -> ReadS CreateDeliverabilityTestReport
ReadS [CreateDeliverabilityTestReport]
(Int -> ReadS CreateDeliverabilityTestReport)
-> ReadS [CreateDeliverabilityTestReport]
-> ReadPrec CreateDeliverabilityTestReport
-> ReadPrec [CreateDeliverabilityTestReport]
-> Read CreateDeliverabilityTestReport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeliverabilityTestReport]
$creadListPrec :: ReadPrec [CreateDeliverabilityTestReport]
readPrec :: ReadPrec CreateDeliverabilityTestReport
$creadPrec :: ReadPrec CreateDeliverabilityTestReport
readList :: ReadS [CreateDeliverabilityTestReport]
$creadList :: ReadS [CreateDeliverabilityTestReport]
readsPrec :: Int -> ReadS CreateDeliverabilityTestReport
$creadsPrec :: Int -> ReadS CreateDeliverabilityTestReport
Prelude.Read, Int -> CreateDeliverabilityTestReport -> ShowS
[CreateDeliverabilityTestReport] -> ShowS
CreateDeliverabilityTestReport -> String
(Int -> CreateDeliverabilityTestReport -> ShowS)
-> (CreateDeliverabilityTestReport -> String)
-> ([CreateDeliverabilityTestReport] -> ShowS)
-> Show CreateDeliverabilityTestReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeliverabilityTestReport] -> ShowS
$cshowList :: [CreateDeliverabilityTestReport] -> ShowS
show :: CreateDeliverabilityTestReport -> String
$cshow :: CreateDeliverabilityTestReport -> String
showsPrec :: Int -> CreateDeliverabilityTestReport -> ShowS
$cshowsPrec :: Int -> CreateDeliverabilityTestReport -> ShowS
Prelude.Show, (forall x.
 CreateDeliverabilityTestReport
 -> Rep CreateDeliverabilityTestReport x)
-> (forall x.
    Rep CreateDeliverabilityTestReport x
    -> CreateDeliverabilityTestReport)
-> Generic CreateDeliverabilityTestReport
forall x.
Rep CreateDeliverabilityTestReport x
-> CreateDeliverabilityTestReport
forall x.
CreateDeliverabilityTestReport
-> Rep CreateDeliverabilityTestReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDeliverabilityTestReport x
-> CreateDeliverabilityTestReport
$cfrom :: forall x.
CreateDeliverabilityTestReport
-> Rep CreateDeliverabilityTestReport x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeliverabilityTestReport' 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:
--
-- 'reportName', 'createDeliverabilityTestReport_reportName' - A unique name that helps you to identify the predictive inbox placement
-- test when you retrieve the results.
--
-- 'tags', 'createDeliverabilityTestReport_tags' - An array of objects that define the tags (keys and values) that you want
-- to associate with the predictive inbox placement test.
--
-- 'fromEmailAddress', 'createDeliverabilityTestReport_fromEmailAddress' - The email address that the predictive inbox placement test email was
-- sent from.
--
-- 'content', 'createDeliverabilityTestReport_content' - The HTML body of the message that you sent when you performed the
-- predictive inbox placement test.
newCreateDeliverabilityTestReport ::
  -- | 'fromEmailAddress'
  Prelude.Text ->
  -- | 'content'
  EmailContent ->
  CreateDeliverabilityTestReport
newCreateDeliverabilityTestReport :: Text -> EmailContent -> CreateDeliverabilityTestReport
newCreateDeliverabilityTestReport
  Text
pFromEmailAddress_
  EmailContent
pContent_ =
    CreateDeliverabilityTestReport' :: Maybe Text
-> Maybe [Tag]
-> Text
-> EmailContent
-> CreateDeliverabilityTestReport
CreateDeliverabilityTestReport'
      { $sel:reportName:CreateDeliverabilityTestReport' :: Maybe Text
reportName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateDeliverabilityTestReport' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:fromEmailAddress:CreateDeliverabilityTestReport' :: Text
fromEmailAddress = Text
pFromEmailAddress_,
        $sel:content:CreateDeliverabilityTestReport' :: EmailContent
content = EmailContent
pContent_
      }

-- | A unique name that helps you to identify the predictive inbox placement
-- test when you retrieve the results.
createDeliverabilityTestReport_reportName :: Lens.Lens' CreateDeliverabilityTestReport (Prelude.Maybe Prelude.Text)
createDeliverabilityTestReport_reportName :: (Maybe Text -> f (Maybe Text))
-> CreateDeliverabilityTestReport
-> f CreateDeliverabilityTestReport
createDeliverabilityTestReport_reportName = (CreateDeliverabilityTestReport -> Maybe Text)
-> (CreateDeliverabilityTestReport
    -> Maybe Text -> CreateDeliverabilityTestReport)
-> Lens
     CreateDeliverabilityTestReport
     CreateDeliverabilityTestReport
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliverabilityTestReport' {Maybe Text
reportName :: Maybe Text
$sel:reportName:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> Maybe Text
reportName} -> Maybe Text
reportName) (\s :: CreateDeliverabilityTestReport
s@CreateDeliverabilityTestReport' {} Maybe Text
a -> CreateDeliverabilityTestReport
s {$sel:reportName:CreateDeliverabilityTestReport' :: Maybe Text
reportName = Maybe Text
a} :: CreateDeliverabilityTestReport)

-- | An array of objects that define the tags (keys and values) that you want
-- to associate with the predictive inbox placement test.
createDeliverabilityTestReport_tags :: Lens.Lens' CreateDeliverabilityTestReport (Prelude.Maybe [Tag])
createDeliverabilityTestReport_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDeliverabilityTestReport
-> f CreateDeliverabilityTestReport
createDeliverabilityTestReport_tags = (CreateDeliverabilityTestReport -> Maybe [Tag])
-> (CreateDeliverabilityTestReport
    -> Maybe [Tag] -> CreateDeliverabilityTestReport)
-> Lens
     CreateDeliverabilityTestReport
     CreateDeliverabilityTestReport
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliverabilityTestReport' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDeliverabilityTestReport
s@CreateDeliverabilityTestReport' {} Maybe [Tag]
a -> CreateDeliverabilityTestReport
s {$sel:tags:CreateDeliverabilityTestReport' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDeliverabilityTestReport) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateDeliverabilityTestReport
 -> f CreateDeliverabilityTestReport)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDeliverabilityTestReport
-> f CreateDeliverabilityTestReport
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The email address that the predictive inbox placement test email was
-- sent from.
createDeliverabilityTestReport_fromEmailAddress :: Lens.Lens' CreateDeliverabilityTestReport Prelude.Text
createDeliverabilityTestReport_fromEmailAddress :: (Text -> f Text)
-> CreateDeliverabilityTestReport
-> f CreateDeliverabilityTestReport
createDeliverabilityTestReport_fromEmailAddress = (CreateDeliverabilityTestReport -> Text)
-> (CreateDeliverabilityTestReport
    -> Text -> CreateDeliverabilityTestReport)
-> Lens
     CreateDeliverabilityTestReport
     CreateDeliverabilityTestReport
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliverabilityTestReport' {Text
fromEmailAddress :: Text
$sel:fromEmailAddress:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> Text
fromEmailAddress} -> Text
fromEmailAddress) (\s :: CreateDeliverabilityTestReport
s@CreateDeliverabilityTestReport' {} Text
a -> CreateDeliverabilityTestReport
s {$sel:fromEmailAddress:CreateDeliverabilityTestReport' :: Text
fromEmailAddress = Text
a} :: CreateDeliverabilityTestReport)

-- | The HTML body of the message that you sent when you performed the
-- predictive inbox placement test.
createDeliverabilityTestReport_content :: Lens.Lens' CreateDeliverabilityTestReport EmailContent
createDeliverabilityTestReport_content :: (EmailContent -> f EmailContent)
-> CreateDeliverabilityTestReport
-> f CreateDeliverabilityTestReport
createDeliverabilityTestReport_content = (CreateDeliverabilityTestReport -> EmailContent)
-> (CreateDeliverabilityTestReport
    -> EmailContent -> CreateDeliverabilityTestReport)
-> Lens
     CreateDeliverabilityTestReport
     CreateDeliverabilityTestReport
     EmailContent
     EmailContent
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliverabilityTestReport' {EmailContent
content :: EmailContent
$sel:content:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> EmailContent
content} -> EmailContent
content) (\s :: CreateDeliverabilityTestReport
s@CreateDeliverabilityTestReport' {} EmailContent
a -> CreateDeliverabilityTestReport
s {$sel:content:CreateDeliverabilityTestReport' :: EmailContent
content = EmailContent
a} :: CreateDeliverabilityTestReport)

instance
  Core.AWSRequest
    CreateDeliverabilityTestReport
  where
  type
    AWSResponse CreateDeliverabilityTestReport =
      CreateDeliverabilityTestReportResponse
  request :: CreateDeliverabilityTestReport
-> Request CreateDeliverabilityTestReport
request = Service
-> CreateDeliverabilityTestReport
-> Request CreateDeliverabilityTestReport
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDeliverabilityTestReport
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateDeliverabilityTestReport)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDeliverabilityTestReport))
-> Logger
-> Service
-> Proxy CreateDeliverabilityTestReport
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateDeliverabilityTestReport)))
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 ->
          Int
-> Text
-> DeliverabilityTestStatus
-> CreateDeliverabilityTestReportResponse
CreateDeliverabilityTestReportResponse'
            (Int
 -> Text
 -> DeliverabilityTestStatus
 -> CreateDeliverabilityTestReportResponse)
-> Either String Int
-> Either
     String
     (Text
      -> DeliverabilityTestStatus
      -> CreateDeliverabilityTestReportResponse)
forall (f :: * -> *) a b. Functor 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))
            Either
  String
  (Text
   -> DeliverabilityTestStatus
   -> CreateDeliverabilityTestReportResponse)
-> Either String Text
-> Either
     String
     (DeliverabilityTestStatus
      -> CreateDeliverabilityTestReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ReportId")
            Either
  String
  (DeliverabilityTestStatus
   -> CreateDeliverabilityTestReportResponse)
-> Either String DeliverabilityTestStatus
-> Either String CreateDeliverabilityTestReportResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DeliverabilityTestStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DeliverabilityTestStatus")
      )

instance
  Prelude.Hashable
    CreateDeliverabilityTestReport

instance
  Prelude.NFData
    CreateDeliverabilityTestReport

instance
  Core.ToHeaders
    CreateDeliverabilityTestReport
  where
  toHeaders :: CreateDeliverabilityTestReport -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateDeliverabilityTestReport -> 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 CreateDeliverabilityTestReport where
  toJSON :: CreateDeliverabilityTestReport -> Value
toJSON CreateDeliverabilityTestReport' {Maybe [Tag]
Maybe Text
Text
EmailContent
content :: EmailContent
fromEmailAddress :: Text
tags :: Maybe [Tag]
reportName :: Maybe Text
$sel:content:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> EmailContent
$sel:fromEmailAddress:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> Text
$sel:tags:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> Maybe [Tag]
$sel:reportName:CreateDeliverabilityTestReport' :: CreateDeliverabilityTestReport -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ReportName" 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
reportName,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"FromEmailAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fromEmailAddress),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> EmailContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EmailContent
content)
          ]
      )

instance Core.ToPath CreateDeliverabilityTestReport where
  toPath :: CreateDeliverabilityTestReport -> ByteString
toPath =
    ByteString -> CreateDeliverabilityTestReport -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/v1/email/deliverability-dashboard/test"

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

-- | Information about the predictive inbox placement test that you created.
--
-- /See:/ 'newCreateDeliverabilityTestReportResponse' smart constructor.
data CreateDeliverabilityTestReportResponse = CreateDeliverabilityTestReportResponse'
  { -- | The response's http status code.
    CreateDeliverabilityTestReportResponse -> Int
httpStatus :: Prelude.Int,
    -- | A unique string that identifies the predictive inbox placement test.
    CreateDeliverabilityTestReportResponse -> Text
reportId :: Prelude.Text,
    -- | The status of the predictive inbox placement test. If the status is
    -- @IN_PROGRESS@, then the predictive inbox placement test is currently
    -- running. Predictive inbox placement tests are usually complete within 24
    -- hours of creating the test. If the status is @COMPLETE@, then the test
    -- is finished, and you can use the @GetDeliverabilityTestReport@ to view
    -- the results of the test.
    CreateDeliverabilityTestReportResponse -> DeliverabilityTestStatus
deliverabilityTestStatus :: DeliverabilityTestStatus
  }
  deriving (CreateDeliverabilityTestReportResponse
-> CreateDeliverabilityTestReportResponse -> Bool
(CreateDeliverabilityTestReportResponse
 -> CreateDeliverabilityTestReportResponse -> Bool)
-> (CreateDeliverabilityTestReportResponse
    -> CreateDeliverabilityTestReportResponse -> Bool)
-> Eq CreateDeliverabilityTestReportResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeliverabilityTestReportResponse
-> CreateDeliverabilityTestReportResponse -> Bool
$c/= :: CreateDeliverabilityTestReportResponse
-> CreateDeliverabilityTestReportResponse -> Bool
== :: CreateDeliverabilityTestReportResponse
-> CreateDeliverabilityTestReportResponse -> Bool
$c== :: CreateDeliverabilityTestReportResponse
-> CreateDeliverabilityTestReportResponse -> Bool
Prelude.Eq, ReadPrec [CreateDeliverabilityTestReportResponse]
ReadPrec CreateDeliverabilityTestReportResponse
Int -> ReadS CreateDeliverabilityTestReportResponse
ReadS [CreateDeliverabilityTestReportResponse]
(Int -> ReadS CreateDeliverabilityTestReportResponse)
-> ReadS [CreateDeliverabilityTestReportResponse]
-> ReadPrec CreateDeliverabilityTestReportResponse
-> ReadPrec [CreateDeliverabilityTestReportResponse]
-> Read CreateDeliverabilityTestReportResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeliverabilityTestReportResponse]
$creadListPrec :: ReadPrec [CreateDeliverabilityTestReportResponse]
readPrec :: ReadPrec CreateDeliverabilityTestReportResponse
$creadPrec :: ReadPrec CreateDeliverabilityTestReportResponse
readList :: ReadS [CreateDeliverabilityTestReportResponse]
$creadList :: ReadS [CreateDeliverabilityTestReportResponse]
readsPrec :: Int -> ReadS CreateDeliverabilityTestReportResponse
$creadsPrec :: Int -> ReadS CreateDeliverabilityTestReportResponse
Prelude.Read, Int -> CreateDeliverabilityTestReportResponse -> ShowS
[CreateDeliverabilityTestReportResponse] -> ShowS
CreateDeliverabilityTestReportResponse -> String
(Int -> CreateDeliverabilityTestReportResponse -> ShowS)
-> (CreateDeliverabilityTestReportResponse -> String)
-> ([CreateDeliverabilityTestReportResponse] -> ShowS)
-> Show CreateDeliverabilityTestReportResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeliverabilityTestReportResponse] -> ShowS
$cshowList :: [CreateDeliverabilityTestReportResponse] -> ShowS
show :: CreateDeliverabilityTestReportResponse -> String
$cshow :: CreateDeliverabilityTestReportResponse -> String
showsPrec :: Int -> CreateDeliverabilityTestReportResponse -> ShowS
$cshowsPrec :: Int -> CreateDeliverabilityTestReportResponse -> ShowS
Prelude.Show, (forall x.
 CreateDeliverabilityTestReportResponse
 -> Rep CreateDeliverabilityTestReportResponse x)
-> (forall x.
    Rep CreateDeliverabilityTestReportResponse x
    -> CreateDeliverabilityTestReportResponse)
-> Generic CreateDeliverabilityTestReportResponse
forall x.
Rep CreateDeliverabilityTestReportResponse x
-> CreateDeliverabilityTestReportResponse
forall x.
CreateDeliverabilityTestReportResponse
-> Rep CreateDeliverabilityTestReportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDeliverabilityTestReportResponse x
-> CreateDeliverabilityTestReportResponse
$cfrom :: forall x.
CreateDeliverabilityTestReportResponse
-> Rep CreateDeliverabilityTestReportResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeliverabilityTestReportResponse' 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:
--
-- 'httpStatus', 'createDeliverabilityTestReportResponse_httpStatus' - The response's http status code.
--
-- 'reportId', 'createDeliverabilityTestReportResponse_reportId' - A unique string that identifies the predictive inbox placement test.
--
-- 'deliverabilityTestStatus', 'createDeliverabilityTestReportResponse_deliverabilityTestStatus' - The status of the predictive inbox placement test. If the status is
-- @IN_PROGRESS@, then the predictive inbox placement test is currently
-- running. Predictive inbox placement tests are usually complete within 24
-- hours of creating the test. If the status is @COMPLETE@, then the test
-- is finished, and you can use the @GetDeliverabilityTestReport@ to view
-- the results of the test.
newCreateDeliverabilityTestReportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'reportId'
  Prelude.Text ->
  -- | 'deliverabilityTestStatus'
  DeliverabilityTestStatus ->
  CreateDeliverabilityTestReportResponse
newCreateDeliverabilityTestReportResponse :: Int
-> Text
-> DeliverabilityTestStatus
-> CreateDeliverabilityTestReportResponse
newCreateDeliverabilityTestReportResponse
  Int
pHttpStatus_
  Text
pReportId_
  DeliverabilityTestStatus
pDeliverabilityTestStatus_ =
    CreateDeliverabilityTestReportResponse' :: Int
-> Text
-> DeliverabilityTestStatus
-> CreateDeliverabilityTestReportResponse
CreateDeliverabilityTestReportResponse'
      { $sel:httpStatus:CreateDeliverabilityTestReportResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:reportId:CreateDeliverabilityTestReportResponse' :: Text
reportId = Text
pReportId_,
        $sel:deliverabilityTestStatus:CreateDeliverabilityTestReportResponse' :: DeliverabilityTestStatus
deliverabilityTestStatus =
          DeliverabilityTestStatus
pDeliverabilityTestStatus_
      }

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

-- | A unique string that identifies the predictive inbox placement test.
createDeliverabilityTestReportResponse_reportId :: Lens.Lens' CreateDeliverabilityTestReportResponse Prelude.Text
createDeliverabilityTestReportResponse_reportId :: (Text -> f Text)
-> CreateDeliverabilityTestReportResponse
-> f CreateDeliverabilityTestReportResponse
createDeliverabilityTestReportResponse_reportId = (CreateDeliverabilityTestReportResponse -> Text)
-> (CreateDeliverabilityTestReportResponse
    -> Text -> CreateDeliverabilityTestReportResponse)
-> Lens
     CreateDeliverabilityTestReportResponse
     CreateDeliverabilityTestReportResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliverabilityTestReportResponse' {Text
reportId :: Text
$sel:reportId:CreateDeliverabilityTestReportResponse' :: CreateDeliverabilityTestReportResponse -> Text
reportId} -> Text
reportId) (\s :: CreateDeliverabilityTestReportResponse
s@CreateDeliverabilityTestReportResponse' {} Text
a -> CreateDeliverabilityTestReportResponse
s {$sel:reportId:CreateDeliverabilityTestReportResponse' :: Text
reportId = Text
a} :: CreateDeliverabilityTestReportResponse)

-- | The status of the predictive inbox placement test. If the status is
-- @IN_PROGRESS@, then the predictive inbox placement test is currently
-- running. Predictive inbox placement tests are usually complete within 24
-- hours of creating the test. If the status is @COMPLETE@, then the test
-- is finished, and you can use the @GetDeliverabilityTestReport@ to view
-- the results of the test.
createDeliverabilityTestReportResponse_deliverabilityTestStatus :: Lens.Lens' CreateDeliverabilityTestReportResponse DeliverabilityTestStatus
createDeliverabilityTestReportResponse_deliverabilityTestStatus :: (DeliverabilityTestStatus -> f DeliverabilityTestStatus)
-> CreateDeliverabilityTestReportResponse
-> f CreateDeliverabilityTestReportResponse
createDeliverabilityTestReportResponse_deliverabilityTestStatus = (CreateDeliverabilityTestReportResponse
 -> DeliverabilityTestStatus)
-> (CreateDeliverabilityTestReportResponse
    -> DeliverabilityTestStatus
    -> CreateDeliverabilityTestReportResponse)
-> Lens
     CreateDeliverabilityTestReportResponse
     CreateDeliverabilityTestReportResponse
     DeliverabilityTestStatus
     DeliverabilityTestStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeliverabilityTestReportResponse' {DeliverabilityTestStatus
deliverabilityTestStatus :: DeliverabilityTestStatus
$sel:deliverabilityTestStatus:CreateDeliverabilityTestReportResponse' :: CreateDeliverabilityTestReportResponse -> DeliverabilityTestStatus
deliverabilityTestStatus} -> DeliverabilityTestStatus
deliverabilityTestStatus) (\s :: CreateDeliverabilityTestReportResponse
s@CreateDeliverabilityTestReportResponse' {} DeliverabilityTestStatus
a -> CreateDeliverabilityTestReportResponse
s {$sel:deliverabilityTestStatus:CreateDeliverabilityTestReportResponse' :: DeliverabilityTestStatus
deliverabilityTestStatus = DeliverabilityTestStatus
a} :: CreateDeliverabilityTestReportResponse)

instance
  Prelude.NFData
    CreateDeliverabilityTestReportResponse