{-# 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.TerminateRequest
-- 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.TerminateRequest where

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

-- | Describes the information used to terminate a WorkSpace.
--
-- /See:/ 'newTerminateRequest' smart constructor.
data TerminateRequest = TerminateRequest'
  { -- | The identifier of the WorkSpace.
    TerminateRequest -> Text
workspaceId :: Prelude.Text
  }
  deriving (TerminateRequest -> TerminateRequest -> Bool
(TerminateRequest -> TerminateRequest -> Bool)
-> (TerminateRequest -> TerminateRequest -> Bool)
-> Eq TerminateRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateRequest -> TerminateRequest -> Bool
$c/= :: TerminateRequest -> TerminateRequest -> Bool
== :: TerminateRequest -> TerminateRequest -> Bool
$c== :: TerminateRequest -> TerminateRequest -> Bool
Prelude.Eq, ReadPrec [TerminateRequest]
ReadPrec TerminateRequest
Int -> ReadS TerminateRequest
ReadS [TerminateRequest]
(Int -> ReadS TerminateRequest)
-> ReadS [TerminateRequest]
-> ReadPrec TerminateRequest
-> ReadPrec [TerminateRequest]
-> Read TerminateRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateRequest]
$creadListPrec :: ReadPrec [TerminateRequest]
readPrec :: ReadPrec TerminateRequest
$creadPrec :: ReadPrec TerminateRequest
readList :: ReadS [TerminateRequest]
$creadList :: ReadS [TerminateRequest]
readsPrec :: Int -> ReadS TerminateRequest
$creadsPrec :: Int -> ReadS TerminateRequest
Prelude.Read, Int -> TerminateRequest -> ShowS
[TerminateRequest] -> ShowS
TerminateRequest -> String
(Int -> TerminateRequest -> ShowS)
-> (TerminateRequest -> String)
-> ([TerminateRequest] -> ShowS)
-> Show TerminateRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateRequest] -> ShowS
$cshowList :: [TerminateRequest] -> ShowS
show :: TerminateRequest -> String
$cshow :: TerminateRequest -> String
showsPrec :: Int -> TerminateRequest -> ShowS
$cshowsPrec :: Int -> TerminateRequest -> ShowS
Prelude.Show, (forall x. TerminateRequest -> Rep TerminateRequest x)
-> (forall x. Rep TerminateRequest x -> TerminateRequest)
-> Generic TerminateRequest
forall x. Rep TerminateRequest x -> TerminateRequest
forall x. TerminateRequest -> Rep TerminateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TerminateRequest x -> TerminateRequest
$cfrom :: forall x. TerminateRequest -> Rep TerminateRequest x
Prelude.Generic)

-- |
-- Create a value of 'TerminateRequest' 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', 'terminateRequest_workspaceId' - The identifier of the WorkSpace.
newTerminateRequest ::
  -- | 'workspaceId'
  Prelude.Text ->
  TerminateRequest
newTerminateRequest :: Text -> TerminateRequest
newTerminateRequest Text
pWorkspaceId_ =
  TerminateRequest' :: Text -> TerminateRequest
TerminateRequest' {$sel:workspaceId:TerminateRequest' :: Text
workspaceId = Text
pWorkspaceId_}

-- | The identifier of the WorkSpace.
terminateRequest_workspaceId :: Lens.Lens' TerminateRequest Prelude.Text
terminateRequest_workspaceId :: (Text -> f Text) -> TerminateRequest -> f TerminateRequest
terminateRequest_workspaceId = (TerminateRequest -> Text)
-> (TerminateRequest -> Text -> TerminateRequest)
-> Lens TerminateRequest TerminateRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateRequest' {Text
workspaceId :: Text
$sel:workspaceId:TerminateRequest' :: TerminateRequest -> Text
workspaceId} -> Text
workspaceId) (\s :: TerminateRequest
s@TerminateRequest' {} Text
a -> TerminateRequest
s {$sel:workspaceId:TerminateRequest' :: Text
workspaceId = Text
a} :: TerminateRequest)

instance Prelude.Hashable TerminateRequest

instance Prelude.NFData TerminateRequest

instance Core.ToJSON TerminateRequest where
  toJSON :: TerminateRequest -> Value
toJSON TerminateRequest' {Text
workspaceId :: Text
$sel:workspaceId:TerminateRequest' :: TerminateRequest -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WorkspaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workspaceId)]
      )