{-# 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.AlexaBusiness.ListBusinessReportSchedules
-- 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 the details of the schedules that a user configured. A download
-- URL of the report associated with each schedule is returned every time
-- this action is called. A new download URL is returned each time, and is
-- valid for 24 hours.
--
-- This operation returns paginated results.
module Amazonka.AlexaBusiness.ListBusinessReportSchedules
  ( -- * Creating a Request
    ListBusinessReportSchedules (..),
    newListBusinessReportSchedules,

    -- * Request Lenses
    listBusinessReportSchedules_nextToken,
    listBusinessReportSchedules_maxResults,

    -- * Destructuring the Response
    ListBusinessReportSchedulesResponse (..),
    newListBusinessReportSchedulesResponse,

    -- * Response Lenses
    listBusinessReportSchedulesResponse_businessReportSchedules,
    listBusinessReportSchedulesResponse_nextToken,
    listBusinessReportSchedulesResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
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:/ 'newListBusinessReportSchedules' smart constructor.
data ListBusinessReportSchedules = ListBusinessReportSchedules'
  { -- | The token used to list the remaining schedules from the previous API
    -- call.
    ListBusinessReportSchedules -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of schedules listed in the call.
    ListBusinessReportSchedules -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListBusinessReportSchedules -> ListBusinessReportSchedules -> Bool
(ListBusinessReportSchedules
 -> ListBusinessReportSchedules -> Bool)
-> (ListBusinessReportSchedules
    -> ListBusinessReportSchedules -> Bool)
-> Eq ListBusinessReportSchedules
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBusinessReportSchedules -> ListBusinessReportSchedules -> Bool
$c/= :: ListBusinessReportSchedules -> ListBusinessReportSchedules -> Bool
== :: ListBusinessReportSchedules -> ListBusinessReportSchedules -> Bool
$c== :: ListBusinessReportSchedules -> ListBusinessReportSchedules -> Bool
Prelude.Eq, ReadPrec [ListBusinessReportSchedules]
ReadPrec ListBusinessReportSchedules
Int -> ReadS ListBusinessReportSchedules
ReadS [ListBusinessReportSchedules]
(Int -> ReadS ListBusinessReportSchedules)
-> ReadS [ListBusinessReportSchedules]
-> ReadPrec ListBusinessReportSchedules
-> ReadPrec [ListBusinessReportSchedules]
-> Read ListBusinessReportSchedules
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBusinessReportSchedules]
$creadListPrec :: ReadPrec [ListBusinessReportSchedules]
readPrec :: ReadPrec ListBusinessReportSchedules
$creadPrec :: ReadPrec ListBusinessReportSchedules
readList :: ReadS [ListBusinessReportSchedules]
$creadList :: ReadS [ListBusinessReportSchedules]
readsPrec :: Int -> ReadS ListBusinessReportSchedules
$creadsPrec :: Int -> ReadS ListBusinessReportSchedules
Prelude.Read, Int -> ListBusinessReportSchedules -> ShowS
[ListBusinessReportSchedules] -> ShowS
ListBusinessReportSchedules -> String
(Int -> ListBusinessReportSchedules -> ShowS)
-> (ListBusinessReportSchedules -> String)
-> ([ListBusinessReportSchedules] -> ShowS)
-> Show ListBusinessReportSchedules
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBusinessReportSchedules] -> ShowS
$cshowList :: [ListBusinessReportSchedules] -> ShowS
show :: ListBusinessReportSchedules -> String
$cshow :: ListBusinessReportSchedules -> String
showsPrec :: Int -> ListBusinessReportSchedules -> ShowS
$cshowsPrec :: Int -> ListBusinessReportSchedules -> ShowS
Prelude.Show, (forall x.
 ListBusinessReportSchedules -> Rep ListBusinessReportSchedules x)
-> (forall x.
    Rep ListBusinessReportSchedules x -> ListBusinessReportSchedules)
-> Generic ListBusinessReportSchedules
forall x.
Rep ListBusinessReportSchedules x -> ListBusinessReportSchedules
forall x.
ListBusinessReportSchedules -> Rep ListBusinessReportSchedules x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBusinessReportSchedules x -> ListBusinessReportSchedules
$cfrom :: forall x.
ListBusinessReportSchedules -> Rep ListBusinessReportSchedules x
Prelude.Generic)

-- |
-- Create a value of 'ListBusinessReportSchedules' 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', 'listBusinessReportSchedules_nextToken' - The token used to list the remaining schedules from the previous API
-- call.
--
-- 'maxResults', 'listBusinessReportSchedules_maxResults' - The maximum number of schedules listed in the call.
newListBusinessReportSchedules ::
  ListBusinessReportSchedules
newListBusinessReportSchedules :: ListBusinessReportSchedules
newListBusinessReportSchedules =
  ListBusinessReportSchedules' :: Maybe Text -> Maybe Natural -> ListBusinessReportSchedules
ListBusinessReportSchedules'
    { $sel:nextToken:ListBusinessReportSchedules' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListBusinessReportSchedules' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The token used to list the remaining schedules from the previous API
-- call.
listBusinessReportSchedules_nextToken :: Lens.Lens' ListBusinessReportSchedules (Prelude.Maybe Prelude.Text)
listBusinessReportSchedules_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListBusinessReportSchedules -> f ListBusinessReportSchedules
listBusinessReportSchedules_nextToken = (ListBusinessReportSchedules -> Maybe Text)
-> (ListBusinessReportSchedules
    -> Maybe Text -> ListBusinessReportSchedules)
-> Lens
     ListBusinessReportSchedules
     ListBusinessReportSchedules
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBusinessReportSchedules' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBusinessReportSchedules
s@ListBusinessReportSchedules' {} Maybe Text
a -> ListBusinessReportSchedules
s {$sel:nextToken:ListBusinessReportSchedules' :: Maybe Text
nextToken = Maybe Text
a} :: ListBusinessReportSchedules)

-- | The maximum number of schedules listed in the call.
listBusinessReportSchedules_maxResults :: Lens.Lens' ListBusinessReportSchedules (Prelude.Maybe Prelude.Natural)
listBusinessReportSchedules_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListBusinessReportSchedules -> f ListBusinessReportSchedules
listBusinessReportSchedules_maxResults = (ListBusinessReportSchedules -> Maybe Natural)
-> (ListBusinessReportSchedules
    -> Maybe Natural -> ListBusinessReportSchedules)
-> Lens
     ListBusinessReportSchedules
     ListBusinessReportSchedules
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBusinessReportSchedules' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListBusinessReportSchedules
s@ListBusinessReportSchedules' {} Maybe Natural
a -> ListBusinessReportSchedules
s {$sel:maxResults:ListBusinessReportSchedules' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListBusinessReportSchedules)

instance Core.AWSPager ListBusinessReportSchedules where
  page :: ListBusinessReportSchedules
-> AWSResponse ListBusinessReportSchedules
-> Maybe ListBusinessReportSchedules
page ListBusinessReportSchedules
rq AWSResponse ListBusinessReportSchedules
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBusinessReportSchedules
ListBusinessReportSchedulesResponse
rs
            ListBusinessReportSchedulesResponse
-> Getting (First Text) ListBusinessReportSchedulesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListBusinessReportSchedulesResponse
-> Const (First Text) ListBusinessReportSchedulesResponse
Lens' ListBusinessReportSchedulesResponse (Maybe Text)
listBusinessReportSchedulesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListBusinessReportSchedulesResponse
 -> Const (First Text) ListBusinessReportSchedulesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListBusinessReportSchedulesResponse 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 ListBusinessReportSchedules
forall a. Maybe a
Prelude.Nothing
    | Maybe [BusinessReportSchedule] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBusinessReportSchedules
ListBusinessReportSchedulesResponse
rs
            ListBusinessReportSchedulesResponse
-> Getting
     (First [BusinessReportSchedule])
     ListBusinessReportSchedulesResponse
     [BusinessReportSchedule]
-> Maybe [BusinessReportSchedule]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [BusinessReportSchedule]
 -> Const
      (First [BusinessReportSchedule]) (Maybe [BusinessReportSchedule]))
-> ListBusinessReportSchedulesResponse
-> Const
     (First [BusinessReportSchedule])
     ListBusinessReportSchedulesResponse
Lens'
  ListBusinessReportSchedulesResponse
  (Maybe [BusinessReportSchedule])
listBusinessReportSchedulesResponse_businessReportSchedules
              ((Maybe [BusinessReportSchedule]
  -> Const
       (First [BusinessReportSchedule]) (Maybe [BusinessReportSchedule]))
 -> ListBusinessReportSchedulesResponse
 -> Const
      (First [BusinessReportSchedule])
      ListBusinessReportSchedulesResponse)
-> (([BusinessReportSchedule]
     -> Const (First [BusinessReportSchedule]) [BusinessReportSchedule])
    -> Maybe [BusinessReportSchedule]
    -> Const
         (First [BusinessReportSchedule]) (Maybe [BusinessReportSchedule]))
-> Getting
     (First [BusinessReportSchedule])
     ListBusinessReportSchedulesResponse
     [BusinessReportSchedule]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BusinessReportSchedule]
 -> Const (First [BusinessReportSchedule]) [BusinessReportSchedule])
-> Maybe [BusinessReportSchedule]
-> Const
     (First [BusinessReportSchedule]) (Maybe [BusinessReportSchedule])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListBusinessReportSchedules
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListBusinessReportSchedules -> Maybe ListBusinessReportSchedules
forall a. a -> Maybe a
Prelude.Just (ListBusinessReportSchedules -> Maybe ListBusinessReportSchedules)
-> ListBusinessReportSchedules -> Maybe ListBusinessReportSchedules
forall a b. (a -> b) -> a -> b
Prelude.$
        ListBusinessReportSchedules
rq
          ListBusinessReportSchedules
-> (ListBusinessReportSchedules -> ListBusinessReportSchedules)
-> ListBusinessReportSchedules
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListBusinessReportSchedules
-> Identity ListBusinessReportSchedules
Lens
  ListBusinessReportSchedules
  ListBusinessReportSchedules
  (Maybe Text)
  (Maybe Text)
listBusinessReportSchedules_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListBusinessReportSchedules
 -> Identity ListBusinessReportSchedules)
-> Maybe Text
-> ListBusinessReportSchedules
-> ListBusinessReportSchedules
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBusinessReportSchedules
ListBusinessReportSchedulesResponse
rs
          ListBusinessReportSchedulesResponse
-> Getting (First Text) ListBusinessReportSchedulesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListBusinessReportSchedulesResponse
-> Const (First Text) ListBusinessReportSchedulesResponse
Lens' ListBusinessReportSchedulesResponse (Maybe Text)
listBusinessReportSchedulesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListBusinessReportSchedulesResponse
 -> Const (First Text) ListBusinessReportSchedulesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListBusinessReportSchedulesResponse 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 ListBusinessReportSchedules where
  type
    AWSResponse ListBusinessReportSchedules =
      ListBusinessReportSchedulesResponse
  request :: ListBusinessReportSchedules -> Request ListBusinessReportSchedules
request = Service
-> ListBusinessReportSchedules
-> Request ListBusinessReportSchedules
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListBusinessReportSchedules
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListBusinessReportSchedules)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListBusinessReportSchedules))
-> Logger
-> Service
-> Proxy ListBusinessReportSchedules
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListBusinessReportSchedules)))
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 [BusinessReportSchedule]
-> Maybe Text -> Int -> ListBusinessReportSchedulesResponse
ListBusinessReportSchedulesResponse'
            (Maybe [BusinessReportSchedule]
 -> Maybe Text -> Int -> ListBusinessReportSchedulesResponse)
-> Either String (Maybe [BusinessReportSchedule])
-> Either
     String (Maybe Text -> Int -> ListBusinessReportSchedulesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [BusinessReportSchedule]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BusinessReportSchedules"
                            Either String (Maybe (Maybe [BusinessReportSchedule]))
-> Maybe [BusinessReportSchedule]
-> Either String (Maybe [BusinessReportSchedule])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [BusinessReportSchedule]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String (Maybe Text -> Int -> ListBusinessReportSchedulesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListBusinessReportSchedulesResponse)
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 -> ListBusinessReportSchedulesResponse)
-> Either String Int
-> Either String ListBusinessReportSchedulesResponse
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 ListBusinessReportSchedules

instance Prelude.NFData ListBusinessReportSchedules

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

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

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

-- | /See:/ 'newListBusinessReportSchedulesResponse' smart constructor.
data ListBusinessReportSchedulesResponse = ListBusinessReportSchedulesResponse'
  { -- | The schedule of the reports.
    ListBusinessReportSchedulesResponse
-> Maybe [BusinessReportSchedule]
businessReportSchedules :: Prelude.Maybe [BusinessReportSchedule],
    -- | The token used to list the remaining schedules from the previous API
    -- call.
    ListBusinessReportSchedulesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListBusinessReportSchedulesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBusinessReportSchedulesResponse
-> ListBusinessReportSchedulesResponse -> Bool
(ListBusinessReportSchedulesResponse
 -> ListBusinessReportSchedulesResponse -> Bool)
-> (ListBusinessReportSchedulesResponse
    -> ListBusinessReportSchedulesResponse -> Bool)
-> Eq ListBusinessReportSchedulesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBusinessReportSchedulesResponse
-> ListBusinessReportSchedulesResponse -> Bool
$c/= :: ListBusinessReportSchedulesResponse
-> ListBusinessReportSchedulesResponse -> Bool
== :: ListBusinessReportSchedulesResponse
-> ListBusinessReportSchedulesResponse -> Bool
$c== :: ListBusinessReportSchedulesResponse
-> ListBusinessReportSchedulesResponse -> Bool
Prelude.Eq, ReadPrec [ListBusinessReportSchedulesResponse]
ReadPrec ListBusinessReportSchedulesResponse
Int -> ReadS ListBusinessReportSchedulesResponse
ReadS [ListBusinessReportSchedulesResponse]
(Int -> ReadS ListBusinessReportSchedulesResponse)
-> ReadS [ListBusinessReportSchedulesResponse]
-> ReadPrec ListBusinessReportSchedulesResponse
-> ReadPrec [ListBusinessReportSchedulesResponse]
-> Read ListBusinessReportSchedulesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBusinessReportSchedulesResponse]
$creadListPrec :: ReadPrec [ListBusinessReportSchedulesResponse]
readPrec :: ReadPrec ListBusinessReportSchedulesResponse
$creadPrec :: ReadPrec ListBusinessReportSchedulesResponse
readList :: ReadS [ListBusinessReportSchedulesResponse]
$creadList :: ReadS [ListBusinessReportSchedulesResponse]
readsPrec :: Int -> ReadS ListBusinessReportSchedulesResponse
$creadsPrec :: Int -> ReadS ListBusinessReportSchedulesResponse
Prelude.Read, Int -> ListBusinessReportSchedulesResponse -> ShowS
[ListBusinessReportSchedulesResponse] -> ShowS
ListBusinessReportSchedulesResponse -> String
(Int -> ListBusinessReportSchedulesResponse -> ShowS)
-> (ListBusinessReportSchedulesResponse -> String)
-> ([ListBusinessReportSchedulesResponse] -> ShowS)
-> Show ListBusinessReportSchedulesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBusinessReportSchedulesResponse] -> ShowS
$cshowList :: [ListBusinessReportSchedulesResponse] -> ShowS
show :: ListBusinessReportSchedulesResponse -> String
$cshow :: ListBusinessReportSchedulesResponse -> String
showsPrec :: Int -> ListBusinessReportSchedulesResponse -> ShowS
$cshowsPrec :: Int -> ListBusinessReportSchedulesResponse -> ShowS
Prelude.Show, (forall x.
 ListBusinessReportSchedulesResponse
 -> Rep ListBusinessReportSchedulesResponse x)
-> (forall x.
    Rep ListBusinessReportSchedulesResponse x
    -> ListBusinessReportSchedulesResponse)
-> Generic ListBusinessReportSchedulesResponse
forall x.
Rep ListBusinessReportSchedulesResponse x
-> ListBusinessReportSchedulesResponse
forall x.
ListBusinessReportSchedulesResponse
-> Rep ListBusinessReportSchedulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBusinessReportSchedulesResponse x
-> ListBusinessReportSchedulesResponse
$cfrom :: forall x.
ListBusinessReportSchedulesResponse
-> Rep ListBusinessReportSchedulesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBusinessReportSchedulesResponse' 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:
--
-- 'businessReportSchedules', 'listBusinessReportSchedulesResponse_businessReportSchedules' - The schedule of the reports.
--
-- 'nextToken', 'listBusinessReportSchedulesResponse_nextToken' - The token used to list the remaining schedules from the previous API
-- call.
--
-- 'httpStatus', 'listBusinessReportSchedulesResponse_httpStatus' - The response's http status code.
newListBusinessReportSchedulesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBusinessReportSchedulesResponse
newListBusinessReportSchedulesResponse :: Int -> ListBusinessReportSchedulesResponse
newListBusinessReportSchedulesResponse Int
pHttpStatus_ =
  ListBusinessReportSchedulesResponse' :: Maybe [BusinessReportSchedule]
-> Maybe Text -> Int -> ListBusinessReportSchedulesResponse
ListBusinessReportSchedulesResponse'
    { $sel:businessReportSchedules:ListBusinessReportSchedulesResponse' :: Maybe [BusinessReportSchedule]
businessReportSchedules =
        Maybe [BusinessReportSchedule]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBusinessReportSchedulesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListBusinessReportSchedulesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The schedule of the reports.
listBusinessReportSchedulesResponse_businessReportSchedules :: Lens.Lens' ListBusinessReportSchedulesResponse (Prelude.Maybe [BusinessReportSchedule])
listBusinessReportSchedulesResponse_businessReportSchedules :: (Maybe [BusinessReportSchedule]
 -> f (Maybe [BusinessReportSchedule]))
-> ListBusinessReportSchedulesResponse
-> f ListBusinessReportSchedulesResponse
listBusinessReportSchedulesResponse_businessReportSchedules = (ListBusinessReportSchedulesResponse
 -> Maybe [BusinessReportSchedule])
-> (ListBusinessReportSchedulesResponse
    -> Maybe [BusinessReportSchedule]
    -> ListBusinessReportSchedulesResponse)
-> Lens'
     ListBusinessReportSchedulesResponse
     (Maybe [BusinessReportSchedule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBusinessReportSchedulesResponse' {Maybe [BusinessReportSchedule]
businessReportSchedules :: Maybe [BusinessReportSchedule]
$sel:businessReportSchedules:ListBusinessReportSchedulesResponse' :: ListBusinessReportSchedulesResponse
-> Maybe [BusinessReportSchedule]
businessReportSchedules} -> Maybe [BusinessReportSchedule]
businessReportSchedules) (\s :: ListBusinessReportSchedulesResponse
s@ListBusinessReportSchedulesResponse' {} Maybe [BusinessReportSchedule]
a -> ListBusinessReportSchedulesResponse
s {$sel:businessReportSchedules:ListBusinessReportSchedulesResponse' :: Maybe [BusinessReportSchedule]
businessReportSchedules = Maybe [BusinessReportSchedule]
a} :: ListBusinessReportSchedulesResponse) ((Maybe [BusinessReportSchedule]
  -> f (Maybe [BusinessReportSchedule]))
 -> ListBusinessReportSchedulesResponse
 -> f ListBusinessReportSchedulesResponse)
-> ((Maybe [BusinessReportSchedule]
     -> f (Maybe [BusinessReportSchedule]))
    -> Maybe [BusinessReportSchedule]
    -> f (Maybe [BusinessReportSchedule]))
-> (Maybe [BusinessReportSchedule]
    -> f (Maybe [BusinessReportSchedule]))
-> ListBusinessReportSchedulesResponse
-> f ListBusinessReportSchedulesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BusinessReportSchedule]
  [BusinessReportSchedule]
  [BusinessReportSchedule]
  [BusinessReportSchedule]
-> Iso
     (Maybe [BusinessReportSchedule])
     (Maybe [BusinessReportSchedule])
     (Maybe [BusinessReportSchedule])
     (Maybe [BusinessReportSchedule])
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
  [BusinessReportSchedule]
  [BusinessReportSchedule]
  [BusinessReportSchedule]
  [BusinessReportSchedule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token used to list the remaining schedules from the previous API
-- call.
listBusinessReportSchedulesResponse_nextToken :: Lens.Lens' ListBusinessReportSchedulesResponse (Prelude.Maybe Prelude.Text)
listBusinessReportSchedulesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListBusinessReportSchedulesResponse
-> f ListBusinessReportSchedulesResponse
listBusinessReportSchedulesResponse_nextToken = (ListBusinessReportSchedulesResponse -> Maybe Text)
-> (ListBusinessReportSchedulesResponse
    -> Maybe Text -> ListBusinessReportSchedulesResponse)
-> Lens' ListBusinessReportSchedulesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBusinessReportSchedulesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBusinessReportSchedulesResponse' :: ListBusinessReportSchedulesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBusinessReportSchedulesResponse
s@ListBusinessReportSchedulesResponse' {} Maybe Text
a -> ListBusinessReportSchedulesResponse
s {$sel:nextToken:ListBusinessReportSchedulesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListBusinessReportSchedulesResponse)

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

instance
  Prelude.NFData
    ListBusinessReportSchedulesResponse