{-# 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.LicenseManager.DeleteLicenseManagerReportGenerator
-- 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 the specified report generator.
--
-- This action deletes the report generator, which stops it from generating
-- future reports. The action cannot be reversed. It has no effect on the
-- previous reports from this generator.
module Amazonka.LicenseManager.DeleteLicenseManagerReportGenerator
  ( -- * Creating a Request
    DeleteLicenseManagerReportGenerator (..),
    newDeleteLicenseManagerReportGenerator,

    -- * Request Lenses
    deleteLicenseManagerReportGenerator_licenseManagerReportGeneratorArn,

    -- * Destructuring the Response
    DeleteLicenseManagerReportGeneratorResponse (..),
    newDeleteLicenseManagerReportGeneratorResponse,

    -- * Response Lenses
    deleteLicenseManagerReportGeneratorResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDeleteLicenseManagerReportGenerator' smart constructor.
data DeleteLicenseManagerReportGenerator = DeleteLicenseManagerReportGenerator'
  { -- | Amazon Resource Name (ARN) of the report generator to be deleted.
    DeleteLicenseManagerReportGenerator -> Text
licenseManagerReportGeneratorArn :: Prelude.Text
  }
  deriving (DeleteLicenseManagerReportGenerator
-> DeleteLicenseManagerReportGenerator -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLicenseManagerReportGenerator
-> DeleteLicenseManagerReportGenerator -> Bool
$c/= :: DeleteLicenseManagerReportGenerator
-> DeleteLicenseManagerReportGenerator -> Bool
== :: DeleteLicenseManagerReportGenerator
-> DeleteLicenseManagerReportGenerator -> Bool
$c== :: DeleteLicenseManagerReportGenerator
-> DeleteLicenseManagerReportGenerator -> Bool
Prelude.Eq, ReadPrec [DeleteLicenseManagerReportGenerator]
ReadPrec DeleteLicenseManagerReportGenerator
Int -> ReadS DeleteLicenseManagerReportGenerator
ReadS [DeleteLicenseManagerReportGenerator]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLicenseManagerReportGenerator]
$creadListPrec :: ReadPrec [DeleteLicenseManagerReportGenerator]
readPrec :: ReadPrec DeleteLicenseManagerReportGenerator
$creadPrec :: ReadPrec DeleteLicenseManagerReportGenerator
readList :: ReadS [DeleteLicenseManagerReportGenerator]
$creadList :: ReadS [DeleteLicenseManagerReportGenerator]
readsPrec :: Int -> ReadS DeleteLicenseManagerReportGenerator
$creadsPrec :: Int -> ReadS DeleteLicenseManagerReportGenerator
Prelude.Read, Int -> DeleteLicenseManagerReportGenerator -> ShowS
[DeleteLicenseManagerReportGenerator] -> ShowS
DeleteLicenseManagerReportGenerator -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLicenseManagerReportGenerator] -> ShowS
$cshowList :: [DeleteLicenseManagerReportGenerator] -> ShowS
show :: DeleteLicenseManagerReportGenerator -> String
$cshow :: DeleteLicenseManagerReportGenerator -> String
showsPrec :: Int -> DeleteLicenseManagerReportGenerator -> ShowS
$cshowsPrec :: Int -> DeleteLicenseManagerReportGenerator -> ShowS
Prelude.Show, forall x.
Rep DeleteLicenseManagerReportGenerator x
-> DeleteLicenseManagerReportGenerator
forall x.
DeleteLicenseManagerReportGenerator
-> Rep DeleteLicenseManagerReportGenerator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteLicenseManagerReportGenerator x
-> DeleteLicenseManagerReportGenerator
$cfrom :: forall x.
DeleteLicenseManagerReportGenerator
-> Rep DeleteLicenseManagerReportGenerator x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLicenseManagerReportGenerator' 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:
--
-- 'licenseManagerReportGeneratorArn', 'deleteLicenseManagerReportGenerator_licenseManagerReportGeneratorArn' - Amazon Resource Name (ARN) of the report generator to be deleted.
newDeleteLicenseManagerReportGenerator ::
  -- | 'licenseManagerReportGeneratorArn'
  Prelude.Text ->
  DeleteLicenseManagerReportGenerator
newDeleteLicenseManagerReportGenerator :: Text -> DeleteLicenseManagerReportGenerator
newDeleteLicenseManagerReportGenerator
  Text
pLicenseManagerReportGeneratorArn_ =
    DeleteLicenseManagerReportGenerator'
      { $sel:licenseManagerReportGeneratorArn:DeleteLicenseManagerReportGenerator' :: Text
licenseManagerReportGeneratorArn =
          Text
pLicenseManagerReportGeneratorArn_
      }

-- | Amazon Resource Name (ARN) of the report generator to be deleted.
deleteLicenseManagerReportGenerator_licenseManagerReportGeneratorArn :: Lens.Lens' DeleteLicenseManagerReportGenerator Prelude.Text
deleteLicenseManagerReportGenerator_licenseManagerReportGeneratorArn :: Lens' DeleteLicenseManagerReportGenerator Text
deleteLicenseManagerReportGenerator_licenseManagerReportGeneratorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLicenseManagerReportGenerator' {Text
licenseManagerReportGeneratorArn :: Text
$sel:licenseManagerReportGeneratorArn:DeleteLicenseManagerReportGenerator' :: DeleteLicenseManagerReportGenerator -> Text
licenseManagerReportGeneratorArn} -> Text
licenseManagerReportGeneratorArn) (\s :: DeleteLicenseManagerReportGenerator
s@DeleteLicenseManagerReportGenerator' {} Text
a -> DeleteLicenseManagerReportGenerator
s {$sel:licenseManagerReportGeneratorArn:DeleteLicenseManagerReportGenerator' :: Text
licenseManagerReportGeneratorArn = Text
a} :: DeleteLicenseManagerReportGenerator)

instance
  Core.AWSRequest
    DeleteLicenseManagerReportGenerator
  where
  type
    AWSResponse DeleteLicenseManagerReportGenerator =
      DeleteLicenseManagerReportGeneratorResponse
  request :: (Service -> Service)
-> DeleteLicenseManagerReportGenerator
-> Request DeleteLicenseManagerReportGenerator
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 DeleteLicenseManagerReportGenerator
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteLicenseManagerReportGenerator)))
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 -> DeleteLicenseManagerReportGeneratorResponse
DeleteLicenseManagerReportGeneratorResponse'
            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
    DeleteLicenseManagerReportGenerator
  where
  hashWithSalt :: Int -> DeleteLicenseManagerReportGenerator -> Int
hashWithSalt
    Int
_salt
    DeleteLicenseManagerReportGenerator' {Text
licenseManagerReportGeneratorArn :: Text
$sel:licenseManagerReportGeneratorArn:DeleteLicenseManagerReportGenerator' :: DeleteLicenseManagerReportGenerator -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
licenseManagerReportGeneratorArn

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

instance
  Data.ToHeaders
    DeleteLicenseManagerReportGenerator
  where
  toHeaders :: DeleteLicenseManagerReportGenerator -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"AWSLicenseManager.DeleteLicenseManagerReportGenerator" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

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

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

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

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

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