{-# 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.IoTWireless.DisassociateWirelessGatewayFromThing
-- 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)
--
-- Disassociates a wireless gateway from its currently associated thing.
module Amazonka.IoTWireless.DisassociateWirelessGatewayFromThing
  ( -- * Creating a Request
    DisassociateWirelessGatewayFromThing (..),
    newDisassociateWirelessGatewayFromThing,

    -- * Request Lenses
    disassociateWirelessGatewayFromThing_id,

    -- * Destructuring the Response
    DisassociateWirelessGatewayFromThingResponse (..),
    newDisassociateWirelessGatewayFromThingResponse,

    -- * Response Lenses
    disassociateWirelessGatewayFromThingResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.Types
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:/ 'newDisassociateWirelessGatewayFromThing' smart constructor.
data DisassociateWirelessGatewayFromThing = DisassociateWirelessGatewayFromThing'
  { -- | The ID of the resource to update.
    DisassociateWirelessGatewayFromThing -> Text
id :: Prelude.Text
  }
  deriving (DisassociateWirelessGatewayFromThing
-> DisassociateWirelessGatewayFromThing -> Bool
(DisassociateWirelessGatewayFromThing
 -> DisassociateWirelessGatewayFromThing -> Bool)
-> (DisassociateWirelessGatewayFromThing
    -> DisassociateWirelessGatewayFromThing -> Bool)
-> Eq DisassociateWirelessGatewayFromThing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateWirelessGatewayFromThing
-> DisassociateWirelessGatewayFromThing -> Bool
$c/= :: DisassociateWirelessGatewayFromThing
-> DisassociateWirelessGatewayFromThing -> Bool
== :: DisassociateWirelessGatewayFromThing
-> DisassociateWirelessGatewayFromThing -> Bool
$c== :: DisassociateWirelessGatewayFromThing
-> DisassociateWirelessGatewayFromThing -> Bool
Prelude.Eq, ReadPrec [DisassociateWirelessGatewayFromThing]
ReadPrec DisassociateWirelessGatewayFromThing
Int -> ReadS DisassociateWirelessGatewayFromThing
ReadS [DisassociateWirelessGatewayFromThing]
(Int -> ReadS DisassociateWirelessGatewayFromThing)
-> ReadS [DisassociateWirelessGatewayFromThing]
-> ReadPrec DisassociateWirelessGatewayFromThing
-> ReadPrec [DisassociateWirelessGatewayFromThing]
-> Read DisassociateWirelessGatewayFromThing
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateWirelessGatewayFromThing]
$creadListPrec :: ReadPrec [DisassociateWirelessGatewayFromThing]
readPrec :: ReadPrec DisassociateWirelessGatewayFromThing
$creadPrec :: ReadPrec DisassociateWirelessGatewayFromThing
readList :: ReadS [DisassociateWirelessGatewayFromThing]
$creadList :: ReadS [DisassociateWirelessGatewayFromThing]
readsPrec :: Int -> ReadS DisassociateWirelessGatewayFromThing
$creadsPrec :: Int -> ReadS DisassociateWirelessGatewayFromThing
Prelude.Read, Int -> DisassociateWirelessGatewayFromThing -> ShowS
[DisassociateWirelessGatewayFromThing] -> ShowS
DisassociateWirelessGatewayFromThing -> String
(Int -> DisassociateWirelessGatewayFromThing -> ShowS)
-> (DisassociateWirelessGatewayFromThing -> String)
-> ([DisassociateWirelessGatewayFromThing] -> ShowS)
-> Show DisassociateWirelessGatewayFromThing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateWirelessGatewayFromThing] -> ShowS
$cshowList :: [DisassociateWirelessGatewayFromThing] -> ShowS
show :: DisassociateWirelessGatewayFromThing -> String
$cshow :: DisassociateWirelessGatewayFromThing -> String
showsPrec :: Int -> DisassociateWirelessGatewayFromThing -> ShowS
$cshowsPrec :: Int -> DisassociateWirelessGatewayFromThing -> ShowS
Prelude.Show, (forall x.
 DisassociateWirelessGatewayFromThing
 -> Rep DisassociateWirelessGatewayFromThing x)
-> (forall x.
    Rep DisassociateWirelessGatewayFromThing x
    -> DisassociateWirelessGatewayFromThing)
