{-# 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.ConnectCases.ListLayouts
(
ListLayouts (..),
newListLayouts,
listLayouts_maxResults,
listLayouts_nextToken,
listLayouts_domainId,
ListLayoutsResponse (..),
newListLayoutsResponse,
listLayoutsResponse_nextToken,
listLayoutsResponse_httpStatus,
listLayoutsResponse_layouts,
)
where
import Amazonka.ConnectCases.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 ListLayouts = ListLayouts'
{
ListLayouts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListLayouts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListLayouts -> Text
domainId :: Prelude.Text
}
deriving (ListLayouts -> ListLayouts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLayouts -> ListLayouts -> Bool
$c/= :: ListLayouts -> ListLayouts -> Bool
== :: ListLayouts -> ListLayouts -> Bool
$c== :: ListLayouts -> ListLayouts -> Bool
Prelude.Eq, ReadPrec [ListLayouts]
ReadPrec ListLayouts
Int -> ReadS ListLayouts
ReadS [ListLayouts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLayouts]
$creadListPrec :: ReadPrec [ListLayouts]
readPrec :: ReadPrec ListLayouts
$creadPrec :: ReadPrec ListLayouts
readList :: ReadS [ListLayouts]
$creadList :: ReadS [ListLayouts]
readsPrec :: Int -> ReadS ListLayouts
$creadsPrec :: Int -> ReadS ListLayouts
Prelude.Read, Int -> ListLayouts -> ShowS
[ListLayouts] -> ShowS
ListLayouts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLayouts] -> ShowS
$cshowList :: [ListLayouts] -> ShowS
show :: ListLayouts -> String
$cshow :: ListLayouts -> String
showsPrec :: Int -> ListLayouts -> ShowS
$cshowsPrec :: Int -> ListLayouts -> ShowS
Prelude.Show, forall x. Rep ListLayouts x -> ListLayouts
forall x. ListLayouts -> Rep ListLayouts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLayouts x -> ListLayouts
$cfrom :: forall x. ListLayouts -> Rep ListLayouts x
Prelude.Generic)
newListLayouts ::
Prelude.Text ->
ListLayouts
newListLayouts :: Text -> ListLayouts
newListLayouts Text
pDomainId_ =
ListLayouts'
{ $sel:maxResults:ListLayouts' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListLayouts' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:domainId:ListLayouts' :: Text
domainId = Text
pDomainId_
}
listLayouts_maxResults :: Lens.Lens' ListLayouts (Prelude.Maybe Prelude.Natural)
listLayouts_maxResults :: Lens' ListLayouts (Maybe Natural)
listLayouts_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayouts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListLayouts' :: ListLayouts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListLayouts
s@ListLayouts' {} Maybe Natural
a -> ListLayouts
s {$sel:maxResults:ListLayouts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListLayouts)
listLayouts_nextToken :: Lens.Lens' ListLayouts (Prelude.Maybe Prelude.Text)
listLayouts_nextToken :: Lens' ListLayouts (Maybe Text)
listLayouts_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayouts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLayouts' :: ListLayouts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLayouts
s@ListLayouts' {} Maybe Text
a -> ListLayouts
s {$sel:nextToken:ListLayouts' :: Maybe Text
nextToken = Maybe Text
a} :: ListLayouts)
listLayouts_domainId :: Lens.Lens' ListLayouts Prelude.Text
listLayouts_domainId :: Lens' ListLayouts Text
listLayouts_domainId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayouts' {Text
domainId :: Text
$sel:domainId:ListLayouts' :: ListLayouts -> Text
domainId} -> Text
domainId) (\s :: ListLayouts
s@ListLayouts' {} Text
a -> ListLayouts
s {$sel:domainId:ListLayouts' :: Text
domainId = Text
a} :: ListLayouts)
instance Core.AWSRequest ListLayouts where
type AWSResponse ListLayouts = ListLayoutsResponse
request :: (Service -> Service) -> ListLayouts -> Request ListLayouts
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 ListLayouts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListLayouts)))
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 Text -> Int -> [LayoutSummary] -> ListLayoutsResponse
ListLayoutsResponse'
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
"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))
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
"layouts" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListLayouts where
hashWithSalt :: Int -> ListLayouts -> Int
hashWithSalt Int
_salt ListLayouts' {Maybe Natural
Maybe Text
Text
domainId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainId:ListLayouts' :: ListLayouts -> Text
$sel:nextToken:ListLayouts' :: ListLayouts -> Maybe Text
$sel:maxResults:ListLayouts' :: ListLayouts -> 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
domainId
instance Prelude.NFData ListLayouts where
rnf :: ListLayouts -> ()
rnf ListLayouts' {Maybe Natural
Maybe Text
Text
domainId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainId:ListLayouts' :: ListLayouts -> Text
$sel:nextToken:ListLayouts' :: ListLayouts -> Maybe Text
$sel:maxResults:ListLayouts' :: ListLayouts -> 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
domainId
instance Data.ToHeaders ListLayouts where
toHeaders :: ListLayouts -> 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.ToJSON ListLayouts where
toJSON :: ListLayouts -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath ListLayouts where
toPath :: ListLayouts -> ByteString
toPath ListLayouts' {Maybe Natural
Maybe Text
Text
domainId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainId:ListLayouts' :: ListLayouts -> Text
$sel:nextToken:ListLayouts' :: ListLayouts -> Maybe Text
$sel:maxResults:ListLayouts' :: ListLayouts -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/domains/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
domainId, ByteString
"/layouts-list"]
instance Data.ToQuery ListLayouts where
toQuery :: ListLayouts -> QueryString
toQuery ListLayouts' {Maybe Natural
Maybe Text
Text
domainId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainId:ListLayouts' :: ListLayouts -> Text
$sel:nextToken:ListLayouts' :: ListLayouts -> Maybe Text
$sel:maxResults:ListLayouts' :: ListLayouts -> 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 ListLayoutsResponse = ListLayoutsResponse'
{
ListLayoutsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListLayoutsResponse -> Int
httpStatus :: Prelude.Int,
ListLayoutsResponse -> [LayoutSummary]
layouts :: [LayoutSummary]
}
deriving (ListLayoutsResponse -> ListLayoutsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLayoutsResponse -> ListLayoutsResponse -> Bool
$c/= :: ListLayoutsResponse -> ListLayoutsResponse -> Bool
== :: ListLayoutsResponse -> ListLayoutsResponse -> Bool
$c== :: ListLayoutsResponse -> ListLayoutsResponse -> Bool
Prelude.Eq, ReadPrec [ListLayoutsResponse]
ReadPrec ListLayoutsResponse
Int -> ReadS ListLayoutsResponse
ReadS [ListLayoutsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLayoutsResponse]
$creadListPrec :: ReadPrec [ListLayoutsResponse]
readPrec :: ReadPrec ListLayoutsResponse
$creadPrec :: ReadPrec ListLayoutsResponse
readList :: ReadS [ListLayoutsResponse]
$creadList :: ReadS [ListLayoutsResponse]
readsPrec :: Int -> ReadS ListLayoutsResponse
$creadsPrec :: Int -> ReadS ListLayoutsResponse
Prelude.Read, Int -> ListLayoutsResponse -> ShowS
[ListLayoutsResponse] -> ShowS
ListLayoutsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLayoutsResponse] -> ShowS
$cshowList :: [ListLayoutsResponse] -> ShowS
show :: ListLayoutsResponse -> String
$cshow :: ListLayoutsResponse -> String
showsPrec :: Int -> ListLayoutsResponse -> ShowS
$cshowsPrec :: Int -> ListLayoutsResponse -> ShowS
Prelude.Show, forall x. Rep ListLayoutsResponse x -> ListLayoutsResponse
forall x. ListLayoutsResponse -> Rep ListLayoutsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLayoutsResponse x -> ListLayoutsResponse
$cfrom :: forall x. ListLayoutsResponse -> Rep ListLayoutsResponse x
Prelude.Generic)
newListLayoutsResponse ::
Prelude.Int ->
ListLayoutsResponse
newListLayoutsResponse :: Int -> ListLayoutsResponse
newListLayoutsResponse Int
pHttpStatus_ =
ListLayoutsResponse'
{ $sel:nextToken:ListLayoutsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListLayoutsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:layouts:ListLayoutsResponse' :: [LayoutSummary]
layouts = forall a. Monoid a => a
Prelude.mempty
}
listLayoutsResponse_nextToken :: Lens.Lens' ListLayoutsResponse (Prelude.Maybe Prelude.Text)
listLayoutsResponse_nextToken :: Lens' ListLayoutsResponse (Maybe Text)
listLayoutsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayoutsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLayoutsResponse' :: ListLayoutsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLayoutsResponse
s@ListLayoutsResponse' {} Maybe Text
a -> ListLayoutsResponse
s {$sel:nextToken:ListLayoutsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLayoutsResponse)
listLayoutsResponse_httpStatus :: Lens.Lens' ListLayoutsResponse Prelude.Int
listLayoutsResponse_httpStatus :: Lens' ListLayoutsResponse Int
listLayoutsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayoutsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListLayoutsResponse' :: ListLayoutsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListLayoutsResponse
s@ListLayoutsResponse' {} Int
a -> ListLayoutsResponse
s {$sel:httpStatus:ListLayoutsResponse' :: Int
httpStatus = Int
a} :: ListLayoutsResponse)
listLayoutsResponse_layouts :: Lens.Lens' ListLayoutsResponse [LayoutSummary]
listLayoutsResponse_layouts :: Lens' ListLayoutsResponse [LayoutSummary]
listLayoutsResponse_layouts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayoutsResponse' {[LayoutSummary]
layouts :: [LayoutSummary]
$sel:layouts:ListLayoutsResponse' :: ListLayoutsResponse -> [LayoutSummary]
layouts} -> [LayoutSummary]
layouts) (\s :: ListLayoutsResponse
s@ListLayoutsResponse' {} [LayoutSummary]
a -> ListLayoutsResponse
s {$sel:layouts:ListLayoutsResponse' :: [LayoutSummary]
layouts = [LayoutSummary]
a} :: ListLayoutsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListLayoutsResponse where
rnf :: ListLayoutsResponse -> ()
rnf ListLayoutsResponse' {Int
[LayoutSummary]
Maybe Text
layouts :: [LayoutSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:layouts:ListLayoutsResponse' :: ListLayoutsResponse -> [LayoutSummary]
$sel:httpStatus:ListLayoutsResponse' :: ListLayoutsResponse -> Int
$sel:nextToken:ListLayoutsResponse' :: ListLayoutsResponse -> Maybe Text
..} =
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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [LayoutSummary]
layouts