{-# 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.DescribeHoursOfOperation
(
DescribeHoursOfOperation (..),
newDescribeHoursOfOperation,
describeHoursOfOperation_instanceId,
describeHoursOfOperation_hoursOfOperationId,
DescribeHoursOfOperationResponse (..),
newDescribeHoursOfOperationResponse,
describeHoursOfOperationResponse_hoursOfOperation,
describeHoursOfOperationResponse_httpStatus,
)
where
import Amazonka.Connect.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
data DescribeHoursOfOperation = DescribeHoursOfOperation'
{
DescribeHoursOfOperation -> Text
instanceId :: Prelude.Text,
DescribeHoursOfOperation -> Text
hoursOfOperationId :: Prelude.Text
}
deriving (DescribeHoursOfOperation -> DescribeHoursOfOperation -> Bool
(DescribeHoursOfOperation -> DescribeHoursOfOperation -> Bool)
-> (DescribeHoursOfOperation -> DescribeHoursOfOperation -> Bool)
-> Eq DescribeHoursOfOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHoursOfOperation -> DescribeHoursOfOperation -> Bool
$c/= :: DescribeHoursOfOperation -> DescribeHoursOfOperation -> Bool
== :: DescribeHoursOfOperation -> DescribeHoursOfOperation -> Bool
$c== :: DescribeHoursOfOperation -> DescribeHoursOfOperation -> Bool
Prelude.Eq, ReadPrec [DescribeHoursOfOperation]
ReadPrec DescribeHoursOfOperation
Int -> ReadS DescribeHoursOfOperation
ReadS [DescribeHoursOfOperation]
(Int -> ReadS DescribeHoursOfOperation)
-> ReadS [DescribeHoursOfOperation]
-> ReadPrec DescribeHoursOfOperation
-> ReadPrec [DescribeHoursOfOperation]
-> Read DescribeHoursOfOperation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHoursOfOperation]
$creadListPrec :: ReadPrec [DescribeHoursOfOperation]
readPrec :: ReadPrec DescribeHoursOfOperation
$creadPrec :: ReadPrec DescribeHoursOfOperation
readList :: ReadS [DescribeHoursOfOperation]
$creadList :: ReadS [DescribeHoursOfOperation]
readsPrec :: Int -> ReadS DescribeHoursOfOperation
$creadsPrec :: Int -> ReadS DescribeHoursOfOperation
Prelude.Read, Int -> DescribeHoursOfOperation -> ShowS
[DescribeHoursOfOperation] -> ShowS
DescribeHoursOfOperation -> String
(Int -> DescribeHoursOfOperation -> ShowS)
-> (DescribeHoursOfOperation -> String)
-> ([DescribeHoursOfOperation] -> ShowS)
-> Show DescribeHoursOfOperation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHoursOfOperation] -> ShowS
$cshowList :: [DescribeHoursOfOperation] -> ShowS
show :: DescribeHoursOfOperation -> String
$cshow :: DescribeHoursOfOperation -> String
showsPrec :: Int -> DescribeHoursOfOperation -> ShowS
$cshowsPrec :: Int -> DescribeHoursOfOperation -> ShowS
Prelude.Show, (forall x.
DescribeHoursOfOperation -> Rep DescribeHoursOfOperation x)
-> (forall x.
Rep DescribeHoursOfOperation x -> DescribeHoursOfOperation)
-> Generic DescribeHoursOfOperation
forall x.
Rep DescribeHoursOfOperation x -> DescribeHoursOfOperation
forall x.
DescribeHoursOfOperation -> Rep DescribeHoursOfOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHoursOfOperation x -> DescribeHoursOfOperation
$cfrom :: forall x.
DescribeHoursOfOperation -> Rep DescribeHoursOfOperation x
Prelude.Generic)
newDescribeHoursOfOperation ::
Prelude.Text ->
Prelude.Text ->
DescribeHoursOfOperation
newDescribeHoursOfOperation :: Text -> Text -> DescribeHoursOfOperation
newDescribeHoursOfOperation
Text
pInstanceId_
Text
pHoursOfOperationId_ =
DescribeHoursOfOperation' :: Text -> Text -> DescribeHoursOfOperation
DescribeHoursOfOperation'
{ $sel:instanceId:DescribeHoursOfOperation' :: Text
instanceId =
Text
pInstanceId_,
$sel:hoursOfOperationId:DescribeHoursOfOperation' :: Text
hoursOfOperationId = Text
pHoursOfOperationId_
}
describeHoursOfOperation_instanceId :: Lens.Lens' DescribeHoursOfOperation Prelude.Text
describeHoursOfOperation_instanceId :: (Text -> f Text)
-> DescribeHoursOfOperation -> f DescribeHoursOfOperation
describeHoursOfOperation_instanceId = (DescribeHoursOfOperation -> Text)
-> (DescribeHoursOfOperation -> Text -> DescribeHoursOfOperation)
-> Lens DescribeHoursOfOperation DescribeHoursOfOperation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHoursOfOperation' {Text
instanceId :: Text
$sel:instanceId:DescribeHoursOfOperation' :: DescribeHoursOfOperation -> Text
instanceId} -> Text
instanceId) (\s :: DescribeHoursOfOperation
s@DescribeHoursOfOperation' {} Text
a -> DescribeHoursOfOperation
s {$sel:instanceId:DescribeHoursOfOperation' :: Text
instanceId = Text
a} :: DescribeHoursOfOperation)
describeHoursOfOperation_hoursOfOperationId :: Lens.Lens' DescribeHoursOfOperation Prelude.Text
describeHoursOfOperation_hoursOfOperationId :: (Text -> f Text)
-> DescribeHoursOfOperation -> f DescribeHoursOfOperation
describeHoursOfOperation_hoursOfOperationId = (DescribeHoursOfOperation -> Text)
-> (DescribeHoursOfOperation -> Text -> DescribeHoursOfOperation)
-> Lens DescribeHoursOfOperation DescribeHoursOfOperation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHoursOfOperation' {Text
hoursOfOperationId :: Text
$sel:hoursOfOperationId:DescribeHoursOfOperation' :: DescribeHoursOfOperation -> Text
hoursOfOperationId} -> Text
hoursOfOperationId) (\s :: DescribeHoursOfOperation
s@DescribeHoursOfOperation' {} Text
a -> DescribeHoursOfOperation
s {$sel:hoursOfOperationId:DescribeHoursOfOperation' :: Text
hoursOfOperationId = Text
a} :: DescribeHoursOfOperation)
instance Core.AWSRequest DescribeHoursOfOperation where
type
AWSResponse DescribeHoursOfOperation =
DescribeHoursOfOperationResponse
request :: DescribeHoursOfOperation -> Request DescribeHoursOfOperation
request = Service
-> DescribeHoursOfOperation -> Request DescribeHoursOfOperation
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeHoursOfOperation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeHoursOfOperation)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeHoursOfOperation))
-> Logger
-> Service
-> Proxy DescribeHoursOfOperation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeHoursOfOperation)))
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 HoursOfOperation -> Int -> DescribeHoursOfOperationResponse
DescribeHoursOfOperationResponse'
(Maybe HoursOfOperation -> Int -> DescribeHoursOfOperationResponse)
-> Either String (Maybe HoursOfOperation)
-> Either String (Int -> DescribeHoursOfOperationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe HoursOfOperation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HoursOfOperation")
Either String (Int -> DescribeHoursOfOperationResponse)
-> Either String Int
-> Either String DescribeHoursOfOperationResponse
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 DescribeHoursOfOperation
instance Prelude.NFData DescribeHoursOfOperation
instance Core.ToHeaders DescribeHoursOfOperation where
toHeaders :: DescribeHoursOfOperation -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeHoursOfOperation -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DescribeHoursOfOperation where
toPath :: DescribeHoursOfOperation -> ByteString
toPath DescribeHoursOfOperation' {Text
hoursOfOperationId :: Text
instanceId :: Text
$sel:hoursOfOperationId:DescribeHoursOfOperation' :: DescribeHoursOfOperation -> Text
$sel:instanceId:DescribeHoursOfOperation' :: DescribeHoursOfOperation -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/hours-of-operations/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
ByteString
"/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
hoursOfOperationId
]
instance Core.ToQuery DescribeHoursOfOperation where
toQuery :: DescribeHoursOfOperation -> QueryString
toQuery = QueryString -> DescribeHoursOfOperation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeHoursOfOperationResponse = DescribeHoursOfOperationResponse'
{
DescribeHoursOfOperationResponse -> Maybe HoursOfOperation
hoursOfOperation :: Prelude.Maybe HoursOfOperation,
DescribeHoursOfOperationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeHoursOfOperationResponse
-> DescribeHoursOfOperationResponse -> Bool
(DescribeHoursOfOperationResponse
-> DescribeHoursOfOperationResponse -> Bool)
-> (DescribeHoursOfOperationResponse
-> DescribeHoursOfOperationResponse -> Bool)
-> Eq DescribeHoursOfOperationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHoursOfOperationResponse
-> DescribeHoursOfOperationResponse -> Bool
$c/= :: DescribeHoursOfOperationResponse
-> DescribeHoursOfOperationResponse -> Bool
== :: DescribeHoursOfOperationResponse
-> DescribeHoursOfOperationResponse -> Bool
$c== :: DescribeHoursOfOperationResponse
-> DescribeHoursOfOperationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeHoursOfOperationResponse]
ReadPrec DescribeHoursOfOperationResponse
Int -> ReadS DescribeHoursOfOperationResponse
ReadS [DescribeHoursOfOperationResponse]
(Int -> ReadS DescribeHoursOfOperationResponse)
-> ReadS [DescribeHoursOfOperationResponse]
-> ReadPrec DescribeHoursOfOperationResponse
-> ReadPrec [DescribeHoursOfOperationResponse]
-> Read DescribeHoursOfOperationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHoursOfOperationResponse]
$creadListPrec :: ReadPrec [DescribeHoursOfOperationResponse]
readPrec :: ReadPrec DescribeHoursOfOperationResponse
$creadPrec :: ReadPrec DescribeHoursOfOperationResponse
readList :: ReadS [DescribeHoursOfOperationResponse]
$creadList :: ReadS [DescribeHoursOfOperationResponse]
readsPrec :: Int -> ReadS DescribeHoursOfOperationResponse
$creadsPrec :: Int -> ReadS DescribeHoursOfOperationResponse
Prelude.Read, Int -> DescribeHoursOfOperationResponse -> ShowS
[DescribeHoursOfOperationResponse] -> ShowS
DescribeHoursOfOperationResponse -> String
(Int -> DescribeHoursOfOperationResponse -> ShowS)
-> (DescribeHoursOfOperationResponse -> String)
-> ([DescribeHoursOfOperationResponse] -> ShowS)
-> Show DescribeHoursOfOperationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHoursOfOperationResponse] -> ShowS
$cshowList :: [DescribeHoursOfOperationResponse] -> ShowS
show :: DescribeHoursOfOperationResponse -> String
$cshow :: DescribeHoursOfOperationResponse -> String
showsPrec :: Int -> DescribeHoursOfOperationResponse -> ShowS
$cshowsPrec :: Int -> DescribeHoursOfOperationResponse -> ShowS
Prelude.Show, (forall x.
DescribeHoursOfOperationResponse
-> Rep DescribeHoursOfOperationResponse x)
-> (forall x.
Rep DescribeHoursOfOperationResponse x
-> DescribeHoursOfOperationResponse)
-> Generic DescribeHoursOfOperationResponse
forall x.
Rep DescribeHoursOfOperationResponse x
-> DescribeHoursOfOperationResponse
forall x.
DescribeHoursOfOperationResponse
-> Rep DescribeHoursOfOperationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHoursOfOperationResponse x
-> DescribeHoursOfOperationResponse
$cfrom :: forall x.
DescribeHoursOfOperationResponse
-> Rep DescribeHoursOfOperationResponse x
Prelude.Generic)
newDescribeHoursOfOperationResponse ::
Prelude.Int ->
DescribeHoursOfOperationResponse
newDescribeHoursOfOperationResponse :: Int -> DescribeHoursOfOperationResponse
newDescribeHoursOfOperationResponse Int
pHttpStatus_ =
DescribeHoursOfOperationResponse' :: Maybe HoursOfOperation -> Int -> DescribeHoursOfOperationResponse
DescribeHoursOfOperationResponse'
{ $sel:hoursOfOperation:DescribeHoursOfOperationResponse' :: Maybe HoursOfOperation
hoursOfOperation =
Maybe HoursOfOperation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeHoursOfOperationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeHoursOfOperationResponse_hoursOfOperation :: Lens.Lens' DescribeHoursOfOperationResponse (Prelude.Maybe HoursOfOperation)
describeHoursOfOperationResponse_hoursOfOperation :: (Maybe HoursOfOperation -> f (Maybe HoursOfOperation))
-> DescribeHoursOfOperationResponse
-> f DescribeHoursOfOperationResponse
describeHoursOfOperationResponse_hoursOfOperation = (DescribeHoursOfOperationResponse -> Maybe HoursOfOperation)
-> (DescribeHoursOfOperationResponse
-> Maybe HoursOfOperation -> DescribeHoursOfOperationResponse)
-> Lens
DescribeHoursOfOperationResponse
DescribeHoursOfOperationResponse
(Maybe HoursOfOperation)
(Maybe HoursOfOperation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHoursOfOperationResponse' {Maybe HoursOfOperation
hoursOfOperation :: Maybe HoursOfOperation
$sel:hoursOfOperation:DescribeHoursOfOperationResponse' :: DescribeHoursOfOperationResponse -> Maybe HoursOfOperation
hoursOfOperation} -> Maybe HoursOfOperation
hoursOfOperation) (\s :: DescribeHoursOfOperationResponse
s@DescribeHoursOfOperationResponse' {} Maybe HoursOfOperation
a -> DescribeHoursOfOperationResponse
s {$sel:hoursOfOperation:DescribeHoursOfOperationResponse' :: Maybe HoursOfOperation
hoursOfOperation = Maybe HoursOfOperation
a} :: DescribeHoursOfOperationResponse)
describeHoursOfOperationResponse_httpStatus :: Lens.Lens' DescribeHoursOfOperationResponse Prelude.Int
describeHoursOfOperationResponse_httpStatus :: (Int -> f Int)
-> DescribeHoursOfOperationResponse
-> f DescribeHoursOfOperationResponse
describeHoursOfOperationResponse_httpStatus = (DescribeHoursOfOperationResponse -> Int)
-> (DescribeHoursOfOperationResponse
-> Int -> DescribeHoursOfOperationResponse)
-> Lens
DescribeHoursOfOperationResponse
DescribeHoursOfOperationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHoursOfOperationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeHoursOfOperationResponse' :: DescribeHoursOfOperationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeHoursOfOperationResponse
s@DescribeHoursOfOperationResponse' {} Int
a -> DescribeHoursOfOperationResponse
s {$sel:httpStatus:DescribeHoursOfOperationResponse' :: Int
httpStatus = Int
a} :: DescribeHoursOfOperationResponse)
instance
Prelude.NFData
DescribeHoursOfOperationResponse