{-# 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.GroundStation.DeleteDataflowEndpointGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a dataflow endpoint group.
module Amazonka.GroundStation.DeleteDataflowEndpointGroup
  ( -- * Creating a Request
    DeleteDataflowEndpointGroup (..),
    newDeleteDataflowEndpointGroup,

    -- * Request Lenses
    deleteDataflowEndpointGroup_dataflowEndpointGroupId,

    -- * Destructuring the Response
    DataflowEndpointGroupIdResponse (..),
    newDataflowEndpointGroupIdResponse,

    -- * Response Lenses
    dataflowEndpointGroupIdResponse_dataflowEndpointGroupId,
  )
where

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

-- |
--
-- /See:/ 'newDeleteDataflowEndpointGroup' smart constructor.
data DeleteDataflowEndpointGroup = DeleteDataflowEndpointGroup'
  { -- | UUID of a dataflow endpoint group.
    DeleteDataflowEndpointGroup -> Text
dataflowEndpointGroupId :: Prelude.Text
  }
  deriving (DeleteDataflowEndpointGroup -> DeleteDataflowEndpointGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDataflowEndpointGroup -> DeleteDataflowEndpointGroup -> Bool
$c/= :: DeleteDataflowEndpointGroup -> DeleteDataflowEndpointGroup -> Bool
== :: DeleteDataflowEndpointGroup -> DeleteDataflowEndpointGroup -> Bool
$c== :: DeleteDataflowEndpointGroup -> DeleteDataflowEndpointGroup -> Bool
Prelude.Eq, ReadPrec [DeleteDataflowEndpointGroup]
ReadPrec DeleteDataflowEndpointGroup
Int -> ReadS DeleteDataflowEndpointGroup
ReadS [DeleteDataflowEndpointGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDataflowEndpointGroup]
$creadListPrec :: ReadPrec [DeleteDataflowEndpointGroup]
readPrec :: ReadPrec DeleteDataflowEndpointGroup
$creadPrec :: ReadPrec DeleteDataflowEndpointGroup
readList :: ReadS [DeleteDataflowEndpointGroup]
$creadList :: ReadS [DeleteDataflowEndpointGroup]
readsPrec :: Int -> ReadS DeleteDataflowEndpointGroup
$creadsPrec :: Int -> ReadS DeleteDataflowEndpointGroup
Prelude.Read, Int -> DeleteDataflowEndpointGroup -> ShowS
[DeleteDataflowEndpointGroup] -> ShowS
DeleteDataflowEndpointGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDataflowEndpointGroup] -> ShowS
$cshowList :: [DeleteDataflowEndpointGroup] -> ShowS
show :: DeleteDataflowEndpointGroup -> String
$cshow :: DeleteDataflowEndpointGroup -> String
showsPrec :: Int -> DeleteDataflowEndpointGroup -> ShowS
$cshowsPrec :: Int -> DeleteDataflowEndpointGroup -> ShowS
Prelude.Show, forall x.
Rep DeleteDataflowEndpointGroup x -> DeleteDataflowEndpointGroup
forall x.
DeleteDataflowEndpointGroup -> Rep DeleteDataflowEndpointGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDataflowEndpointGroup x -> DeleteDataflowEndpointGroup
$cfrom :: forall x.
DeleteDataflowEndpointGroup -> Rep DeleteDataflowEndpointGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDataflowEndpointGroup' 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:
--
-- 'dataflowEndpointGroupId', 'deleteDataflowEndpointGroup_dataflowEndpointGroupId' - UUID of a dataflow endpoint group.
newDeleteDataflowEndpointGroup ::
  -- | 'dataflowEndpointGroupId'
  Prelude.Text ->
  DeleteDataflowEndpointGroup
newDeleteDataflowEndpointGroup :: Text -> DeleteDataflowEndpointGroup
newDeleteDataflowEndpointGroup
  Text
pDataflowEndpointGroupId_ =
    DeleteDataflowEndpointGroup'
      { $sel:dataflowEndpointGroupId:DeleteDataflowEndpointGroup' :: Text
dataflowEndpointGroupId =
          Text
pDataflowEndpointGroupId_
      }

-- | UUID of a dataflow endpoint group.
deleteDataflowEndpointGroup_dataflowEndpointGroupId :: Lens.Lens' DeleteDataflowEndpointGroup Prelude.Text
deleteDataflowEndpointGroup_dataflowEndpointGroupId :: Lens' DeleteDataflowEndpointGroup Text
deleteDataflowEndpointGroup_dataflowEndpointGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataflowEndpointGroup' {Text
dataflowEndpointGroupId :: Text
$sel:dataflowEndpointGroupId:DeleteDataflowEndpointGroup' :: DeleteDataflowEndpointGroup -> Text
dataflowEndpointGroupId} -> Text
dataflowEndpointGroupId) (\s :: DeleteDataflowEndpointGroup
s@DeleteDataflowEndpointGroup' {} Text
a -> DeleteDataflowEndpointGroup
s {$sel:dataflowEndpointGroupId:DeleteDataflowEndpointGroup' :: Text
dataflowEndpointGroupId = Text
a} :: DeleteDataflowEndpointGroup)

instance Core.AWSRequest DeleteDataflowEndpointGroup where
  type
    AWSResponse DeleteDataflowEndpointGroup =
      DataflowEndpointGroupIdResponse
  request :: (Service -> Service)
-> DeleteDataflowEndpointGroup
-> Request DeleteDataflowEndpointGroup
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 DeleteDataflowEndpointGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDataflowEndpointGroup)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      (\Int
s ResponseHeaders
h Object
x -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)

instance Prelude.Hashable DeleteDataflowEndpointGroup where
  hashWithSalt :: Int -> DeleteDataflowEndpointGroup -> Int
hashWithSalt Int
_salt DeleteDataflowEndpointGroup' {Text
dataflowEndpointGroupId :: Text
$sel:dataflowEndpointGroupId:DeleteDataflowEndpointGroup' :: DeleteDataflowEndpointGroup -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataflowEndpointGroupId

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

instance Data.ToHeaders DeleteDataflowEndpointGroup where
  toHeaders :: DeleteDataflowEndpointGroup -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeleteDataflowEndpointGroup where
  toPath :: DeleteDataflowEndpointGroup -> ByteString
toPath DeleteDataflowEndpointGroup' {Text
dataflowEndpointGroupId :: Text
$sel:dataflowEndpointGroupId:DeleteDataflowEndpointGroup' :: DeleteDataflowEndpointGroup -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/dataflowEndpointGroup/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
dataflowEndpointGroupId
      ]

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