{-# 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.IotTwinMaker.GetWorkspace
(
GetWorkspace (..),
newGetWorkspace,
getWorkspace_workspaceId,
GetWorkspaceResponse (..),
newGetWorkspaceResponse,
getWorkspaceResponse_description,
getWorkspaceResponse_httpStatus,
getWorkspaceResponse_workspaceId,
getWorkspaceResponse_arn,
getWorkspaceResponse_s3Location,
getWorkspaceResponse_role,
getWorkspaceResponse_creationDateTime,
getWorkspaceResponse_updateDateTime,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IotTwinMaker.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetWorkspace = GetWorkspace'
{
GetWorkspace -> Text
workspaceId :: Prelude.Text
}
deriving (GetWorkspace -> GetWorkspace -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWorkspace -> GetWorkspace -> Bool
$c/= :: GetWorkspace -> GetWorkspace -> Bool
== :: GetWorkspace -> GetWorkspace -> Bool
$c== :: GetWorkspace -> GetWorkspace -> Bool
Prelude.Eq, ReadPrec [GetWorkspace]
ReadPrec GetWorkspace
Int -> ReadS GetWorkspace
ReadS [GetWorkspace]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWorkspace]
$creadListPrec :: ReadPrec [GetWorkspace]
readPrec :: ReadPrec GetWorkspace
$creadPrec :: ReadPrec GetWorkspace
readList :: ReadS [GetWorkspace]
$creadList :: ReadS [GetWorkspace]
readsPrec :: Int -> ReadS GetWorkspace
$creadsPrec :: Int -> ReadS GetWorkspace
Prelude.Read, Int -> GetWorkspace -> ShowS
[GetWorkspace] -> ShowS
GetWorkspace -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkspace] -> ShowS
$cshowList :: [GetWorkspace] -> ShowS
show :: GetWorkspace -> String
$cshow :: GetWorkspace -> String
showsPrec :: Int -> GetWorkspace -> ShowS
$cshowsPrec :: Int -> GetWorkspace -> ShowS
Prelude.Show, forall x. Rep GetWorkspace x -> GetWorkspace
forall x. GetWorkspace -> Rep GetWorkspace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWorkspace x -> GetWorkspace
$cfrom :: forall x. GetWorkspace -> Rep GetWorkspace x
Prelude.Generic)
newGetWorkspace ::
Prelude.Text ->
GetWorkspace
newGetWorkspace :: Text -> GetWorkspace
newGetWorkspace Text
pWorkspaceId_ =
GetWorkspace' {$sel:workspaceId:GetWorkspace' :: Text
workspaceId = Text
pWorkspaceId_}
getWorkspace_workspaceId :: Lens.Lens' GetWorkspace Prelude.Text
getWorkspace_workspaceId :: Lens' GetWorkspace Text
getWorkspace_workspaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspace' {Text
workspaceId :: Text
$sel:workspaceId:GetWorkspace' :: GetWorkspace -> Text
workspaceId} -> Text
workspaceId) (\s :: GetWorkspace
s@GetWorkspace' {} Text
a -> GetWorkspace
s {$sel:workspaceId:GetWorkspace' :: Text
workspaceId = Text
a} :: GetWorkspace)
instance Core.AWSRequest GetWorkspace where
type AWSResponse GetWorkspace = GetWorkspaceResponse
request :: (Service -> Service) -> GetWorkspace -> Request GetWorkspace
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 GetWorkspace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetWorkspace)))
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
-> GetWorkspaceResponse
GetWorkspaceResponse'
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
"description")
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
"workspaceId")
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
"arn")
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
"s3Location")
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
"role")
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
"creationDateTime")
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
"updateDateTime")
)
instance Prelude.Hashable GetWorkspace where
hashWithSalt :: Int -> GetWorkspace -> Int
hashWithSalt Int
_salt GetWorkspace' {Text
workspaceId :: Text
$sel:workspaceId:GetWorkspace' :: GetWorkspace -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workspaceId
instance Prelude.NFData GetWorkspace where
rnf :: GetWorkspace -> ()
rnf GetWorkspace' {Text
workspaceId :: Text
$sel:workspaceId:GetWorkspace' :: GetWorkspace -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
workspaceId
instance Data.ToHeaders GetWorkspace where
toHeaders :: GetWorkspace -> 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 GetWorkspace where
toPath :: GetWorkspace -> ByteString
toPath GetWorkspace' {Text
workspaceId :: Text
$sel:workspaceId:GetWorkspace' :: GetWorkspace -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/workspaces/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
workspaceId]
instance Data.ToQuery GetWorkspace where
toQuery :: GetWorkspace -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetWorkspaceResponse = GetWorkspaceResponse'
{
GetWorkspaceResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
GetWorkspaceResponse -> Int
httpStatus :: Prelude.Int,
GetWorkspaceResponse -> Text
workspaceId :: Prelude.Text,
GetWorkspaceResponse -> Text
arn :: Prelude.Text,
GetWorkspaceResponse -> Text
s3Location :: Prelude.Text,
GetWorkspaceResponse -> Text
role' :: Prelude.Text,
GetWorkspaceResponse -> POSIX
creationDateTime :: Data.POSIX,
GetWorkspaceResponse -> POSIX
updateDateTime :: Data.POSIX
}
deriving (GetWorkspaceResponse -> GetWorkspaceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWorkspaceResponse -> GetWorkspaceResponse -> Bool
$c/= :: GetWorkspaceResponse -> GetWorkspaceResponse -> Bool
== :: GetWorkspaceResponse -> GetWorkspaceResponse -> Bool
$c== :: GetWorkspaceResponse -> GetWorkspaceResponse -> Bool
Prelude.Eq, ReadPrec [GetWorkspaceResponse]
ReadPrec GetWorkspaceResponse
Int -> ReadS GetWorkspaceResponse
ReadS [GetWorkspaceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWorkspaceResponse]
$creadListPrec :: ReadPrec [GetWorkspaceResponse]
readPrec :: ReadPrec GetWorkspaceResponse
$creadPrec :: ReadPrec GetWorkspaceResponse
readList :: ReadS [GetWorkspaceResponse]
$creadList :: ReadS [GetWorkspaceResponse]
readsPrec :: Int -> ReadS GetWorkspaceResponse
$creadsPrec :: Int -> ReadS GetWorkspaceResponse
Prelude.Read, Int -> GetWorkspaceResponse -> ShowS
[GetWorkspaceResponse] -> ShowS
GetWorkspaceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkspaceResponse] -> ShowS
$cshowList :: [GetWorkspaceResponse] -> ShowS
show :: GetWorkspaceResponse -> String
$cshow :: GetWorkspaceResponse -> String
showsPrec :: Int -> GetWorkspaceResponse -> ShowS
$cshowsPrec :: Int -> GetWorkspaceResponse -> ShowS
Prelude.Show, forall x. Rep GetWorkspaceResponse x -> GetWorkspaceResponse
forall x. GetWorkspaceResponse -> Rep GetWorkspaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWorkspaceResponse x -> GetWorkspaceResponse
$cfrom :: forall x. GetWorkspaceResponse -> Rep GetWorkspaceResponse x
Prelude.Generic)
newGetWorkspaceResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
GetWorkspaceResponse
newGetWorkspaceResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> GetWorkspaceResponse
newGetWorkspaceResponse
Int
pHttpStatus_
Text
pWorkspaceId_
Text
pArn_
Text
pS3Location_
Text
pRole_
UTCTime
pCreationDateTime_
UTCTime
pUpdateDateTime_ =
GetWorkspaceResponse'
{ $sel:description:GetWorkspaceResponse' :: Maybe Text
description =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetWorkspaceResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:workspaceId:GetWorkspaceResponse' :: Text
workspaceId = Text
pWorkspaceId_,
$sel:arn:GetWorkspaceResponse' :: Text
arn = Text
pArn_,
$sel:s3Location:GetWorkspaceResponse' :: Text
s3Location = Text
pS3Location_,
$sel:role':GetWorkspaceResponse' :: Text
role' = Text
pRole_,
$sel:creationDateTime:GetWorkspaceResponse' :: POSIX
creationDateTime =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDateTime_,
$sel:updateDateTime:GetWorkspaceResponse' :: POSIX
updateDateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateDateTime_
}
getWorkspaceResponse_description :: Lens.Lens' GetWorkspaceResponse (Prelude.Maybe Prelude.Text)
getWorkspaceResponse_description :: Lens' GetWorkspaceResponse (Maybe Text)
getWorkspaceResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {Maybe Text
description :: Maybe Text
$sel:description:GetWorkspaceResponse' :: GetWorkspaceResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} Maybe Text
a -> GetWorkspaceResponse
s {$sel:description:GetWorkspaceResponse' :: Maybe Text
description = Maybe Text
a} :: GetWorkspaceResponse)
getWorkspaceResponse_httpStatus :: Lens.Lens' GetWorkspaceResponse Prelude.Int
getWorkspaceResponse_httpStatus :: Lens' GetWorkspaceResponse Int
getWorkspaceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetWorkspaceResponse' :: GetWorkspaceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} Int
a -> GetWorkspaceResponse
s {$sel:httpStatus:GetWorkspaceResponse' :: Int
httpStatus = Int
a} :: GetWorkspaceResponse)
getWorkspaceResponse_workspaceId :: Lens.Lens' GetWorkspaceResponse Prelude.Text
getWorkspaceResponse_workspaceId :: Lens' GetWorkspaceResponse Text
getWorkspaceResponse_workspaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {Text
workspaceId :: Text
$sel:workspaceId:GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
workspaceId} -> Text
workspaceId) (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} Text
a -> GetWorkspaceResponse
s {$sel:workspaceId:GetWorkspaceResponse' :: Text
workspaceId = Text
a} :: GetWorkspaceResponse)
getWorkspaceResponse_arn :: Lens.Lens' GetWorkspaceResponse Prelude.Text
getWorkspaceResponse_arn :: Lens' GetWorkspaceResponse Text
getWorkspaceResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {Text
arn :: Text
$sel:arn:GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
arn} -> Text
arn) (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} Text
a -> GetWorkspaceResponse
s {$sel:arn:GetWorkspaceResponse' :: Text
arn = Text
a} :: GetWorkspaceResponse)
getWorkspaceResponse_s3Location :: Lens.Lens' GetWorkspaceResponse Prelude.Text
getWorkspaceResponse_s3Location :: Lens' GetWorkspaceResponse Text
getWorkspaceResponse_s3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {Text
s3Location :: Text
$sel:s3Location:GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
s3Location} -> Text
s3Location) (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} Text
a -> GetWorkspaceResponse
s {$sel:s3Location:GetWorkspaceResponse' :: Text
s3Location = Text
a} :: GetWorkspaceResponse)
getWorkspaceResponse_role :: Lens.Lens' GetWorkspaceResponse Prelude.Text
getWorkspaceResponse_role :: Lens' GetWorkspaceResponse Text
getWorkspaceResponse_role = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {Text
role' :: Text
$sel:role':GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
role'} -> Text
role') (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} Text
a -> GetWorkspaceResponse
s {$sel:role':GetWorkspaceResponse' :: Text
role' = Text
a} :: GetWorkspaceResponse)
getWorkspaceResponse_creationDateTime :: Lens.Lens' GetWorkspaceResponse Prelude.UTCTime
getWorkspaceResponse_creationDateTime :: Lens' GetWorkspaceResponse UTCTime
getWorkspaceResponse_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {POSIX
creationDateTime :: POSIX
$sel:creationDateTime:GetWorkspaceResponse' :: GetWorkspaceResponse -> POSIX
creationDateTime} -> POSIX
creationDateTime) (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} POSIX
a -> GetWorkspaceResponse
s {$sel:creationDateTime:GetWorkspaceResponse' :: POSIX
creationDateTime = POSIX
a} :: GetWorkspaceResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getWorkspaceResponse_updateDateTime :: Lens.Lens' GetWorkspaceResponse Prelude.UTCTime
getWorkspaceResponse_updateDateTime :: Lens' GetWorkspaceResponse UTCTime
getWorkspaceResponse_updateDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkspaceResponse' {POSIX
updateDateTime :: POSIX
$sel:updateDateTime:GetWorkspaceResponse' :: GetWorkspaceResponse -> POSIX
updateDateTime} -> POSIX
updateDateTime) (\s :: GetWorkspaceResponse
s@GetWorkspaceResponse' {} POSIX
a -> GetWorkspaceResponse
s {$sel:updateDateTime:GetWorkspaceResponse' :: POSIX
updateDateTime = POSIX
a} :: GetWorkspaceResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Prelude.NFData GetWorkspaceResponse where
rnf :: GetWorkspaceResponse -> ()
rnf GetWorkspaceResponse' {Int
Maybe Text
Text
POSIX
updateDateTime :: POSIX
creationDateTime :: POSIX
role' :: Text
s3Location :: Text
arn :: Text
workspaceId :: Text
httpStatus :: Int
description :: Maybe Text
$sel:updateDateTime:GetWorkspaceResponse' :: GetWorkspaceResponse -> POSIX
$sel:creationDateTime:GetWorkspaceResponse' :: GetWorkspaceResponse -> POSIX
$sel:role':GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
$sel:s3Location:GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
$sel:arn:GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
$sel:workspaceId:GetWorkspaceResponse' :: GetWorkspaceResponse -> Text
$sel:httpStatus:GetWorkspaceResponse' :: GetWorkspaceResponse -> Int
$sel:description:GetWorkspaceResponse' :: GetWorkspaceResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
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
workspaceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
s3Location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
role'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationDateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
updateDateTime