{-# 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.DescribeSolution
(
DescribeSolution (..),
newDescribeSolution,
describeSolution_solutionArn,
DescribeSolutionResponse (..),
newDescribeSolutionResponse,
describeSolutionResponse_solution,
describeSolutionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Personalize.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeSolution = DescribeSolution'
{
DescribeSolution -> Text
solutionArn :: Prelude.Text
}
deriving (DescribeSolution -> DescribeSolution -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSolution -> DescribeSolution -> Bool
$c/= :: DescribeSolution -> DescribeSolution -> Bool
== :: DescribeSolution -> DescribeSolution -> Bool
$c== :: DescribeSolution -> DescribeSolution -> Bool
Prelude.Eq, ReadPrec [DescribeSolution]
ReadPrec DescribeSolution
Int -> ReadS DescribeSolution
ReadS [DescribeSolution]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSolution]
$creadListPrec :: ReadPrec [DescribeSolution]
readPrec :: ReadPrec DescribeSolution
$creadPrec :: ReadPrec DescribeSolution
readList :: ReadS [DescribeSolution]
$creadList :: ReadS [DescribeSolution]
readsPrec :: Int -> ReadS DescribeSolution
$creadsPrec :: Int -> ReadS DescribeSolution
Prelude.Read, Int -> DescribeSolution -> ShowS
[DescribeSolution] -> ShowS
DescribeSolution -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSolution] -> ShowS
$cshowList :: [DescribeSolution] -> ShowS
show :: DescribeSolution -> String
$cshow :: DescribeSolution -> String
showsPrec :: Int -> DescribeSolution -> ShowS
$cshowsPrec :: Int -> DescribeSolution -> ShowS
Prelude.Show, forall x. Rep DescribeSolution x -> DescribeSolution
forall x. DescribeSolution -> Rep DescribeSolution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeSolution x -> DescribeSolution
$cfrom :: forall x. DescribeSolution -> Rep DescribeSolution x
Prelude.Generic)
newDescribeSolution ::
Prelude.Text ->
DescribeSolution
newDescribeSolution :: Text -> DescribeSolution
newDescribeSolution Text
pSolutionArn_ =
DescribeSolution' {$sel:solutionArn:DescribeSolution' :: Text
solutionArn = Text
pSolutionArn_}
describeSolution_solutionArn :: Lens.Lens' DescribeSolution Prelude.Text
describeSolution_solutionArn :: Lens' DescribeSolution Text
describeSolution_solutionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSolution' {Text
solutionArn :: Text
$sel:solutionArn:DescribeSolution' :: DescribeSolution -> Text
solutionArn} -> Text
solutionArn) (\s :: DescribeSolution
s@DescribeSolution' {} Text
a -> DescribeSolution
s {$sel:solutionArn:DescribeSolution' :: Text
solutionArn = Text
a} :: DescribeSolution)
instance Core.AWSRequest DescribeSolution where
type
AWSResponse DescribeSolution =
DescribeSolutionResponse
request :: (Service -> Service)
-> DescribeSolution -> Request DescribeSolution
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeSolution
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeSolution)))
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 ->
Maybe Solution -> Int -> DescribeSolutionResponse
DescribeSolutionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"solution")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DescribeSolution where
hashWithSalt :: Int -> DescribeSolution -> Int
hashWithSalt Int
_salt DescribeSolution' {Text
solutionArn :: Text
$sel:solutionArn:DescribeSolution' :: DescribeSolution -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
solutionArn
instance Prelude.NFData DescribeSolution where
rnf :: DescribeSolution -> ()
rnf DescribeSolution' {Text
solutionArn :: Text
$sel:solutionArn:DescribeSolution' :: DescribeSolution -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
solutionArn
instance Data.ToHeaders DescribeSolution where
toHeaders :: DescribeSolution -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonPersonalize.DescribeSolution" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DescribeSolution where
toJSON :: DescribeSolution -> Value
toJSON DescribeSolution' {Text
solutionArn :: Text
$sel:solutionArn:DescribeSolution' :: DescribeSolution -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"solutionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
solutionArn)]
)
instance Data.ToPath DescribeSolution where
toPath :: DescribeSolution -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeSolution where
toQuery :: DescribeSolution -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeSolutionResponse = DescribeSolutionResponse'
{
DescribeSolutionResponse -> Maybe Solution
solution :: Prelude.Maybe Solution,
DescribeSolutionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeSolutionResponse -> DescribeSolutionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSolutionResponse -> DescribeSolutionResponse -> Bool
$c/= :: DescribeSolutionResponse -> DescribeSolutionResponse -> Bool
== :: DescribeSolutionResponse -> DescribeSolutionResponse -> Bool
$c== :: DescribeSolutionResponse -> DescribeSolutionResponse -> Bool
Prelude.Eq, ReadPrec [DescribeSolutionResponse]
ReadPrec DescribeSolutionResponse
Int -> ReadS DescribeSolutionResponse
ReadS [DescribeSolutionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSolutionResponse]
$creadListPrec :: ReadPrec [DescribeSolutionResponse]
readPrec :: ReadPrec DescribeSolutionResponse
$creadPrec :: ReadPrec DescribeSolutionResponse
readList :: ReadS [DescribeSolutionResponse]
$creadList :: ReadS [DescribeSolutionResponse]
readsPrec :: Int -> ReadS DescribeSolutionResponse
$creadsPrec :: Int -> ReadS DescribeSolutionResponse
Prelude.Read, Int -> DescribeSolutionResponse -> ShowS
[DescribeSolutionResponse] -> ShowS
DescribeSolutionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSolutionResponse] -> ShowS
$cshowList :: [DescribeSolutionResponse] -> ShowS
show :: DescribeSolutionResponse -> String
$cshow :: DescribeSolutionResponse -> String
showsPrec :: Int -> DescribeSolutionResponse -> ShowS
$cshowsPrec :: Int -> DescribeSolutionResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeSolutionResponse x -> DescribeSolutionResponse
forall x.
DescribeSolutionResponse -> Rep DescribeSolutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSolutionResponse x -> DescribeSolutionResponse
$cfrom :: forall x.
DescribeSolutionResponse -> Rep DescribeSolutionResponse x
Prelude.Generic)
newDescribeSolutionResponse ::
Prelude.Int ->
DescribeSolutionResponse
newDescribeSolutionResponse :: Int -> DescribeSolutionResponse
newDescribeSolutionResponse Int
pHttpStatus_ =
DescribeSolutionResponse'
{ $sel:solution:DescribeSolutionResponse' :: Maybe Solution
solution =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeSolutionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeSolutionResponse_solution :: Lens.Lens' DescribeSolutionResponse (Prelude.Maybe Solution)
describeSolutionResponse_solution :: Lens' DescribeSolutionResponse (Maybe Solution)
describeSolutionResponse_solution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSolutionResponse' {Maybe Solution
solution :: Maybe Solution
$sel:solution:DescribeSolutionResponse' :: DescribeSolutionResponse -> Maybe Solution
solution} -> Maybe Solution
solution) (\s :: DescribeSolutionResponse
s@DescribeSolutionResponse' {} Maybe Solution
a -> DescribeSolutionResponse
s {$sel:solution:DescribeSolutionResponse' :: Maybe Solution
solution = Maybe Solution
a} :: DescribeSolutionResponse)
describeSolutionResponse_httpStatus :: Lens.Lens' DescribeSolutionResponse Prelude.Int
describeSolutionResponse_httpStatus :: Lens' DescribeSolutionResponse Int
describeSolutionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSolutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeSolutionResponse' :: DescribeSolutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeSolutionResponse
s@DescribeSolutionResponse' {} Int
a -> DescribeSolutionResponse
s {$sel:httpStatus:DescribeSolutionResponse' :: Int
httpStatus = Int
a} :: DescribeSolutionResponse)
instance Prelude.NFData DescribeSolutionResponse where
rnf :: DescribeSolutionResponse -> ()
rnf DescribeSolutionResponse' {Int
Maybe Solution
httpStatus :: Int
solution :: Maybe Solution
$sel:httpStatus:DescribeSolutionResponse' :: DescribeSolutionResponse -> Int
$sel:solution:DescribeSolutionResponse' :: DescribeSolutionResponse -> Maybe Solution
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Solution
solution
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus