{-# 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-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 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.Lens as Lens
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
(DeleteRecommenderConfiguration
 -> DeleteRecommenderConfiguration -> Bool)
-> (DeleteRecommenderConfiguration
    -> DeleteRecommenderConfiguration -> Bool)
-> Eq DeleteRecommenderConfiguration
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]
(Int -> ReadS DeleteRecommenderConfiguration)
-> ReadS [DeleteRecommenderConfiguration]
-> ReadPrec DeleteRecommenderConfiguration
-> ReadPrec [DeleteRecommenderConfiguration]
-> Read 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
(Int -> DeleteRecommenderConfiguration -> ShowS)
-> (DeleteRecommenderConfiguration -> String)
-> ([DeleteRecommenderConfiguration] -> ShowS)
-> Show DeleteRecommenderConfiguration
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.
 DeleteRecommenderConfiguration
 -> Rep DeleteRecommenderConfiguration x)
-> (forall x.
    Rep DeleteRecommenderConfiguration x
    -> DeleteRecommenderConfiguration)
-> Generic DeleteRecommenderConfiguration
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' :: Text -> DeleteRecommenderConfiguration
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 :: (Text -> f Text)
-> DeleteRecommenderConfiguration
-> f DeleteRecommenderConfiguration
deleteRecommenderConfiguration_recommenderId = (DeleteRecommenderConfiguration -> Text)
-> (DeleteRecommenderConfiguration
    -> Text -> DeleteRecommenderConfiguration)
-> Lens
     DeleteRecommenderConfiguration
     DeleteRecommenderConfiguration
     Text
     Text
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 :: DeleteRecommenderConfiguration
-> Request DeleteRecommenderConfiguration
request = Service
-> DeleteRecommenderConfiguration
-> Request DeleteRecommenderConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteRecommenderConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteRecommenderConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DeleteRecommenderConfiguration))
-> Logger
-> Service
-> Proxy DeleteRecommenderConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteRecommenderConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> RecommenderConfigurationResponse
-> DeleteRecommenderConfigurationResponse
DeleteRecommenderConfigurationResponse'
            (Int
 -> RecommenderConfigurationResponse
 -> DeleteRecommenderConfigurationResponse)
-> Either String Int
-> Either
     String
     (RecommenderConfigurationResponse
      -> DeleteRecommenderConfigurationResponse)
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))
            Either
  String
  (RecommenderConfigurationResponse
   -> DeleteRecommenderConfigurationResponse)
-> Either String RecommenderConfigurationResponse
-> Either String DeleteRecommenderConfigurationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String RecommenderConfigurationResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
      )

instance
  Prelude.Hashable
    DeleteRecommenderConfiguration

instance
  Prelude.NFData
    DeleteRecommenderConfiguration

instance
  Core.ToHeaders
    DeleteRecommenderConfiguration
  where
  toHeaders :: DeleteRecommenderConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DeleteRecommenderConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeleteRecommenderConfiguration where
  toPath :: DeleteRecommenderConfiguration -> ByteString
toPath DeleteRecommenderConfiguration' {Text
recommenderId :: Text
$sel:recommenderId:DeleteRecommenderConfiguration' :: DeleteRecommenderConfiguration -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/recommenders/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
recommenderId]

instance Core.ToQuery DeleteRecommenderConfiguration where
  toQuery :: DeleteRecommenderConfiguration -> QueryString
toQuery = QueryString -> DeleteRecommenderConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteRecommenderConfigurationResponse
 -> DeleteRecommenderConfigurationResponse -> Bool)
-> (DeleteRecommenderConfigurationResponse
    -> DeleteRecommenderConfigurationResponse -> Bool)
-> Eq DeleteRecommenderConfigurationResponse
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]
(Int -> ReadS DeleteRecommenderConfigurationResponse)
-> ReadS [DeleteRecommenderConfigurationResponse]
-> ReadPrec DeleteRecommenderConfigurationResponse
-> ReadPrec [DeleteRecommenderConfigurationResponse]
-> Read 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
(Int -> DeleteRecommenderConfigurationResponse -> ShowS)
-> (DeleteRecommenderConfigurationResponse -> String)
-> ([DeleteRecommenderConfigurationResponse] -> ShowS)
-> Show DeleteRecommenderConfigurationResponse
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.
 DeleteRecommenderConfigurationResponse
 -> Rep DeleteRecommenderConfigurationResponse x)
-> (forall x.
    Rep DeleteRecommenderConfigurationResponse x
    -> DeleteRecommenderConfigurationResponse)
-> Generic DeleteRecommenderConfigurationResponse
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' :: Int
-> RecommenderConfigurationResponse
-> DeleteRecommenderConfigurationResponse
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 :: (Int -> f Int)
-> DeleteRecommenderConfigurationResponse
-> f DeleteRecommenderConfigurationResponse
deleteRecommenderConfigurationResponse_httpStatus = (DeleteRecommenderConfigurationResponse -> Int)
-> (DeleteRecommenderConfigurationResponse
    -> Int -> DeleteRecommenderConfigurationResponse)
-> Lens
     DeleteRecommenderConfigurationResponse
     DeleteRecommenderConfigurationResponse
     Int
     Int
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 :: (RecommenderConfigurationResponse
 -> f RecommenderConfigurationResponse)
-> DeleteRecommenderConfigurationResponse
-> f DeleteRecommenderConfigurationResponse
deleteRecommenderConfigurationResponse_recommenderConfigurationResponse = (DeleteRecommenderConfigurationResponse
 -> RecommenderConfigurationResponse)
-> (DeleteRecommenderConfigurationResponse
    -> RecommenderConfigurationResponse
    -> DeleteRecommenderConfigurationResponse)
-> Lens
     DeleteRecommenderConfigurationResponse
     DeleteRecommenderConfigurationResponse
     RecommenderConfigurationResponse
     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