{-# 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.IoT.ListScheduledAudits
-- 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)
--
-- Lists all of your scheduled audits.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListScheduledAudits>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListScheduledAudits
  ( -- * Creating a Request
    ListScheduledAudits (..),
    newListScheduledAudits,

    -- * Request Lenses
    listScheduledAudits_nextToken,
    listScheduledAudits_maxResults,

    -- * Destructuring the Response
    ListScheduledAuditsResponse (..),
    newListScheduledAuditsResponse,

    -- * Response Lenses
    listScheduledAuditsResponse_scheduledAudits,
    listScheduledAuditsResponse_nextToken,
    listScheduledAuditsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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:/ 'newListScheduledAudits' smart constructor.
data ListScheduledAudits = ListScheduledAudits'
  { -- | The token for the next set of results.
    ListScheduledAudits -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return at one time. The default is 25.
    ListScheduledAudits -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListScheduledAudits -> ListScheduledAudits -> Bool
(ListScheduledAudits -> ListScheduledAudits -> Bool)
-> (ListScheduledAudits -> ListScheduledAudits -> Bool)
-> Eq ListScheduledAudits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListScheduledAudits -> ListScheduledAudits -> Bool
$c/= :: ListScheduledAudits -> ListScheduledAudits -> Bool
== :: ListScheduledAudits -> ListScheduledAudits -> Bool
$c== :: ListScheduledAudits -> ListScheduledAudits -> Bool
Prelude.Eq, ReadPrec [ListScheduledAudits]
ReadPrec ListScheduledAudits
Int -> ReadS ListScheduledAudits
ReadS [ListScheduledAudits]
(Int -> ReadS ListScheduledAudits)
-> ReadS [ListScheduledAudits]
-> ReadPrec ListScheduledAudits
-> ReadPrec [ListScheduledAudits]
-> Read ListScheduledAudits
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListScheduledAudits]
$creadListPrec :: ReadPrec [ListScheduledAudits]
readPrec :: ReadPrec ListScheduledAudits
$creadPrec :: ReadPrec ListScheduledAudits
readList :: ReadS [ListScheduledAudits]
$creadList :: ReadS [ListScheduledAudits]
readsPrec :: Int -> ReadS ListScheduledAudits
$creadsPrec :: Int -> ReadS ListScheduledAudits
Prelude.Read, Int -> ListScheduledAudits -> ShowS
[ListScheduledAudits] -> ShowS
ListScheduledAudits -> String
(Int -> ListScheduledAudits -> ShowS)
-> (ListScheduledAudits -> String)
-> ([ListScheduledAudits] -> ShowS)
-> Show ListScheduledAudits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListScheduledAudits] -> ShowS
$cshowList :: [ListScheduledAudits] -> ShowS
show :: ListScheduledAudits -> String
$cshow :: ListScheduledAudits -> String
showsPrec :: Int -> ListScheduledAudits -> ShowS
$cshowsPrec :: Int -> ListScheduledAudits -> ShowS
Prelude.Show, (forall x. ListScheduledAudits -> Rep ListScheduledAudits x)
-> (forall x. Rep ListScheduledAudits x -> ListScheduledAudits)
-> Generic ListScheduledAudits
forall x. Rep ListScheduledAudits x -> ListScheduledAudits
forall x. ListScheduledAudits -> Rep ListScheduledAudits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListScheduledAudits x -> ListScheduledAudits
$cfrom :: forall x. ListScheduledAudits -> Rep ListScheduledAudits x
Prelude.Generic)

-- |
-- Create a value of 'ListScheduledAudits' 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', 'listScheduledAudits_nextToken' - The token for the next set of results.
--
-- 'maxResults', 'listScheduledAudits_maxResults' - The maximum number of results to return at one time. The default is 25.
newListScheduledAudits ::
  ListScheduledAudits
newListScheduledAudits :: ListScheduledAudits
newListScheduledAudits =
  ListScheduledAudits' :: Maybe Text -> Maybe Natural -> ListScheduledAudits
ListScheduledAudits'
    { $sel:nextToken:ListScheduledAudits' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListScheduledAudits' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The token for the next set of results.
listScheduledAudits_nextToken :: Lens.Lens' ListScheduledAudits (Prelude.Maybe Prelude.Text)
listScheduledAudits_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListScheduledAudits -> f ListScheduledAudits
listScheduledAudits_nextToken = (ListScheduledAudits -> Maybe Text)
-> (ListScheduledAudits -> Maybe Text -> ListScheduledAudits)
-> Lens
     ListScheduledAudits ListScheduledAudits (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListScheduledAudits' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListScheduledAudits' :: ListScheduledAudits -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListScheduledAudits
s@ListScheduledAudits' {} Maybe Text
a -> ListScheduledAudits
s {$sel:nextToken:ListScheduledAudits' :: Maybe Text
nextToken = Maybe Text
a} :: ListScheduledAudits)

-- | The maximum number of results to return at one time. The default is 25.
listScheduledAudits_maxResults :: Lens.Lens' ListScheduledAudits (Prelude.Maybe Prelude.Natural)
listScheduledAudits_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListScheduledAudits -> f ListScheduledAudits
listScheduledAudits_maxResults = (ListScheduledAudits -> Maybe Natural)
-> (ListScheduledAudits -> Maybe Natural -> ListScheduledAudits)
-> Lens
     ListScheduledAudits
     ListScheduledAudits
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListScheduledAudits' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListScheduledAudits' :: ListScheduledAudits -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListScheduledAudits
s@ListScheduledAudits' {} Maybe Natural
a -> ListScheduledAudits
s {$sel:maxResults:ListScheduledAudits' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListScheduledAudits)

instance Core.AWSPager ListScheduledAudits where
  page :: ListScheduledAudits
-> AWSResponse ListScheduledAudits -> Maybe ListScheduledAudits
page ListScheduledAudits
rq AWSResponse ListScheduledAudits
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListScheduledAudits
ListScheduledAuditsResponse
rs
            ListScheduledAuditsResponse
-> Getting (First Text) ListScheduledAuditsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListScheduledAuditsResponse
-> Const (First Text) ListScheduledAuditsResponse
Lens' ListScheduledAuditsResponse (Maybe Text)
listScheduledAuditsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListScheduledAuditsResponse
 -> Const (First Text) ListScheduledAuditsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListScheduledAuditsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListScheduledAudits
forall a. Maybe a
Prelude.Nothing
    | Maybe [ScheduledAuditMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListScheduledAudits
ListScheduledAuditsResponse
rs
            ListScheduledAuditsResponse
-> Getting
     (First [ScheduledAuditMetadata])
     ListScheduledAuditsResponse
     [ScheduledAuditMetadata]
-> Maybe [ScheduledAuditMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ScheduledAuditMetadata]
 -> Const
      (First [ScheduledAuditMetadata]) (Maybe [ScheduledAuditMetadata]))
-> ListScheduledAuditsResponse
-> Const
     (First [ScheduledAuditMetadata]) ListScheduledAuditsResponse
Lens' ListScheduledAuditsResponse (Maybe [ScheduledAuditMetadata])
listScheduledAuditsResponse_scheduledAudits
              ((Maybe [ScheduledAuditMetadata]
  -> Const
       (First [ScheduledAuditMetadata]) (Maybe [ScheduledAuditMetadata]))
 -> ListScheduledAuditsResponse
 -> Const
      (First [ScheduledAuditMetadata]) ListScheduledAuditsResponse)
-> (([ScheduledAuditMetadata]
     -> Const (First [ScheduledAuditMetadata]) [ScheduledAuditMetadata])
    -> Maybe [ScheduledAuditMetadata]
    -> Const
         (First [ScheduledAuditMetadata]) (Maybe [ScheduledAuditMetadata]))
-> Getting
     (First [ScheduledAuditMetadata])
     ListScheduledAuditsResponse
     [ScheduledAuditMetadata]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ScheduledAuditMetadata]
 -> Const (First [ScheduledAuditMetadata]) [ScheduledAuditMetadata])
