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

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

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

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

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

instance Prelude.Hashable RebuildRequest

instance Prelude.NFData RebuildRequest

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