{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WorkSpaces.Types.StopRequest
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.WorkSpaces.Types.StopRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the information used to stop a WorkSpace.
--
-- /See:/ 'newStopRequest' smart constructor.
data StopRequest = StopRequest'
  { -- | The identifier of the WorkSpace.
    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)

-- |
-- Create a value of 'StopRequest' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'workspaceId', 'stopRequest_workspaceId' - The identifier of the WorkSpace.
newStopRequest ::
  StopRequest
newStopRequest :: StopRequest
newStopRequest =
  StopRequest' :: Maybe Text -> StopRequest
StopRequest' {$sel:workspaceId:StopRequest' :: Maybe Text
workspaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The identifier of the WorkSpace.
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]
      )