{-# 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.StopRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StopRequest = StopRequest'
{
StopRequest -> Maybe Text
workspaceId :: Prelude.Maybe Prelude.Text
}
deriving (StopRequest -> StopRequest -> Bool
(StopRequest -> StopRequest -> Bool)
-> (StopRequest -> StopRequest -> Bool) -> Eq StopRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopRequest -> StopRequest -> Bool
$c/= :: StopRequest -> StopRequest -> Bool
== :: StopRequest -> StopRequest -> Bool
$c== :: StopRequest -> StopRequest -> Bool
Prelude.Eq, ReadPrec [StopRequest]
ReadPrec StopRequest
Int -> ReadS StopRequest
ReadS [StopRequest]
(Int -> ReadS StopRequest)
-> ReadS [StopRequest]
-> ReadPrec StopRequest
-> ReadPrec [StopRequest]
-> Read StopRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopRequest]
$creadListPrec :: ReadPrec [StopRequest]
readPrec :: ReadPrec StopRequest
$creadPrec :: ReadPrec StopRequest
readList :: ReadS [StopRequest]
$creadList :: ReadS [StopRequest]
readsPrec :: Int -> ReadS StopRequest
$creadsPrec :: Int -> ReadS StopRequest
Prelude.Read, Int -> StopRequest -> ShowS
[StopRequest] -> ShowS
StopRequest -> String
(Int -> StopRequest -> ShowS)
-> (StopRequest -> String)
-> ([StopRequest] -> ShowS)
-> Show StopRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopRequest] -> ShowS
$cshowList :: [StopRequest] -> ShowS
show :: StopRequest -> String
$cshow :: StopRequest -> String
showsPrec :: Int -> StopRequest -> ShowS
$cshowsPrec :: Int -> StopRequest -> ShowS
Prelude.Show, (forall x. StopRequest -> Rep StopRequest x)
-> (forall x. Rep StopRequest x -> StopRequest)
-> Generic StopRequest
forall x. Rep StopRequest x -> StopRequest
forall x. StopRequest -> Rep StopRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopRequest x -> StopRequest
$cfrom :: forall x. StopRequest -> Rep StopRequest x
Prelude.Generic)
newStopRequest ::
StopRequest
newStopRequest :: StopRequest
newStopRequest =
StopRequest' :: Maybe Text -> StopRequest
StopRequest' {$sel:workspaceId:StopRequest' :: Maybe Text
workspaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing}
stopRequest_workspaceId :: Lens.Lens' StopRequest (Prelude.Maybe Prelude.Text)
stopRequest_workspaceId :: (Maybe Text -> f (Maybe Text)) -> StopRequest -> f StopRequest
stopRequest_workspaceId = (StopRequest -> Maybe Text)
-> (StopRequest -> Maybe Text -> StopRequest)
-> Lens StopRequest StopRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRequest' {Maybe Text
workspaceId :: Maybe Text
$sel:workspaceId:StopRequest' :: StopRequest -> Maybe Text
workspaceId} -> Maybe Text
workspaceId) (\s :: StopRequest
s@StopRequest' {} Maybe Text
a -> StopRequest
s {$sel:workspaceId:StopRequest' :: Maybe Text
workspaceId = Maybe Text
a} :: StopRequest)
instance Prelude.Hashable StopRequest
instance Prelude.NFData StopRequest
instance Core.ToJSON StopRequest where
toJSON :: StopRequest -> Value
toJSON StopRequest' {Maybe Text
workspaceId :: Maybe Text
$sel:workspaceId:StopRequest' :: StopRequest -> 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]
)