{-# 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.Inspector.GetExclusionsPreview
-- 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)
--
-- Retrieves the exclusions preview (a list of ExclusionPreview objects)
-- specified by the preview token. You can obtain the preview token by
-- running the CreateExclusionsPreview API.
module Amazonka.Inspector.GetExclusionsPreview
  ( -- * Creating a Request
    GetExclusionsPreview (..),
    newGetExclusionsPreview,

    -- * Request Lenses
    getExclusionsPreview_locale,
    getExclusionsPreview_nextToken,
    getExclusionsPreview_maxResults,
    getExclusionsPreview_assessmentTemplateArn,
    getExclusionsPreview_previewToken,

    -- * Destructuring the Response
    GetExclusionsPreviewResponse (..),
    newGetExclusionsPreviewResponse,

    -- * Response Lenses
    getExclusionsPreviewResponse_exclusionPreviews,
    getExclusionsPreviewResponse_nextToken,
    getExclusionsPreviewResponse_httpStatus,
    getExclusionsPreviewResponse_previewStatus,
  )
where

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

-- | /See:/ 'newGetExclusionsPreview' smart constructor.
data GetExclusionsPreview = GetExclusionsPreview'
  { -- | The locale into which you want to translate the exclusion\'s title,
    -- description, and recommendation.
    GetExclusionsPreview -> Maybe Locale
locale :: Prelude.Maybe Locale,
    -- | You can use this parameter when paginating results. Set the value of
    -- this parameter to null on your first call to the
    -- GetExclusionsPreviewRequest action. Subsequent calls to the action fill
    -- nextToken in the request with the value of nextToken from the previous
    -- response to continue listing data.
    GetExclusionsPreview -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | You can use this parameter to indicate the maximum number of items you
    -- want in the response. The default value is 100. The maximum value is
    -- 500.
    GetExclusionsPreview -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The ARN that specifies the assessment template for which the exclusions
    -- preview was requested.
    GetExclusionsPreview -> Text
assessmentTemplateArn :: Prelude.Text,
    -- | The unique identifier associated of the exclusions preview.
    GetExclusionsPreview -> Text
previewToken :: Prelude.Text
  }
  deriving (GetExclusionsPreview -> GetExclusionsPreview -> Bool
(GetExclusionsPreview -> GetExclusionsPreview -> Bool)
-> (GetExclusionsPreview -> GetExclusionsPreview -> Bool)
-> Eq GetExclusionsPreview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetExclusionsPreview -> GetExclusionsPreview -> Bool
$c/= :: GetExclusionsPreview -> GetExclusionsPreview -> Bool
== :: GetExclusionsPreview -> GetExclusionsPreview -> Bool
$c== :: GetExclusionsPreview -> GetExclusionsPreview -> Bool
Prelude.Eq, ReadPrec [GetExclusionsPreview]
ReadPrec GetExclusionsPreview
Int -> ReadS GetExclusionsPreview
ReadS [GetExclusionsPreview]
(Int -> ReadS GetExclusionsPreview)
-> ReadS [GetExclusionsPreview]
-> ReadPrec GetExclusionsPreview
-> ReadPrec [GetExclusionsPreview]
-> Read GetExclusionsPreview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetExclusionsPreview]
$creadListPrec :: ReadPrec [GetExclusionsPreview]
readPrec :: ReadPrec GetExclusionsPreview
$creadPrec :: ReadPrec GetExclusionsPreview
readList :: ReadS [GetExclusionsPreview]
$creadList :: ReadS [GetExclusionsPreview]
readsPrec :: Int -> ReadS GetExclusionsPreview
$creadsPrec :: Int -> ReadS GetExclusionsPreview
Prelude.Read, Int -> GetExclusionsPreview -> ShowS
[GetExclusionsPreview] -> ShowS
GetExclusionsPreview -> String
(Int -> GetExclusionsPreview -> ShowS)
-> (GetExclusionsPreview -> String)
-> ([GetExclusionsPreview] -> ShowS)
-> Show GetExclusionsPreview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetExclusionsPreview] -> ShowS
$cshowList :: [GetExclusionsPreview] -> ShowS
show :: GetExclusionsPreview -> String
$cshow :: GetExclusionsPreview -> String
showsPrec :: Int -> GetExclusionsPreview -> ShowS
$cshowsPrec :: Int -> GetExclusionsPreview -> ShowS
Prelude.Show, (forall x. GetExclusionsPreview -> Rep GetExclusionsPreview x)
-> (forall x. Rep GetExclusionsPreview x -> GetExclusionsPreview)
-> Generic GetExclusionsPreview
forall x. Rep GetExclusionsPreview x -> GetExclusionsPreview
forall x. GetExclusionsPreview -> Rep GetExclusionsPreview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetExclusionsPreview x -> GetExclusionsPreview
$cfrom :: forall x. GetExclusionsPreview -> Rep GetExclusionsPreview x
Prelude.Generic)

-- |
-- Create a value of 'GetExclusionsPreview' 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:
--
-- 'locale', 'getExclusionsPreview_locale' - The locale into which you want to translate the exclusion\'s title,
-- description, and recommendation.
--
-- 'nextToken', 'getExclusionsPreview_nextToken' - You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the
-- GetExclusionsPreviewRequest action. Subsequent calls to the action fill
-- nextToken in the request with the value of nextToken from the previous
-- response to continue listing data.
--
-- 'maxResults', 'getExclusionsPreview_maxResults' - You can use this parameter to indicate the maximum number of items you
-- want in the response. The default value is 100. The maximum value is
-- 500.
--
-- 'assessmentTemplateArn', 'getExclusionsPreview_assessmentTemplateArn' - The ARN that specifies the assessment template for which the exclusions
-- preview was requested.
--
-- 'previewToken', 'getExclusionsPreview_previewToken' - The unique identifier associated of the exclusions preview.
newGetExclusionsPreview ::
  -- | 'assessmentTemplateArn'
  Prelude.Text ->
  -- | 'previewToken'
  Prelude.Text ->
  GetExclusionsPreview
newGetExclusionsPreview :: Text -> Text -> GetExclusionsPreview
newGetExclusionsPreview
  Text
pAssessmentTemplateArn_
  Text
pPreviewToken_ =
    GetExclusionsPreview' :: Maybe Locale
-> Maybe Text -> Maybe Int -> Text -> Text -> GetExclusionsPreview
GetExclusionsPreview'
      { $sel:locale:GetExclusionsPreview' :: Maybe Locale
locale = Maybe Locale
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetExclusionsPreview' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetExclusionsPreview' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:assessmentTemplateArn:GetExclusionsPreview' :: Text
assessmentTemplateArn = Text
pAssessmentTemplateArn_,
        $sel:previewToken:GetExclusionsPreview' :: Text
previewToken = Text
pPreviewToken_
      }

-- | The locale into which you want to translate the exclusion\'s title,
-- description, and recommendation.
getExclusionsPreview_locale :: Lens.Lens' GetExclusionsPreview (Prelude.Maybe Locale)
getExclusionsPreview_locale :: (Maybe Locale -> f (Maybe Locale))
-> GetExclusionsPreview -> f GetExclusionsPreview
getExclusionsPreview_locale = (GetExclusionsPreview -> Maybe Locale)
-> (GetExclusionsPreview -> Maybe Locale -> GetExclusionsPreview)
-> Lens
     GetExclusionsPreview
     GetExclusionsPreview
     (Maybe Locale)
     (Maybe Locale)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreview' {Maybe Locale
locale :: Maybe Locale
$sel:locale:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Locale
locale} -> Maybe Locale
locale) (\s :: GetExclusionsPreview
s@GetExclusionsPreview' {} Maybe Locale
a -> GetExclusionsPreview
s {$sel:locale:GetExclusionsPreview' :: Maybe Locale
locale = Maybe Locale
a} :: GetExclusionsPreview)

