{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AlexaBusiness.SearchRooms
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Searches rooms and lists the ones that meet a set of filter and sort
-- criteria.
--
-- This operation returns paginated results.
module Amazonka.AlexaBusiness.SearchRooms
  ( -- * Creating a Request
    SearchRooms (..),
    newSearchRooms,

    -- * Request Lenses
    searchRooms_filters,
    searchRooms_maxResults,
    searchRooms_nextToken,
    searchRooms_sortCriteria,

    -- * Destructuring the Response
    SearchRoomsResponse (..),
    newSearchRoomsResponse,

    -- * Response Lenses
    searchRoomsResponse_nextToken,
    searchRoomsResponse_rooms,
    searchRoomsResponse_totalCount,
    searchRoomsResponse_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

-- | /See:/ 'newSearchRooms' smart constructor.
data SearchRooms = SearchRooms'
  { -- | The filters to use to list a specified set of rooms. The supported
    -- filter keys are RoomName and ProfileName.
    SearchRooms -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to include in the response. If more
    -- results exist than the specified @MaxResults@ value, a token is included
    -- in the response so that the remaining results can be retrieved.
    SearchRooms -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | An optional token returned from a prior request. Use this token for
    -- pagination of results from this action. If this parameter is specified,
    -- the response includes only results beyond the token, up to the value
    -- specified by @MaxResults@.
    SearchRooms -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sort order to use in listing the specified set of rooms. The
    -- supported sort keys are RoomName and ProfileName.
    SearchRooms -> Maybe [Sort]
sortCriteria :: Prelude.Maybe [Sort]
  }
  deriving (SearchRooms -> SearchRooms -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchRooms -> SearchRooms -> Bool
$c/= :: SearchRooms -> SearchRooms -> Bool
== :: SearchRooms -> SearchRooms -> Bool
$c== :: SearchRooms -> SearchRooms -> Bool
Prelude.Eq, ReadPrec [SearchRooms]
ReadPrec SearchRooms
Int -> ReadS SearchRooms
ReadS [SearchRooms]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchRooms]
$creadListPrec :: ReadPrec [SearchRooms]
readPrec :: ReadPrec SearchRooms
$creadPrec :: ReadPrec SearchRooms
readList :: ReadS [SearchRooms]
$creadList :: ReadS [SearchRooms]
readsPrec :: Int -> ReadS SearchRooms
$creadsPrec :: Int -> ReadS SearchRooms
Prelude.Read, Int -> SearchRooms -> ShowS
[SearchRooms] -> ShowS
SearchRooms -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchRooms] -> ShowS
$cshowList :: [SearchRooms] -> ShowS
show :: SearchRooms -> String
$cshow :: SearchRooms -> String
showsPrec :: Int -> SearchRooms -> ShowS
$cshowsPrec :: Int -> SearchRooms -> ShowS
Prelude.Show, forall x. Rep SearchRooms x -> SearchRooms
forall x. SearchRooms -> Rep SearchRooms x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchRooms x -> SearchRooms
$cfrom :: forall x. SearchRooms -> Rep SearchRooms x
Prelude.Generic)

-- |
-- Create a value of 'SearchRooms' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'filters', 'searchRooms_filters' - The filters to use to list a specified set of rooms. The supported
-- filter keys are RoomName and ProfileName.
--
-- 'maxResults', 'searchRooms_maxResults' - The maximum number of results to include in the response. If more
-- results exist than the specified @MaxResults@ value, a token is included
-- in the response so that the remaining results can be retrieved.
--
-- 'nextToken', 'searchRooms_nextToken' - An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by @MaxResults@.
--
-- 'sortCriteria', 'searchRooms_sortCriteria' - The sort order to use in listing the specified set of rooms. The
-- supported sort keys are RoomName and ProfileName.
newSearchRooms ::
  SearchRooms
newSearchRooms :: SearchRooms
newSearchRooms =
  SearchRooms'
    { $sel:filters:SearchRooms' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchRooms' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchRooms' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortCriteria:SearchRooms' :: Maybe [Sort]
sortCriteria = forall a. Maybe a
Prelude.Nothing
    }

-- | The filters to use to list a specified set of rooms. The supported
-- filter keys are RoomName and ProfileName.
searchRooms_filters :: Lens.Lens' SearchRooms (Prelude.Maybe [Filter])
searchRooms_filters :: Lens' SearchRooms (Maybe [Filter])
searchRooms_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRooms' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:SearchRooms' :: SearchRooms -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: SearchRooms
s@SearchRooms' {} Maybe [Filter]
a -> SearchRooms
s {$sel:filters:SearchRooms' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: SearchRooms) 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

-- | The maximum number of results to include in the response. If more
-- results exist than the specified @MaxResults@ value, a token is included
-- in the response so that the remaining results can be retrieved.
searchRooms_maxResults :: Lens.Lens' SearchRooms (Prelude.Maybe Prelude.Natural)
searchRooms_maxResults :: Lens' SearchRooms (Maybe Natural)
searchRooms_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRooms' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchRooms' :: SearchRooms -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchRooms
s@SearchRooms' {} Maybe Natural
a -> SearchRooms
s {$sel:maxResults:SearchRooms' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchRooms)

-- | An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by @MaxResults@.
searchRooms_nextToken :: Lens.Lens' SearchRooms (Prelude.Maybe Prelude.Text)
searchRooms_nextToken :: Lens' SearchRooms (Maybe Text)
searchRooms_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRooms' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchRooms' :: SearchRooms -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchRooms
s@SearchRooms' {} Maybe Text
a -> SearchRooms
s {$sel:nextToken:SearchRooms' :: Maybe Text
nextToken = Maybe Text
a} :: SearchRooms)

-- | The sort order to use in listing the specified set of rooms. The
-- supported sort keys are RoomName and ProfileName.
searchRooms_sortCriteria :: Lens.Lens' SearchRooms (Prelude.Maybe [Sort])
searchRooms_sortCriteria :: Lens' SearchRooms (Maybe [Sort])
searchRooms_sortCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRooms' {Maybe [Sort]
sortCriteria :: Maybe [Sort]
$sel:sortCriteria:SearchRooms' :: SearchRooms -> Maybe [Sort]
sortCriteria} -> Maybe [Sort]
sortCriteria) (\s :: SearchRooms
s@SearchRooms' {} Maybe [Sort]
a -> SearchRooms
s {$sel:sortCriteria:SearchRooms' :: Maybe [Sort]
sortCriteria = Maybe [Sort]
a} :: SearchRooms) 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

instance Core.AWSPager SearchRooms where
  page :: SearchRooms -> AWSResponse SearchRooms -> Maybe SearchRooms
page SearchRooms
rq AWSResponse SearchRooms
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse SearchRooms
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchRoomsResponse (Maybe Text)
searchRoomsResponse_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 SearchRooms
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchRoomsResponse (Maybe [RoomData])
searchRoomsResponse_rooms
            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.$ SearchRooms
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' SearchRooms (Maybe Text)
searchRooms_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse SearchRooms
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchRoomsResponse (Maybe Text)
searchRoomsResponse_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 SearchRooms where
  type AWSResponse SearchRooms = SearchRoomsResponse
  request :: (Service -> Service) -> SearchRooms -> Request SearchRooms
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 SearchRooms
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchRooms)))
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
-> Maybe [RoomData] -> Maybe Int -> Int -> SearchRoomsResponse
SearchRoomsResponse'
            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.<*> (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)
            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
"TotalCount")
            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 SearchRooms where
  hashWithSalt :: Int -> SearchRooms -> Int
hashWithSalt Int
_salt SearchRooms' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchRooms' :: SearchRooms -> Maybe [Sort]
$sel:nextToken:SearchRooms' :: SearchRooms -> Maybe Text
$sel:maxResults:SearchRooms' :: SearchRooms -> Maybe Natural
$sel:filters:SearchRooms' :: SearchRooms -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      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` Maybe [Sort]
sortCriteria

instance Prelude.NFData SearchRooms where
  rnf :: SearchRooms -> ()
rnf SearchRooms' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchRooms' :: SearchRooms -> Maybe [Sort]
$sel:nextToken:SearchRooms' :: SearchRooms -> Maybe Text
$sel:maxResults:SearchRooms' :: SearchRooms -> Maybe Natural
$sel:filters:SearchRooms' :: SearchRooms -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      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
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Sort]
sortCriteria

instance Data.ToHeaders SearchRooms where
  toHeaders :: SearchRooms -> 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.SearchRooms" ::
                          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 SearchRooms where
  toJSON :: SearchRooms -> Value
toJSON SearchRooms' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchRooms' :: SearchRooms -> Maybe [Sort]
$sel:nextToken:SearchRooms' :: SearchRooms -> Maybe Text
$sel:maxResults:SearchRooms' :: SearchRooms -> Maybe Natural
$sel:filters:SearchRooms' :: SearchRooms -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" 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 [Filter]
filters,
            (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,
            (Key
"SortCriteria" 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 [Sort]
sortCriteria
          ]
      )

instance Data.ToPath SearchRooms where
  toPath :: SearchRooms -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery SearchRooms where
  toQuery :: SearchRooms -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newSearchRoomsResponse' smart constructor.
data SearchRoomsResponse = SearchRoomsResponse'
  { -- | The token returned to indicate that there is more data available.
    SearchRoomsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The rooms that meet the specified set of filter criteria, in sort order.
    SearchRoomsResponse -> Maybe [RoomData]
rooms :: Prelude.Maybe [RoomData],
    -- | The total number of rooms returned.
    SearchRoomsResponse -> Maybe Int
totalCount :: Prelude.Maybe Prelude.Int,
    -- | The response's http status code.
    SearchRoomsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchRoomsResponse -> SearchRoomsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchRoomsResponse -> SearchRoomsResponse -> Bool
$c/= :: SearchRoomsResponse -> SearchRoomsResponse -> Bool
== :: SearchRoomsResponse -> SearchRoomsResponse -> Bool
$c== :: SearchRoomsResponse -> SearchRoomsResponse -> Bool
Prelude.Eq, ReadPrec [SearchRoomsResponse]
ReadPrec SearchRoomsResponse
Int -> ReadS SearchRoomsResponse
ReadS [SearchRoomsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchRoomsResponse]
$creadListPrec :: ReadPrec [SearchRoomsResponse]
readPrec :: ReadPrec SearchRoomsResponse
$creadPrec :: ReadPrec SearchRoomsResponse
readList :: ReadS [SearchRoomsResponse]
$creadList :: ReadS [SearchRoomsResponse]
readsPrec :: Int -> ReadS SearchRoomsResponse
$creadsPrec :: Int -> ReadS SearchRoomsResponse
Prelude.Read, Int -> SearchRoomsResponse -> ShowS
[SearchRoomsResponse] -> ShowS
SearchRoomsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchRoomsResponse] -> ShowS
$cshowList :: [SearchRoomsResponse] -> ShowS
show :: SearchRoomsResponse -> String
$cshow :: SearchRoomsResponse -> String
showsPrec :: Int -> SearchRoomsResponse -> ShowS
$cshowsPrec :: Int -> SearchRoomsResponse -> ShowS
Prelude.Show, forall x. Rep SearchRoomsResponse x -> SearchRoomsResponse
forall x. SearchRoomsResponse -> Rep SearchRoomsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchRoomsResponse x -> SearchRoomsResponse
$cfrom :: forall x. SearchRoomsResponse -> Rep SearchRoomsResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchRoomsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'searchRoomsResponse_nextToken' - The token returned to indicate that there is more data available.
--
-- 'rooms', 'searchRoomsResponse_rooms' - The rooms that meet the specified set of filter criteria, in sort order.
--
-- 'totalCount', 'searchRoomsResponse_totalCount' - The total number of rooms returned.
--
-- 'httpStatus', 'searchRoomsResponse_httpStatus' - The response's http status code.
newSearchRoomsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchRoomsResponse
newSearchRoomsResponse :: Int -> SearchRoomsResponse
newSearchRoomsResponse Int
pHttpStatus_ =
  SearchRoomsResponse'
    { $sel:nextToken:SearchRoomsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:rooms:SearchRoomsResponse' :: Maybe [RoomData]
rooms = forall a. Maybe a
Prelude.Nothing,
      $sel:totalCount:SearchRoomsResponse' :: Maybe Int
totalCount = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchRoomsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token returned to indicate that there is more data available.
searchRoomsResponse_nextToken :: Lens.Lens' SearchRoomsResponse (Prelude.Maybe Prelude.Text)
searchRoomsResponse_nextToken :: Lens' SearchRoomsResponse (Maybe Text)
searchRoomsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRoomsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchRoomsResponse' :: SearchRoomsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchRoomsResponse
s@SearchRoomsResponse' {} Maybe Text
a -> SearchRoomsResponse
s {$sel:nextToken:SearchRoomsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchRoomsResponse)

-- | The rooms that meet the specified set of filter criteria, in sort order.
searchRoomsResponse_rooms :: Lens.Lens' SearchRoomsResponse (Prelude.Maybe [RoomData])
searchRoomsResponse_rooms :: Lens' SearchRoomsResponse (Maybe [RoomData])
searchRoomsResponse_rooms = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRoomsResponse' {Maybe [RoomData]
rooms :: Maybe [RoomData]
$sel:rooms:SearchRoomsResponse' :: SearchRoomsResponse -> Maybe [RoomData]
rooms} -> Maybe [RoomData]
rooms) (\s :: SearchRoomsResponse
s@SearchRoomsResponse' {} Maybe [RoomData]
a -> SearchRoomsResponse
s {$sel:rooms:SearchRoomsResponse' :: Maybe [RoomData]
rooms = Maybe [RoomData]
a} :: SearchRoomsResponse) 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

-- | The total number of rooms returned.
searchRoomsResponse_totalCount :: Lens.Lens' SearchRoomsResponse (Prelude.Maybe Prelude.Int)
searchRoomsResponse_totalCount :: Lens' SearchRoomsResponse (Maybe Int)
searchRoomsResponse_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRoomsResponse' {Maybe Int
totalCount :: Maybe Int
$sel:totalCount:SearchRoomsResponse' :: SearchRoomsResponse -> Maybe Int
totalCount} -> Maybe Int
totalCount) (\s :: SearchRoomsResponse
s@SearchRoomsResponse' {} Maybe Int
a -> SearchRoomsResponse
s {$sel:totalCount:SearchRoomsResponse' :: Maybe Int
totalCount = Maybe Int
a} :: SearchRoomsResponse)

-- | The response's http status code.
searchRoomsResponse_httpStatus :: Lens.Lens' SearchRoomsResponse Prelude.Int
searchRoomsResponse_httpStatus :: Lens' SearchRoomsResponse Int
searchRoomsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchRoomsResponse' {Int
httpStatus :: Int
$sel:httpStatus:SearchRoomsResponse' :: SearchRoomsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SearchRoomsResponse
s@SearchRoomsResponse' {} Int
a -> SearchRoomsResponse
s {$sel:httpStatus:SearchRoomsResponse' :: Int
httpStatus = Int
a} :: SearchRoomsResponse)

instance Prelude.NFData SearchRoomsResponse where
  rnf :: SearchRoomsResponse -> ()
rnf SearchRoomsResponse' {Int
Maybe Int
Maybe [RoomData]
Maybe Text
httpStatus :: Int
totalCount :: Maybe Int
rooms :: Maybe [RoomData]
nextToken :: Maybe Text
$sel:httpStatus:SearchRoomsResponse' :: SearchRoomsResponse -> Int
$sel:totalCount:SearchRoomsResponse' :: SearchRoomsResponse -> Maybe Int
$sel:rooms:SearchRoomsResponse' :: SearchRoomsResponse -> Maybe [RoomData]
$sel:nextToken:SearchRoomsResponse' :: SearchRoomsResponse -> 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 Maybe [RoomData]
rooms
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus