{-# 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.LookoutVision.DescribeProject
(
DescribeProject (..),
newDescribeProject,
describeProject_projectName,
DescribeProjectResponse (..),
newDescribeProjectResponse,
describeProjectResponse_projectDescription,
describeProjectResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutVision.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeProject = DescribeProject'
{
DescribeProject -> Text
projectName :: Prelude.Text
}
deriving (DescribeProject -> DescribeProject -> Bool
(DescribeProject -> DescribeProject -> Bool)
-> (DescribeProject -> DescribeProject -> Bool)
-> Eq DescribeProject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProject -> DescribeProject -> Bool
$c/= :: DescribeProject -> DescribeProject -> Bool
== :: DescribeProject -> DescribeProject -> Bool
$c== :: DescribeProject -> DescribeProject -> Bool
Prelude.Eq, ReadPrec [DescribeProject]
ReadPrec DescribeProject
Int -> ReadS DescribeProject
ReadS [DescribeProject]
(Int -> ReadS DescribeProject)
-> ReadS [DescribeProject]
-> ReadPrec DescribeProject
-> ReadPrec [DescribeProject]
-> Read DescribeProject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProject]
$creadListPrec :: ReadPrec [DescribeProject]
readPrec :: ReadPrec DescribeProject
$creadPrec :: ReadPrec DescribeProject
readList :: ReadS [DescribeProject]
$creadList :: ReadS [DescribeProject]
readsPrec :: Int -> ReadS DescribeProject
$creadsPrec :: Int -> ReadS DescribeProject
Prelude.Read, Int -> DescribeProject -> ShowS
[DescribeProject] -> ShowS
DescribeProject -> String
(Int -> DescribeProject -> ShowS)
-> (DescribeProject -> String)
-> ([DescribeProject] -> ShowS)
-> Show DescribeProject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProject] -> ShowS
$cshowList :: [DescribeProject] -> ShowS
show :: DescribeProject -> String
$cshow :: DescribeProject -> String
showsPrec :: Int -> DescribeProject -> ShowS
$cshowsPrec :: Int -> DescribeProject -> ShowS
Prelude.Show, (forall x. DescribeProject -> Rep DescribeProject x)
-> (forall x. Rep DescribeProject x -> DescribeProject)
-> Generic DescribeProject
forall x. Rep DescribeProject x -> DescribeProject
forall x. DescribeProject -> Rep DescribeProject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeProject x -> DescribeProject
$cfrom :: forall x. DescribeProject -> Rep DescribeProject x
Prelude.Generic)
newDescribeProject ::
Prelude.Text ->
DescribeProject
newDescribeProject :: Text -> DescribeProject
newDescribeProject Text
pProjectName_ =
DescribeProject' :: Text -> DescribeProject
DescribeProject' {$sel:projectName:DescribeProject' :: Text
projectName = Text
pProjectName_}
describeProject_projectName :: Lens.Lens' DescribeProject Prelude.Text
describeProject_projectName :: (Text -> f Text) -> DescribeProject -> f DescribeProject
describeProject_projectName = (DescribeProject -> Text)
-> (DescribeProject -> Text -> DescribeProject)
-> Lens DescribeProject DescribeProject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProject' {Text
projectName :: Text
$sel:projectName:DescribeProject' :: DescribeProject -> Text
projectName} -> Text
projectName) (\s :: DescribeProject
s@DescribeProject' {} Text
a -> DescribeProject
s {$sel:projectName:DescribeProject' :: Text
projectName = Text
a} :: DescribeProject)
instance Core.AWSRequest DescribeProject where
type
AWSResponse DescribeProject =
DescribeProjectResponse
request :: DescribeProject -> Request DescribeProject
request = Service -> DescribeProject -> Request DescribeProject
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeProject)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeProject))
-> Logger
-> Service
-> Proxy DescribeProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeProject)))
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 ->
Maybe ProjectDescription -> Int -> DescribeProjectResponse
DescribeProjectResponse'
(Maybe ProjectDescription -> Int -> DescribeProjectResponse)
-> Either String (Maybe ProjectDescription)
-> Either String (Int -> DescribeProjectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProjectDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProjectDescription")
Either String (Int -> DescribeProjectResponse)
-> Either String Int -> Either String DescribeProjectResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DescribeProject
instance Prelude.NFData DescribeProject
instance Core.ToHeaders DescribeProject where
toHeaders :: DescribeProject -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeProject -> 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 DescribeProject where
toPath :: DescribeProject -> ByteString
toPath DescribeProject' {Text
projectName :: Text
$sel:projectName:DescribeProject' :: DescribeProject -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2020-11-20/projects/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
projectName]
instance Core.ToQuery DescribeProject where
toQuery :: DescribeProject -> QueryString
toQuery = QueryString -> DescribeProject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeProjectResponse = DescribeProjectResponse'
{
DescribeProjectResponse -> Maybe ProjectDescription
projectDescription :: Prelude.Maybe ProjectDescription,
DescribeProjectResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeProjectResponse -> DescribeProjectResponse -> Bool
(DescribeProjectResponse -> DescribeProjectResponse -> Bool)
-> (DescribeProjectResponse -> DescribeProjectResponse -> Bool)
-> Eq DescribeProjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProjectResponse -> DescribeProjectResponse -> Bool
$c/= :: DescribeProjectResponse -> DescribeProjectResponse -> Bool
== :: DescribeProjectResponse -> DescribeProjectResponse -> Bool
$c== :: DescribeProjectResponse -> DescribeProjectResponse -> Bool
Prelude.Eq, ReadPrec [DescribeProjectResponse]
ReadPrec DescribeProjectResponse
Int -> ReadS DescribeProjectResponse
ReadS [DescribeProjectResponse]
(Int -> ReadS DescribeProjectResponse)
-> ReadS [DescribeProjectResponse]
-> ReadPrec DescribeProjectResponse
-> ReadPrec [DescribeProjectResponse]
-> Read DescribeProjectResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProjectResponse]
$creadListPrec :: ReadPrec [DescribeProjectResponse]
readPrec :: ReadPrec DescribeProjectResponse
$creadPrec :: ReadPrec DescribeProjectResponse
readList :: ReadS [DescribeProjectResponse]
$creadList :: ReadS [DescribeProjectResponse]
readsPrec :: Int -> ReadS DescribeProjectResponse
$creadsPrec :: Int -> ReadS DescribeProjectResponse
Prelude.Read, Int -> DescribeProjectResponse -> ShowS
[DescribeProjectResponse] -> ShowS
DescribeProjectResponse -> String
(Int -> DescribeProjectResponse -> ShowS)
-> (DescribeProjectResponse -> String)
-> ([DescribeProjectResponse] -> ShowS)
-> Show DescribeProjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProjectResponse] -> ShowS
$cshowList :: [DescribeProjectResponse] -> ShowS
show :: DescribeProjectResponse -> String
$cshow :: DescribeProjectResponse -> String
showsPrec :: Int -> DescribeProjectResponse -> ShowS
$cshowsPrec :: Int -> DescribeProjectResponse -> ShowS
Prelude.Show, (forall x.
DescribeProjectResponse -> Rep DescribeProjectResponse x)
-> (forall x.
Rep DescribeProjectResponse x -> DescribeProjectResponse)
-> Generic DescribeProjectResponse
forall x. Rep DescribeProjectResponse x -> DescribeProjectResponse
forall x. DescribeProjectResponse -> Rep DescribeProjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeProjectResponse x -> DescribeProjectResponse
$cfrom :: forall x. DescribeProjectResponse -> Rep DescribeProjectResponse x
Prelude.Generic)
newDescribeProjectResponse ::
Prelude.Int ->
DescribeProjectResponse
newDescribeProjectResponse :: Int -> DescribeProjectResponse
newDescribeProjectResponse Int
pHttpStatus_ =
DescribeProjectResponse' :: Maybe ProjectDescription -> Int -> DescribeProjectResponse
DescribeProjectResponse'
{ $sel:projectDescription:DescribeProjectResponse' :: Maybe ProjectDescription
projectDescription =
Maybe ProjectDescription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeProjectResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeProjectResponse_projectDescription :: Lens.Lens' DescribeProjectResponse (Prelude.Maybe ProjectDescription)
describeProjectResponse_projectDescription :: (Maybe ProjectDescription -> f (Maybe ProjectDescription))
-> DescribeProjectResponse -> f DescribeProjectResponse
describeProjectResponse_projectDescription = (DescribeProjectResponse -> Maybe ProjectDescription)
-> (DescribeProjectResponse
-> Maybe ProjectDescription -> DescribeProjectResponse)
-> Lens
DescribeProjectResponse
DescribeProjectResponse
(Maybe ProjectDescription)
(Maybe ProjectDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {Maybe ProjectDescription
projectDescription :: Maybe ProjectDescription
$sel:projectDescription:DescribeProjectResponse' :: DescribeProjectResponse -> Maybe ProjectDescription
projectDescription} -> Maybe ProjectDescription
projectDescription) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} Maybe ProjectDescription
a -> DescribeProjectResponse
s {$sel:projectDescription:DescribeProjectResponse' :: Maybe ProjectDescription
projectDescription = Maybe ProjectDescription
a} :: DescribeProjectResponse)
describeProjectResponse_httpStatus :: Lens.Lens' DescribeProjectResponse Prelude.Int
describeProjectResponse_httpStatus :: (Int -> f Int)
-> DescribeProjectResponse -> f DescribeProjectResponse
describeProjectResponse_httpStatus = (DescribeProjectResponse -> Int)
-> (DescribeProjectResponse -> Int -> DescribeProjectResponse)
-> Lens DescribeProjectResponse DescribeProjectResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeProjectResponse' :: DescribeProjectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} Int
a -> DescribeProjectResponse
s {$sel:httpStatus:DescribeProjectResponse' :: Int
httpStatus = Int
a} :: DescribeProjectResponse)
instance Prelude.NFData DescribeProjectResponse