{-# 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.DescribeFeatureTransformation
(
DescribeFeatureTransformation (..),
newDescribeFeatureTransformation,
describeFeatureTransformation_featureTransformationArn,
DescribeFeatureTransformationResponse (..),
newDescribeFeatureTransformationResponse,
describeFeatureTransformationResponse_featureTransformation,
describeFeatureTransformationResponse_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 DescribeFeatureTransformation = DescribeFeatureTransformation'
{
DescribeFeatureTransformation -> Text
featureTransformationArn :: Prelude.Text
}
deriving (DescribeFeatureTransformation
-> DescribeFeatureTransformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFeatureTransformation
-> DescribeFeatureTransformation -> Bool
$c/= :: DescribeFeatureTransformation
-> DescribeFeatureTransformation -> Bool
== :: DescribeFeatureTransformation
-> DescribeFeatureTransformation -> Bool
$c== :: DescribeFeatureTransformation
-> DescribeFeatureTransformation -> Bool
Prelude.Eq, ReadPrec [DescribeFeatureTransformation]
ReadPrec DescribeFeatureTransformation
Int -> ReadS DescribeFeatureTransformation
ReadS [DescribeFeatureTransformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFeatureTransformation]
$creadListPrec :: ReadPrec [DescribeFeatureTransformation]
readPrec :: ReadPrec DescribeFeatureTransformation
$creadPrec :: ReadPrec DescribeFeatureTransformation
readList :: ReadS [DescribeFeatureTransformation]
$creadList :: ReadS [DescribeFeatureTransformation]
readsPrec :: Int -> ReadS DescribeFeatureTransformation
$creadsPrec :: Int -> ReadS DescribeFeatureTransformation
Prelude.Read, Int -> DescribeFeatureTransformation -> ShowS
[DescribeFeatureTransformation] -> ShowS
DescribeFeatureTransformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFeatureTransformation] -> ShowS
$cshowList :: [DescribeFeatureTransformation] -> ShowS
show :: DescribeFeatureTransformation -> String
$cshow :: DescribeFeatureTransformation -> String
showsPrec :: Int -> DescribeFeatureTransformation -> ShowS
$cshowsPrec :: Int -> DescribeFeatureTransformation -> ShowS
Prelude.Show, forall x.
Rep DescribeFeatureTransformation x
-> DescribeFeatureTransformation
forall x.
DescribeFeatureTransformation
-> Rep DescribeFeatureTransformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFeatureTransformation x
-> DescribeFeatureTransformation
$cfrom :: forall x.
DescribeFeatureTransformation
-> Rep DescribeFeatureTransformation x
Prelude.Generic)
newDescribeFeatureTransformation ::
Prelude.Text ->
DescribeFeatureTransformation
newDescribeFeatureTransformation :: Text -> DescribeFeatureTransformation
newDescribeFeatureTransformation
Text
pFeatureTransformationArn_ =
DescribeFeatureTransformation'
{ $sel:featureTransformationArn:DescribeFeatureTransformation' :: Text
featureTransformationArn =
Text
pFeatureTransformationArn_
}
describeFeatureTransformation_featureTransformationArn :: Lens.Lens' DescribeFeatureTransformation Prelude.Text
describeFeatureTransformation_featureTransformationArn :: Lens' DescribeFeatureTransformation Text
describeFeatureTransformation_featureTransformationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFeatureTransformation' {Text
featureTransformationArn :: Text
$sel:featureTransformationArn:DescribeFeatureTransformation' :: DescribeFeatureTransformation -> Text
featureTransformationArn} -> Text
featureTransformationArn) (\s :: DescribeFeatureTransformation
s@DescribeFeatureTransformation' {} Text
a -> DescribeFeatureTransformation
s {$sel:featureTransformationArn:DescribeFeatureTransformation' :: Text
featureTransformationArn = Text
a} :: DescribeFeatureTransformation)
instance
Core.AWSRequest
DescribeFeatureTransformation
where
type
AWSResponse DescribeFeatureTransformation =
DescribeFeatureTransformationResponse
request :: (Service -> Service)
-> DescribeFeatureTransformation
-> Request DescribeFeatureTransformation
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 DescribeFeatureTransformation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFeatureTransformation)))
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 FeatureTransformation
-> Int -> DescribeFeatureTransformationResponse
DescribeFeatureTransformationResponse'
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
"featureTransformation")
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
DescribeFeatureTransformation
where
hashWithSalt :: Int -> DescribeFeatureTransformation -> Int
hashWithSalt Int
_salt DescribeFeatureTransformation' {Text
featureTransformationArn :: Text
$sel:featureTransformationArn:DescribeFeatureTransformation' :: DescribeFeatureTransformation -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
featureTransformationArn
instance Prelude.NFData DescribeFeatureTransformation where
rnf :: DescribeFeatureTransformation -> ()
rnf DescribeFeatureTransformation' {Text
featureTransformationArn :: Text
$sel:featureTransformationArn:DescribeFeatureTransformation' :: DescribeFeatureTransformation -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
featureTransformationArn
instance Data.ToHeaders DescribeFeatureTransformation where
toHeaders :: DescribeFeatureTransformation -> 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.DescribeFeatureTransformation" ::
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 DescribeFeatureTransformation where
toJSON :: DescribeFeatureTransformation -> Value
toJSON DescribeFeatureTransformation' {Text
featureTransformationArn :: Text
$sel:featureTransformationArn:DescribeFeatureTransformation' :: DescribeFeatureTransformation -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"featureTransformationArn"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
featureTransformationArn
)
]
)
instance Data.ToPath DescribeFeatureTransformation where
toPath :: DescribeFeatureTransformation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeFeatureTransformation where
toQuery :: DescribeFeatureTransformation -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeFeatureTransformationResponse = DescribeFeatureTransformationResponse'
{
DescribeFeatureTransformationResponse
-> Maybe FeatureTransformation
featureTransformation :: Prelude.Maybe FeatureTransformation,
DescribeFeatureTransformationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeFeatureTransformationResponse
-> DescribeFeatureTransformationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFeatureTransformationResponse
-> DescribeFeatureTransformationResponse -> Bool
$c/= :: DescribeFeatureTransformationResponse
-> DescribeFeatureTransformationResponse -> Bool
== :: DescribeFeatureTransformationResponse
-> DescribeFeatureTransformationResponse -> Bool
$c== :: DescribeFeatureTransformationResponse
-> DescribeFeatureTransformationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFeatureTransformationResponse]
ReadPrec DescribeFeatureTransformationResponse
Int -> ReadS DescribeFeatureTransformationResponse
ReadS [DescribeFeatureTransformationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFeatureTransformationResponse]
$creadListPrec :: ReadPrec [DescribeFeatureTransformationResponse]
readPrec :: ReadPrec DescribeFeatureTransformationResponse
$creadPrec :: ReadPrec DescribeFeatureTransformationResponse
readList :: ReadS [DescribeFeatureTransformationResponse]
$creadList :: ReadS [DescribeFeatureTransformationResponse]
readsPrec :: Int -> ReadS DescribeFeatureTransformationResponse
$creadsPrec :: Int -> ReadS DescribeFeatureTransformationResponse
Prelude.Read, Int -> DescribeFeatureTransformationResponse -> ShowS
[DescribeFeatureTransformationResponse] -> ShowS
DescribeFeatureTransformationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFeatureTransformationResponse] -> ShowS
$cshowList :: [DescribeFeatureTransformationResponse] -> ShowS
show :: DescribeFeatureTransformationResponse -> String
$cshow :: DescribeFeatureTransformationResponse -> String
showsPrec :: Int -> DescribeFeatureTransformationResponse -> ShowS
$cshowsPrec :: Int -> DescribeFeatureTransformationResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeFeatureTransformationResponse x
-> DescribeFeatureTransformationResponse
forall x.
DescribeFeatureTransformationResponse
-> Rep DescribeFeatureTransformationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFeatureTransformationResponse x
-> DescribeFeatureTransformationResponse
$cfrom :: forall x.
DescribeFeatureTransformationResponse
-> Rep DescribeFeatureTransformationResponse x
Prelude.Generic)
newDescribeFeatureTransformationResponse ::
Prelude.Int ->
DescribeFeatureTransformationResponse
newDescribeFeatureTransformationResponse :: Int -> DescribeFeatureTransformationResponse
newDescribeFeatureTransformationResponse Int
pHttpStatus_ =
DescribeFeatureTransformationResponse'
{ $sel:featureTransformation:DescribeFeatureTransformationResponse' :: Maybe FeatureTransformation
featureTransformation =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeFeatureTransformationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeFeatureTransformationResponse_featureTransformation :: Lens.Lens' DescribeFeatureTransformationResponse (Prelude.Maybe FeatureTransformation)
describeFeatureTransformationResponse_featureTransformation :: Lens'
DescribeFeatureTransformationResponse (Maybe FeatureTransformation)
describeFeatureTransformationResponse_featureTransformation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFeatureTransformationResponse' {Maybe FeatureTransformation
featureTransformation :: Maybe FeatureTransformation
$sel:featureTransformation:DescribeFeatureTransformationResponse' :: DescribeFeatureTransformationResponse
-> Maybe FeatureTransformation
featureTransformation} -> Maybe FeatureTransformation
featureTransformation) (\s :: DescribeFeatureTransformationResponse
s@DescribeFeatureTransformationResponse' {} Maybe FeatureTransformation
a -> DescribeFeatureTransformationResponse
s {$sel:featureTransformation:DescribeFeatureTransformationResponse' :: Maybe FeatureTransformation
featureTransformation = Maybe FeatureTransformation
a} :: DescribeFeatureTransformationResponse)
describeFeatureTransformationResponse_httpStatus :: Lens.Lens' DescribeFeatureTransformationResponse Prelude.Int
describeFeatureTransformationResponse_httpStatus :: Lens' DescribeFeatureTransformationResponse Int
describeFeatureTransformationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFeatureTransformationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFeatureTransformationResponse' :: DescribeFeatureTransformationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFeatureTransformationResponse
s@DescribeFeatureTransformationResponse' {} Int
a -> DescribeFeatureTransformationResponse
s {$sel:httpStatus:DescribeFeatureTransformationResponse' :: Int
httpStatus = Int
a} :: DescribeFeatureTransformationResponse)
instance
Prelude.NFData
DescribeFeatureTransformationResponse
where
rnf :: DescribeFeatureTransformationResponse -> ()
rnf DescribeFeatureTransformationResponse' {Int
Maybe FeatureTransformation
httpStatus :: Int
featureTransformation :: Maybe FeatureTransformation
$sel:httpStatus:DescribeFeatureTransformationResponse' :: DescribeFeatureTransformationResponse -> Int
$sel:featureTransformation:DescribeFeatureTransformationResponse' :: DescribeFeatureTransformationResponse
-> Maybe FeatureTransformation
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FeatureTransformation
featureTransformation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus