{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_maxResults,
    getExclusionsPreview_nextToken,
    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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector.Types
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 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,
    -- | 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,
    -- | 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
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]
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
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. 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.
--
-- '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.
--
-- '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.
--
-- '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'
      { $sel:locale:GetExclusionsPreview' :: Maybe Locale
locale = forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetExclusionsPreview' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetExclusionsPreview' :: Maybe Text
nextToken = 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 :: Lens' GetExclusionsPreview (Maybe Locale)
getExclusionsPreview_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 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 :: Lens' GetExclusionsPreview (Maybe Int)
getExclusionsPreview_maxResults = 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)

-- | 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 :: Lens' GetExclusionsPreview (Maybe Text)
getExclusionsPreview_nextToken = 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)

-- | The ARN that specifies the assessment template for which the exclusions
-- preview was requested.
getExclusionsPreview_assessmentTemplateArn :: Lens.Lens' GetExclusionsPreview Prelude.Text
getExclusionsPreview_assessmentTemplateArn :: Lens' GetExclusionsPreview Text
getExclusionsPreview_assessmentTemplateArn = 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 :: Lens' GetExclusionsPreview Text
getExclusionsPreview_previewToken = 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 :: (Service -> Service)
-> GetExclusionsPreview -> Request GetExclusionsPreview
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 GetExclusionsPreview
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetExclusionsPreview)))
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 [ExclusionPreview]
-> Maybe Text
-> Int
-> PreviewStatus
-> GetExclusionsPreviewResponse
GetExclusionsPreviewResponse'
            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
"exclusionPreviews"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            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
"nextToken")
            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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"previewStatus")
      )

instance Prelude.Hashable GetExclusionsPreview where
  hashWithSalt :: Int -> GetExclusionsPreview -> Int
hashWithSalt Int
_salt GetExclusionsPreview' {Maybe Int
Maybe Text
Maybe Locale
Text
previewToken :: Text
assessmentTemplateArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
locale :: Maybe Locale
$sel:previewToken:GetExclusionsPreview' :: GetExclusionsPreview -> Text
$sel:assessmentTemplateArn:GetExclusionsPreview' :: GetExclusionsPreview -> Text
$sel:nextToken:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Text
$sel:maxResults:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Int
$sel:locale:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Locale
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Locale
locale
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
assessmentTemplateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
previewToken

instance Prelude.NFData GetExclusionsPreview where
  rnf :: GetExclusionsPreview -> ()
rnf GetExclusionsPreview' {Maybe Int
Maybe Text
Maybe Locale
Text
previewToken :: Text
assessmentTemplateArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
locale :: Maybe Locale
$sel:previewToken:GetExclusionsPreview' :: GetExclusionsPreview -> Text
$sel:assessmentTemplateArn:GetExclusionsPreview' :: GetExclusionsPreview -> Text
$sel:nextToken:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Text
$sel:maxResults:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Int
$sel:locale:GetExclusionsPreview' :: GetExclusionsPreview -> Maybe Locale
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Locale
locale
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
assessmentTemplateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
previewToken

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

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

instance Data.ToQuery GetExclusionsPreview where
  toQuery :: GetExclusionsPreview -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
      { $sel:exclusionPreviews:GetExclusionsPreviewResponse' :: Maybe [ExclusionPreview]
exclusionPreviews =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetExclusionsPreviewResponse' :: Maybe Text
nextToken = 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 :: Lens' GetExclusionsPreviewResponse (Maybe [ExclusionPreview])
getExclusionsPreviewResponse_exclusionPreviews = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' GetExclusionsPreviewResponse (Maybe Text)
getExclusionsPreviewResponse_nextToken = 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 :: Lens' GetExclusionsPreviewResponse Int
getExclusionsPreviewResponse_httpStatus = 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 :: Lens' GetExclusionsPreviewResponse PreviewStatus
getExclusionsPreviewResponse_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 where
  rnf :: GetExclusionsPreviewResponse -> ()
rnf GetExclusionsPreviewResponse' {Int
Maybe [ExclusionPreview]
Maybe Text
PreviewStatus
previewStatus :: PreviewStatus
httpStatus :: Int
nextToken :: Maybe Text
exclusionPreviews :: Maybe [ExclusionPreview]
$sel:previewStatus:GetExclusionsPreviewResponse' :: GetExclusionsPreviewResponse -> PreviewStatus
$sel:httpStatus:GetExclusionsPreviewResponse' :: GetExclusionsPreviewResponse -> Int
$sel:nextToken:GetExclusionsPreviewResponse' :: GetExclusionsPreviewResponse -> Maybe Text
$sel:exclusionPreviews:GetExclusionsPreviewResponse' :: GetExclusionsPreviewResponse -> Maybe [ExclusionPreview]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ExclusionPreview]
exclusionPreviews
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PreviewStatus
previewStatus