{-# 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.Transcribe.DeleteCallAnalyticsJob
-- 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 call analytics job using its name.
module Amazonka.Transcribe.DeleteCallAnalyticsJob
  ( -- * Creating a Request
    DeleteCallAnalyticsJob (..),
    newDeleteCallAnalyticsJob,

    -- * Request Lenses
    deleteCallAnalyticsJob_callAnalyticsJobName,

    -- * Destructuring the Response
    DeleteCallAnalyticsJobResponse (..),
    newDeleteCallAnalyticsJobResponse,

    -- * Response Lenses
    deleteCallAnalyticsJobResponse_httpStatus,
  )
where

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
import Amazonka.Transcribe.Types

-- | /See:/ 'newDeleteCallAnalyticsJob' smart constructor.
data DeleteCallAnalyticsJob = DeleteCallAnalyticsJob'
  { -- | The name of the call analytics job you want to delete.
    DeleteCallAnalyticsJob -> Text
callAnalyticsJobName :: Prelude.Text
  }
  deriving (DeleteCallAnalyticsJob -> DeleteCallAnalyticsJob -> Bool
(DeleteCallAnalyticsJob -> DeleteCallAnalyticsJob -> Bool)
-> (DeleteCallAnalyticsJob -> DeleteCallAnalyticsJob -> Bool)
-> Eq DeleteCallAnalyticsJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCallAnalyticsJob -> DeleteCallAnalyticsJob -> Bool
$c/= :: DeleteCallAnalyticsJob -> DeleteCallAnalyticsJob -> Bool
== :: DeleteCallAnalyticsJob -> DeleteCallAnalyticsJob -> Bool
$c== :: DeleteCallAnalyticsJob -> DeleteCallAnalyticsJob -> Bool
Prelude.Eq, ReadPrec [DeleteCallAnalyticsJob]
ReadPrec DeleteCallAnalyticsJob
Int -> ReadS DeleteCallAnalyticsJob
ReadS [DeleteCallAnalyticsJob]
(Int -> ReadS DeleteCallAnalyticsJob)
-> ReadS [DeleteCallAnalyticsJob]
-> ReadPrec DeleteCallAnalyticsJob
-> ReadPrec [DeleteCallAnalyticsJob]
-> Read DeleteCallAnalyticsJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCallAnalyticsJob]
$creadListPrec :: ReadPrec [DeleteCallAnalyticsJob]
readPrec :: ReadPrec DeleteCallAnalyticsJob
$creadPrec :: ReadPrec DeleteCallAnalyticsJob
readList :: ReadS [DeleteCallAnalyticsJob]
$creadList :: ReadS [DeleteCallAnalyticsJob]
readsPrec :: Int -> ReadS DeleteCallAnalyticsJob
$creadsPrec :: Int -> ReadS DeleteCallAnalyticsJob
Prelude.Read, Int -> DeleteCallAnalyticsJob -> ShowS
[DeleteCallAnalyticsJob] -> ShowS
DeleteCallAnalyticsJob -> String
(Int -> DeleteCallAnalyticsJob -> ShowS)
-> (DeleteCallAnalyticsJob -> String)
-> ([DeleteCallAnalyticsJob] -> ShowS)
-> Show DeleteCallAnalyticsJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCallAnalyticsJob] -> ShowS
$cshowList :: [DeleteCallAnalyticsJob] -> ShowS
show :: DeleteCallAnalyticsJob -> String
$cshow :: DeleteCallAnalyticsJob -> String
showsPrec :: Int -> DeleteCallAnalyticsJob -> ShowS
$cshowsPrec :: Int -> DeleteCallAnalyticsJob -> ShowS
Prelude.Show, (forall x. DeleteCallAnalyticsJob -> Rep DeleteCallAnalyticsJob x)
-> (forall x.
    Rep DeleteCallAnalyticsJob x -> DeleteCallAnalyticsJob)
-> Generic DeleteCallAnalyticsJob
forall x. Rep DeleteCallAnalyticsJob x -> DeleteCallAnalyticsJob
forall x. DeleteCallAnalyticsJob -> Rep DeleteCallAnalyticsJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCallAnalyticsJob x -> DeleteCallAnalyticsJob
$cfrom :: forall x. DeleteCallAnalyticsJob -> Rep DeleteCallAnalyticsJob x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCallAnalyticsJob' 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:
--
-- 'callAnalyticsJobName', 'deleteCallAnalyticsJob_callAnalyticsJobName' - The name of the call analytics job you want to delete.
newDeleteCallAnalyticsJob ::
  -- | 'callAnalyticsJobName'
  Prelude.Text ->
  DeleteCallAnalyticsJob
newDeleteCallAnalyticsJob :: Text -> DeleteCallAnalyticsJob
newDeleteCallAnalyticsJob Text
pCallAnalyticsJobName_ =
  DeleteCallAnalyticsJob' :: Text -> DeleteCallAnalyticsJob
DeleteCallAnalyticsJob'
    { $sel:callAnalyticsJobName:DeleteCallAnalyticsJob' :: Text
callAnalyticsJobName =
        Text
pCallAnalyticsJobName_
    }

-- | The name of the call analytics job you want to delete.
deleteCallAnalyticsJob_callAnalyticsJobName :: Lens.Lens' DeleteCallAnalyticsJob Prelude.Text
deleteCallAnalyticsJob_callAnalyticsJobName :: (Text -> f Text)
-> DeleteCallAnalyticsJob -> f DeleteCallAnalyticsJob
deleteCallAnalyticsJob_callAnalyticsJobName = (DeleteCallAnalyticsJob -> Text)
-> (DeleteCallAnalyticsJob -> Text -> DeleteCallAnalyticsJob)
-> Lens DeleteCallAnalyticsJob DeleteCallAnalyticsJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCallAnalyticsJob' {Text
callAnalyticsJobName :: Text
$sel:callAnalyticsJobName:DeleteCallAnalyticsJob' :: DeleteCallAnalyticsJob -> Text
callAnalyticsJobName} -> Text
callAnalyticsJobName) (\s :: DeleteCallAnalyticsJob
s@DeleteCallAnalyticsJob' {} Text
a -> DeleteCallAnalyticsJob
s {$sel:callAnalyticsJobName:DeleteCallAnalyticsJob' :: Text
callAnalyticsJobName = Text
a} :: DeleteCallAnalyticsJob)

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

instance Prelude.NFData DeleteCallAnalyticsJob

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

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

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

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

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

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

instance
  Prelude.NFData
    DeleteCallAnalyticsJobResponse