{-# 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.Personalize.DeleteEventTracker
-- 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 the event tracker. Does not delete the event-interactions
-- dataset from the associated dataset group. For more information on event
-- trackers, see CreateEventTracker.
module Amazonka.Personalize.DeleteEventTracker
  ( -- * Creating a Request
    DeleteEventTracker (..),
    newDeleteEventTracker,

    -- * Request Lenses
    deleteEventTracker_eventTrackerArn,

    -- * Destructuring the Response
    DeleteEventTrackerResponse (..),
    newDeleteEventTrackerResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

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

-- |
-- Create a value of 'DeleteEventTracker' 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:
--
-- 'eventTrackerArn', 'deleteEventTracker_eventTrackerArn' - The Amazon Resource Name (ARN) of the event tracker to delete.
newDeleteEventTracker ::
  -- | 'eventTrackerArn'
  Prelude.Text ->
  DeleteEventTracker
newDeleteEventTracker :: Text -> DeleteEventTracker
newDeleteEventTracker Text
pEventTrackerArn_ =
  DeleteEventTracker' :: Text -> DeleteEventTracker
DeleteEventTracker'
    { $sel:eventTrackerArn:DeleteEventTracker' :: Text
eventTrackerArn =
        Text
pEventTrackerArn_
    }

-- | The Amazon Resource Name (ARN) of the event tracker to delete.
deleteEventTracker_eventTrackerArn :: Lens.Lens' DeleteEventTracker Prelude.Text
deleteEventTracker_eventTrackerArn :: (Text -> f Text) -> DeleteEventTracker -> f DeleteEventTracker
deleteEventTracker_eventTrackerArn = (DeleteEventTracker -> Text)
-> (DeleteEventTracker -> Text -> DeleteEventTracker)
-> Lens DeleteEventTracker DeleteEventTracker Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEventTracker' {Text
eventTrackerArn :: Text
$sel:eventTrackerArn:DeleteEventTracker' :: DeleteEventTracker -> Text
eventTrackerArn} -> Text
eventTrackerArn) (\s :: DeleteEventTracker
s@DeleteEventTracker' {} Text
a -> DeleteEventTracker
s {$sel:eventTrackerArn:DeleteEventTracker' :: Text
eventTrackerArn = Text
a} :: DeleteEventTracker)

instance Core.AWSRequest DeleteEventTracker where
  type
    AWSResponse DeleteEventTracker =
      DeleteEventTrackerResponse
  request :: DeleteEventTracker -> Request DeleteEventTracker
request = Service -> DeleteEventTracker -> Request DeleteEventTracker
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteEventTracker
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteEventTracker)))
response =
    AWSResponse DeleteEventTracker
-> Logger
-> Service
-> Proxy DeleteEventTracker
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteEventTracker)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteEventTracker
DeleteEventTrackerResponse
DeleteEventTrackerResponse'

instance Prelude.Hashable DeleteEventTracker

instance Prelude.NFData DeleteEventTracker

instance Core.ToHeaders DeleteEventTracker where
  toHeaders :: DeleteEventTracker -> [Header]
toHeaders =
    [Header] -> DeleteEventTracker -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"AmazonPersonalize.DeleteEventTracker" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteEventTracker where
  toJSON :: DeleteEventTracker -> Value
toJSON DeleteEventTracker' {Text
eventTrackerArn :: Text
$sel:eventTrackerArn:DeleteEventTracker' :: DeleteEventTracker -> 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
"eventTrackerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventTrackerArn)
          ]
      )

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

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

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

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

instance Prelude.NFData DeleteEventTrackerResponse