{-# 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.IVSChat.ListRooms
(
ListRooms (..),
newListRooms,
listRooms_loggingConfigurationIdentifier,
listRooms_maxResults,
listRooms_messageReviewHandlerUri,
listRooms_name,
listRooms_nextToken,
ListRoomsResponse (..),
newListRoomsResponse,
listRoomsResponse_nextToken,
listRoomsResponse_httpStatus,
listRoomsResponse_rooms,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IVSChat.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListRooms = ListRooms'
{
ListRooms -> Maybe Text
loggingConfigurationIdentifier :: Prelude.Maybe Prelude.Text,
ListRooms -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListRooms -> Maybe Text
messageReviewHandlerUri :: Prelude.Maybe Prelude.Text,
ListRooms -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ListRooms -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListRooms -> ListRooms -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRooms -> ListRooms -> Bool
$c/= :: ListRooms -> ListRooms -> Bool
== :: ListRooms -> ListRooms -> Bool
$c== :: ListRooms -> ListRooms -> Bool
Prelude.Eq, ReadPrec [ListRooms]
ReadPrec ListRooms
Int -> ReadS ListRooms
ReadS [ListRooms]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRooms]
$creadListPrec :: ReadPrec [ListRooms]
readPrec :: ReadPrec ListRooms
$creadPrec :: ReadPrec ListRooms
readList :: ReadS [ListRooms]
$creadList :: ReadS [ListRooms]
readsPrec :: Int -> ReadS ListRooms
$creadsPrec :: Int -> ReadS ListRooms
Prelude.Read, Int -> ListRooms -> ShowS
[ListRooms] -> ShowS
ListRooms -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRooms] -> ShowS
$cshowList :: [ListRooms] -> ShowS
show :: ListRooms -> String
$cshow :: ListRooms -> String
showsPrec :: Int -> ListRooms -> ShowS
$cshowsPrec :: Int -> ListRooms -> ShowS
Prelude.Show, forall x. Rep ListRooms x -> ListRooms
forall x. ListRooms -> Rep ListRooms x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRooms x -> ListRooms
$cfrom :: forall x. ListRooms -> Rep ListRooms x
Prelude.Generic)
newListRooms ::
ListRooms
newListRooms :: ListRooms
newListRooms =
ListRooms'
{ $sel:loggingConfigurationIdentifier:ListRooms' :: Maybe Text
loggingConfigurationIdentifier =
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListRooms' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:messageReviewHandlerUri:ListRooms' :: Maybe Text
messageReviewHandlerUri = forall a. Maybe a
Prelude.Nothing,
$sel:name:ListRooms' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListRooms' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listRooms_loggingConfigurationIdentifier :: Lens.Lens' ListRooms (Prelude.Maybe Prelude.Text)
listRooms_loggingConfigurationIdentifier :: Lens' ListRooms (Maybe Text)
listRooms_loggingConfigurationIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRooms' {Maybe Text
loggingConfigurationIdentifier :: Maybe Text
$sel:loggingConfigurationIdentifier:ListRooms' :: ListRooms -> Maybe Text
loggingConfigurationIdentifier} -> Maybe Text
loggingConfigurationIdentifier) (\s :: ListRooms
s@ListRooms' {} Maybe Text
a -> ListRooms
s {$sel:loggingConfigurationIdentifier:ListRooms' :: Maybe Text
loggingConfigurationIdentifier = Maybe Text
a} :: ListRooms)
listRooms_maxResults :: Lens.Lens' ListRooms (Prelude.Maybe Prelude.Natural)
listRooms_maxResults :: Lens' ListRooms (Maybe Natural)
listRooms_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRooms' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRooms' :: ListRooms -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRooms
s@ListRooms' {} Maybe Natural
a -> ListRooms
s {$sel:maxResults:ListRooms' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRooms)
listRooms_messageReviewHandlerUri :: Lens.Lens' ListRooms (Prelude.Maybe Prelude.Text)
listRooms_messageReviewHandlerUri :: Lens' ListRooms (Maybe Text)
listRooms_messageReviewHandlerUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRooms' {Maybe Text
messageReviewHandlerUri :: Maybe Text
$sel:messageReviewHandlerUri:ListRooms' :: ListRooms -> Maybe Text
messageReviewHandlerUri} -> Maybe Text
messageReviewHandlerUri) (\s :: ListRooms
s@ListRooms' {} Maybe Text
a -> ListRooms
s {$sel:messageReviewHandlerUri:ListRooms' :: Maybe Text
messageReviewHandlerUri = Maybe Text
a} :: ListRooms)
listRooms_name :: Lens.Lens' ListRooms (Prelude.Maybe Prelude.Text)
listRooms_name :: Lens' ListRooms (Maybe Text)
listRooms_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRooms' {Maybe Text
name :: Maybe Text
$sel:name:ListRooms' :: ListRooms -> Maybe Text
name} -> Maybe Text
name) (\s :: ListRooms
s@ListRooms' {} Maybe Text
a -> ListRooms
s {$sel:name:ListRooms' :: Maybe Text
name = Maybe Text
a} :: ListRooms)
listRooms_nextToken :: Lens.Lens' ListRooms (Prelude.Maybe Prelude.Text)
listRooms_nextToken :: Lens' ListRooms (Maybe Text)
listRooms_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRooms' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRooms' :: ListRooms -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRooms
s@ListRooms' {} Maybe Text
a -> ListRooms
s {$sel:nextToken:ListRooms' :: Maybe Text
nextToken = Maybe Text
a} :: ListRooms)
instance Core.AWSRequest ListRooms where
type AWSResponse ListRooms = ListRoomsResponse
request :: (Service -> Service) -> ListRooms -> Request ListRooms
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 ListRooms
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRooms)))
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 -> [RoomSummary] -> ListRoomsResponse
ListRoomsResponse'
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
"rooms" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListRooms where
hashWithSalt :: Int -> ListRooms -> Int
hashWithSalt Int
_salt ListRooms' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
name :: Maybe Text
messageReviewHandlerUri :: Maybe Text
maxResults :: Maybe Natural
loggingConfigurationIdentifier :: Maybe Text
$sel:nextToken:ListRooms' :: ListRooms -> Maybe Text
$sel:name:ListRooms' :: ListRooms -> Maybe Text
$sel:messageReviewHandlerUri:ListRooms' :: ListRooms -> Maybe Text
$sel:maxResults:ListRooms' :: ListRooms -> Maybe Natural
$sel:loggingConfigurationIdentifier:ListRooms' :: ListRooms -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
loggingConfigurationIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
messageReviewHandlerUri
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListRooms where
rnf :: ListRooms -> ()
rnf ListRooms' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
name :: Maybe Text
messageReviewHandlerUri :: Maybe Text
maxResults :: Maybe Natural
loggingConfigurationIdentifier :: Maybe Text
$sel:nextToken:ListRooms' :: ListRooms -> Maybe Text
$sel:name:ListRooms' :: ListRooms -> Maybe Text
$sel:messageReviewHandlerUri:ListRooms' :: ListRooms -> Maybe Text
$sel:maxResults:ListRooms' :: ListRooms -> Maybe Natural
$sel:loggingConfigurationIdentifier:ListRooms' :: ListRooms -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
loggingConfigurationIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
messageReviewHandlerUri
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListRooms where
toHeaders :: ListRooms -> 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 ListRooms where
toJSON :: ListRooms -> Value
toJSON ListRooms' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
name :: Maybe Text
messageReviewHandlerUri :: Maybe Text
maxResults :: Maybe Natural
loggingConfigurationIdentifier :: Maybe Text
$sel:nextToken:ListRooms' :: ListRooms -> Maybe Text
$sel:name:ListRooms' :: ListRooms -> Maybe Text
$sel:messageReviewHandlerUri:ListRooms' :: ListRooms -> Maybe Text
$sel:maxResults:ListRooms' :: ListRooms -> Maybe Natural
$sel:loggingConfigurationIdentifier:ListRooms' :: ListRooms -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"loggingConfigurationIdentifier" 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
loggingConfigurationIdentifier,
(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
"messageReviewHandlerUri" 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
messageReviewHandlerUri,
(Key
"name" 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
name,
(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 ListRooms where
toPath :: ListRooms -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/ListRooms"
instance Data.ToQuery ListRooms where
toQuery :: ListRooms -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListRoomsResponse = ListRoomsResponse'
{
ListRoomsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListRoomsResponse -> Int
httpStatus :: Prelude.Int,
ListRoomsResponse -> [RoomSummary]
rooms :: [RoomSummary]
}
deriving (ListRoomsResponse -> ListRoomsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRoomsResponse -> ListRoomsResponse -> Bool
$c/= :: ListRoomsResponse -> ListRoomsResponse -> Bool
== :: ListRoomsResponse -> ListRoomsResponse -> Bool
$c== :: ListRoomsResponse -> ListRoomsResponse -> Bool
Prelude.Eq, ReadPrec [ListRoomsResponse]
ReadPrec ListRoomsResponse
Int -> ReadS ListRoomsResponse
ReadS [ListRoomsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRoomsResponse]
$creadListPrec :: ReadPrec [ListRoomsResponse]
readPrec :: ReadPrec ListRoomsResponse
$creadPrec :: ReadPrec ListRoomsResponse
readList :: ReadS [ListRoomsResponse]
$creadList :: ReadS [ListRoomsResponse]
readsPrec :: Int -> ReadS ListRoomsResponse
$creadsPrec :: Int -> ReadS ListRoomsResponse
Prelude.Read, Int -> ListRoomsResponse -> ShowS
[ListRoomsResponse] -> ShowS
ListRoomsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRoomsResponse] -> ShowS
$cshowList :: [ListRoomsResponse] -> ShowS
show :: ListRoomsResponse -> String
$cshow :: ListRoomsResponse -> String
showsPrec :: Int -> ListRoomsResponse -> ShowS
$cshowsPrec :: Int -> ListRoomsResponse -> ShowS
Prelude.Show, forall x. Rep ListRoomsResponse x -> ListRoomsResponse
forall x. ListRoomsResponse -> Rep ListRoomsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRoomsResponse x -> ListRoomsResponse
$cfrom :: forall x. ListRoomsResponse -> Rep ListRoomsResponse x
Prelude.Generic)
newListRoomsResponse ::
Prelude.Int ->
ListRoomsResponse
newListRoomsResponse :: Int -> ListRoomsResponse
newListRoomsResponse Int
pHttpStatus_ =
ListRoomsResponse'
{ $sel:nextToken:ListRoomsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListRoomsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:rooms:ListRoomsResponse' :: [RoomSummary]
rooms = forall a. Monoid a => a
Prelude.mempty
}
listRoomsResponse_nextToken :: Lens.Lens' ListRoomsResponse (Prelude.Maybe Prelude.Text)
listRoomsResponse_nextToken :: Lens' ListRoomsResponse (Maybe Text)
listRoomsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoomsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRoomsResponse' :: ListRoomsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRoomsResponse
s@ListRoomsResponse' {} Maybe Text
a -> ListRoomsResponse
s {$sel:nextToken:ListRoomsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRoomsResponse)
listRoomsResponse_httpStatus :: Lens.Lens' ListRoomsResponse Prelude.Int
listRoomsResponse_httpStatus :: Lens' ListRoomsResponse Int
listRoomsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoomsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRoomsResponse' :: ListRoomsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRoomsResponse
s@ListRoomsResponse' {} Int
a -> ListRoomsResponse
s {$sel:httpStatus:ListRoomsResponse' :: Int
httpStatus = Int
a} :: ListRoomsResponse)
listRoomsResponse_rooms :: Lens.Lens' ListRoomsResponse [RoomSummary]
listRoomsResponse_rooms :: Lens' ListRoomsResponse [RoomSummary]
listRoomsResponse_rooms = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoomsResponse' {[RoomSummary]
rooms :: [RoomSummary]
$sel:rooms:ListRoomsResponse' :: ListRoomsResponse -> [RoomSummary]
rooms} -> [RoomSummary]
rooms) (\s :: ListRoomsResponse
s@ListRoomsResponse' {} [RoomSummary]
a -> ListRoomsResponse
s {$sel:rooms:ListRoomsResponse' :: [RoomSummary]
rooms = [RoomSummary]
a} :: ListRoomsResponse) 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 ListRoomsResponse where
rnf :: ListRoomsResponse -> ()
rnf ListRoomsResponse' {Int
[RoomSummary]
Maybe Text
rooms :: [RoomSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:rooms:ListRoomsResponse' :: ListRoomsResponse -> [RoomSummary]
$sel:httpStatus:ListRoomsResponse' :: ListRoomsResponse -> Int
$sel:nextToken:ListRoomsResponse' :: ListRoomsResponse -> 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 [RoomSummary]
rooms