{-# 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.StartSmartHomeApplianceDiscovery
-- 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)
--
-- Initiates the discovery of any smart home appliances associated with the
-- room.
module Amazonka.AlexaBusiness.StartSmartHomeApplianceDiscovery
  ( -- * Creating a Request
    StartSmartHomeApplianceDiscovery (..),
    newStartSmartHomeApplianceDiscovery,

    -- * Request Lenses
    startSmartHomeApplianceDiscovery_roomArn,

    -- * Destructuring the Response
    StartSmartHomeApplianceDiscoveryResponse (..),
    newStartSmartHomeApplianceDiscoveryResponse,

    -- * Response Lenses
    startSmartHomeApplianceDiscoveryResponse_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:/ 'newStartSmartHomeApplianceDiscovery' smart constructor.
data StartSmartHomeApplianceDiscovery = StartSmartHomeApplianceDiscovery'
  { -- | The room where smart home appliance discovery was initiated.
    StartSmartHomeApplianceDiscovery -> Text
roomArn :: Prelude.Text
  }
  deriving (StartSmartHomeApplianceDiscovery
-> StartSmartHomeApplianceDiscovery -> Bool
(StartSmartHomeApplianceDiscovery
 -> StartSmartHomeApplianceDiscovery -> Bool)
-> (StartSmartHomeApplianceDiscovery
    -> StartSmartHomeApplianceDiscovery -> Bool)
-> Eq StartSmartHomeApplianceDiscovery
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSmartHomeApplianceDiscovery
-> StartSmartHomeApplianceDiscovery -> Bool
$c/= :: StartSmartHomeApplianceDiscovery
-> StartSmartHomeApplianceDiscovery -> Bool
== :: StartSmartHomeApplianceDiscovery
-> StartSmartHomeApplianceDiscovery -> Bool
$c== :: StartSmartHomeApplianceDiscovery
-> StartSmartHomeApplianceDiscovery -> Bool
Prelude.Eq, ReadPrec [StartSmartHomeApplianceDiscovery]
ReadPrec StartSmartHomeApplianceDiscovery
Int -> ReadS StartSmartHomeApplianceDiscovery
ReadS [StartSmartHomeApplianceDiscovery]
(Int -> ReadS StartSmartHomeApplianceDiscovery)
-> ReadS [StartSmartHomeApplianceDiscovery]
-> ReadPrec StartSmartHomeApplianceDiscovery
-> ReadPrec [StartSmartHomeApplianceDiscovery]
-> Read StartSmartHomeApplianceDiscovery
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSmartHomeApplianceDiscovery]
$creadListPrec :: ReadPrec [StartSmartHomeApplianceDiscovery]
readPrec :: ReadPrec StartSmartHomeApplianceDiscovery
$creadPrec :: ReadPrec StartSmartHomeApplianceDiscovery
readList :: ReadS [StartSmartHomeApplianceDiscovery]
$creadList :: ReadS [StartSmartHomeApplianceDiscovery]
readsPrec :: Int -> ReadS StartSmartHomeApplianceDiscovery
$creadsPrec :: Int -> ReadS StartSmartHomeApplianceDiscovery
Prelude.Read, Int -> StartSmartHomeApplianceDiscovery -> ShowS
[StartSmartHomeApplianceDiscovery] -> ShowS
StartSmartHomeApplianceDiscovery -> String
(Int -> StartSmartHomeApplianceDiscovery -> ShowS)
-> (StartSmartHomeApplianceDiscovery -> String)
-> ([StartSmartHomeApplianceDiscovery] -> ShowS)
-> Show StartSmartHomeApplianceDiscovery
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSmartHomeApplianceDiscovery] -> ShowS
$cshowList :: [StartSmartHomeApplianceDiscovery] -> ShowS
show :: StartSmartHomeApplianceDiscovery -> String
$cshow :: StartSmartHomeApplianceDiscovery -> String
showsPrec :: Int -> StartSmartHomeApplianceDiscovery -> ShowS
$cshowsPrec :: Int -> StartSmartHomeApplianceDiscovery -> ShowS
Prelude.Show, (forall x.
 StartSmartHomeApplianceDiscovery
 -> Rep StartSmartHomeApplianceDiscovery x)
-> (forall x.
    Rep StartSmartHomeApplianceDiscovery x
    -> StartSmartHomeApplianceDiscovery)
-> Generic StartSmartHomeApplianceDiscovery
forall x.
Rep StartSmartHomeApplianceDiscovery x
-> StartSmartHomeApplianceDiscovery
forall x.
StartSmartHomeApplianceDiscovery
-> Rep StartSmartHomeApplianceDiscovery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartSmartHomeApplianceDiscovery x
-> StartSmartHomeApplianceDiscovery
$cfrom :: forall x.
StartSmartHomeApplianceDiscovery
-> Rep StartSmartHomeApplianceDiscovery x
Prelude.Generic)

