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

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

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

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

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

instance Prelude.Hashable RebootRequest

instance Prelude.NFData RebootRequest

instance Core.ToJSON RebootRequest where
  toJSON :: RebootRequest -> Value
toJSON RebootRequest' {Text
workspaceId :: Text
$sel:workspaceId:RebootRequest' :: RebootRequest -> 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)]
      )