{-# 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.ForgetSmartHomeAppliances
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Forgets smart home appliances associated to a room.
module Amazonka.AlexaBusiness.ForgetSmartHomeAppliances
  ( -- * Creating a Request
    ForgetSmartHomeAppliances (..),
    newForgetSmartHomeAppliances,

    -- * Request Lenses
    forgetSmartHomeAppliances_roomArn,

    -- * Destructuring the Response
    ForgetSmartHomeAppliancesResponse (..),
    newForgetSmartHomeAppliancesResponse,

    -- * Response Lenses
    forgetSmartHomeAppliancesResponse_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:/ 'newForgetSmartHomeAppliances' smart constructor.
data ForgetSmartHomeAppliances = ForgetSmartHomeAppliances'
  { -- | The room that the appliances are associated with.
    ForgetSmartHomeAppliances -> Text
roomArn :: Prelude.Text
  }
  deriving (ForgetSmartHomeAppliances -> ForgetSmartHomeAppliances -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ForgetSmartHomeAppliances -> ForgetSmartHomeAppliances -> Bool
$c/= :: ForgetSmartHomeAppliances -> ForgetSmartHomeAppliances -> Bool
== :: ForgetSmartHomeAppliances -> ForgetSmartHomeAppliances -> Bool
$c== :: ForgetSmartHomeAppliances -> ForgetSmartHomeAppliances -> Bool
Prelude.Eq, ReadPrec [ForgetSmartHomeAppliances]
ReadPrec ForgetSmartHomeAppliances
Int -> ReadS ForgetSmartHomeAppliances
ReadS [ForgetSmartHomeAppliances]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ForgetSmartHomeAppliances]
$creadListPrec :: ReadPrec [ForgetSmartHomeAppliances]
readPrec :: ReadPrec ForgetSmartHomeAppliances
$creadPrec :: ReadPrec ForgetSmartHomeAppliances
readList :: ReadS [ForgetSmartHomeAppliances]
$creadList :: ReadS [ForgetSmartHomeAppliances]
readsPrec :: Int -> ReadS ForgetSmartHomeAppliances
$creadsPrec :: Int -> ReadS ForgetSmartHomeAppliances
Prelude.Read, Int -> ForgetSmartHomeAppliances -> ShowS
[ForgetSmartHomeAppliances] -> ShowS
ForgetSmartHomeAppliances -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ForgetSmartHomeAppliances] -> ShowS
$cshowList :: [ForgetSmartHomeAppliances] -> ShowS
show :: ForgetSmartHomeAppliances -> String
$cshow :: ForgetSmartHomeAppliances -> String
showsPrec :: Int -> ForgetSmartHomeAppliances -> ShowS
$cshowsPrec :: Int -> ForgetSmartHomeAppliances -> ShowS
Prelude.Show, forall x.
Rep ForgetSmartHomeAppliances x -> ForgetSmartHomeAppliances
forall x.
ForgetSmartHomeAppliances -> Rep ForgetSmartHomeAppliances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ForgetSmartHomeAppliances x -> ForgetSmartHomeAppliances
$cfrom :: forall x.
ForgetSmartHomeAppliances -> Rep ForgetSmartHomeAppliances x
Prelude.Generic)

-- |
-- Create a value of 'ForgetSmartHomeAppliances' 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', 'forgetSmartHomeAppliances_roomArn' - The room that the appliances are associated with.
newForgetSmartHomeAppliances ::
  -- | 'roomArn'
  Prelude.Text ->
  ForgetSmartHomeAppliances
newForgetSmartHomeAppliances :: Text -> ForgetSmartHomeAppliances
newForgetSmartHomeAppliances Text
pRoomArn_ =
  ForgetSmartHomeAppliances' {$sel:roomArn:ForgetSmartHomeAppliances' :: Text
roomArn = Text
pRoomArn_}

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

instance Core.AWSRequest ForgetSmartHomeAppliances where
  type
    AWSResponse ForgetSmartHomeAppliances =
      ForgetSmartHomeAppliancesResponse
  request :: (Service -> Service)
-> ForgetSmartHomeAppliances -> Request ForgetSmartHomeAppliances
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 ForgetSmartHomeAppliances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ForgetSmartHomeAppliances)))
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 -> ForgetSmartHomeAppliancesResponse
ForgetSmartHomeAppliancesResponse'
            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 ForgetSmartHomeAppliances where
  hashWithSalt :: Int -> ForgetSmartHomeAppliances -> Int
hashWithSalt Int
_salt ForgetSmartHomeAppliances' {Text
roomArn :: Text
$sel:roomArn:ForgetSmartHomeAppliances' :: ForgetSmartHomeAppliances -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roomArn

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

instance Data.ToHeaders ForgetSmartHomeAppliances where
  toHeaders :: ForgetSmartHomeAppliances -> 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.ForgetSmartHomeAppliances" ::
                          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 ForgetSmartHomeAppliances where
  toJSON :: ForgetSmartHomeAppliances -> Value
toJSON ForgetSmartHomeAppliances' {Text
roomArn :: Text
$sel:roomArn:ForgetSmartHomeAppliances' :: ForgetSmartHomeAppliances -> 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 ForgetSmartHomeAppliances where
  toPath :: ForgetSmartHomeAppliances -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

instance
  Prelude.NFData
    ForgetSmartHomeAppliancesResponse
  where
  rnf :: ForgetSmartHomeAppliancesResponse -> ()
rnf ForgetSmartHomeAppliancesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ForgetSmartHomeAppliancesResponse' :: ForgetSmartHomeAppliancesResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus