{-# 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.DeleteBusinessReportSchedule
-- 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 recurring report delivery schedule with the specified
-- schedule ARN.
module Amazonka.AlexaBusiness.DeleteBusinessReportSchedule
  ( -- * Creating a Request
    DeleteBusinessReportSchedule (..),
    newDeleteBusinessReportSchedule,

    -- * Request Lenses
    deleteBusinessReportSchedule_scheduleArn,

    -- * Destructuring the Response
    DeleteBusinessReportScheduleResponse (..),
    newDeleteBusinessReportScheduleResponse,

    -- * Response Lenses
    deleteBusinessReportScheduleResponse_httpStatus,
  )
where

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

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

-- |
-- Create a value of 'DeleteBusinessReportSchedule' 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:
--
-- 'scheduleArn', 'deleteBusinessReportSchedule_scheduleArn' - The ARN of the business report schedule.
newDeleteBusinessReportSchedule ::
  -- | 'scheduleArn'
  Prelude.Text ->
  DeleteBusinessReportSchedule
newDeleteBusinessReportSchedule :: Text -> DeleteBusinessReportSchedule
newDeleteBusinessReportSchedule Text
pScheduleArn_ =
  DeleteBusinessReportSchedule'
    { $sel:scheduleArn:DeleteBusinessReportSchedule' :: Text
scheduleArn =
        Text
pScheduleArn_
    }

-- | The ARN of the business report schedule.
deleteBusinessReportSchedule_scheduleArn :: Lens.Lens' DeleteBusinessReportSchedule Prelude.Text
deleteBusinessReportSchedule_scheduleArn :: Lens' DeleteBusinessReportSchedule Text
deleteBusinessReportSchedule_scheduleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBusinessReportSchedule' {Text
scheduleArn :: Text
$sel:scheduleArn:DeleteBusinessReportSchedule' :: DeleteBusinessReportSchedule -> Text
scheduleArn} -> Text
scheduleArn) (\s :: DeleteBusinessReportSchedule
s@DeleteBusinessReportSchedule' {} Text
a -> DeleteBusinessReportSchedule
s {$sel:scheduleArn:DeleteBusinessReportSchedule' :: Text
scheduleArn = Text
a} :: DeleteBusinessReportSchedule)

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

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

instance Data.ToHeaders DeleteBusinessReportSchedule where
  toHeaders :: DeleteBusinessReportSchedule -> 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
"AlexaForBusiness.DeleteBusinessReportSchedule" ::
                          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 DeleteBusinessReportSchedule where
  toJSON :: DeleteBusinessReportSchedule -> Value
toJSON DeleteBusinessReportSchedule' {Text
scheduleArn :: Text
$sel:scheduleArn:DeleteBusinessReportSchedule' :: DeleteBusinessReportSchedule -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"ScheduleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
scheduleArn)]
      )

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

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

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

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

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

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