{-# 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.IoTSiteWise.DescribeProject
(
DescribeProject (..),
newDescribeProject,
describeProject_projectId,
DescribeProjectResponse (..),
newDescribeProjectResponse,
describeProjectResponse_projectDescription,
describeProjectResponse_httpStatus,
describeProjectResponse_projectId,
describeProjectResponse_projectArn,
describeProjectResponse_projectName,
describeProjectResponse_portalId,
describeProjectResponse_projectCreationDate,
describeProjectResponse_projectLastUpdateDate,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeProject = DescribeProject'
{
DescribeProject -> Text
projectId :: Prelude.Text
}
deriving (DescribeProject -> DescribeProject -> Bool
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]
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
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. 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
pProjectId_ =
DescribeProject' {$sel:projectId:DescribeProject' :: Text
projectId = Text
pProjectId_}
describeProject_projectId :: Lens.Lens' DescribeProject Prelude.Text
describeProject_projectId :: Lens' DescribeProject Text
describeProject_projectId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProject' {Text
projectId :: Text
$sel:projectId:DescribeProject' :: DescribeProject -> Text
projectId} -> Text
projectId) (\s :: DescribeProject
s@DescribeProject' {} Text
a -> DescribeProject
s {$sel:projectId:DescribeProject' :: Text
projectId = Text
a} :: DescribeProject)
instance Core.AWSRequest DescribeProject where
type
AWSResponse DescribeProject =
DescribeProjectResponse
request :: (Service -> Service) -> DescribeProject -> Request DescribeProject
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeProject)))
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 Text
-> Int
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> DescribeProjectResponse
DescribeProjectResponse'
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
"projectDescription")
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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"projectId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"projectArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"projectName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"portalId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"projectCreationDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"projectLastUpdateDate")
)
instance Prelude.Hashable DescribeProject where
hashWithSalt :: Int -> DescribeProject -> Int
hashWithSalt Int
_salt DescribeProject' {Text
projectId :: Text
$sel:projectId:DescribeProject' :: DescribeProject -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectId
instance Prelude.NFData DescribeProject where
rnf :: DescribeProject -> ()
rnf DescribeProject' {Text
projectId :: Text
$sel:projectId:DescribeProject' :: DescribeProject -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
projectId
instance Data.ToHeaders DescribeProject where
toHeaders :: DescribeProject -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DescribeProject where
toPath :: DescribeProject -> ByteString
toPath DescribeProject' {Text
projectId :: Text
$sel:projectId:DescribeProject' :: DescribeProject -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/projects/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
projectId]
instance Data.ToQuery DescribeProject where
toQuery :: DescribeProject -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeProjectResponse = DescribeProjectResponse'
{
DescribeProjectResponse -> Maybe Text
projectDescription :: Prelude.Maybe Prelude.Text,
DescribeProjectResponse -> Int
httpStatus :: Prelude.Int,
DescribeProjectResponse -> Text
projectId :: Prelude.Text,
DescribeProjectResponse -> Text
projectArn :: Prelude.Text,
DescribeProjectResponse -> Text
projectName :: Prelude.Text,
DescribeProjectResponse -> Text
portalId :: Prelude.Text,
DescribeProjectResponse -> POSIX
projectCreationDate :: Data.POSIX,
DescribeProjectResponse -> POSIX
projectLastUpdateDate :: Data.POSIX
}
deriving (DescribeProjectResponse -> DescribeProjectResponse -> Bool
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]
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
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. 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 ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
DescribeProjectResponse
newDescribeProjectResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> DescribeProjectResponse
newDescribeProjectResponse
Int
pHttpStatus_
Text
pProjectId_
Text
pProjectArn_
Text
pProjectName_
Text
pPortalId_
UTCTime
pProjectCreationDate_
UTCTime
pProjectLastUpdateDate_ =
DescribeProjectResponse'
{ $sel:projectDescription:DescribeProjectResponse' :: Maybe Text
projectDescription =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeProjectResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:projectId:DescribeProjectResponse' :: Text
projectId = Text
pProjectId_,
$sel:projectArn:DescribeProjectResponse' :: Text
projectArn = Text
pProjectArn_,
$sel:projectName:DescribeProjectResponse' :: Text
projectName = Text
pProjectName_,
$sel:portalId:DescribeProjectResponse' :: Text
portalId = Text
pPortalId_,
$sel:projectCreationDate:DescribeProjectResponse' :: POSIX
projectCreationDate =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pProjectCreationDate_,
$sel:projectLastUpdateDate:DescribeProjectResponse' :: POSIX
projectLastUpdateDate =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pProjectLastUpdateDate_
}
describeProjectResponse_projectDescription :: Lens.Lens' DescribeProjectResponse (Prelude.Maybe Prelude.Text)
describeProjectResponse_projectDescription :: Lens' DescribeProjectResponse (Maybe Text)
describeProjectResponse_projectDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {Maybe Text
projectDescription :: Maybe Text
$sel:projectDescription:DescribeProjectResponse' :: DescribeProjectResponse -> Maybe Text
projectDescription} -> Maybe Text
projectDescription) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} Maybe Text
a -> DescribeProjectResponse
s {$sel:projectDescription:DescribeProjectResponse' :: Maybe Text
projectDescription = Maybe Text
a} :: DescribeProjectResponse)
describeProjectResponse_httpStatus :: Lens.Lens' DescribeProjectResponse Prelude.Int
describeProjectResponse_httpStatus :: Lens' DescribeProjectResponse Int
describeProjectResponse_httpStatus = 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)
describeProjectResponse_projectId :: Lens.Lens' DescribeProjectResponse Prelude.Text
describeProjectResponse_projectId :: Lens' DescribeProjectResponse Text
describeProjectResponse_projectId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {Text
projectId :: Text
$sel:projectId:DescribeProjectResponse' :: DescribeProjectResponse -> Text
projectId} -> Text
projectId) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} Text
a -> DescribeProjectResponse
s {$sel:projectId:DescribeProjectResponse' :: Text
projectId = Text
a} :: DescribeProjectResponse)
describeProjectResponse_projectArn :: Lens.Lens' DescribeProjectResponse Prelude.Text
describeProjectResponse_projectArn :: Lens' DescribeProjectResponse Text
describeProjectResponse_projectArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {Text
projectArn :: Text
$sel:projectArn:DescribeProjectResponse' :: DescribeProjectResponse -> Text
projectArn} -> Text
projectArn) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} Text
a -> DescribeProjectResponse
s {$sel:projectArn:DescribeProjectResponse' :: Text
projectArn = Text
a} :: DescribeProjectResponse)
describeProjectResponse_projectName :: Lens.Lens' DescribeProjectResponse Prelude.Text
describeProjectResponse_projectName :: Lens' DescribeProjectResponse Text
describeProjectResponse_projectName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {Text
projectName :: Text
$sel:projectName:DescribeProjectResponse' :: DescribeProjectResponse -> Text
projectName} -> Text
projectName) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} Text
a -> DescribeProjectResponse
s {$sel:projectName:DescribeProjectResponse' :: Text
projectName = Text
a} :: DescribeProjectResponse)
describeProjectResponse_portalId :: Lens.Lens' DescribeProjectResponse Prelude.Text
describeProjectResponse_portalId :: Lens' DescribeProjectResponse Text
describeProjectResponse_portalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {Text
portalId :: Text
$sel:portalId:DescribeProjectResponse' :: DescribeProjectResponse -> Text
portalId} -> Text
portalId) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} Text
a -> DescribeProjectResponse
s {$sel:portalId:DescribeProjectResponse' :: Text
portalId = Text
a} :: DescribeProjectResponse)
describeProjectResponse_projectCreationDate :: Lens.Lens' DescribeProjectResponse Prelude.UTCTime
describeProjectResponse_projectCreationDate :: Lens' DescribeProjectResponse UTCTime
describeProjectResponse_projectCreationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {POSIX
projectCreationDate :: POSIX
$sel:projectCreationDate:DescribeProjectResponse' :: DescribeProjectResponse -> POSIX
projectCreationDate} -> POSIX
projectCreationDate) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} POSIX
a -> DescribeProjectResponse
s {$sel:projectCreationDate:DescribeProjectResponse' :: POSIX
projectCreationDate = POSIX
a} :: DescribeProjectResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
describeProjectResponse_projectLastUpdateDate :: Lens.Lens' DescribeProjectResponse Prelude.UTCTime
describeProjectResponse_projectLastUpdateDate :: Lens' DescribeProjectResponse UTCTime
describeProjectResponse_projectLastUpdateDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectResponse' {POSIX
projectLastUpdateDate :: POSIX
$sel:projectLastUpdateDate:DescribeProjectResponse' :: DescribeProjectResponse -> POSIX
projectLastUpdateDate} -> POSIX
projectLastUpdateDate) (\s :: DescribeProjectResponse
s@DescribeProjectResponse' {} POSIX
a -> DescribeProjectResponse
s {$sel:projectLastUpdateDate:DescribeProjectResponse' :: POSIX
projectLastUpdateDate = POSIX
a} :: DescribeProjectResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Prelude.NFData DescribeProjectResponse where
rnf :: DescribeProjectResponse -> ()
rnf DescribeProjectResponse' {Int
Maybe Text
Text
POSIX
projectLastUpdateDate :: POSIX
projectCreationDate :: POSIX
portalId :: Text
projectName :: Text
projectArn :: Text
projectId :: Text
httpStatus :: Int
projectDescription :: Maybe Text
$sel:projectLastUpdateDate:DescribeProjectResponse' :: DescribeProjectResponse -> POSIX
$sel:projectCreationDate:DescribeProjectResponse' :: DescribeProjectResponse -> POSIX
$sel:portalId:DescribeProjectResponse' :: DescribeProjectResponse -> Text
$sel:projectName:DescribeProjectResponse' :: DescribeProjectResponse -> Text
$sel:projectArn:DescribeProjectResponse' :: DescribeProjectResponse -> Text
$sel:projectId:DescribeProjectResponse' :: DescribeProjectResponse -> Text
$sel:httpStatus:DescribeProjectResponse' :: DescribeProjectResponse -> Int
$sel:projectDescription:DescribeProjectResponse' :: DescribeProjectResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
projectDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
projectId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
projectArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
projectName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
portalId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
projectCreationDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
projectLastUpdateDate