{-# 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.ListSmartHomeAppliances
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all of the smart home appliances associated with a room.
--
-- This operation returns paginated results.
module Amazonka.AlexaBusiness.ListSmartHomeAppliances
  ( -- * Creating a Request
    ListSmartHomeAppliances (..),
    newListSmartHomeAppliances,

    -- * Request Lenses
    listSmartHomeAppliances_nextToken,
    listSmartHomeAppliances_maxResults,
    listSmartHomeAppliances_roomArn,

    -- * Destructuring the Response
    ListSmartHomeAppliancesResponse (..),
    newListSmartHomeAppliancesResponse,

    -- * Response Lenses
    listSmartHomeAppliancesResponse_smartHomeAppliances,
    listSmartHomeAppliancesResponse_nextToken,
    listSmartHomeAppliancesResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.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

-- | /See:/ 'newListSmartHomeAppliances' smart constructor.
data ListSmartHomeAppliances = ListSmartHomeAppliances'
  { -- | The tokens used for pagination.
    ListSmartHomeAppliances -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of appliances to be returned, per paginated calls.
    ListSmartHomeAppliances -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The room that the appliances are associated with.
    ListSmartHomeAppliances -> Text
roomArn :: Prelude.Text
  }
  deriving (ListSmartHomeAppliances -> ListSmartHomeAppliances -> Bool
(ListSmartHomeAppliances -> ListSmartHomeAppliances -> Bool)
-> (ListSmartHomeAppliances -> ListSmartHomeAppliances -> Bool)
-> Eq ListSmartHomeAppliances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSmartHomeAppliances -> ListSmartHomeAppliances -> Bool
$c/= :: ListSmartHomeAppliances -> ListSmartHomeAppliances -> Bool
== :: ListSmartHomeAppliances -> ListSmartHomeAppliances -> Bool
$c== :: ListSmartHomeAppliances -> ListSmartHomeAppliances -> Bool
Prelude.Eq, ReadPrec [ListSmartHomeAppliances]
ReadPrec ListSmartHomeAppliances
Int -> ReadS ListSmartHomeAppliances
ReadS [ListSmartHomeAppliances]
(Int -> ReadS ListSmartHomeAppliances)
-> ReadS [ListSmartHomeAppliances]
-> ReadPrec ListSmartHomeAppliances
-> ReadPrec [ListSmartHomeAppliances]
-> Read ListSmartHomeAppliances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSmartHomeAppliances]
$creadListPrec :: ReadPrec [ListSmartHomeAppliances]
readPrec :: ReadPrec ListSmartHomeAppliances
$creadPrec :: ReadPrec ListSmartHomeAppliances
readList :: ReadS [ListSmartHomeAppliances]
$creadList :: ReadS [ListSmartHomeAppliances]
readsPrec :: Int -> ReadS ListSmartHomeAppliances
$creadsPrec :: Int -> ReadS ListSmartHomeAppliances
Prelude.Read, Int -> ListSmartHomeAppliances -> ShowS
[ListSmartHomeAppliances] -> ShowS
ListSmartHomeAppliances -> String
(Int -> ListSmartHomeAppliances -> ShowS)
-> (ListSmartHomeAppliances -> String)
-> ([ListSmartHomeAppliances] -> ShowS)
-> Show ListSmartHomeAppliances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSmartHomeAppliances] -> ShowS
$cshowList :: [ListSmartHomeAppliances] -> ShowS
show :: ListSmartHomeAppliances -> String
$cshow :: ListSmartHomeAppliances -> String
showsPrec :: Int -> ListSmartHomeAppliances -> ShowS
$cshowsPrec :: Int -> ListSmartHomeAppliances -> ShowS
Prelude.Show, (forall x.
 ListSmartHomeAppliances -> Rep ListSmartHomeAppliances x)
-> (forall x.
    Rep ListSmartHomeAppliances x -> ListSmartHomeAppliances)
-> Generic ListSmartHomeAppliances
forall x. Rep ListSmartHomeAppliances x -> ListSmartHomeAppliances
forall x. ListSmartHomeAppliances -> Rep ListSmartHomeAppliances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSmartHomeAppliances x -> ListSmartHomeAppliances
$cfrom :: forall x. ListSmartHomeAppliances -> Rep ListSmartHomeAppliances x
Prelude.Generic)

-- |
-- Create a value of 'ListSmartHomeAppliances' 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', 'listSmartHomeAppliances_nextToken' - The tokens used for pagination.
--
-- 'maxResults', 'listSmartHomeAppliances_maxResults' - The maximum number of appliances to be returned, per paginated calls.
--
-- 'roomArn', 'listSmartHomeAppliances_roomArn' - The room that the appliances are associated with.
newListSmartHomeAppliances ::
  -- | 'roomArn'
  Prelude.Text ->
  ListSmartHomeAppliances
newListSmartHomeAppliances :: Text -> ListSmartHomeAppliances
newListSmartHomeAppliances Text
pRoomArn_ =
  ListSmartHomeAppliances' :: Maybe Text -> Maybe Natural -> Text -> ListSmartHomeAppliances
ListSmartHomeAppliances'
    { $sel:nextToken:ListSmartHomeAppliances' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSmartHomeAppliances' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:roomArn:ListSmartHomeAppliances' :: Text
roomArn = Text
pRoomArn_
    }

-- | The tokens used for pagination.
listSmartHomeAppliances_nextToken :: Lens.Lens' ListSmartHomeAppliances (Prelude.Maybe Prelude.Text)
listSmartHomeAppliances_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSmartHomeAppliances -> f ListSmartHomeAppliances
listSmartHomeAppliances_nextToken = (ListSmartHomeAppliances -> Maybe Text)
-> (ListSmartHomeAppliances
    -> Maybe Text -> ListSmartHomeAppliances)
-> Lens
     ListSmartHomeAppliances
     ListSmartHomeAppliances
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSmartHomeAppliances' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSmartHomeAppliances' :: ListSmartHomeAppliances -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSmartHomeAppliances
s@ListSmartHomeAppliances' {} Maybe Text
a -> ListSmartHomeAppliances
s {$sel:nextToken:ListSmartHomeAppliances' :: Maybe Text
nextToken = Maybe Text
a} :: ListSmartHomeAppliances)

-- | The maximum number of appliances to be returned, per paginated calls.
listSmartHomeAppliances_maxResults :: Lens.Lens' ListSmartHomeAppliances (Prelude.Maybe Prelude.Natural)
listSmartHomeAppliances_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListSmartHomeAppliances -> f ListSmartHomeAppliances
listSmartHomeAppliances_maxResults = (ListSmartHomeAppliances -> Maybe Natural)
-> (ListSmartHomeAppliances
    -> Maybe Natural -> ListSmartHomeAppliances)
-> Lens
     ListSmartHomeAppliances
     ListSmartHomeAppliances
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSmartHomeAppliances' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSmartHomeAppliances' :: ListSmartHomeAppliances -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSmartHomeAppliances
s@ListSmartHomeAppliances' {} Maybe Natural
a -> ListSmartHomeAppliances
s {$sel:maxResults:ListSmartHomeAppliances' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSmartHomeAppliances)

-- | The room that the appliances are associated with.
listSmartHomeAppliances_roomArn :: Lens.Lens' ListSmartHomeAppliances Prelude.Text
listSmartHomeAppliances_roomArn :: (Text -> f Text)
-> ListSmartHomeAppliances -> f ListSmartHomeAppliances
listSmartHomeAppliances_roomArn = (ListSmartHomeAppliances -> Text)
-> (ListSmartHomeAppliances -> Text -> ListSmartHomeAppliances)
-> Lens ListSmartHomeAppliances ListSmartHomeAppliances Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSmartHomeAppliances' {Text
roomArn :: Text
$sel:roomArn:ListSmartHomeAppliances' :: ListSmartHomeAppliances -> Text
roomArn} -> Text
roomArn) (\s :: ListSmartHomeAppliances
s@ListSmartHomeAppliances' {} Text
a -> ListSmartHomeAppliances
s {$sel:roomArn:ListSmartHomeAppliances' :: Text
roomArn = Text
a} :: ListSmartHomeAppliances)

instance Core.AWSPager ListSmartHomeAppliances where
  page :: ListSmartHomeAppliances
-> AWSResponse ListSmartHomeAppliances
-> Maybe ListSmartHomeAppliances
page ListSmartHomeAppliances
rq AWSResponse ListSmartHomeAppliances
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSmartHomeAppliances
ListSmartHomeAppliancesResponse
rs
            ListSmartHomeAppliancesResponse
-> Getting (First Text) ListSmartHomeAppliancesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSmartHomeAppliancesResponse
-> Const (First Text) ListSmartHomeAppliancesResponse
Lens' ListSmartHomeAppliancesResponse (Maybe Text)
listSmartHomeAppliancesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSmartHomeAppliancesResponse
 -> Const (First Text) ListSmartHomeAppliancesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSmartHomeAppliancesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListSmartHomeAppliances
forall a. Maybe a
Prelude.Nothing
    | Maybe [SmartHomeAppliance] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSmartHomeAppliances
ListSmartHomeAppliancesResponse
rs
            ListSmartHomeAppliancesResponse
-> Getting
     (First [SmartHomeAppliance])
     ListSmartHomeAppliancesResponse
     [SmartHomeAppliance]
-> Maybe [SmartHomeAppliance]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [SmartHomeAppliance]
 -> Const (First [SmartHomeAppliance]) (Maybe [SmartHomeAppliance]))
-> ListSmartHomeAppliancesResponse
-> Const
     (First [SmartHomeAppliance]) ListSmartHomeAppliancesResponse
Lens' ListSmartHomeAppliancesResponse (Maybe [SmartHomeAppliance])
listSmartHomeAppliancesResponse_smartHomeAppliances
              ((Maybe [SmartHomeAppliance]
  -> Const (First [SmartHomeAppliance]) (Maybe [SmartHomeAppliance]))
 -> ListSmartHomeAppliancesResponse
 -> Const
      (First [SmartHomeAppliance]) ListSmartHomeAppliancesResponse)
-> (([SmartHomeAppliance]
     -> Const (First [SmartHomeAppliance]) [SmartHomeAppliance])
    -> Maybe [SmartHomeAppliance]
    -> Const (First [SmartHomeAppliance]) (Maybe [SmartHomeAppliance]))
-> Getting
     (First [SmartHomeAppliance])
     ListSmartHomeAppliancesResponse
     [SmartHomeAppliance]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SmartHomeAppliance]
 -> Const (First [SmartHomeAppliance]) [SmartHomeAppliance])
-> Maybe [SmartHomeAppliance]
-> Const (First [SmartHomeAppliance]) (Maybe [SmartHomeAppliance])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListSmartHomeAppliances
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListSmartHomeAppliances -> Maybe ListSmartHomeAppliances
forall a. a -> Maybe a
Prelude.Just (ListSmartHomeAppliances -> Maybe ListSmartHomeAppliances)
-> ListSmartHomeAppliances -> Maybe ListSmartHomeAppliances
forall a b. (a -> b) -> a -> b
Prelude.$
        ListSmartHomeAppliances
rq
          ListSmartHomeAppliances
-> (ListSmartHomeAppliances -> ListSmartHomeAppliances)
-> ListSmartHomeAppliances
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListSmartHomeAppliances -> Identity ListSmartHomeAppliances
Lens
  ListSmartHomeAppliances
  ListSmartHomeAppliances
  (Maybe Text)
  (Maybe Text)
listSmartHomeAppliances_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListSmartHomeAppliances -> Identity ListSmartHomeAppliances)
-> Maybe Text -> ListSmartHomeAppliances -> ListSmartHomeAppliances
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSmartHomeAppliances
ListSmartHomeAppliancesResponse
rs
          ListSmartHomeAppliancesResponse
-> Getting (First Text) ListSmartHomeAppliancesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSmartHomeAppliancesResponse
-> Const (First Text) ListSmartHomeAppliancesResponse
Lens' ListSmartHomeAppliancesResponse (Maybe Text)
listSmartHomeAppliancesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSmartHomeAppliancesResponse
 -> Const (First Text) ListSmartHomeAppliancesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSmartHomeAppliancesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListSmartHomeAppliances where
  type
    AWSResponse ListSmartHomeAppliances =
      ListSmartHomeAppliancesResponse
  request :: ListSmartHomeAppliances -> Request ListSmartHomeAppliances
request = Service
-> ListSmartHomeAppliances -> Request ListSmartHomeAppliances
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListSmartHomeAppliances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSmartHomeAppliances)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListSmartHomeAppliances))
-> Logger
-> Service
-> Proxy ListSmartHomeAppliances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSmartHomeAppliances)))
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 [SmartHomeAppliance]
-> Maybe Text -> Int -> ListSmartHomeAppliancesResponse
ListSmartHomeAppliancesResponse'
            (Maybe [SmartHomeAppliance]
 -> Maybe Text -> Int -> ListSmartHomeAppliancesResponse)
-> Either String (Maybe [SmartHomeAppliance])
-> Either
     String (Maybe Text -> Int -> ListSmartHomeAppliancesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [SmartHomeAppliance]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SmartHomeAppliances"
                            Either String (Maybe (Maybe [SmartHomeAppliance]))
-> Maybe [SmartHomeAppliance]
-> Either String (Maybe [SmartHomeAppliance])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SmartHomeAppliance]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String (Maybe Text -> Int -> ListSmartHomeAppliancesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListSmartHomeAppliancesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> ListSmartHomeAppliancesResponse)
-> Either String Int
-> Either String ListSmartHomeAppliancesResponse
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 ListSmartHomeAppliances

instance Prelude.NFData ListSmartHomeAppliances

instance Core.ToHeaders ListSmartHomeAppliances where
  toHeaders :: ListSmartHomeAppliances -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSmartHomeAppliances -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AlexaForBusiness.ListSmartHomeAppliances" ::
                          Prelude.ByteString
                      ),
            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.ToJSON ListSmartHomeAppliances where
  toJSON :: ListSmartHomeAppliances -> Value
toJSON ListSmartHomeAppliances' {Maybe Natural
Maybe Text
Text
roomArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:roomArn:ListSmartHomeAppliances' :: ListSmartHomeAppliances -> Text
$sel:maxResults:ListSmartHomeAppliances' :: ListSmartHomeAppliances -> Maybe Natural
$sel:nextToken:ListSmartHomeAppliances' :: ListSmartHomeAppliances -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoomArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roomArn)
          ]
      )

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

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

-- | /See:/ 'newListSmartHomeAppliancesResponse' smart constructor.
data ListSmartHomeAppliancesResponse = ListSmartHomeAppliancesResponse'
  { -- | The smart home appliances.
    ListSmartHomeAppliancesResponse -> Maybe [SmartHomeAppliance]
smartHomeAppliances :: Prelude.Maybe [SmartHomeAppliance],
    -- | The tokens used for pagination.
    ListSmartHomeAppliancesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListSmartHomeAppliancesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSmartHomeAppliancesResponse
-> ListSmartHomeAppliancesResponse -> Bool
(ListSmartHomeAppliancesResponse
 -> ListSmartHomeAppliancesResponse -> Bool)
-> (ListSmartHomeAppliancesResponse
    -> ListSmartHomeAppliancesResponse -> Bool)
-> Eq ListSmartHomeAppliancesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSmartHomeAppliancesResponse
-> ListSmartHomeAppliancesResponse -> Bool
$c/= :: ListSmartHomeAppliancesResponse
-> ListSmartHomeAppliancesResponse -> Bool
== :: ListSmartHomeAppliancesResponse
-> ListSmartHomeAppliancesResponse -> Bool
$c== :: ListSmartHomeAppliancesResponse
-> ListSmartHomeAppliancesResponse -> Bool
Prelude.Eq, ReadPrec [ListSmartHomeAppliancesResponse]
ReadPrec ListSmartHomeAppliancesResponse
Int -> ReadS ListSmartHomeAppliancesResponse
ReadS [ListSmartHomeAppliancesResponse]
(Int -> ReadS ListSmartHomeAppliancesResponse)
-> ReadS [ListSmartHomeAppliancesResponse]
-> ReadPrec ListSmartHomeAppliancesResponse
-> ReadPrec [ListSmartHomeAppliancesResponse]
-> Read ListSmartHomeAppliancesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSmartHomeAppliancesResponse]
$creadListPrec :: ReadPrec [ListSmartHomeAppliancesResponse]
readPrec :: ReadPrec ListSmartHomeAppliancesResponse
$creadPrec :: ReadPrec ListSmartHomeAppliancesResponse
readList :: ReadS [ListSmartHomeAppliancesResponse]
$creadList :: ReadS [ListSmartHomeAppliancesResponse]
readsPrec :: Int -> ReadS ListSmartHomeAppliancesResponse
$creadsPrec :: Int -> ReadS ListSmartHomeAppliancesResponse
Prelude.Read, Int -> ListSmartHomeAppliancesResponse -> ShowS
[ListSmartHomeAppliancesResponse] -> ShowS
ListSmartHomeAppliancesResponse -> String
(Int -> ListSmartHomeAppliancesResponse -> ShowS)
-> (ListSmartHomeAppliancesResponse -> String)
-> ([ListSmartHomeAppliancesResponse] -> ShowS)
-> Show ListSmartHomeAppliancesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSmartHomeAppliancesResponse] -> ShowS
$cshowList :: [ListSmartHomeAppliancesResponse] -> ShowS
show :: ListSmartHomeAppliancesResponse -> String
$cshow :: ListSmartHomeAppliancesResponse -> String
showsPrec :: Int -> ListSmartHomeAppliancesResponse -> ShowS
$cshowsPrec :: Int -> ListSmartHomeAppliancesResponse -> ShowS
Prelude.Show, (forall x.
 ListSmartHomeAppliancesResponse
 -> Rep ListSmartHomeAppliancesResponse x)
-> (forall x.
    Rep ListSmartHomeAppliancesResponse x
    -> ListSmartHomeAppliancesResponse)
-> Generic ListSmartHomeAppliancesResponse
forall x.
Rep ListSmartHomeAppliancesResponse x
-> ListSmartHomeAppliancesResponse
forall x.
ListSmartHomeAppliancesResponse
-> Rep ListSmartHomeAppliancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSmartHomeAppliancesResponse x
-> ListSmartHomeAppliancesResponse
$cfrom :: forall x.
ListSmartHomeAppliancesResponse
-> Rep ListSmartHomeAppliancesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSmartHomeAppliancesResponse' 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:
--
-- 'smartHomeAppliances', 'listSmartHomeAppliancesResponse_smartHomeAppliances' - The smart home appliances.
--
-- 'nextToken', 'listSmartHomeAppliancesResponse_nextToken' - The tokens used for pagination.
--
-- 'httpStatus', 'listSmartHomeAppliancesResponse_httpStatus' - The response's http status code.
newListSmartHomeAppliancesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSmartHomeAppliancesResponse
newListSmartHomeAppliancesResponse :: Int -> ListSmartHomeAppliancesResponse
newListSmartHomeAppliancesResponse Int
pHttpStatus_ =
  ListSmartHomeAppliancesResponse' :: Maybe [SmartHomeAppliance]
-> Maybe Text -> Int -> ListSmartHomeAppliancesResponse
ListSmartHomeAppliancesResponse'
    { $sel:smartHomeAppliances:ListSmartHomeAppliancesResponse' :: Maybe [SmartHomeAppliance]
smartHomeAppliances =
        Maybe [SmartHomeAppliance]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSmartHomeAppliancesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSmartHomeAppliancesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The smart home appliances.
listSmartHomeAppliancesResponse_smartHomeAppliances :: Lens.Lens' ListSmartHomeAppliancesResponse (Prelude.Maybe [SmartHomeAppliance])
listSmartHomeAppliancesResponse_smartHomeAppliances :: (Maybe [SmartHomeAppliance] -> f (Maybe [SmartHomeAppliance]))
-> ListSmartHomeAppliancesResponse
-> f ListSmartHomeAppliancesResponse
listSmartHomeAppliancesResponse_smartHomeAppliances = (ListSmartHomeAppliancesResponse -> Maybe [SmartHomeAppliance])
-> (ListSmartHomeAppliancesResponse
    -> Maybe [SmartHomeAppliance] -> ListSmartHomeAppliancesResponse)
-> Lens'
     ListSmartHomeAppliancesResponse (Maybe [SmartHomeAppliance])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSmartHomeAppliancesResponse' {Maybe [SmartHomeAppliance]
smartHomeAppliances :: Maybe [SmartHomeAppliance]
$sel:smartHomeAppliances:ListSmartHomeAppliancesResponse' :: ListSmartHomeAppliancesResponse -> Maybe [SmartHomeAppliance]
smartHomeAppliances} -> Maybe [SmartHomeAppliance]
smartHomeAppliances) (\s :: ListSmartHomeAppliancesResponse
s@ListSmartHomeAppliancesResponse' {} Maybe [SmartHomeAppliance]
a -> ListSmartHomeAppliancesResponse
s {$sel:smartHomeAppliances:ListSmartHomeAppliancesResponse' :: Maybe [SmartHomeAppliance]
smartHomeAppliances = Maybe [SmartHomeAppliance]
a} :: ListSmartHomeAppliancesResponse) ((Maybe [SmartHomeAppliance] -> f (Maybe [SmartHomeAppliance]))
 -> ListSmartHomeAppliancesResponse
 -> f ListSmartHomeAppliancesResponse)
-> ((Maybe [SmartHomeAppliance] -> f (Maybe [SmartHomeAppliance]))
    -> Maybe [SmartHomeAppliance] -> f (Maybe [SmartHomeAppliance]))
-> (Maybe [SmartHomeAppliance] -> f (Maybe [SmartHomeAppliance]))
-> ListSmartHomeAppliancesResponse
-> f ListSmartHomeAppliancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SmartHomeAppliance]
  [SmartHomeAppliance]
  [SmartHomeAppliance]
  [SmartHomeAppliance]
-> Iso
     (Maybe [SmartHomeAppliance])
     (Maybe [SmartHomeAppliance])
     (Maybe [SmartHomeAppliance])
     (Maybe [SmartHomeAppliance])
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 AnIso
  [SmartHomeAppliance]
  [SmartHomeAppliance]
  [SmartHomeAppliance]
  [SmartHomeAppliance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tokens used for pagination.
listSmartHomeAppliancesResponse_nextToken :: Lens.Lens' ListSmartHomeAppliancesResponse (Prelude.Maybe Prelude.Text)
listSmartHomeAppliancesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSmartHomeAppliancesResponse
-> f ListSmartHomeAppliancesResponse
listSmartHomeAppliancesResponse_nextToken = (ListSmartHomeAppliancesResponse -> Maybe Text)
-> (ListSmartHomeAppliancesResponse
    -> Maybe Text -> ListSmartHomeAppliancesResponse)
-> Lens' ListSmartHomeAppliancesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSmartHomeAppliancesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSmartHomeAppliancesResponse' :: ListSmartHomeAppliancesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSmartHomeAppliancesResponse
s@ListSmartHomeAppliancesResponse' {} Maybe Text
a -> ListSmartHomeAppliancesResponse
s {$sel:nextToken:ListSmartHomeAppliancesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSmartHomeAppliancesResponse)

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

instance
  Prelude.NFData
    ListSmartHomeAppliancesResponse