-- |
-- Create a value of 'StartSmartHomeApplianceDiscovery' 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:
--
-- 'roomArn', 'startSmartHomeApplianceDiscovery_roomArn' - The room where smart home appliance discovery was initiated.
newStartSmartHomeApplianceDiscovery ::
  -- | 'roomArn'
  Prelude.Text ->
  StartSmartHomeApplianceDiscovery
newStartSmartHomeApplianceDiscovery :: Text -> StartSmartHomeApplianceDiscovery
newStartSmartHomeApplianceDiscovery Text
pRoomArn_ =
  StartSmartHomeApplianceDiscovery' :: Text -> StartSmartHomeApplianceDiscovery
StartSmartHomeApplianceDiscovery'
    { $sel:roomArn:StartSmartHomeApplianceDiscovery' :: Text
roomArn =
        Text
pRoomArn_
    }

-- | The room where smart home appliance discovery was initiated.
startSmartHomeApplianceDiscovery_roomArn :: Lens.Lens' StartSmartHomeApplianceDiscovery Prelude.Text
startSmartHomeApplianceDiscovery_roomArn :: (Text -> f Text)
-> StartSmartHomeApplianceDiscovery
-> f StartSmartHomeApplianceDiscovery
startSmartHomeApplianceDiscovery_roomArn = (StartSmartHomeApplianceDiscovery -> Text)
-> (StartSmartHomeApplianceDiscovery
    -> Text -> StartSmartHomeApplianceDiscovery)
-> Lens
     StartSmartHomeApplianceDiscovery
     StartSmartHomeApplianceDiscovery
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSmartHomeApplianceDiscovery' {Text
roomArn :: Text
$sel:roomArn:StartSmartHomeApplianceDiscovery' :: StartSmartHomeApplianceDiscovery -> Text
roomArn} -> Text
roomArn) (\s :: StartSmartHomeApplianceDiscovery
s@StartSmartHomeApplianceDiscovery' {} Text
a -> StartSmartHomeApplianceDiscovery
s {$sel:roomArn:StartSmartHomeApplianceDiscovery' :: Text
roomArn = Text
a} :: StartSmartHomeApplianceDiscovery)

instance
  Core.AWSRequest
    StartSmartHomeApplianceDiscovery
  where
  type
    AWSResponse StartSmartHomeApplianceDiscovery =
      StartSmartHomeApplianceDiscoveryResponse
  request :: StartSmartHomeApplianceDiscovery
-> Request StartSmartHomeApplianceDiscovery
request = Service
-> StartSmartHomeApplianceDiscovery
-> Request StartSmartHomeApplianceDiscovery
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartSmartHomeApplianceDiscovery
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse StartSmartHomeApplianceDiscovery)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse StartSmartHomeApplianceDiscovery))
-> Logger
-> Service
-> Proxy StartSmartHomeApplianceDiscovery
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse StartSmartHomeApplianceDiscovery)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> StartSmartHomeApplianceDiscoveryResponse
StartSmartHomeApplianceDiscoveryResponse'
            (Int -> StartSmartHomeApplianceDiscoveryResponse)
-> Either String Int
-> Either String StartSmartHomeApplianceDiscoveryResponse
forall (f :: * -> *) a b. Functor 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
    StartSmartHomeApplianceDiscovery

instance
  Prelude.NFData
    StartSmartHomeApplianceDiscovery

instance
  Core.ToHeaders
    StartSmartHomeApplianceDiscovery
  where
  toHeaders :: StartSmartHomeApplianceDiscovery -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> StartSmartHomeApplianceDiscovery -> 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.StartSmartHomeApplianceDiscovery" ::
                          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 StartSmartHomeApplianceDiscovery where
  toJSON :: StartSmartHomeApplianceDiscovery -> Value
toJSON StartSmartHomeApplianceDiscovery' {Text
roomArn :: Text
$sel:roomArn:StartSmartHomeApplianceDiscovery' :: StartSmartHomeApplianceDiscovery -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [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 StartSmartHomeApplianceDiscovery where
  toPath :: StartSmartHomeApplianceDiscovery -> ByteString
toPath = ByteString -> StartSmartHomeApplianceDiscovery -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'StartSmartHomeApplianceDiscoveryResponse' 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:
--
-- 'httpStatus', 'startSmartHomeApplianceDiscoveryResponse_httpStatus' - The response's http status code.
newStartSmartHomeApplianceDiscoveryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartSmartHomeApplianceDiscoveryResponse
newStartSmartHomeApplianceDiscoveryResponse :: Int -> StartSmartHomeApplianceDiscoveryResponse
newStartSmartHomeApplianceDiscoveryResponse
  Int
pHttpStatus_ =
    StartSmartHomeApplianceDiscoveryResponse' :: Int -> StartSmartHomeApplianceDiscoveryResponse
StartSmartHomeApplianceDiscoveryResponse'
      { $sel:httpStatus:StartSmartHomeApplianceDiscoveryResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

instance
  Prelude.NFData
    StartSmartHomeApplianceDiscoveryResponse