-- | You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the
-- GetExclusionsPreviewRequest action. Subsequent calls to the action fill
-- nextToken in the request with the value of nextToken from the previous
-- response to continue listing data.
getExclusionsPreview_nextToken :: Lens.Lens' GetExclusionsPreview (Prelude.Maybe Prelude.Text)
getExclusionsPreview_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetExclusionsPreview -> f GetExclusionsPreview
getExclusionsPreview_nextToken = (GetExclusionsPreview -> Maybe Text)
-> (GetExclusionsPreview -> Maybe Text -> GetExclusionsPreview)
-> Lens
     GetExclusionsPreview GetExclusionsPreview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreview' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetExclusionsPreview
s@GetExclusionsPreview' {} Maybe Text
a -> GetExclusionsPreview
s {$sel:nextToken:GetExclusionsPreview' :: Maybe Text
nextToken = Maybe Text
a} :: GetExclusionsPreview)

-- | You can use this parameter to indicate the maximum number of items you
-- want in the response. The default value is 100. The maximum value is
-- 500.
getExclusionsPreview_maxResults :: Lens.Lens' GetExclusionsPreview (Prelude.Maybe Prelude.Int)
getExclusionsPreview_maxResults :: (Maybe Int -> f (Maybe Int))
-> GetExclusionsPreview -> f GetExclusionsPreview
getExclusionsPreview_maxResults = (GetExclusionsPreview -> Maybe Int)
-> (GetExclusionsPreview -> Maybe Int -> GetExclusionsPreview)
-> Lens
     GetExclusionsPreview GetExclusionsPreview (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreview' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetExclusionsPreview
s@GetExclusionsPreview' {} Maybe Int
a -> GetExclusionsPreview
s {$sel:maxResults:GetExclusionsPreview' :: Maybe Int
maxResults = Maybe Int
a} :: GetExclusionsPreview)

-- | The ARN that specifies the assessment template for which the exclusions
-- preview was requested.
getExclusionsPreview_assessmentTemplateArn :: Lens.Lens' GetExclusionsPreview Prelude.Text
getExclusionsPreview_assessmentTemplateArn :: (Text -> f Text) -> GetExclusionsPreview -> f GetExclusionsPreview
getExclusionsPreview_assessmentTemplateArn = (GetExclusionsPreview -> Text)
-> (GetExclusionsPreview -> Text -> GetExclusionsPreview)
-> Lens GetExclusionsPreview GetExclusionsPreview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreview' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:GetExclusionsPreview' :: GetExclusionsPreview -> Text
assessmentTemplateArn} -> Text
assessmentTemplateArn) (\s :: GetExclusionsPreview
s@GetExclusionsPreview' {} Text
a -> GetExclusionsPreview
s {$sel:assessmentTemplateArn:GetExclusionsPreview' :: Text
assessmentTemplateArn = Text
a} :: GetExclusionsPreview)

-- | The unique identifier associated of the exclusions preview.
getExclusionsPreview_previewToken :: Lens.Lens' GetExclusionsPreview Prelude.Text
getExclusionsPreview_previewToken :: (Text -> f Text) -> GetExclusionsPreview -> f GetExclusionsPreview
getExclusionsPreview_previewToken = (GetExclusionsPreview -> Text)
-> (GetExclusionsPreview -> Text -> GetExclusionsPreview)
-> Lens GetExclusionsPreview GetExclusionsPreview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreview' {Text
previewToken :: Text
$sel:previewToken:GetExclusionsPreview' :: GetExclusionsPreview -> Text
previewToken} -> Text
previewToken) (\s :: GetExclusionsPreview
s@GetExclusionsPreview' {} Text
a -> GetExclusionsPreview
s {$sel:previewToken:GetExclusionsPreview' :: Text
previewToken = Text
a} :: GetExclusionsPreview)

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

instance Prelude.Hashable GetExclusionsPreview

instance Prelude.NFData GetExclusionsPreview

instance Core.ToHeaders GetExclusionsPreview where
  toHeaders :: GetExclusionsPreview -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetExclusionsPreview -> 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
