{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.WorkSpaces.Types.StartRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StartRequest = StartRequest'
{
StartRequest -> Maybe Text
workspaceId :: Prelude.Maybe Prelude.Text
}
deriving (StartRequest -> StartRequest -> Bool
(StartRequest -> StartRequest -> Bool)
-> (StartRequest -> StartRequest -> Bool) -> Eq StartRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRequest -> StartRequest -> Bool
$c/= :: StartRequest -> StartRequest -> Bool
== :: StartRequest -> StartRequest -> Bool
$c== :: StartRequest -> StartRequest -> Bool
Prelude.Eq, ReadPrec [StartRequest]
ReadPrec StartRequest
Int -> ReadS StartRequest
ReadS [StartRequest]
(Int -> ReadS StartRequest)
-> ReadS [StartRequest]
-> ReadPrec StartRequest
-> ReadPrec [StartRequest]
-> Read StartRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRequest]
$creadListPrec :: ReadPrec [StartRequest]
readPrec :: ReadPrec StartRequest
$creadPrec :: ReadPrec StartRequest
readList :: ReadS [StartRequest]
$creadList :: ReadS [StartRequest]
readsPrec :: Int -> ReadS StartRequest
$creadsPrec :: Int -> ReadS StartRequest
Prelude.Read, Int -> StartRequest -> ShowS
[StartRequest] -> ShowS
StartRequest -> String
(Int -> StartRequest -> ShowS)
-> (StartRequest -> String)
-> ([StartRequest] -> ShowS)
-> Show StartRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRequest] -> ShowS
$cshowList :: [StartRequest] -> ShowS
show :: StartRequest -> String
$cshow :: StartRequest -> String
showsPrec :: Int -> StartRequest -> ShowS
$cshowsPrec :: Int -> StartRequest -> ShowS
Prelude.Show, (forall x. StartRequest -> Rep StartRequest x)
-> (forall x. Rep StartRequest x -> StartRequest)
-> Generic StartRequest
forall x. Rep StartRequest x -> StartRequest
forall x. StartRequest -> Rep StartRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartRequest x -> StartRequest
$cfrom :: forall x. StartRequest -> Rep StartRequest x
Prelude.Generic)
newStartRequest ::
StartRequest
newStartRequest :: StartRequest
newStartRequest =
StartRequest' :: Maybe Text -> StartRequest
StartRequest' {$sel:workspaceId:StartRequest' :: Maybe Text
workspaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing}
startRequest_workspaceId :: Lens.Lens' StartRequest (Prelude.Maybe Prelude.Text)
startRequest_workspaceId :: (Maybe Text -> f (Maybe Text)) -> StartRequest -> f StartRequest
startRequest_workspaceId = (StartRequest -> Maybe Text)
-> (StartRequest -> Maybe Text -> StartRequest)
-> Lens StartRequest StartRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRequest' {Maybe Text
workspaceId :: Maybe Text
$sel:workspaceId:StartRequest' :: StartRequest -> Maybe Text
workspaceId} -> Maybe Text
workspaceId) (\s :: StartRequest
s@StartRequest' {} Maybe Text
a -> StartRequest
s {$sel:workspaceId:StartRequest' :: Maybe Text
workspaceId = Maybe Text
a} :: StartRequest)
instance Prelude.Hashable StartRequest
instance Prelude.NFData StartRequest
instance Core.ToJSON StartRequest where
toJSON :: StartRequest -> Value
toJSON StartRequest' {Maybe Text
workspaceId :: Maybe Text
$sel:workspaceId:StartRequest' :: StartRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"WorkspaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
workspaceId]
)