{-# 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.Pinpoint.DeleteRecommenderConfiguration
-- 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 an Amazon Pinpoint configuration for a recommender model.
module Amazonka.Pinpoint.DeleteRecommenderConfiguration
  ( -- * Creating a Request
    DeleteRecommenderConfiguration (..),
    newDeleteRecommenderConfiguration,

    -- * Request Lenses
    deleteRecommenderConfiguration_recommenderId,

    -- * Destructuring the Response
    DeleteRecommenderConfigurationResponse (..),
    newDeleteRecommenderConfigurationResponse,

    -- * Response Lenses
    deleteRecommenderConfigurationResponse_httpStatus,
    deleteRecommenderConfigurationResponse_recommenderConfigurationResponse,
  )
where

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

-- | /See:/ 'newDeleteRecommenderConfiguration' smart constructor.
data DeleteRecommenderConfiguration = DeleteRecommenderConfiguration'
  { -- | The unique identifier for the recommender model configuration. This
    -- identifier is displayed as the __Recommender ID__ on the Amazon Pinpoint
    -- console.
    DeleteRecommenderConfiguration -> Text
recommenderId :: Prelude.Text
  }
  deriving (DeleteRecommenderConfiguration
-> DeleteRecommenderConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRecommenderConfiguration
-> DeleteRecommenderConfiguration -> Bool
$c/= :: DeleteRecommenderConfiguration
-> DeleteRecommenderConfiguration -> Bool
== :: DeleteRecommenderConfiguration
-> DeleteRecommenderConfiguration -> Bool
$c== :: DeleteRecommenderConfiguration
-> DeleteRecommenderConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteRecommenderConfiguration]
ReadPrec DeleteRecommenderConfiguration
Int -> ReadS DeleteRecommenderConfiguration
ReadS [DeleteRecommenderConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRecommenderConfiguration]
$creadListPrec :: ReadPrec [DeleteRecommenderConfiguration]
readPrec :: ReadPrec DeleteRecommenderConfiguration
$creadPrec :: ReadPrec DeleteRecommenderConfiguration
readList :: ReadS [DeleteRecommenderConfiguration]
$creadList :: ReadS [DeleteRecommenderConfiguration]
readsPrec :: Int -> ReadS DeleteRecommenderConfiguration
$creadsPrec :: Int -> ReadS DeleteRecommenderConfiguration
Prelude.Read, Int -> DeleteRecommenderConfiguration -> ShowS
[DeleteRecommenderConfiguration] -> ShowS
DeleteRecommenderConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRecommenderConfiguration] -> ShowS
$cshowList :: [DeleteRecommenderConfiguration] -> ShowS
show :: DeleteRecommenderConfiguration -> String
$cshow :: DeleteRecommenderConfiguration -> String
showsPrec :: Int -> DeleteRecommenderConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteRecommenderConfiguration -> ShowS
Prelude.Show, forall x.
Rep DeleteRecommenderConfiguration x
-> DeleteRecommenderConfiguration
forall x.
DeleteRecommenderConfiguration
-> Rep DeleteRecommenderConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRecommenderConfiguration x
-> DeleteRecommenderConfiguration
$cfrom :: forall x.
DeleteRecommenderConfiguration
-> Rep DeleteRecommenderConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRecommenderConfiguration' 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:
--
-- 'recommenderId', 'deleteRecommenderConfiguration_recommenderId' - The unique identifier for the recommender model configuration. This
-- identifier is displayed as the __Recommender ID__ on the Amazon Pinpoint
-- console.
newDeleteRecommenderConfiguration ::
  -- | 'recommenderId'
  Prelude.Text ->
  DeleteRecommenderConfiguration
newDeleteRecommenderConfiguration :: Text -> DeleteRecommenderConfiguration
newDeleteRecommenderConfiguration Text
pRecommenderId_ =
  DeleteRecommenderConfiguration'
    { $sel:recommenderId:DeleteRecommenderConfiguration' :: Text
recommenderId =
        Text
pRecommenderId_
    }

-- | The unique identifier for the recommender model configuration. This
-- identifier is displayed as the __Recommender ID__ on the Amazon Pinpoint
-- console.
deleteRecommenderConfiguration_recommenderId :: Lens.Lens' DeleteRecommenderConfiguration Prelude.Text
deleteRecommenderConfiguration_recommenderId :: Lens' DeleteRecommenderConfiguration Text
deleteRecommenderConfiguration_recommenderId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRecommenderConfiguration' {Text
recommenderId :: Text
$sel:recommenderId:DeleteRecommenderConfiguration' :: DeleteRecommenderConfiguration -> Text
recommenderId} -> Text
recommenderId) (\s :: DeleteRecommenderConfiguration
s@DeleteRecommenderConfiguration' {} Text
a -> DeleteRecommenderConfiguration
s {$sel:recommenderId:DeleteRecommenderConfiguration' :: Text
recommenderId = Text
a} :: DeleteRecommenderConfiguration)

instance
  Core.AWSRequest
    DeleteRecommenderConfiguration
  where
  type
    AWSResponse DeleteRecommenderConfiguration =
      DeleteRecommenderConfigurationResponse
  request :: (Service -> Service)
-> DeleteRecommenderConfiguration
-> Request DeleteRecommenderConfiguration
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteRecommenderConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteRecommenderConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> RecommenderConfigurationResponse
-> DeleteRecommenderConfigurationResponse
DeleteRecommenderConfigurationResponse'
            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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
      )

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

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

instance
  Data.ToHeaders
    DeleteRecommenderConfiguration
  where
  toHeaders :: DeleteRecommenderConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeleteRecommenderConfiguration where
  toPath :: DeleteRecommenderConfiguration -> ByteString
toPath DeleteRecommenderConfiguration' {Text
recommenderId :: Text
$sel:recommenderId:DeleteRecommenderConfiguration' :: DeleteRecommenderConfiguration -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/recommenders/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
recommenderId]

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

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

-- |
-- Create a value of 'DeleteRecommenderConfigurationResponse' 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', 'deleteRecommenderConfigurationResponse_httpStatus' - The response's http status code.
--
-- 'recommenderConfigurationResponse', 'deleteRecommenderConfigurationResponse_recommenderConfigurationResponse' - Undocumented member.
newDeleteRecommenderConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'recommenderConfigurationResponse'
  RecommenderConfigurationResponse ->
  DeleteRecommenderConfigurationResponse
newDeleteRecommenderConfigurationResponse :: Int
-> RecommenderConfigurationResponse
-> DeleteRecommenderConfigurationResponse
newDeleteRecommenderConfigurationResponse
  Int
pHttpStatus_
  RecommenderConfigurationResponse
pRecommenderConfigurationResponse_ =
    DeleteRecommenderConfigurationResponse'
      { $sel:httpStatus:DeleteRecommenderConfigurationResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:recommenderConfigurationResponse:DeleteRecommenderConfigurationResponse' :: RecommenderConfigurationResponse
recommenderConfigurationResponse =
          RecommenderConfigurationResponse
pRecommenderConfigurationResponse_
      }

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

-- | Undocumented member.
deleteRecommenderConfigurationResponse_recommenderConfigurationResponse :: Lens.Lens' DeleteRecommenderConfigurationResponse RecommenderConfigurationResponse
deleteRecommenderConfigurationResponse_recommenderConfigurationResponse :: Lens'
  DeleteRecommenderConfigurationResponse
  RecommenderConfigurationResponse
deleteRecommenderConfigurationResponse_recommenderConfigurationResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRecommenderConfigurationResponse' {RecommenderConfigurationResponse
recommenderConfigurationResponse :: RecommenderConfigurationResponse
$sel:recommenderConfigurationResponse:DeleteRecommenderConfigurationResponse' :: DeleteRecommenderConfigurationResponse
-> RecommenderConfigurationResponse
recommenderConfigurationResponse} -> RecommenderConfigurationResponse
recommenderConfigurationResponse) (\s :: DeleteRecommenderConfigurationResponse
s@DeleteRecommenderConfigurationResponse' {} RecommenderConfigurationResponse
a -> DeleteRecommenderConfigurationResponse
s {$sel:recommenderConfigurationResponse:DeleteRecommenderConfigurationResponse' :: RecommenderConfigurationResponse
recommenderConfigurationResponse = RecommenderConfigurationResponse
a} :: DeleteRecommenderConfigurationResponse)

instance
  Prelude.NFData
    DeleteRecommenderConfigurationResponse
  where
  rnf :: DeleteRecommenderConfigurationResponse -> ()
rnf DeleteRecommenderConfigurationResponse' {Int
RecommenderConfigurationResponse
recommenderConfigurationResponse :: RecommenderConfigurationResponse
httpStatus :: Int
$sel:recommenderConfigurationResponse:DeleteRecommenderConfigurationResponse' :: DeleteRecommenderConfigurationResponse
-> RecommenderConfigurationResponse
$sel:httpStatus:DeleteRecommenderConfigurationResponse' :: DeleteRecommenderConfigurationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RecommenderConfigurationResponse
recommenderConfigurationResponse