"InspectorService.GetExclusionsPreview" ::
                          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 GetExclusionsPreview where
  toJSON :: GetExclusionsPreview -> Value
toJSON GetExclusionsPreview' {Maybe Int
Maybe Text
Maybe Locale
Text
previewToken :: Text
assessmentTemplateArn :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
locale :: Maybe Locale
$sel:previewToken:GetExclusionsPreview' :: GetExclusionsPreview -> Text
$sel:assessmentTemplateArn:GetExclusionsPreview' :: GetExclusionsPreview -> Text
$sel:maxResults:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Int
$sel:nextToken:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Text
$sel:locale:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Locale
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"locale" Text -> Locale -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Locale -> Pair) -> Maybe Locale -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Locale
locale,
            (Text
"nextToken" 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
nextToken,
            (Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"assessmentTemplateArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assessmentTemplateArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"previewToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
previewToken)
          ]
      )

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

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

-- | /See:/ 'newGetExclusionsPreviewResponse' smart constructor.
data GetExclusionsPreviewResponse = GetExclusionsPreviewResponse'
  { -- | Information about the exclusions included in the preview.
    GetExclusionsPreviewResponse -> Maybe [ExclusionPreview]
exclusionPreviews :: Prelude.Maybe [ExclusionPreview],
    -- | When a response is generated, if there is more data to be listed, this
    -- parameters is present in the response and contains the value to use for
    -- the nextToken parameter in a subsequent pagination request. If there is
    -- no more data to be listed, this parameter is set to null.
    GetExclusionsPreviewResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetExclusionsPreviewResponse -> Int
httpStatus :: Prelude.Int,
    -- | Specifies the status of the request to generate an exclusions preview.
    GetExclusionsPreviewResponse -> PreviewStatus
previewStatus :: PreviewStatus
  }
  deriving (GetExclusionsPreviewResponse
-> GetExclusionsPreviewResponse -> Bool
(GetExclusionsPreviewResponse
 -> GetExclusionsPreviewResponse -> Bool)
-> (GetExclusionsPreviewResponse
    -> GetExclusionsPreviewResponse -> Bool)
-> Eq GetExclusionsPreviewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetExclusionsPreviewResponse
-> GetExclusionsPreviewResponse -> Bool
$c/= :: GetExclusionsPreviewResponse
-> GetExclusionsPreviewResponse -> Bool
== :: GetExclusionsPreviewResponse
-> GetExclusionsPreviewResponse -> Bool
$c== :: GetExclusionsPreviewResponse
-> GetExclusionsPreviewResponse -> Bool
Prelude.Eq, ReadPrec [GetExclusionsPreviewResponse]
ReadPrec GetExclusionsPreviewResponse
Int -> ReadS GetExclusionsPreviewResponse
ReadS [GetExclusionsPreviewResponse]
(Int -> ReadS GetExclusionsPreviewResponse)
-> ReadS [GetExclusionsPreviewResponse]
-> ReadPrec GetExclusionsPreviewResponse
-> ReadPrec [GetExclusionsPreviewResponse]
-> Read GetExclusionsPreviewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetExclusionsPreviewResponse]
$creadListPrec :: ReadPrec [GetExclusionsPreviewResponse]
readPrec :: ReadPrec GetExclusionsPreviewResponse
$creadPrec :: ReadPrec GetExclusionsPreviewResponse
readList :: ReadS [GetExclusionsPreviewResponse]
$creadList :: ReadS [GetExclusionsPreviewResponse]
readsPrec :: Int -> ReadS GetExclusionsPreviewResponse
$creadsPrec :: Int -> ReadS GetExclusionsPreviewResponse
Prelude.Read, Int -> GetExclusionsPreviewResponse -> ShowS
[GetExclusionsPreviewResponse] -> ShowS
GetExclusionsPreviewResponse -> String
(Int -> GetExclusionsPreviewResponse -> ShowS)
-> (GetExclusionsPreviewResponse -> String)
-> ([GetExclusionsPreviewResponse] -> ShowS)
-> Show GetExclusionsPreviewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetExclusionsPreviewResponse] -> ShowS
$cshowList :: [GetExclusionsPreviewResponse] -> ShowS
show :: GetExclusionsPreviewResponse -> String
$cshow :: GetExclusionsPreviewResponse -> String
showsPrec :: Int -> GetExclusionsPreviewResponse -> ShowS
$cshowsPrec :: Int -> GetExclusionsPreviewResponse -> ShowS
Prelude.Show, (forall x.
 GetExclusionsPreviewResponse -> Rep GetExclusionsPreviewResponse x)
