{-# 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.DisassociateWirelessGatewayFromCertificate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Disassociates a wireless gateway from its currently associated
-- certificate.
module Amazonka.IoTWireless.DisassociateWirelessGatewayFromCertificate
  ( -- * Creating a Request
    DisassociateWirelessGatewayFromCertificate (..),
    newDisassociateWirelessGatewayFromCertificate,

    -- * Request Lenses
    disassociateWirelessGatewayFromCertificate_id,

    -- * Destructuring the Response
    DisassociateWirelessGatewayFromCertificateResponse (..),
    newDisassociateWirelessGatewayFromCertificateResponse,

    -- * Response Lenses
    disassociateWirelessGatewayFromCertificateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDisassociateWirelessGatewayFromCertificate' smart constructor.
data DisassociateWirelessGatewayFromCertificate = DisassociateWirelessGatewayFromCertificate'
  { -- | The ID of the resource to update.
    DisassociateWirelessGatewayFromCertificate -> Text
id :: Prelude.Text
  }
  deriving (DisassociateWirelessGatewayFromCertificate
-> DisassociateWirelessGatewayFromCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateWirelessGatewayFromCertificate
-> DisassociateWirelessGatewayFromCertificate -> Bool
$c/= :: DisassociateWirelessGatewayFromCertificate
-> DisassociateWirelessGatewayFromCertificate -> Bool
== :: DisassociateWirelessGatewayFromCertificate
-> DisassociateWirelessGatewayFromCertificate -> Bool
$c== :: DisassociateWirelessGatewayFromCertificate
-> DisassociateWirelessGatewayFromCertificate -> Bool
Prelude.Eq, ReadPrec [DisassociateWirelessGatewayFromCertificate]
ReadPrec DisassociateWirelessGatewayFromCertificate
Int -> ReadS DisassociateWirelessGatewayFromCertificate
ReadS [DisassociateWirelessGatewayFromCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateWirelessGatewayFromCertificate]
$creadListPrec :: ReadPrec [DisassociateWirelessGatewayFromCertificate]
readPrec :: ReadPrec DisassociateWirelessGatewayFromCertificate
$creadPrec :: ReadPrec DisassociateWirelessGatewayFromCertificate
readList :: ReadS [DisassociateWirelessGatewayFromCertificate]
$creadList :: ReadS [DisassociateWirelessGatewayFromCertificate]
readsPrec :: Int -> ReadS DisassociateWirelessGatewayFromCertificate
$creadsPrec :: Int -> ReadS DisassociateWirelessGatewayFromCertificate
Prelude.Read, Int -> DisassociateWirelessGatewayFromCertificate -> ShowS
[DisassociateWirelessGatewayFromCertificate] -> ShowS
DisassociateWirelessGatewayFromCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateWirelessGatewayFromCertificate] -> ShowS
$cshowList :: [DisassociateWirelessGatewayFromCertificate] -> ShowS
show :: DisassociateWirelessGatewayFromCertificate -> String
$cshow :: DisassociateWirelessGatewayFromCertificate -> String
showsPrec :: Int -> DisassociateWirelessGatewayFromCertificate -> ShowS
$cshowsPrec :: Int -> DisassociateWirelessGatewayFromCertificate -> ShowS
Prelude.Show, forall x.
Rep DisassociateWirelessGatewayFromCertificate x
-> DisassociateWirelessGatewayFromCertificate
forall x.
DisassociateWirelessGatewayFromCertificate
-> Rep DisassociateWirelessGatewayFromCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateWirelessGatewayFromCertificate x
-> DisassociateWirelessGatewayFromCertificate
$cfrom :: forall x.
DisassociateWirelessGatewayFromCertificate
-> Rep DisassociateWirelessGatewayFromCertificate x
Prelude.Generic)

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

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

instance
  Core.AWSRequest
    DisassociateWirelessGatewayFromCertificate
  where
  type
    AWSResponse
      DisassociateWirelessGatewayFromCertificate =
      DisassociateWirelessGatewayFromCertificateResponse
  request :: (Service -> Service)
-> DisassociateWirelessGatewayFromCertificate
-> Request DisassociateWirelessGatewayFromCertificate
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateWirelessGatewayFromCertificate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DisassociateWirelessGatewayFromCertificate)))
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 -> DisassociateWirelessGatewayFromCertificateResponse
DisassociateWirelessGatewayFromCertificateResponse'
            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
    DisassociateWirelessGatewayFromCertificate
  where
  hashWithSalt :: Int -> DisassociateWirelessGatewayFromCertificate -> Int
hashWithSalt
    Int
_salt
    DisassociateWirelessGatewayFromCertificate' {Text
id :: Text
$sel:id:DisassociateWirelessGatewayFromCertificate' :: DisassociateWirelessGatewayFromCertificate -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

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

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

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

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

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

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

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

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