{-# 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.GuardDuty.DescribeMalwareScans
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of malware scans. Each member account can view the
-- malware scans for their own accounts. An administrator can view the
-- malware scans for all the member accounts.
--
-- This operation returns paginated results.
module Amazonka.GuardDuty.DescribeMalwareScans
  ( -- * Creating a Request
    DescribeMalwareScans (..),
    newDescribeMalwareScans,

    -- * Request Lenses
    describeMalwareScans_filterCriteria,
    describeMalwareScans_maxResults,
    describeMalwareScans_nextToken,
    describeMalwareScans_sortCriteria,
    describeMalwareScans_detectorId,

    -- * Destructuring the Response
    DescribeMalwareScansResponse (..),
    newDescribeMalwareScansResponse,

    -- * Response Lenses
    describeMalwareScansResponse_nextToken,
    describeMalwareScansResponse_httpStatus,
    describeMalwareScansResponse_scans,
  )
where

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

-- | /See:/ 'newDescribeMalwareScans' smart constructor.
data DescribeMalwareScans = DescribeMalwareScans'
  { -- | Represents the criteria to be used in the filter for describing scan
    -- entries.
    DescribeMalwareScans -> Maybe FilterCriteria
filterCriteria :: Prelude.Maybe FilterCriteria,
    -- | You can use this parameter to indicate the maximum number of items that
    -- you want in the response. The default value is 50. The maximum value is
    -- 50.
    DescribeMalwareScans -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | You can use this parameter when paginating results. Set the value of
    -- this parameter to null on your first call to the list action. For
    -- subsequent calls to the action, fill nextToken in the request with the
    -- value of NextToken from the previous response to continue listing data.
    DescribeMalwareScans -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Represents the criteria used for sorting scan entries.
    DescribeMalwareScans -> Maybe SortCriteria
sortCriteria :: Prelude.Maybe SortCriteria,
    -- | The unique ID of the detector that the request is associated with.
    DescribeMalwareScans -> Text
detectorId :: Prelude.Text
  }
  deriving (DescribeMalwareScans -> DescribeMalwareScans -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMalwareScans -> DescribeMalwareScans -> Bool
$c/= :: DescribeMalwareScans -> DescribeMalwareScans -> Bool
== :: DescribeMalwareScans -> DescribeMalwareScans -> Bool
$c== :: DescribeMalwareScans -> DescribeMalwareScans -> Bool
Prelude.Eq, ReadPrec [DescribeMalwareScans]
ReadPrec DescribeMalwareScans
Int -> ReadS DescribeMalwareScans
ReadS [DescribeMalwareScans]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMalwareScans]
$creadListPrec :: ReadPrec [DescribeMalwareScans]
readPrec :: ReadPrec DescribeMalwareScans
$creadPrec :: ReadPrec DescribeMalwareScans
readList :: ReadS [DescribeMalwareScans]
$creadList :: ReadS [DescribeMalwareScans]
readsPrec :: Int -> ReadS DescribeMalwareScans
$creadsPrec :: Int -> ReadS DescribeMalwareScans
Prelude.Read, Int -> DescribeMalwareScans -> ShowS
[DescribeMalwareScans] -> ShowS
DescribeMalwareScans -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMalwareScans] -> ShowS
$cshowList :: [DescribeMalwareScans] -> ShowS
show :: DescribeMalwareScans -> String
$cshow :: DescribeMalwareScans -> String
showsPrec :: Int -> DescribeMalwareScans -> ShowS
$cshowsPrec :: Int -> DescribeMalwareScans -> ShowS
Prelude.Show, forall x. Rep DescribeMalwareScans x -> DescribeMalwareScans
forall x. DescribeMalwareScans -> Rep DescribeMalwareScans x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeMalwareScans x -> DescribeMalwareScans
$cfrom :: forall x. DescribeMalwareScans -> Rep DescribeMalwareScans x
Prelude.Generic)

-- |
-- Create a value of 'DescribeMalwareScans' 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:
--
-- 'filterCriteria', 'describeMalwareScans_filterCriteria' - Represents the criteria to be used in the filter for describing scan
-- entries.
--
-- 'maxResults', 'describeMalwareScans_maxResults' - You can use this parameter to indicate the maximum number of items that
-- you want in the response. The default value is 50. The maximum value is
-- 50.
--
-- 'nextToken', 'describeMalwareScans_nextToken' - You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the list action. For
-- subsequent calls to the action, fill nextToken in the request with the
-- value of NextToken from the previous response to continue listing data.
--
-- 'sortCriteria', 'describeMalwareScans_sortCriteria' - Represents the criteria used for sorting scan entries.
--
-- 'detectorId', 'describeMalwareScans_detectorId' - The unique ID of the detector that the request is associated with.
newDescribeMalwareScans ::
  -- | 'detectorId'
  Prelude.Text ->
  DescribeMalwareScans
newDescribeMalwareScans :: Text -> DescribeMalwareScans
newDescribeMalwareScans Text
pDetectorId_ =
  DescribeMalwareScans'
    { $sel:filterCriteria:DescribeMalwareScans' :: Maybe FilterCriteria
filterCriteria =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeMalwareScans' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeMalwareScans' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortCriteria:DescribeMalwareScans' :: Maybe SortCriteria
sortCriteria = forall a. Maybe a
Prelude.Nothing,
      $sel:detectorId:DescribeMalwareScans' :: Text
detectorId = Text
pDetectorId_
    }

-- | Represents the criteria to be used in the filter for describing scan
-- entries.
describeMalwareScans_filterCriteria :: Lens.Lens' DescribeMalwareScans (Prelude.Maybe FilterCriteria)
describeMalwareScans_filterCriteria :: Lens' DescribeMalwareScans (Maybe FilterCriteria)
describeMalwareScans_filterCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMalwareScans' {Maybe FilterCriteria
filterCriteria :: Maybe FilterCriteria
$sel:filterCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe FilterCriteria
filterCriteria} -> Maybe FilterCriteria
filterCriteria) (\s :: DescribeMalwareScans
s@DescribeMalwareScans' {} Maybe FilterCriteria
a -> DescribeMalwareScans
s {$sel:filterCriteria:DescribeMalwareScans' :: Maybe FilterCriteria
filterCriteria = Maybe FilterCriteria
a} :: DescribeMalwareScans)

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

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

-- | Represents the criteria used for sorting scan entries.
describeMalwareScans_sortCriteria :: Lens.Lens' DescribeMalwareScans (Prelude.Maybe SortCriteria)
describeMalwareScans_sortCriteria :: Lens' DescribeMalwareScans (Maybe SortCriteria)
describeMalwareScans_sortCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMalwareScans' {Maybe SortCriteria
sortCriteria :: Maybe SortCriteria
$sel:sortCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe SortCriteria
sortCriteria} -> Maybe SortCriteria
sortCriteria) (\s :: DescribeMalwareScans
s@DescribeMalwareScans' {} Maybe SortCriteria
a -> DescribeMalwareScans
s {$sel:sortCriteria:DescribeMalwareScans' :: Maybe SortCriteria
sortCriteria = Maybe SortCriteria
a} :: DescribeMalwareScans)

-- | The unique ID of the detector that the request is associated with.
describeMalwareScans_detectorId :: Lens.Lens' DescribeMalwareScans Prelude.Text
describeMalwareScans_detectorId :: Lens' DescribeMalwareScans Text
describeMalwareScans_detectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMalwareScans' {Text
detectorId :: Text
$sel:detectorId:DescribeMalwareScans' :: DescribeMalwareScans -> Text
detectorId} -> Text
detectorId) (\s :: DescribeMalwareScans
s@DescribeMalwareScans' {} Text
a -> DescribeMalwareScans
s {$sel:detectorId:DescribeMalwareScans' :: Text
detectorId = Text
a} :: DescribeMalwareScans)

instance Core.AWSPager DescribeMalwareScans where
  page :: DescribeMalwareScans
-> AWSResponse DescribeMalwareScans -> Maybe DescribeMalwareScans
page DescribeMalwareScans
rq AWSResponse DescribeMalwareScans
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeMalwareScans
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeMalwareScansResponse (Maybe Text)
describeMalwareScansResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse DescribeMalwareScans
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' DescribeMalwareScansResponse [Scan]
describeMalwareScansResponse_scans) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeMalwareScans
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeMalwareScans (Maybe Text)
describeMalwareScans_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeMalwareScans
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeMalwareScansResponse (Maybe Text)
describeMalwareScansResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeMalwareScans where
  type
    AWSResponse DescribeMalwareScans =
      DescribeMalwareScansResponse
  request :: (Service -> Service)
-> DescribeMalwareScans -> Request DescribeMalwareScans
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 DescribeMalwareScans
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeMalwareScans)))
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 -> Int -> [Scan] -> DescribeMalwareScansResponse
DescribeMalwareScansResponse'
            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
"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 (Maybe a)
Data..?> Key
"scans" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable DescribeMalwareScans where
  hashWithSalt :: Int -> DescribeMalwareScans -> Int
hashWithSalt Int
_salt DescribeMalwareScans' {Maybe Natural
Maybe Text
Maybe FilterCriteria
Maybe SortCriteria
Text
detectorId :: Text
sortCriteria :: Maybe SortCriteria
nextToken :: Maybe Text
maxResults :: Maybe Natural
filterCriteria :: Maybe FilterCriteria
$sel:detectorId:DescribeMalwareScans' :: DescribeMalwareScans -> Text
$sel:sortCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe SortCriteria
$sel:nextToken:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Text
$sel:maxResults:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Natural
$sel:filterCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe FilterCriteria
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FilterCriteria
filterCriteria
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortCriteria
sortCriteria
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
detectorId

instance Prelude.NFData DescribeMalwareScans where
  rnf :: DescribeMalwareScans -> ()
rnf DescribeMalwareScans' {Maybe Natural
Maybe Text
Maybe FilterCriteria
Maybe SortCriteria
Text
detectorId :: Text
sortCriteria :: Maybe SortCriteria
nextToken :: Maybe Text
maxResults :: Maybe Natural
filterCriteria :: Maybe FilterCriteria
$sel:detectorId:DescribeMalwareScans' :: DescribeMalwareScans -> Text
$sel:sortCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe SortCriteria
$sel:nextToken:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Text
$sel:maxResults:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Natural
$sel:filterCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe FilterCriteria
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FilterCriteria
filterCriteria
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
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 Maybe SortCriteria
sortCriteria
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
detectorId

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

instance Data.ToJSON DescribeMalwareScans where
  toJSON :: DescribeMalwareScans -> Value
toJSON DescribeMalwareScans' {Maybe Natural
Maybe Text
Maybe FilterCriteria
Maybe SortCriteria
Text
detectorId :: Text
sortCriteria :: Maybe SortCriteria
nextToken :: Maybe Text
maxResults :: Maybe Natural
filterCriteria :: Maybe FilterCriteria
$sel:detectorId:DescribeMalwareScans' :: DescribeMalwareScans -> Text
$sel:sortCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe SortCriteria
$sel:nextToken:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Text
$sel:maxResults:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Natural
$sel:filterCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe FilterCriteria
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"filterCriteria" 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 FilterCriteria
filterCriteria,
            (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 Natural
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,
            (Key
"sortCriteria" 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 SortCriteria
sortCriteria
          ]
      )

instance Data.ToPath DescribeMalwareScans where
  toPath :: DescribeMalwareScans -> ByteString
toPath DescribeMalwareScans' {Maybe Natural
Maybe Text
Maybe FilterCriteria
Maybe SortCriteria
Text
detectorId :: Text
sortCriteria :: Maybe SortCriteria
nextToken :: Maybe Text
maxResults :: Maybe Natural
filterCriteria :: Maybe FilterCriteria
$sel:detectorId:DescribeMalwareScans' :: DescribeMalwareScans -> Text
$sel:sortCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe SortCriteria
$sel:nextToken:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Text
$sel:maxResults:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe Natural
$sel:filterCriteria:DescribeMalwareScans' :: DescribeMalwareScans -> Maybe FilterCriteria
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/detector/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
detectorId,
        ByteString
"/malware-scans"
      ]

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

-- | /See:/ 'newDescribeMalwareScansResponse' smart constructor.
data DescribeMalwareScansResponse = DescribeMalwareScansResponse'
  { -- | The pagination parameter to be used on the next list operation to
    -- retrieve more items.
    DescribeMalwareScansResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeMalwareScansResponse -> Int
httpStatus :: Prelude.Int,
    -- | Contains information about malware scans.
    DescribeMalwareScansResponse -> [Scan]
scans :: [Scan]
  }
  deriving (DescribeMalwareScansResponse
-> DescribeMalwareScansResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMalwareScansResponse
-> DescribeMalwareScansResponse -> Bool
$c/= :: DescribeMalwareScansResponse
-> DescribeMalwareScansResponse -> Bool
== :: DescribeMalwareScansResponse
-> DescribeMalwareScansResponse -> Bool
$c== :: DescribeMalwareScansResponse
-> DescribeMalwareScansResponse -> Bool
Prelude.Eq, ReadPrec [DescribeMalwareScansResponse]
ReadPrec DescribeMalwareScansResponse
Int -> ReadS DescribeMalwareScansResponse
ReadS [DescribeMalwareScansResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMalwareScansResponse]
$creadListPrec :: ReadPrec [DescribeMalwareScansResponse]
readPrec :: ReadPrec DescribeMalwareScansResponse
$creadPrec :: ReadPrec DescribeMalwareScansResponse
readList :: ReadS [DescribeMalwareScansResponse]
$creadList :: ReadS [DescribeMalwareScansResponse]
readsPrec :: Int -> ReadS DescribeMalwareScansResponse
$creadsPrec :: Int -> ReadS DescribeMalwareScansResponse
Prelude.Read, Int -> DescribeMalwareScansResponse -> ShowS
[DescribeMalwareScansResponse] -> ShowS
DescribeMalwareScansResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMalwareScansResponse] -> ShowS
$cshowList :: [DescribeMalwareScansResponse] -> ShowS
show :: DescribeMalwareScansResponse -> String
$cshow :: DescribeMalwareScansResponse -> String
showsPrec :: Int -> DescribeMalwareScansResponse -> ShowS
$cshowsPrec :: Int -> DescribeMalwareScansResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeMalwareScansResponse x -> DescribeMalwareScansResponse
forall x.
DescribeMalwareScansResponse -> Rep DescribeMalwareScansResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeMalwareScansResponse x -> DescribeMalwareScansResponse
$cfrom :: forall x.
DescribeMalwareScansResponse -> Rep DescribeMalwareScansResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeMalwareScansResponse' 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:
--
-- 'nextToken', 'describeMalwareScansResponse_nextToken' - The pagination parameter to be used on the next list operation to
-- retrieve more items.
--
-- 'httpStatus', 'describeMalwareScansResponse_httpStatus' - The response's http status code.
--
-- 'scans', 'describeMalwareScansResponse_scans' - Contains information about malware scans.
newDescribeMalwareScansResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeMalwareScansResponse
newDescribeMalwareScansResponse :: Int -> DescribeMalwareScansResponse
newDescribeMalwareScansResponse Int
pHttpStatus_ =
  DescribeMalwareScansResponse'
    { $sel:nextToken:DescribeMalwareScansResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeMalwareScansResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:scans:DescribeMalwareScansResponse' :: [Scan]
scans = forall a. Monoid a => a
Prelude.mempty
    }

-- | The pagination parameter to be used on the next list operation to
-- retrieve more items.
describeMalwareScansResponse_nextToken :: Lens.Lens' DescribeMalwareScansResponse (Prelude.Maybe Prelude.Text)
describeMalwareScansResponse_nextToken :: Lens' DescribeMalwareScansResponse (Maybe Text)
describeMalwareScansResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMalwareScansResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeMalwareScansResponse' :: DescribeMalwareScansResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeMalwareScansResponse
s@DescribeMalwareScansResponse' {} Maybe Text
a -> DescribeMalwareScansResponse
s {$sel:nextToken:DescribeMalwareScansResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeMalwareScansResponse)

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

-- | Contains information about malware scans.
describeMalwareScansResponse_scans :: Lens.Lens' DescribeMalwareScansResponse [Scan]
describeMalwareScansResponse_scans :: Lens' DescribeMalwareScansResponse [Scan]
describeMalwareScansResponse_scans = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMalwareScansResponse' {[Scan]
scans :: [Scan]
$sel:scans:DescribeMalwareScansResponse' :: DescribeMalwareScansResponse -> [Scan]
scans} -> [Scan]
scans) (\s :: DescribeMalwareScansResponse
s@DescribeMalwareScansResponse' {} [Scan]
a -> DescribeMalwareScansResponse
s {$sel:scans:DescribeMalwareScansResponse' :: [Scan]
scans = [Scan]
a} :: DescribeMalwareScansResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData DescribeMalwareScansResponse where
  rnf :: DescribeMalwareScansResponse -> ()
rnf DescribeMalwareScansResponse' {Int
[Scan]
Maybe Text
scans :: [Scan]
httpStatus :: Int
nextToken :: Maybe Text
$sel:scans:DescribeMalwareScansResponse' :: DescribeMalwareScansResponse -> [Scan]
$sel:httpStatus:DescribeMalwareScansResponse' :: DescribeMalwareScansResponse -> Int
$sel:nextToken:DescribeMalwareScansResponse' :: DescribeMalwareScansResponse -> Maybe Text
..} =
    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 [Scan]
scans