-> (forall x.
    Rep GetExclusionsPreviewResponse x -> GetExclusionsPreviewResponse)
-> Generic GetExclusionsPreviewResponse
forall x.
Rep GetExclusionsPreviewResponse x -> GetExclusionsPreviewResponse
forall x.
GetExclusionsPreviewResponse -> Rep GetExclusionsPreviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetExclusionsPreviewResponse x -> GetExclusionsPreviewResponse
$cfrom :: forall x.
GetExclusionsPreviewResponse -> Rep GetExclusionsPreviewResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetExclusionsPreviewResponse' 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:
--
-- 'exclusionPreviews', 'getExclusionsPreviewResponse_exclusionPreviews' - Information about the exclusions included in the preview.
--
-- 'nextToken', 'getExclusionsPreviewResponse_nextToken' - When a response is generated, if there is more data to be listed, this
-- parameters is present in the response and contains the value to use for
-- the nextToken parameter in a subsequent pagination request. If there is
-- no more data to be listed, this parameter is set to null.
--
-- 'httpStatus', 'getExclusionsPreviewResponse_httpStatus' - The response's http status code.
--
-- 'previewStatus', 'getExclusionsPreviewResponse_previewStatus' - Specifies the status of the request to generate an exclusions preview.
newGetExclusionsPreviewResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'previewStatus'
  PreviewStatus ->
  GetExclusionsPreviewResponse
newGetExclusionsPreviewResponse :: Int -> PreviewStatus -> GetExclusionsPreviewResponse
newGetExclusionsPreviewResponse
  Int
pHttpStatus_
  PreviewStatus
pPreviewStatus_ =
    GetExclusionsPreviewResponse' :: Maybe [ExclusionPreview]
-> Maybe Text
-> Int
-> PreviewStatus
-> GetExclusionsPreviewResponse
GetExclusionsPreviewResponse'
      { $sel:exclusionPreviews:GetExclusionsPreviewResponse' :: Maybe [ExclusionPreview]
exclusionPreviews =
          Maybe [ExclusionPreview]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetExclusionsPreviewResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetExclusionsPreviewResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:previewStatus:GetExclusionsPreviewResponse' :: PreviewStatus
previewStatus = PreviewStatus
pPreviewStatus_
      }

-- | Information about the exclusions included in the preview.
getExclusionsPreviewResponse_exclusionPreviews :: Lens.Lens' GetExclusionsPreviewResponse (Prelude.Maybe [ExclusionPreview])
getExclusionsPreviewResponse_exclusionPreviews :: (Maybe [ExclusionPreview] -> f (Maybe [ExclusionPreview]))
-> GetExclusionsPreviewResponse -> f GetExclusionsPreviewResponse
getExclusionsPreviewResponse_exclusionPreviews = (GetExclusionsPreviewResponse -> Maybe [ExclusionPreview])
-> (GetExclusionsPreviewResponse
    -> Maybe [ExclusionPreview] -> GetExclusionsPreviewResponse)
-> Lens
     GetExclusionsPreviewResponse
     GetExclusionsPreviewResponse
     (Maybe [ExclusionPreview])
     (Maybe [ExclusionPreview])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreviewResponse' {Maybe [ExclusionPreview]
exclusionPreviews :: Maybe [ExclusionPreview]
$sel:exclusionPreviews:GetExclusionsPreviewResponse' :: GetExclusionsPreviewResponse -> Maybe [ExclusionPreview]
exclusionPreviews} -> Maybe [ExclusionPreview]
exclusionPreviews) (\s :: GetExclusionsPreviewResponse
s@GetExclusionsPreviewResponse' {} Maybe [ExclusionPreview]
a -> GetExclusionsPreviewResponse
s {$sel:exclusionPreviews:GetExclusionsPreviewResponse' :: Maybe [ExclusionPreview]
exclusionPreviews = Maybe [ExclusionPreview]
a} :: GetExclusionsPreviewResponse) ((Maybe [ExclusionPreview] -> f (Maybe [ExclusionPreview]))
 -> GetExclusionsPreviewResponse -> f GetExclusionsPreviewResponse)
-> ((Maybe [ExclusionPreview] -> f (Maybe [ExclusionPreview]))
    -> Maybe [ExclusionPreview] -> f (Maybe [ExclusionPreview]))
-> (Maybe [ExclusionPreview] -> f (Maybe [ExclusionPreview]))
-> GetExclusionsPreviewResponse
-> f GetExclusionsPreviewResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ExclusionPreview]
  [ExclusionPreview]
  [ExclusionPreview]
  [ExclusionPreview]
-> Iso
     (Maybe [ExclusionPreview])
     (Maybe [ExclusionPreview])
     (Maybe [ExclusionPreview])
     (Maybe [ExclusionPreview])
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
  [ExclusionPreview]
  [ExclusionPreview]
  [ExclusionPreview]
  [ExclusionPreview]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When a response is generated, if there is more data to be listed, this
-- parameters is present in the response and contains the value to use for
-- the nextToken parameter in a subsequent pagination request. If there is
-- no more data to be listed, this parameter is set to null.
getExclusionsPreviewResponse_nextToken :: Lens.Lens' GetExclusionsPreviewResponse (Prelude.Maybe Prelude.Text)
getExclusionsPreviewResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetExclusionsPreviewResponse -> f GetExclusionsPreviewResponse
getExclusionsPreviewResponse_nextToken = (GetExclusionsPreviewResponse -> Maybe Text)
-> (GetExclusionsPreviewResponse
    -> Maybe Text -> GetExclusionsPreviewResponse)
-> Lens
     GetExclusionsPreviewResponse
     GetExclusionsPreviewResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreviewResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetExclusionsPreviewResponse' :: GetExclusionsPreviewResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetExclusionsPreviewResponse
s@GetExclusionsPreviewResponse' {} Maybe Text
a -> GetExclusionsPreviewResponse
s {$sel:nextToken:GetExclusionsPreviewResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetExclusionsPreviewResponse)

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

-- | Specifies the status of the request to generate an exclusions preview.
getExclusionsPreviewResponse_previewStatus :: Lens.Lens' GetExclusionsPreviewResponse PreviewStatus
getExclusionsPreviewResponse_previewStatus :: (PreviewStatus -> f PreviewStatus)
-> GetExclusionsPreviewResponse -> f GetExclusionsPreviewResponse
getExclusionsPreviewResponse_previewStatus = (GetExclusionsPreviewResponse -> PreviewStatus)
-> (GetExclusionsPreviewResponse
    -> PreviewStatus -> GetExclusionsPreviewResponse)
-> Lens
     GetExclusionsPreviewResponse
     GetExclusionsPreviewResponse
     PreviewStatus
     PreviewStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetExclusionsPreviewResponse' {PreviewStatus
previewStatus :: PreviewStatus
$sel:previewStatus:GetExclusionsPreviewResponse' :: GetExclusionsPreviewResponse -> PreviewStatus
previewStatus} -> PreviewStatus
previewStatus) (\s :: GetExclusionsPreviewResponse
s@GetExclusionsPreviewResponse' {} PreviewStatus
a -> GetExclusionsPreviewResponse
s {$sel:previewStatus:GetExclusionsPreviewResponse' :: PreviewStatus
previewStatus = PreviewStatus
a} :: GetExclusionsPreviewResponse)

instance Prelude.NFData GetExclusionsPreviewResponse