{-# 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.Connect.ListHoursOfOperations
(
ListHoursOfOperations (..),
newListHoursOfOperations,
listHoursOfOperations_maxResults,
listHoursOfOperations_nextToken,
listHoursOfOperations_instanceId,
ListHoursOfOperationsResponse (..),
newListHoursOfOperationsResponse,
listHoursOfOperationsResponse_hoursOfOperationSummaryList,
listHoursOfOperationsResponse_nextToken,
listHoursOfOperationsResponse_httpStatus,
)
where
import Amazonka.Connect.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 ListHoursOfOperations = ListHoursOfOperations'
{
ListHoursOfOperations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListHoursOfOperations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListHoursOfOperations -> Text
instanceId :: Prelude.Text
}
deriving (ListHoursOfOperations -> ListHoursOfOperations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHoursOfOperations -> ListHoursOfOperations -> Bool
$c/= :: ListHoursOfOperations -> ListHoursOfOperations -> Bool
== :: ListHoursOfOperations -> ListHoursOfOperations -> Bool
$c== :: ListHoursOfOperations -> ListHoursOfOperations -> Bool
Prelude.Eq, ReadPrec [ListHoursOfOperations]
ReadPrec ListHoursOfOperations
Int -> ReadS ListHoursOfOperations
ReadS [ListHoursOfOperations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHoursOfOperations]
$creadListPrec :: ReadPrec [ListHoursOfOperations]
readPrec :: ReadPrec ListHoursOfOperations
$creadPrec :: ReadPrec ListHoursOfOperations
readList :: ReadS [ListHoursOfOperations]
$creadList :: ReadS [ListHoursOfOperations]
readsPrec :: Int -> ReadS ListHoursOfOperations
$creadsPrec :: Int -> ReadS ListHoursOfOperations
Prelude.Read, Int -> ListHoursOfOperations -> ShowS
[ListHoursOfOperations] -> ShowS
ListHoursOfOperations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHoursOfOperations] -> ShowS
$cshowList :: [ListHoursOfOperations] -> ShowS
show :: ListHoursOfOperations -> String
$cshow :: ListHoursOfOperations -> String
showsPrec :: Int -> ListHoursOfOperations -> ShowS
$cshowsPrec :: Int -> ListHoursOfOperations -> ShowS
Prelude.Show, forall x. Rep ListHoursOfOperations x -> ListHoursOfOperations
forall x. ListHoursOfOperations -> Rep ListHoursOfOperations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListHoursOfOperations x -> ListHoursOfOperations
$cfrom :: forall x. ListHoursOfOperations -> Rep ListHoursOfOperations x
Prelude.Generic)
newListHoursOfOperations ::
Prelude.Text ->
ListHoursOfOperations
newListHoursOfOperations :: Text -> ListHoursOfOperations
newListHoursOfOperations Text
pInstanceId_ =
ListHoursOfOperations'
{ $sel:maxResults:ListHoursOfOperations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListHoursOfOperations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:ListHoursOfOperations' :: Text
instanceId = Text
pInstanceId_
}
listHoursOfOperations_maxResults :: Lens.Lens' ListHoursOfOperations (Prelude.Maybe Prelude.Natural)
listHoursOfOperations_maxResults :: Lens' ListHoursOfOperations (Maybe Natural)
listHoursOfOperations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHoursOfOperations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListHoursOfOperations
s@ListHoursOfOperations' {} Maybe Natural
a -> ListHoursOfOperations
s {$sel:maxResults:ListHoursOfOperations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListHoursOfOperations)
listHoursOfOperations_nextToken :: Lens.Lens' ListHoursOfOperations (Prelude.Maybe Prelude.Text)
listHoursOfOperations_nextToken :: Lens' ListHoursOfOperations (Maybe Text)
listHoursOfOperations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHoursOfOperations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHoursOfOperations
s@ListHoursOfOperations' {} Maybe Text
a -> ListHoursOfOperations
s {$sel:nextToken:ListHoursOfOperations' :: Maybe Text
nextToken = Maybe Text
a} :: ListHoursOfOperations)
listHoursOfOperations_instanceId :: Lens.Lens' ListHoursOfOperations Prelude.Text
listHoursOfOperations_instanceId :: Lens' ListHoursOfOperations Text
listHoursOfOperations_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHoursOfOperations' {Text
instanceId :: Text
$sel:instanceId:ListHoursOfOperations' :: ListHoursOfOperations -> Text
instanceId} -> Text
instanceId) (\s :: ListHoursOfOperations
s@ListHoursOfOperations' {} Text
a -> ListHoursOfOperations
s {$sel:instanceId:ListHoursOfOperations' :: Text
instanceId = Text
a} :: ListHoursOfOperations)
instance Core.AWSPager ListHoursOfOperations where
page :: ListHoursOfOperations
-> AWSResponse ListHoursOfOperations -> Maybe ListHoursOfOperations
page ListHoursOfOperations
rq AWSResponse ListHoursOfOperations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListHoursOfOperations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHoursOfOperationsResponse (Maybe Text)
listHoursOfOperationsResponse_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 ListHoursOfOperations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListHoursOfOperationsResponse (Maybe [HoursOfOperationSummary])
listHoursOfOperationsResponse_hoursOfOperationSummaryList
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.$ ListHoursOfOperations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListHoursOfOperations (Maybe Text)
listHoursOfOperations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListHoursOfOperations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHoursOfOperationsResponse (Maybe Text)
listHoursOfOperationsResponse_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 ListHoursOfOperations where
type
AWSResponse ListHoursOfOperations =
ListHoursOfOperationsResponse
request :: (Service -> Service)
-> ListHoursOfOperations -> Request ListHoursOfOperations
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListHoursOfOperations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListHoursOfOperations)))
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 [HoursOfOperationSummary]
-> Maybe Text -> Int -> ListHoursOfOperationsResponse
ListHoursOfOperationsResponse'
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
"HoursOfOperationSummaryList"
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 ListHoursOfOperations where
hashWithSalt :: Int -> ListHoursOfOperations -> Int
hashWithSalt Int
_salt ListHoursOfOperations' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListHoursOfOperations' :: ListHoursOfOperations -> Text
$sel:nextToken:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Text
$sel:maxResults:ListHoursOfOperations' :: ListHoursOfOperations -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
instance Prelude.NFData ListHoursOfOperations where
rnf :: ListHoursOfOperations -> ()
rnf ListHoursOfOperations' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListHoursOfOperations' :: ListHoursOfOperations -> Text
$sel:nextToken:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Text
$sel:maxResults:ListHoursOfOperations' :: ListHoursOfOperations -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
instance Data.ToHeaders ListHoursOfOperations where
toHeaders :: ListHoursOfOperations -> 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.ToPath ListHoursOfOperations where
toPath :: ListHoursOfOperations -> ByteString
toPath ListHoursOfOperations' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListHoursOfOperations' :: ListHoursOfOperations -> Text
$sel:nextToken:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Text
$sel:maxResults:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/hours-of-operations-summary/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId
]
instance Data.ToQuery ListHoursOfOperations where
toQuery :: ListHoursOfOperations -> QueryString
toQuery ListHoursOfOperations' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListHoursOfOperations' :: ListHoursOfOperations -> Text
$sel:nextToken:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Text
$sel:maxResults:ListHoursOfOperations' :: ListHoursOfOperations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListHoursOfOperationsResponse = ListHoursOfOperationsResponse'
{
ListHoursOfOperationsResponse -> Maybe [HoursOfOperationSummary]
hoursOfOperationSummaryList :: Prelude.Maybe [HoursOfOperationSummary],
ListHoursOfOperationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListHoursOfOperationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListHoursOfOperationsResponse
-> ListHoursOfOperationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHoursOfOperationsResponse
-> ListHoursOfOperationsResponse -> Bool
$c/= :: ListHoursOfOperationsResponse
-> ListHoursOfOperationsResponse -> Bool
== :: ListHoursOfOperationsResponse
-> ListHoursOfOperationsResponse -> Bool
$c== :: ListHoursOfOperationsResponse
-> ListHoursOfOperationsResponse -> Bool
Prelude.Eq, ReadPrec [ListHoursOfOperationsResponse]
ReadPrec ListHoursOfOperationsResponse
Int -> ReadS ListHoursOfOperationsResponse
ReadS [ListHoursOfOperationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHoursOfOperationsResponse]
$creadListPrec :: ReadPrec [ListHoursOfOperationsResponse]
readPrec :: ReadPrec ListHoursOfOperationsResponse
$creadPrec :: ReadPrec ListHoursOfOperationsResponse
readList :: ReadS [ListHoursOfOperationsResponse]
$creadList :: ReadS [ListHoursOfOperationsResponse]
readsPrec :: Int -> ReadS ListHoursOfOperationsResponse
$creadsPrec :: Int -> ReadS ListHoursOfOperationsResponse
Prelude.Read, Int -> ListHoursOfOperationsResponse -> ShowS
[ListHoursOfOperationsResponse] -> ShowS
ListHoursOfOperationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHoursOfOperationsResponse] -> ShowS
$cshowList :: [ListHoursOfOperationsResponse] -> ShowS
show :: ListHoursOfOperationsResponse -> String
$cshow :: ListHoursOfOperationsResponse -> String
showsPrec :: Int -> ListHoursOfOperationsResponse -> ShowS
$cshowsPrec :: Int -> ListHoursOfOperationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListHoursOfOperationsResponse x
-> ListHoursOfOperationsResponse
forall x.
ListHoursOfOperationsResponse
-> Rep ListHoursOfOperationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListHoursOfOperationsResponse x
-> ListHoursOfOperationsResponse
$cfrom :: forall x.
ListHoursOfOperationsResponse
-> Rep ListHoursOfOperationsResponse x
Prelude.Generic)
newListHoursOfOperationsResponse ::
Prelude.Int ->
ListHoursOfOperationsResponse
newListHoursOfOperationsResponse :: Int -> ListHoursOfOperationsResponse
newListHoursOfOperationsResponse Int
pHttpStatus_ =
ListHoursOfOperationsResponse'
{ $sel:hoursOfOperationSummaryList:ListHoursOfOperationsResponse' :: Maybe [HoursOfOperationSummary]
hoursOfOperationSummaryList =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListHoursOfOperationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListHoursOfOperationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listHoursOfOperationsResponse_hoursOfOperationSummaryList :: Lens.Lens' ListHoursOfOperationsResponse (Prelude.Maybe [HoursOfOperationSummary])
listHoursOfOperationsResponse_hoursOfOperationSummaryList :: Lens'
ListHoursOfOperationsResponse (Maybe [HoursOfOperationSummary])
listHoursOfOperationsResponse_hoursOfOperationSummaryList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHoursOfOperationsResponse' {Maybe [HoursOfOperationSummary]
hoursOfOperationSummaryList :: Maybe [HoursOfOperationSummary]
$sel:hoursOfOperationSummaryList:ListHoursOfOperationsResponse' :: ListHoursOfOperationsResponse -> Maybe [HoursOfOperationSummary]
hoursOfOperationSummaryList} -> Maybe [HoursOfOperationSummary]
hoursOfOperationSummaryList) (\s :: ListHoursOfOperationsResponse
s@ListHoursOfOperationsResponse' {} Maybe [HoursOfOperationSummary]
a -> ListHoursOfOperationsResponse
s {$sel:hoursOfOperationSummaryList:ListHoursOfOperationsResponse' :: Maybe [HoursOfOperationSummary]
hoursOfOperationSummaryList = Maybe [HoursOfOperationSummary]
a} :: ListHoursOfOperationsResponse) 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
listHoursOfOperationsResponse_nextToken :: Lens.Lens' ListHoursOfOperationsResponse (Prelude.Maybe Prelude.Text)
listHoursOfOperationsResponse_nextToken :: Lens' ListHoursOfOperationsResponse (Maybe Text)
listHoursOfOperationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHoursOfOperationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHoursOfOperationsResponse' :: ListHoursOfOperationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHoursOfOperationsResponse
s@ListHoursOfOperationsResponse' {} Maybe Text
a -> ListHoursOfOperationsResponse
s {$sel:nextToken:ListHoursOfOperationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListHoursOfOperationsResponse)
listHoursOfOperationsResponse_httpStatus :: Lens.Lens' ListHoursOfOperationsResponse Prelude.Int
listHoursOfOperationsResponse_httpStatus :: Lens' ListHoursOfOperationsResponse Int
listHoursOfOperationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHoursOfOperationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListHoursOfOperationsResponse' :: ListHoursOfOperationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListHoursOfOperationsResponse
s@ListHoursOfOperationsResponse' {} Int
a -> ListHoursOfOperationsResponse
s {$sel:httpStatus:ListHoursOfOperationsResponse' :: Int
httpStatus = Int
a} :: ListHoursOfOperationsResponse)
instance Prelude.NFData ListHoursOfOperationsResponse where
rnf :: ListHoursOfOperationsResponse -> ()
rnf ListHoursOfOperationsResponse' {Int
Maybe [HoursOfOperationSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
hoursOfOperationSummaryList :: Maybe [HoursOfOperationSummary]
$sel:httpStatus:ListHoursOfOperationsResponse' :: ListHoursOfOperationsResponse -> Int
$sel:nextToken:ListHoursOfOperationsResponse' :: ListHoursOfOperationsResponse -> Maybe Text
$sel:hoursOfOperationSummaryList:ListHoursOfOperationsResponse' :: ListHoursOfOperationsResponse -> Maybe [HoursOfOperationSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [HoursOfOperationSummary]
hoursOfOperationSummaryList
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