{-# 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.LookoutEquipment.DeleteLabelGroup
-- 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 group of labels.
module Amazonka.LookoutEquipment.DeleteLabelGroup
  ( -- * Creating a Request
    DeleteLabelGroup (..),
    newDeleteLabelGroup,

    -- * Request Lenses
    deleteLabelGroup_labelGroupName,

    -- * Destructuring the Response
    DeleteLabelGroupResponse (..),
    newDeleteLabelGroupResponse,
  )
where

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

-- | /See:/ 'newDeleteLabelGroup' smart constructor.
data DeleteLabelGroup = DeleteLabelGroup'
  { -- | The name of the label group that you want to delete. Data in this field
    -- will be retained for service usage. Follow best practices for the
    -- security of your data.
    DeleteLabelGroup -> Text
labelGroupName :: Prelude.Text
  }
  deriving (DeleteLabelGroup -> DeleteLabelGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLabelGroup -> DeleteLabelGroup -> Bool
$c/= :: DeleteLabelGroup -> DeleteLabelGroup -> Bool
== :: DeleteLabelGroup -> DeleteLabelGroup -> Bool
$c== :: DeleteLabelGroup -> DeleteLabelGroup -> Bool
Prelude.Eq, ReadPrec [DeleteLabelGroup]
ReadPrec DeleteLabelGroup
Int -> ReadS DeleteLabelGroup
ReadS [DeleteLabelGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLabelGroup]
$creadListPrec :: ReadPrec [DeleteLabelGroup]
readPrec :: ReadPrec DeleteLabelGroup
$creadPrec :: ReadPrec DeleteLabelGroup
readList :: ReadS [DeleteLabelGroup]
$creadList :: ReadS [DeleteLabelGroup]
readsPrec :: Int -> ReadS DeleteLabelGroup
$creadsPrec :: Int -> ReadS DeleteLabelGroup
Prelude.Read, Int -> DeleteLabelGroup -> ShowS
[DeleteLabelGroup] -> ShowS
DeleteLabelGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLabelGroup] -> ShowS
$cshowList :: [DeleteLabelGroup] -> ShowS
show :: DeleteLabelGroup -> String
$cshow :: DeleteLabelGroup -> String
showsPrec :: Int -> DeleteLabelGroup -> ShowS
$cshowsPrec :: Int -> DeleteLabelGroup -> ShowS
Prelude.Show, forall x. Rep DeleteLabelGroup x -> DeleteLabelGroup
forall x. DeleteLabelGroup -> Rep DeleteLabelGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLabelGroup x -> DeleteLabelGroup
$cfrom :: forall x. DeleteLabelGroup -> Rep DeleteLabelGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLabelGroup' 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:
--
-- 'labelGroupName', 'deleteLabelGroup_labelGroupName' - The name of the label group that you want to delete. Data in this field
-- will be retained for service usage. Follow best practices for the
-- security of your data.
newDeleteLabelGroup ::
  -- | 'labelGroupName'
  Prelude.Text ->
  DeleteLabelGroup
newDeleteLabelGroup :: Text -> DeleteLabelGroup
newDeleteLabelGroup Text
pLabelGroupName_ =
  DeleteLabelGroup'
    { $sel:labelGroupName:DeleteLabelGroup' :: Text
labelGroupName =
        Text
pLabelGroupName_
    }

-- | The name of the label group that you want to delete. Data in this field
-- will be retained for service usage. Follow best practices for the
-- security of your data.
deleteLabelGroup_labelGroupName :: Lens.Lens' DeleteLabelGroup Prelude.Text
deleteLabelGroup_labelGroupName :: Lens' DeleteLabelGroup Text
deleteLabelGroup_labelGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLabelGroup' {Text
labelGroupName :: Text
$sel:labelGroupName:DeleteLabelGroup' :: DeleteLabelGroup -> Text
labelGroupName} -> Text
labelGroupName) (\s :: DeleteLabelGroup
s@DeleteLabelGroup' {} Text
a -> DeleteLabelGroup
s {$sel:labelGroupName:DeleteLabelGroup' :: Text
labelGroupName = Text
a} :: DeleteLabelGroup)

instance Core.AWSRequest DeleteLabelGroup where
  type
    AWSResponse DeleteLabelGroup =
      DeleteLabelGroupResponse
  request :: (Service -> Service)
-> DeleteLabelGroup -> Request DeleteLabelGroup
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 DeleteLabelGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLabelGroup)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteLabelGroupResponse
DeleteLabelGroupResponse'

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

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

instance Data.ToHeaders DeleteLabelGroup where
  toHeaders :: DeleteLabelGroup -> [Header]
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 -> [Header]
Data.=# ( ByteString
"AWSLookoutEquipmentFrontendService.DeleteLabelGroup" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteLabelGroup where
  toJSON :: DeleteLabelGroup -> Value
toJSON DeleteLabelGroup' {Text
labelGroupName :: Text
$sel:labelGroupName:DeleteLabelGroup' :: DeleteLabelGroup -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"LabelGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
labelGroupName)
          ]
      )

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

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

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

-- |
-- Create a value of 'DeleteLabelGroupResponse' 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.
newDeleteLabelGroupResponse ::
  DeleteLabelGroupResponse
newDeleteLabelGroupResponse :: DeleteLabelGroupResponse
newDeleteLabelGroupResponse =
  DeleteLabelGroupResponse
DeleteLabelGroupResponse'

instance Prelude.NFData DeleteLabelGroupResponse where
  rnf :: DeleteLabelGroupResponse -> ()
rnf DeleteLabelGroupResponse
_ = ()