{-# 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 #-}
module Amazonka.AlexaBusiness.ListBusinessReportSchedules
(
ListBusinessReportSchedules (..),
newListBusinessReportSchedules,
listBusinessReportSchedules_maxResults,
listBusinessReportSchedules_nextToken,
ListBusinessReportSchedulesResponse (..),
newListBusinessReportSchedulesResponse,
listBusinessReportSchedulesResponse_businessReportSchedules,
listBusinessReportSchedulesResponse_nextToken,
listBusinessReportSchedulesResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListBusinessReportSchedules = ListBusinessReportSchedules'
{
ListBusinessReportSchedules -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListBusinessReportSchedules -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListBusinessReportSchedules -> ListBusinessReportSchedules -> Bool
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]
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
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.
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)
newListBusinessReportSchedules ::
ListBusinessReportSchedules
newListBusinessReportSchedules :: ListBusinessReportSchedules
newListBusinessReportSchedules =
ListBusinessReportSchedules'
{ $sel:maxResults:ListBusinessReportSchedules' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListBusinessReportSchedules' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listBusinessReportSchedules_maxResults :: Lens.Lens' ListBusinessReportSchedules (Prelude.Maybe Prelude.Natural)
listBusinessReportSchedules_maxResults :: Lens' ListBusinessReportSchedules (Maybe Natural)
listBusinessReportSchedules_maxResults = 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)
listBusinessReportSchedules_nextToken :: Lens.Lens' ListBusinessReportSchedules (Prelude.Maybe Prelude.Text)
listBusinessReportSchedules_nextToken :: Lens' ListBusinessReportSchedules (Maybe Text)
listBusinessReportSchedules_nextToken = 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)
instance Core.AWSPager ListBusinessReportSchedules where
page :: ListBusinessReportSchedules
-> AWSResponse ListBusinessReportSchedules
-> Maybe ListBusinessReportSchedules
page ListBusinessReportSchedules
rq AWSResponse ListBusinessReportSchedules
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListBusinessReportSchedules
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBusinessReportSchedulesResponse (Maybe Text)
listBusinessReportSchedulesResponse_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 ListBusinessReportSchedules
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListBusinessReportSchedulesResponse
(Maybe [BusinessReportSchedule])
listBusinessReportSchedulesResponse_businessReportSchedules
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
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListBusinessReportSchedules
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListBusinessReportSchedules (Maybe Text)
listBusinessReportSchedules_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBusinessReportSchedules
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBusinessReportSchedulesResponse (Maybe Text)
listBusinessReportSchedulesResponse_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 ListBusinessReportSchedules where
type
AWSResponse ListBusinessReportSchedules =
ListBusinessReportSchedulesResponse
request :: (Service -> Service)
-> ListBusinessReportSchedules
-> Request ListBusinessReportSchedules
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 ListBusinessReportSchedules
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListBusinessReportSchedules)))
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 [BusinessReportSchedule]
-> Maybe Text -> Int -> ListBusinessReportSchedulesResponse
ListBusinessReportSchedulesResponse'
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
"BusinessReportSchedules"
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))
)
instance Prelude.Hashable ListBusinessReportSchedules where
hashWithSalt :: Int -> ListBusinessReportSchedules -> Int
hashWithSalt Int
_salt ListBusinessReportSchedules' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Text
$sel:maxResults:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListBusinessReportSchedules where
rnf :: ListBusinessReportSchedules -> ()
rnf ListBusinessReportSchedules' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Text
$sel:maxResults:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Natural
..} =
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
instance Data.ToHeaders ListBusinessReportSchedules where
toHeaders :: ListBusinessReportSchedules -> 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
"AlexaForBusiness.ListBusinessReportSchedules" ::
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 ListBusinessReportSchedules where
toJSON :: ListBusinessReportSchedules -> Value
toJSON ListBusinessReportSchedules' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Text
$sel:maxResults:ListBusinessReportSchedules' :: ListBusinessReportSchedules -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
]
)
instance Data.ToPath ListBusinessReportSchedules where
toPath :: ListBusinessReportSchedules -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListBusinessReportSchedules where
toQuery :: ListBusinessReportSchedules -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListBusinessReportSchedulesResponse = ListBusinessReportSchedulesResponse'
{
ListBusinessReportSchedulesResponse
-> Maybe [BusinessReportSchedule]
businessReportSchedules :: Prelude.Maybe [BusinessReportSchedule],
ListBusinessReportSchedulesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListBusinessReportSchedulesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListBusinessReportSchedulesResponse
-> ListBusinessReportSchedulesResponse -> Bool
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]
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
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.
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)
newListBusinessReportSchedulesResponse ::
Prelude.Int ->
ListBusinessReportSchedulesResponse
newListBusinessReportSchedulesResponse :: Int -> ListBusinessReportSchedulesResponse
newListBusinessReportSchedulesResponse Int
pHttpStatus_ =
ListBusinessReportSchedulesResponse'
{ $sel:businessReportSchedules:ListBusinessReportSchedulesResponse' :: Maybe [BusinessReportSchedule]
businessReportSchedules =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListBusinessReportSchedulesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListBusinessReportSchedulesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listBusinessReportSchedulesResponse_businessReportSchedules :: Lens.Lens' ListBusinessReportSchedulesResponse (Prelude.Maybe [BusinessReportSchedule])
listBusinessReportSchedulesResponse_businessReportSchedules :: Lens'
ListBusinessReportSchedulesResponse
(Maybe [BusinessReportSchedule])
listBusinessReportSchedulesResponse_businessReportSchedules = 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) 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
listBusinessReportSchedulesResponse_nextToken :: Lens.Lens' ListBusinessReportSchedulesResponse (Prelude.Maybe Prelude.Text)
listBusinessReportSchedulesResponse_nextToken :: Lens' ListBusinessReportSchedulesResponse (Maybe Text)
listBusinessReportSchedulesResponse_nextToken = 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)
listBusinessReportSchedulesResponse_httpStatus :: Lens.Lens' ListBusinessReportSchedulesResponse Prelude.Int
listBusinessReportSchedulesResponse_httpStatus :: Lens' ListBusinessReportSchedulesResponse Int
listBusinessReportSchedulesResponse_httpStatus = 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
where
rnf :: ListBusinessReportSchedulesResponse -> ()
rnf ListBusinessReportSchedulesResponse' {Int
Maybe [BusinessReportSchedule]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
businessReportSchedules :: Maybe [BusinessReportSchedule]
$sel:httpStatus:ListBusinessReportSchedulesResponse' :: ListBusinessReportSchedulesResponse -> Int
$sel:nextToken:ListBusinessReportSchedulesResponse' :: ListBusinessReportSchedulesResponse -> Maybe Text
$sel:businessReportSchedules:ListBusinessReportSchedulesResponse' :: ListBusinessReportSchedulesResponse
-> Maybe [BusinessReportSchedule]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [BusinessReportSchedule]
businessReportSchedules
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