-> Maybe [ScheduledAuditMetadata]
-> Const
     (First [ScheduledAuditMetadata]) (Maybe [ScheduledAuditMetadata])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListScheduledAudits
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListScheduledAudits -> Maybe ListScheduledAudits
forall a. a -> Maybe a
Prelude.Just (ListScheduledAudits -> Maybe ListScheduledAudits)
-> ListScheduledAudits -> Maybe ListScheduledAudits
forall a b. (a -> b) -> a -> b
Prelude.$
        ListScheduledAudits
rq
          ListScheduledAudits
-> (ListScheduledAudits -> ListScheduledAudits)
-> ListScheduledAudits
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListScheduledAudits -> Identity ListScheduledAudits
Lens
  ListScheduledAudits ListScheduledAudits (Maybe Text) (Maybe Text)
listScheduledAudits_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListScheduledAudits -> Identity ListScheduledAudits)
-> Maybe Text -> ListScheduledAudits -> ListScheduledAudits
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListScheduledAudits
ListScheduledAuditsResponse
rs
          ListScheduledAuditsResponse
-> Getting (First Text) ListScheduledAuditsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListScheduledAuditsResponse
-> Const (First Text) ListScheduledAuditsResponse
Lens' ListScheduledAuditsResponse (Maybe Text)
listScheduledAuditsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListScheduledAuditsResponse
 -> Const (First Text) ListScheduledAuditsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListScheduledAuditsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListScheduledAudits where
  type
    AWSResponse ListScheduledAudits =
      ListScheduledAuditsResponse
  request :: ListScheduledAudits -> Request ListScheduledAudits
request = Service -> ListScheduledAudits -> Request ListScheduledAudits
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListScheduledAudits
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListScheduledAudits)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListScheduledAudits))
-> Logger
-> Service
-> Proxy ListScheduledAudits
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListScheduledAudits)))
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 [ScheduledAuditMetadata]
-> Maybe Text -> Int -> ListScheduledAuditsResponse
ListScheduledAuditsResponse'
            (Maybe [ScheduledAuditMetadata]
 -> Maybe Text -> Int -> ListScheduledAuditsResponse)
-> Either String (Maybe [ScheduledAuditMetadata])
-> Either String (Maybe Text -> Int -> ListScheduledAuditsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ScheduledAuditMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"scheduledAudits"
                            Either String (Maybe (Maybe [ScheduledAuditMetadata]))
-> Maybe [ScheduledAuditMetadata]
-> Either String (Maybe [ScheduledAuditMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ScheduledAuditMetadata]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> ListScheduledAuditsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListScheduledAuditsResponse)
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 -> ListScheduledAuditsResponse)
-> Either String Int -> Either String ListScheduledAuditsResponse
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))
      )

instance Prelude.Hashable ListScheduledAudits

instance Prelude.NFData ListScheduledAudits

instance Core.ToHeaders ListScheduledAudits where
  toHeaders :: ListScheduledAudits -> ResponseHeaders
toHeaders = ResponseHeaders -> ListScheduledAudits -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListScheduledAudits where
  toQuery :: ListScheduledAudits -> QueryString
