{-# 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.UpdateScene
(
UpdateScene (..),
newUpdateScene,
updateScene_capabilities,
updateScene_contentLocation,
updateScene_description,
updateScene_workspaceId,
updateScene_sceneId,
UpdateSceneResponse (..),
newUpdateSceneResponse,
updateSceneResponse_httpStatus,
updateSceneResponse_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 UpdateScene = UpdateScene'
{
UpdateScene -> Maybe [Text]
capabilities :: Prelude.Maybe [Prelude.Text],
UpdateScene -> Maybe Text
contentLocation :: Prelude.Maybe Prelude.Text,
UpdateScene -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateScene -> Text
workspaceId :: Prelude.Text,
UpdateScene -> Text
sceneId :: Prelude.Text
}
deriving (UpdateScene -> UpdateScene -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateScene -> UpdateScene -> Bool
$c/= :: UpdateScene -> UpdateScene -> Bool
== :: UpdateScene -> UpdateScene -> Bool
$c== :: UpdateScene -> UpdateScene -> Bool
Prelude.Eq, ReadPrec [UpdateScene]
ReadPrec UpdateScene
Int -> ReadS UpdateScene
ReadS [UpdateScene]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateScene]
$creadListPrec :: ReadPrec [UpdateScene]
readPrec :: ReadPrec UpdateScene
$creadPrec :: ReadPrec UpdateScene
readList :: ReadS [UpdateScene]
$creadList :: ReadS [UpdateScene]
readsPrec :: Int -> ReadS UpdateScene
$creadsPrec :: Int -> ReadS UpdateScene
Prelude.Read, Int -> UpdateScene -> ShowS
[UpdateScene] -> ShowS
UpdateScene -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateScene] -> ShowS
$cshowList :: [UpdateScene] -> ShowS
show :: UpdateScene -> String
$cshow :: UpdateScene -> String
showsPrec :: Int -> UpdateScene -> ShowS
$cshowsPrec :: Int -> UpdateScene -> ShowS
Prelude.Show, forall x. Rep UpdateScene x -> UpdateScene
forall x. UpdateScene -> Rep UpdateScene x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateScene x -> UpdateScene
$cfrom :: forall x. UpdateScene -> Rep UpdateScene x
Prelude.Generic)
newUpdateScene ::
Prelude.Text ->
Prelude.Text ->
UpdateScene
newUpdateScene :: Text -> Text -> UpdateScene
newUpdateScene Text
pWorkspaceId_ Text
pSceneId_ =
UpdateScene'
{ $sel:capabilities:UpdateScene' :: Maybe [Text]
capabilities = forall a. Maybe a
Prelude.Nothing,
$sel:contentLocation:UpdateScene' :: Maybe Text
contentLocation = forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateScene' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:workspaceId:UpdateScene' :: Text
workspaceId = Text
pWorkspaceId_,
$sel:sceneId:UpdateScene' :: Text
sceneId = Text
pSceneId_
}
updateScene_capabilities :: Lens.Lens' UpdateScene (Prelude.Maybe [Prelude.Text])
updateScene_capabilities :: Lens' UpdateScene (Maybe [Text])
updateScene_capabilities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScene' {Maybe [Text]
capabilities :: Maybe [Text]
$sel:capabilities:UpdateScene' :: UpdateScene -> Maybe [Text]
capabilities} -> Maybe [Text]
capabilities) (\s :: UpdateScene
s@UpdateScene' {} Maybe [Text]
a -> UpdateScene
s {$sel:capabilities:UpdateScene' :: Maybe [Text]
capabilities = Maybe [Text]
a} :: UpdateScene) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateScene_contentLocation :: Lens.Lens' UpdateScene (Prelude.Maybe Prelude.Text)
updateScene_contentLocation :: Lens' UpdateScene (Maybe Text)
updateScene_contentLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScene' {Maybe Text
contentLocation :: Maybe Text
$sel:contentLocation:UpdateScene' :: UpdateScene -> Maybe Text
contentLocation} -> Maybe Text
contentLocation) (\s :: UpdateScene
s@UpdateScene' {} Maybe Text
a -> UpdateScene
s {$sel:contentLocation:UpdateScene' :: Maybe Text
contentLocation = Maybe Text
a} :: UpdateScene)
updateScene_description :: Lens.Lens' UpdateScene (Prelude.Maybe Prelude.Text)
updateScene_description :: Lens' UpdateScene (Maybe Text)
updateScene_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScene' {Maybe Text
description :: Maybe Text
$sel:description:UpdateScene' :: UpdateScene -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateScene
s@UpdateScene' {} Maybe Text
a -> UpdateScene
s {$sel:description:UpdateScene' :: Maybe Text
description = Maybe Text
a} :: UpdateScene)
updateScene_workspaceId :: Lens.Lens' UpdateScene Prelude.Text
updateScene_workspaceId :: Lens' UpdateScene Text
updateScene_workspaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScene' {Text
workspaceId :: Text
$sel:workspaceId:UpdateScene' :: UpdateScene -> Text
workspaceId} -> Text
workspaceId) (\s :: UpdateScene
s@UpdateScene' {} Text
a -> UpdateScene
s {$sel:workspaceId:UpdateScene' :: Text
workspaceId = Text
a} :: UpdateScene)
updateScene_sceneId :: Lens.Lens' UpdateScene Prelude.Text
updateScene_sceneId :: Lens' UpdateScene Text
updateScene_sceneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScene' {Text
sceneId :: Text
$sel:sceneId:UpdateScene' :: UpdateScene -> Text
sceneId} -> Text
sceneId) (\s :: UpdateScene
s@UpdateScene' {} Text
a -> UpdateScene
s {$sel:sceneId:UpdateScene' :: Text
sceneId = Text
a} :: UpdateScene)
instance Core.AWSRequest UpdateScene where
type AWSResponse UpdateScene = UpdateSceneResponse
request :: (Service -> Service) -> UpdateScene -> Request UpdateScene
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateScene
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateScene)))
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 ->
Int -> POSIX -> UpdateSceneResponse
UpdateSceneResponse'
forall (f :: * -> *) a b. Functor 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
"updateDateTime")
)
instance Prelude.Hashable UpdateScene where
hashWithSalt :: Int -> UpdateScene -> Int
hashWithSalt Int
_salt UpdateScene' {Maybe [Text]
Maybe Text
Text
sceneId :: Text
workspaceId :: Text
description :: Maybe Text
contentLocation :: Maybe Text
capabilities :: Maybe [Text]
$sel:sceneId:UpdateScene' :: UpdateScene -> Text
$sel:workspaceId:UpdateScene' :: UpdateScene -> Text
$sel:description:UpdateScene' :: UpdateScene -> Maybe Text
$sel:contentLocation:UpdateScene' :: UpdateScene -> Maybe Text
$sel:capabilities:UpdateScene' :: UpdateScene -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
capabilities
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentLocation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workspaceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sceneId
instance Prelude.NFData UpdateScene where
rnf :: UpdateScene -> ()
rnf UpdateScene' {Maybe [Text]
Maybe Text
Text
sceneId :: Text
workspaceId :: Text
description :: Maybe Text
contentLocation :: Maybe Text
capabilities :: Maybe [Text]
$sel:sceneId:UpdateScene' :: UpdateScene -> Text
$sel:workspaceId:UpdateScene' :: UpdateScene -> Text
$sel:description:UpdateScene' :: UpdateScene -> Maybe Text
$sel:contentLocation:UpdateScene' :: UpdateScene -> Maybe Text
$sel:capabilities:UpdateScene' :: UpdateScene -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
capabilities
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentLocation
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
workspaceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sceneId
instance Data.ToHeaders UpdateScene where
toHeaders :: UpdateScene -> 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.ToJSON UpdateScene where
toJSON :: UpdateScene -> Value
toJSON UpdateScene' {Maybe [Text]
Maybe Text
Text
sceneId :: Text
workspaceId :: Text
description :: Maybe Text
contentLocation :: Maybe Text
capabilities :: Maybe [Text]
$sel:sceneId:UpdateScene' :: UpdateScene -> Text
$sel:workspaceId:UpdateScene' :: UpdateScene -> Text
$sel:description:UpdateScene' :: UpdateScene -> Maybe Text
$sel:contentLocation:UpdateScene' :: UpdateScene -> Maybe Text
$sel:capabilities:UpdateScene' :: UpdateScene -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"capabilities" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
capabilities,
(Key
"contentLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
contentLocation,
(Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
]
)
instance Data.ToPath UpdateScene where
toPath :: UpdateScene -> ByteString
toPath UpdateScene' {Maybe [Text]
Maybe Text
Text
sceneId :: Text
workspaceId :: Text
description :: Maybe Text
contentLocation :: Maybe Text
capabilities :: Maybe [Text]
$sel:sceneId:UpdateScene' :: UpdateScene -> Text
$sel:workspaceId:UpdateScene' :: UpdateScene -> Text
$sel:description:UpdateScene' :: UpdateScene -> Maybe Text
$sel:contentLocation:UpdateScene' :: UpdateScene -> Maybe Text
$sel:capabilities:UpdateScene' :: UpdateScene -> Maybe [Text]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/workspaces/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
workspaceId,
ByteString
"/scenes/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
sceneId
]
instance Data.ToQuery UpdateScene where
toQuery :: UpdateScene -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateSceneResponse = UpdateSceneResponse'
{
UpdateSceneResponse -> Int
httpStatus :: Prelude.Int,
UpdateSceneResponse -> POSIX
updateDateTime :: Data.POSIX
}
deriving (UpdateSceneResponse -> UpdateSceneResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSceneResponse -> UpdateSceneResponse -> Bool
$c/= :: UpdateSceneResponse -> UpdateSceneResponse -> Bool
== :: UpdateSceneResponse -> UpdateSceneResponse -> Bool
$c== :: UpdateSceneResponse -> UpdateSceneResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSceneResponse]
ReadPrec UpdateSceneResponse
Int -> ReadS UpdateSceneResponse
ReadS [UpdateSceneResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSceneResponse]
$creadListPrec :: ReadPrec [UpdateSceneResponse]
readPrec :: ReadPrec UpdateSceneResponse
$creadPrec :: ReadPrec UpdateSceneResponse
readList :: ReadS [UpdateSceneResponse]
$creadList :: ReadS [UpdateSceneResponse]
readsPrec :: Int -> ReadS UpdateSceneResponse
$creadsPrec :: Int -> ReadS UpdateSceneResponse
Prelude.Read, Int -> UpdateSceneResponse -> ShowS
[UpdateSceneResponse] -> ShowS
UpdateSceneResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSceneResponse] -> ShowS
$cshowList :: [UpdateSceneResponse] -> ShowS
show :: UpdateSceneResponse -> String
$cshow :: UpdateSceneResponse -> String
showsPrec :: Int -> UpdateSceneResponse -> ShowS
$cshowsPrec :: Int -> UpdateSceneResponse -> ShowS
Prelude.Show, forall x. Rep UpdateSceneResponse x -> UpdateSceneResponse
forall x. UpdateSceneResponse -> Rep UpdateSceneResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSceneResponse x -> UpdateSceneResponse
$cfrom :: forall x. UpdateSceneResponse -> Rep UpdateSceneResponse x
Prelude.Generic)
newUpdateSceneResponse ::
Prelude.Int ->
Prelude.UTCTime ->
UpdateSceneResponse
newUpdateSceneResponse :: Int -> UTCTime -> UpdateSceneResponse
newUpdateSceneResponse Int
pHttpStatus_ UTCTime
pUpdateDateTime_ =
UpdateSceneResponse'
{ $sel:httpStatus:UpdateSceneResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:updateDateTime:UpdateSceneResponse' :: POSIX
updateDateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateDateTime_
}
updateSceneResponse_httpStatus :: Lens.Lens' UpdateSceneResponse Prelude.Int
updateSceneResponse_httpStatus :: Lens' UpdateSceneResponse Int
updateSceneResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSceneResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSceneResponse' :: UpdateSceneResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSceneResponse
s@UpdateSceneResponse' {} Int
a -> UpdateSceneResponse
s {$sel:httpStatus:UpdateSceneResponse' :: Int
httpStatus = Int
a} :: UpdateSceneResponse)
updateSceneResponse_updateDateTime :: Lens.Lens' UpdateSceneResponse Prelude.UTCTime
updateSceneResponse_updateDateTime :: Lens' UpdateSceneResponse UTCTime
updateSceneResponse_updateDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSceneResponse' {POSIX
updateDateTime :: POSIX
$sel:updateDateTime:UpdateSceneResponse' :: UpdateSceneResponse -> POSIX
updateDateTime} -> POSIX
updateDateTime) (\s :: UpdateSceneResponse
s@UpdateSceneResponse' {} POSIX
a -> UpdateSceneResponse
s {$sel:updateDateTime:UpdateSceneResponse' :: POSIX
updateDateTime = POSIX
a} :: UpdateSceneResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Prelude.NFData UpdateSceneResponse where
rnf :: UpdateSceneResponse -> ()
rnf UpdateSceneResponse' {Int
POSIX
updateDateTime :: POSIX
httpStatus :: Int
$sel:updateDateTime:UpdateSceneResponse' :: UpdateSceneResponse -> POSIX
$sel:httpStatus:UpdateSceneResponse' :: UpdateSceneResponse -> Int
..} =
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 POSIX
updateDateTime