{-# 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.DeleteGatewayGroup
-- 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)
--
-- Deletes a gateway group.
module Amazonka.AlexaBusiness.DeleteGatewayGroup
  ( -- * Creating a Request
    DeleteGatewayGroup (..),
    newDeleteGatewayGroup,

    -- * Request Lenses
    deleteGatewayGroup_gatewayGroupArn,

    -- * Destructuring the Response
    DeleteGatewayGroupResponse (..),
    newDeleteGatewayGroupResponse,

    -- * Response Lenses
    deleteGatewayGroupResponse_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:/ 'newDeleteGatewayGroup' smart constructor.
data DeleteGatewayGroup = DeleteGatewayGroup'
  { -- | The ARN of the gateway group to delete.
    DeleteGatewayGroup -> Text
gatewayGroupArn :: Prelude.Text
  }
  deriving (DeleteGatewayGroup -> DeleteGatewayGroup -> Bool
(DeleteGatewayGroup -> DeleteGatewayGroup -> Bool)
-> (DeleteGatewayGroup -> DeleteGatewayGroup -> Bool)
-> Eq DeleteGatewayGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGatewayGroup -> DeleteGatewayGroup -> Bool
$c/= :: DeleteGatewayGroup -> DeleteGatewayGroup -> Bool
== :: DeleteGatewayGroup -> DeleteGatewayGroup -> Bool
$c== :: DeleteGatewayGroup -> DeleteGatewayGroup -> Bool
Prelude.Eq, ReadPrec [DeleteGatewayGroup]
ReadPrec DeleteGatewayGroup
Int -> ReadS DeleteGatewayGroup
ReadS [DeleteGatewayGroup]
(Int -> ReadS DeleteGatewayGroup)
-> ReadS [DeleteGatewayGroup]
-> ReadPrec DeleteGatewayGroup
-> ReadPrec [DeleteGatewayGroup]
-> Read DeleteGatewayGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGatewayGroup]
$creadListPrec :: ReadPrec [DeleteGatewayGroup]
readPrec :: ReadPrec DeleteGatewayGroup
$creadPrec :: ReadPrec DeleteGatewayGroup
readList :: ReadS [DeleteGatewayGroup]
$creadList :: ReadS [DeleteGatewayGroup]
readsPrec :: Int -> ReadS DeleteGatewayGroup
$creadsPrec :: Int -> ReadS DeleteGatewayGroup
Prelude.Read, Int -> DeleteGatewayGroup -> ShowS
[DeleteGatewayGroup] -> ShowS
DeleteGatewayGroup -> String
(Int -> DeleteGatewayGroup -> ShowS)
-> (DeleteGatewayGroup -> String)
-> ([DeleteGatewayGroup] -> ShowS)
-> Show DeleteGatewayGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGatewayGroup] -> ShowS
$cshowList :: [DeleteGatewayGroup] -> ShowS
show :: DeleteGatewayGroup -> String
$cshow :: DeleteGatewayGroup -> String
showsPrec :: Int -> DeleteGatewayGroup -> ShowS
$cshowsPrec :: Int -> DeleteGatewayGroup -> ShowS
Prelude.Show, (forall x. DeleteGatewayGroup -> Rep DeleteGatewayGroup x)
-> (forall x. Rep DeleteGatewayGroup x -> DeleteGatewayGroup)
-> Generic DeleteGatewayGroup
forall x. Rep DeleteGatewayGroup x -> DeleteGatewayGroup
forall x. DeleteGatewayGroup -> Rep DeleteGatewayGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteGatewayGroup x -> DeleteGatewayGroup
$cfrom :: forall x. DeleteGatewayGroup -> Rep DeleteGatewayGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteGatewayGroup' 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:
--
-- 'gatewayGroupArn', 'deleteGatewayGroup_gatewayGroupArn' - The ARN of the gateway group to delete.
newDeleteGatewayGroup ::
  -- | 'gatewayGroupArn'
  Prelude.Text ->
  DeleteGatewayGroup
newDeleteGatewayGroup :: Text -> DeleteGatewayGroup
newDeleteGatewayGroup Text
pGatewayGroupArn_ =
  DeleteGatewayGroup' :: Text -> DeleteGatewayGroup
DeleteGatewayGroup'
    { $sel:gatewayGroupArn:DeleteGatewayGroup' :: Text
gatewayGroupArn =
        Text
pGatewayGroupArn_
    }

-- | The ARN of the gateway group to delete.
deleteGatewayGroup_gatewayGroupArn :: Lens.Lens' DeleteGatewayGroup Prelude.Text
deleteGatewayGroup_gatewayGroupArn :: (Text -> f Text) -> DeleteGatewayGroup -> f DeleteGatewayGroup
deleteGatewayGroup_gatewayGroupArn = (DeleteGatewayGroup -> Text)
-> (DeleteGatewayGroup -> Text -> DeleteGatewayGroup)
-> Lens DeleteGatewayGroup DeleteGatewayGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGatewayGroup' {Text
gatewayGroupArn :: Text
$sel:gatewayGroupArn:DeleteGatewayGroup' :: DeleteGatewayGroup -> Text
gatewayGroupArn} -> Text
gatewayGroupArn) (\s :: DeleteGatewayGroup
s@DeleteGatewayGroup' {} Text
a -> DeleteGatewayGroup
s {$sel:gatewayGroupArn:DeleteGatewayGroup' :: Text
gatewayGroupArn = Text
a} :: DeleteGatewayGroup)

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

instance Prelude.NFData DeleteGatewayGroup

instance Core.ToHeaders DeleteGatewayGroup where
  toHeaders :: DeleteGatewayGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteGatewayGroup -> 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.DeleteGatewayGroup" ::
                          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 DeleteGatewayGroup where
  toJSON :: DeleteGatewayGroup -> Value
toJSON DeleteGatewayGroup' {Text
gatewayGroupArn :: Text
$sel:gatewayGroupArn:DeleteGatewayGroup' :: DeleteGatewayGroup -> 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
"GatewayGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayGroupArn)
          ]
      )

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

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

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

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

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

instance Prelude.NFData DeleteGatewayGroupResponse