{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.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:/ 'newStartSmartHomeApplianceDiscovery' smart constructor.
data StartSmartHomeApplianceDiscovery = StartSmartHomeApplianceDiscovery'
  { -- | The room where smart home appliance discovery was initiated.
    StartSmartHomeApplianceDiscovery -> Text
roomArn :: Prelude.Text
  }
  deriving (StartSmartHomeApplianceDiscovery
-> StartSmartHomeApplianceDiscovery -> Bool
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]
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
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.
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'
    { $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 :: Lens' StartSmartHomeApplianceDiscovery Text
startSmartHomeApplianceDiscovery_roomArn = 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 :: (Service -> Service)
-> StartSmartHomeApplianceDiscovery
-> Request StartSmartHomeApplianceDiscovery
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 StartSmartHomeApplianceDiscovery
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse StartSmartHomeApplianceDiscovery)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> StartSmartHomeApplianceDiscoveryResponse
StartSmartHomeApplianceDiscoveryResponse'
            forall (f :: * -> *) a b. Functor 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
    StartSmartHomeApplianceDiscovery
  where
  hashWithSalt :: Int -> StartSmartHomeApplianceDiscovery -> Int
hashWithSalt
    Int
_salt
    StartSmartHomeApplianceDiscovery' {Text
roomArn :: Text
$sel:roomArn:StartSmartHomeApplianceDiscovery' :: StartSmartHomeApplianceDiscovery -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roomArn

instance
  Prelude.NFData
    StartSmartHomeApplianceDiscovery
  where
  rnf :: StartSmartHomeApplianceDiscovery -> ()
rnf StartSmartHomeApplianceDiscovery' {Text
roomArn :: Text
$sel:roomArn:StartSmartHomeApplianceDiscovery' :: StartSmartHomeApplianceDiscovery -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
roomArn

instance
  Data.ToHeaders
    StartSmartHomeApplianceDiscovery
  where
  toHeaders :: StartSmartHomeApplianceDiscovery -> 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.StartSmartHomeApplianceDiscovery" ::
                          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 StartSmartHomeApplianceDiscovery where
  toJSON :: StartSmartHomeApplianceDiscovery -> Value
toJSON StartSmartHomeApplianceDiscovery' {Text
roomArn :: Text
$sel:roomArn:StartSmartHomeApplianceDiscovery' :: StartSmartHomeApplianceDiscovery -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"RoomArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roomArn)]
      )

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

instance
  Data.ToQuery
    StartSmartHomeApplianceDiscovery
  where
  toQuery :: StartSmartHomeApplianceDiscovery -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
      { $sel:httpStatus:StartSmartHomeApplianceDiscoveryResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
startSmartHomeApplianceDiscoveryResponse_httpStatus :: Lens.Lens' StartSmartHomeApplianceDiscoveryResponse Prelude.Int
startSmartHomeApplianceDiscoveryResponse_httpStatus :: Lens' StartSmartHomeApplianceDiscoveryResponse Int
startSmartHomeApplianceDiscoveryResponse_httpStatus = 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
  where
  rnf :: StartSmartHomeApplianceDiscoveryResponse -> ()
rnf StartSmartHomeApplianceDiscoveryResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartSmartHomeApplianceDiscoveryResponse' :: StartSmartHomeApplianceDiscoveryResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus