{-# 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 #-}
module Amazonka.Personalize.DeleteSolution
(
DeleteSolution (..),
newDeleteSolution,
deleteSolution_solutionArn,
DeleteSolutionResponse (..),
newDeleteSolutionResponse,
)
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
data DeleteSolution = DeleteSolution'
{
DeleteSolution -> Text
solutionArn :: Prelude.Text
}
deriving (DeleteSolution -> DeleteSolution -> Bool
(DeleteSolution -> DeleteSolution -> Bool)
-> (DeleteSolution -> DeleteSolution -> Bool) -> Eq DeleteSolution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSolution -> DeleteSolution -> Bool
$c/= :: DeleteSolution -> DeleteSolution -> Bool
== :: DeleteSolution -> DeleteSolution -> Bool
$c== :: DeleteSolution -> DeleteSolution -> Bool
Prelude.Eq, ReadPrec [DeleteSolution]
ReadPrec DeleteSolution
Int -> ReadS DeleteSolution
ReadS [DeleteSolution]
(Int -> ReadS DeleteSolution)
-> ReadS [DeleteSolution]
-> ReadPrec DeleteSolution
-> ReadPrec [DeleteSolution]
-> Read DeleteSolution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSolution]
$creadListPrec :: ReadPrec [DeleteSolution]
readPrec :: ReadPrec DeleteSolution
$creadPrec :: ReadPrec DeleteSolution
readList :: ReadS [DeleteSolution]
$creadList :: ReadS [DeleteSolution]
readsPrec :: Int -> ReadS DeleteSolution
$creadsPrec :: Int -> ReadS DeleteSolution
Prelude.Read, Int -> DeleteSolution -> ShowS
[DeleteSolution] -> ShowS
DeleteSolution -> String
(Int -> DeleteSolution -> ShowS)
-> (DeleteSolution -> String)
-> ([DeleteSolution] -> ShowS)
-> Show DeleteSolution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSolution] -> ShowS
$cshowList :: [DeleteSolution] -> ShowS
show :: DeleteSolution -> String
$cshow :: DeleteSolution -> String
showsPrec :: Int -> DeleteSolution -> ShowS
$cshowsPrec :: Int -> DeleteSolution -> ShowS
Prelude.Show, (forall x. DeleteSolution -> Rep DeleteSolution x)
-> (forall x. Rep DeleteSolution x -> DeleteSolution)
-> Generic DeleteSolution
forall x. Rep DeleteSolution x -> DeleteSolution
forall x. DeleteSolution -> Rep DeleteSolution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSolution x -> DeleteSolution
$cfrom :: forall x. DeleteSolution -> Rep DeleteSolution x
Prelude.Generic)
newDeleteSolution ::
Prelude.Text ->
DeleteSolution
newDeleteSolution :: Text -> DeleteSolution
newDeleteSolution Text
pSolutionArn_ =
DeleteSolution' :: Text -> DeleteSolution
DeleteSolution' {$sel:solutionArn:DeleteSolution' :: Text
solutionArn = Text
pSolutionArn_}
deleteSolution_solutionArn :: Lens.Lens' DeleteSolution Prelude.Text
deleteSolution_solutionArn :: (Text -> f Text) -> DeleteSolution -> f DeleteSolution
deleteSolution_solutionArn = (DeleteSolution -> Text)
-> (DeleteSolution -> Text -> DeleteSolution)
-> Lens DeleteSolution DeleteSolution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSolution' {Text
solutionArn :: Text
$sel:solutionArn:DeleteSolution' :: DeleteSolution -> Text
solutionArn} -> Text
solutionArn) (\s :: DeleteSolution
s@DeleteSolution' {} Text
a -> DeleteSolution
s {$sel:solutionArn:DeleteSolution' :: Text
solutionArn = Text
a} :: DeleteSolution)
instance Core.AWSRequest DeleteSolution where
type
AWSResponse DeleteSolution =
DeleteSolutionResponse
request :: DeleteSolution -> Request DeleteSolution
request = Service -> DeleteSolution -> Request DeleteSolution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSolution
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSolution)))
response =
AWSResponse DeleteSolution
-> Logger
-> Service
-> Proxy DeleteSolution
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSolution)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteSolution
DeleteSolutionResponse
DeleteSolutionResponse'
instance Prelude.Hashable DeleteSolution
instance Prelude.NFData DeleteSolution
instance Core.ToHeaders DeleteSolution where
toHeaders :: DeleteSolution -> [Header]
toHeaders =
[Header] -> DeleteSolution -> [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.DeleteSolution" ::
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 DeleteSolution where
toJSON :: DeleteSolution -> Value
toJSON DeleteSolution' {Text
solutionArn :: Text
$sel:solutionArn:DeleteSolution' :: DeleteSolution -> 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
"solutionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
solutionArn)]
)
instance Core.ToPath DeleteSolution where
toPath :: DeleteSolution -> ByteString
toPath = ByteString -> DeleteSolution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteSolution where
toQuery :: DeleteSolution -> QueryString
toQuery = QueryString -> DeleteSolution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSolutionResponse = DeleteSolutionResponse'
{
}
deriving (DeleteSolutionResponse -> DeleteSolutionResponse -> Bool
(DeleteSolutionResponse -> DeleteSolutionResponse -> Bool)
-> (DeleteSolutionResponse -> DeleteSolutionResponse -> Bool)
-> Eq DeleteSolutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSolutionResponse -> DeleteSolutionResponse -> Bool
$c/= :: DeleteSolutionResponse -> DeleteSolutionResponse -> Bool
== :: DeleteSolutionResponse -> DeleteSolutionResponse -> Bool
$c== :: DeleteSolutionResponse -> DeleteSolutionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSolutionResponse]
ReadPrec DeleteSolutionResponse
Int -> ReadS DeleteSolutionResponse
ReadS [DeleteSolutionResponse]
(Int -> ReadS DeleteSolutionResponse)
-> ReadS [DeleteSolutionResponse]
-> ReadPrec DeleteSolutionResponse
-> ReadPrec [DeleteSolutionResponse]
-> Read DeleteSolutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSolutionResponse]
$creadListPrec :: ReadPrec [DeleteSolutionResponse]
readPrec :: ReadPrec DeleteSolutionResponse
$creadPrec :: ReadPrec DeleteSolutionResponse
readList :: ReadS [DeleteSolutionResponse]
$creadList :: ReadS [DeleteSolutionResponse]
readsPrec :: Int -> ReadS DeleteSolutionResponse
$creadsPrec :: Int -> ReadS DeleteSolutionResponse
Prelude.Read, Int -> DeleteSolutionResponse -> ShowS
[DeleteSolutionResponse] -> ShowS
DeleteSolutionResponse -> String
(Int -> DeleteSolutionResponse -> ShowS)
-> (DeleteSolutionResponse -> String)
-> ([DeleteSolutionResponse] -> ShowS)
-> Show DeleteSolutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSolutionResponse] -> ShowS
$cshowList :: [DeleteSolutionResponse] -> ShowS
show :: DeleteSolutionResponse -> String
$cshow :: DeleteSolutionResponse -> String
showsPrec :: Int -> DeleteSolutionResponse -> ShowS
$cshowsPrec :: Int -> DeleteSolutionResponse -> ShowS
Prelude.Show, (forall x. DeleteSolutionResponse -> Rep DeleteSolutionResponse x)
-> (forall x.
Rep DeleteSolutionResponse x -> DeleteSolutionResponse)
-> Generic DeleteSolutionResponse
forall x. Rep DeleteSolutionResponse x -> DeleteSolutionResponse
forall x. DeleteSolutionResponse -> Rep DeleteSolutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSolutionResponse x -> DeleteSolutionResponse
$cfrom :: forall x. DeleteSolutionResponse -> Rep DeleteSolutionResponse x
Prelude.Generic)
newDeleteSolutionResponse ::
DeleteSolutionResponse
newDeleteSolutionResponse :: DeleteSolutionResponse
newDeleteSolutionResponse = DeleteSolutionResponse
DeleteSolutionResponse'
instance Prelude.NFData DeleteSolutionResponse