-> Generic DisassociateWirelessGatewayFromThing
forall x.
Rep DisassociateWirelessGatewayFromThing x
-> DisassociateWirelessGatewayFromThing
forall x.
DisassociateWirelessGatewayFromThing
-> Rep DisassociateWirelessGatewayFromThing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateWirelessGatewayFromThing x
-> DisassociateWirelessGatewayFromThing
$cfrom :: forall x.
DisassociateWirelessGatewayFromThing
-> Rep DisassociateWirelessGatewayFromThing x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateWirelessGatewayFromThing' 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:
--
-- 'id', 'disassociateWirelessGatewayFromThing_id' - The ID of the resource to update.
newDisassociateWirelessGatewayFromThing ::
  -- | 'id'
  Prelude.Text ->
  DisassociateWirelessGatewayFromThing
newDisassociateWirelessGatewayFromThing :: Text -> DisassociateWirelessGatewayFromThing
newDisassociateWirelessGatewayFromThing Text
pId_ =
  DisassociateWirelessGatewayFromThing' :: Text -> DisassociateWirelessGatewayFromThing
DisassociateWirelessGatewayFromThing' {$sel:id:DisassociateWirelessGatewayFromThing' :: Text
id = Text
pId_}

-- | The ID of the resource to update.
disassociateWirelessGatewayFromThing_id :: Lens.Lens' DisassociateWirelessGatewayFromThing Prelude.Text
disassociateWirelessGatewayFromThing_id :: (Text -> f Text)
-> DisassociateWirelessGatewayFromThing
-> f DisassociateWirelessGatewayFromThing
disassociateWirelessGatewayFromThing_id = (DisassociateWirelessGatewayFromThing -> Text)
-> (DisassociateWirelessGatewayFromThing
    -> Text -> DisassociateWirelessGatewayFromThing)
-> Lens
     DisassociateWirelessGatewayFromThing
     DisassociateWirelessGatewayFromThing
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateWirelessGatewayFromThing' {Text
id :: Text
$sel:id:DisassociateWirelessGatewayFromThing' :: DisassociateWirelessGatewayFromThing -> Text
id} -> Text
id) (\s :: DisassociateWirelessGatewayFromThing
s@DisassociateWirelessGatewayFromThing' {} Text
a -> DisassociateWirelessGatewayFromThing
s {$sel:id:DisassociateWirelessGatewayFromThing' :: Text
id = Text
a} :: DisassociateWirelessGatewayFromThing)

instance
  Core.AWSRequest
    DisassociateWirelessGatewayFromThing
  where
  type
    AWSResponse DisassociateWirelessGatewayFromThing =
      DisassociateWirelessGatewayFromThingResponse
  request :: DisassociateWirelessGatewayFromThing
-> Request DisassociateWirelessGatewayFromThing
request = Service
-> DisassociateWirelessGatewayFromThing
-> Request DisassociateWirelessGatewayFromThing
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DisassociateWirelessGatewayFromThing
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DisassociateWirelessGatewayFromThing)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either
      String (AWSResponse DisassociateWirelessGatewayFromThing))
-> Logger
-> Service
-> Proxy DisassociateWirelessGatewayFromThing
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DisassociateWirelessGatewayFromThing)))
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 -> DisassociateWirelessGatewayFromThingResponse
DisassociateWirelessGatewayFromThingResponse'
            (Int -> DisassociateWirelessGatewayFromThingResponse)
-> Either String Int
-> Either String DisassociateWirelessGatewayFromThingResponse
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
    DisassociateWirelessGatewayFromThing

instance
  Prelude.NFData
    DisassociateWirelessGatewayFromThing

instance
  Core.ToHeaders
    DisassociateWirelessGatewayFromThing
  where
  toHeaders :: DisassociateWirelessGatewayFromThing -> ResponseHeaders
toHeaders = ResponseHeaders
-> DisassociateWirelessGatewayFromThing -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance
  Core.ToPath
    DisassociateWirelessGatewayFromThing
  where
  toPath :: DisassociateWirelessGatewayFromThing -> ByteString
toPath DisassociateWirelessGatewayFromThing' {Text
id :: Text
$sel:id:DisassociateWirelessGatewayFromThing' :: DisassociateWirelessGatewayFromThing -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/wireless-gateways/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id, ByteString
"/thing"]

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

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

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

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

instance
  Prelude.NFData
    DisassociateWirelessGatewayFromThingResponse