toQuery ListScheduledAudits' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListScheduledAudits' :: ListScheduledAudits -> Maybe Natural
$sel:nextToken:ListScheduledAudits' :: ListScheduledAudits -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListScheduledAuditsResponse' smart constructor.
data ListScheduledAuditsResponse = ListScheduledAuditsResponse'
  { -- | The list of scheduled audits.
    ListScheduledAuditsResponse -> Maybe [ScheduledAuditMetadata]
scheduledAudits :: Prelude.Maybe [ScheduledAuditMetadata],
    -- | A token that can be used to retrieve the next set of results, or @null@
    -- if there are no additional results.
    ListScheduledAuditsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListScheduledAuditsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListScheduledAuditsResponse -> ListScheduledAuditsResponse -> Bool
(ListScheduledAuditsResponse
 -> ListScheduledAuditsResponse -> Bool)
-> (ListScheduledAuditsResponse
    -> ListScheduledAuditsResponse -> Bool)
-> Eq ListScheduledAuditsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListScheduledAuditsResponse -> ListScheduledAuditsResponse -> Bool
$c/= :: ListScheduledAuditsResponse -> ListScheduledAuditsResponse -> Bool
== :: ListScheduledAuditsResponse -> ListScheduledAuditsResponse -> Bool
$c== :: ListScheduledAuditsResponse -> ListScheduledAuditsResponse -> Bool
Prelude.Eq, ReadPrec [ListScheduledAuditsResponse]
ReadPrec ListScheduledAuditsResponse
Int -> ReadS ListScheduledAuditsResponse
ReadS [ListScheduledAuditsResponse]
(Int -> ReadS ListScheduledAuditsResponse)
-> ReadS [ListScheduledAuditsResponse]
-> ReadPrec ListScheduledAuditsResponse
-> ReadPrec [ListScheduledAuditsResponse]
-> Read ListScheduledAuditsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListScheduledAuditsResponse]
$creadListPrec :: ReadPrec [ListScheduledAuditsResponse]
readPrec :: ReadPrec ListScheduledAuditsResponse
$creadPrec :: ReadPrec ListScheduledAuditsResponse
readList :: ReadS [ListScheduledAuditsResponse]
$creadList :: ReadS [ListScheduledAuditsResponse]
readsPrec :: Int -> ReadS ListScheduledAuditsResponse
$creadsPrec :: Int -> ReadS ListScheduledAuditsResponse
Prelude.Read, Int -> ListScheduledAuditsResponse -> ShowS
[ListScheduledAuditsResponse] -> ShowS
ListScheduledAuditsResponse -> String
(Int -> ListScheduledAuditsResponse -> ShowS)
-> (ListScheduledAuditsResponse -> String)
-> ([ListScheduledAuditsResponse] -> ShowS)
-> Show ListScheduledAuditsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListScheduledAuditsResponse] -> ShowS
$cshowList :: [ListScheduledAuditsResponse] -> ShowS
show :: ListScheduledAuditsResponse -> String
$cshow :: ListScheduledAuditsResponse -> String
showsPrec :: Int -> ListScheduledAuditsResponse -> ShowS
$cshowsPrec :: Int -> ListScheduledAuditsResponse -> ShowS
Prelude.Show, (forall x.
 ListScheduledAuditsResponse -> Rep ListScheduledAuditsResponse x)
-> (forall x.
    Rep ListScheduledAuditsResponse x -> ListScheduledAuditsResponse)
-> Generic ListScheduledAuditsResponse
forall x.
Rep ListScheduledAuditsResponse x -> ListScheduledAuditsResponse
forall x.
ListScheduledAuditsResponse -> Rep ListScheduledAuditsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListScheduledAuditsResponse x -> ListScheduledAuditsResponse
$cfrom :: forall x.
ListScheduledAuditsResponse -> Rep ListScheduledAuditsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListScheduledAuditsResponse' 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:
--
-- 'scheduledAudits', 'listScheduledAuditsResponse_scheduledAudits' - The list of scheduled audits.
--
-- 'nextToken', 'listScheduledAuditsResponse_nextToken' - A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
--
-- 'httpStatus', 'listScheduledAuditsResponse_httpStatus' - The response's http status code.
newListScheduledAuditsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListScheduledAuditsResponse
newListScheduledAuditsResponse :: Int -> ListScheduledAuditsResponse
newListScheduledAuditsResponse Int
pHttpStatus_ =
  ListScheduledAuditsResponse' :: Maybe [ScheduledAuditMetadata]
-> Maybe Text -> Int -> ListScheduledAuditsResponse
ListScheduledAuditsResponse'
    { $sel:scheduledAudits:ListScheduledAuditsResponse' :: Maybe [ScheduledAuditMetadata]
scheduledAudits =
        Maybe [ScheduledAuditMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListScheduledAuditsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListScheduledAuditsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of scheduled audits.
listScheduledAuditsResponse_scheduledAudits :: Lens.Lens' ListScheduledAuditsResponse (Prelude.Maybe [ScheduledAuditMetadata])
listScheduledAuditsResponse_scheduledAudits :: (Maybe [ScheduledAuditMetadata]
 -> f (Maybe [ScheduledAuditMetadata]))
-> ListScheduledAuditsResponse -> f ListScheduledAuditsResponse
listScheduledAuditsResponse_scheduledAudits = (ListScheduledAuditsResponse -> Maybe [ScheduledAuditMetadata])
-> (ListScheduledAuditsResponse
    -> Maybe [ScheduledAuditMetadata] -> ListScheduledAuditsResponse)
-> Lens'
     ListScheduledAuditsResponse (Maybe [ScheduledAuditMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListScheduledAuditsResponse' {Maybe [ScheduledAuditMetadata]
scheduledAudits :: Maybe [ScheduledAuditMetadata]
$sel:scheduledAudits:ListScheduledAuditsResponse' :: ListScheduledAuditsResponse -> Maybe [ScheduledAuditMetadata]
scheduledAudits} -> Maybe [ScheduledAuditMetadata]
scheduledAudits) (\s :: ListScheduledAuditsResponse
s@ListScheduledAuditsResponse' {} Maybe [ScheduledAuditMetadata]
a -> ListScheduledAuditsResponse
s {$sel:scheduledAudits:ListScheduledAuditsResponse' :: Maybe [ScheduledAuditMetadata]
scheduledAudits = Maybe [ScheduledAuditMetadata]
a} :: ListScheduledAuditsResponse) ((Maybe [ScheduledAuditMetadata]
  -> f (Maybe [ScheduledAuditMetadata]))
 -> ListScheduledAuditsResponse -> f ListScheduledAuditsResponse)
-> ((Maybe [ScheduledAuditMetadata]
     -> f (Maybe [ScheduledAuditMetadata]))
    -> Maybe [ScheduledAuditMetadata]
    -> f (Maybe [ScheduledAuditMetadata]))
-> (Maybe [ScheduledAuditMetadata]
    -> f (Maybe [ScheduledAuditMetadata]))
-> ListScheduledAuditsResponse
-> f ListScheduledAuditsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ScheduledAuditMetadata]
  [ScheduledAuditMetadata]
  [ScheduledAuditMetadata]
  [ScheduledAuditMetadata]
-> Iso
     (Maybe [ScheduledAuditMetadata])
     (Maybe [ScheduledAuditMetadata])
     (Maybe [ScheduledAuditMetadata])
     (Maybe [ScheduledAuditMetadata])
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
  [ScheduledAuditMetadata]
  [ScheduledAuditMetadata]
  [ScheduledAuditMetadata]
  [ScheduledAuditMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
listScheduledAuditsResponse_nextToken :: Lens.Lens' ListScheduledAuditsResponse (Prelude.Maybe Prelude.Text)
listScheduledAuditsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListScheduledAuditsResponse -> f ListScheduledAuditsResponse
listScheduledAuditsResponse_nextToken = (ListScheduledAuditsResponse -> Maybe Text)
-> (ListScheduledAuditsResponse
    -> Maybe Text -> ListScheduledAuditsResponse)
-> Lens' ListScheduledAuditsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListScheduledAuditsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListScheduledAuditsResponse' :: ListScheduledAuditsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListScheduledAuditsResponse
s@ListScheduledAuditsResponse' {} Maybe Text
a -> ListScheduledAuditsResponse
s {$sel:nextToken:ListScheduledAuditsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListScheduledAuditsResponse)

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

instance Prelude.NFData ListScheduledAuditsResponse