{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.WorkSpaces.UpdateWorkspaceBundle
(
UpdateWorkspaceBundle (..),
newUpdateWorkspaceBundle,
updateWorkspaceBundle_bundleId,
updateWorkspaceBundle_imageId,
UpdateWorkspaceBundleResponse (..),
newUpdateWorkspaceBundleResponse,
updateWorkspaceBundleResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkSpaces.Types
data UpdateWorkspaceBundle = UpdateWorkspaceBundle'
{
UpdateWorkspaceBundle -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
UpdateWorkspaceBundle -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text
}
deriving (UpdateWorkspaceBundle -> UpdateWorkspaceBundle -> Bool
(UpdateWorkspaceBundle -> UpdateWorkspaceBundle -> Bool)
-> (UpdateWorkspaceBundle -> UpdateWorkspaceBundle -> Bool)
-> Eq UpdateWorkspaceBundle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkspaceBundle -> UpdateWorkspaceBundle -> Bool
$c/= :: UpdateWorkspaceBundle -> UpdateWorkspaceBundle -> Bool
== :: UpdateWorkspaceBundle -> UpdateWorkspaceBundle -> Bool
$c== :: UpdateWorkspaceBundle -> UpdateWorkspaceBundle -> Bool
Prelude.Eq, ReadPrec [UpdateWorkspaceBundle]
ReadPrec UpdateWorkspaceBundle
Int -> ReadS UpdateWorkspaceBundle
ReadS [UpdateWorkspaceBundle]
(Int -> ReadS UpdateWorkspaceBundle)
-> ReadS [UpdateWorkspaceBundle]
-> ReadPrec UpdateWorkspaceBundle
-> ReadPrec [UpdateWorkspaceBundle]
-> Read UpdateWorkspaceBundle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWorkspaceBundle]
$creadListPrec :: ReadPrec [UpdateWorkspaceBundle]
readPrec :: ReadPrec UpdateWorkspaceBundle
$creadPrec :: ReadPrec UpdateWorkspaceBundle
readList :: ReadS [UpdateWorkspaceBundle]
$creadList :: ReadS [UpdateWorkspaceBundle]
readsPrec :: Int -> ReadS UpdateWorkspaceBundle
$creadsPrec :: Int -> ReadS UpdateWorkspaceBundle
Prelude.Read, Int -> UpdateWorkspaceBundle -> ShowS
[UpdateWorkspaceBundle] -> ShowS
UpdateWorkspaceBundle -> String
(Int -> UpdateWorkspaceBundle -> ShowS)
-> (UpdateWorkspaceBundle -> String)
-> ([UpdateWorkspaceBundle] -> ShowS)
-> Show UpdateWorkspaceBundle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkspaceBundle] -> ShowS
$cshowList :: [UpdateWorkspaceBundle] -> ShowS
show :: UpdateWorkspaceBundle -> String
$cshow :: UpdateWorkspaceBundle -> String
showsPrec :: Int -> UpdateWorkspaceBundle -> ShowS
$cshowsPrec :: Int -> UpdateWorkspaceBundle -> ShowS
Prelude.Show, (forall x. UpdateWorkspaceBundle -> Rep UpdateWorkspaceBundle x)
-> (forall x. Rep UpdateWorkspaceBundle x -> UpdateWorkspaceBundle)
-> Generic UpdateWorkspaceBundle
forall x. Rep UpdateWorkspaceBundle x -> UpdateWorkspaceBundle
forall x. UpdateWorkspaceBundle -> Rep UpdateWorkspaceBundle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateWorkspaceBundle x -> UpdateWorkspaceBundle
$cfrom :: forall x. UpdateWorkspaceBundle -> Rep UpdateWorkspaceBundle x
Prelude.Generic)
newUpdateWorkspaceBundle ::
UpdateWorkspaceBundle
newUpdateWorkspaceBundle :: UpdateWorkspaceBundle
newUpdateWorkspaceBundle =
UpdateWorkspaceBundle' :: Maybe Text -> Maybe Text -> UpdateWorkspaceBundle
UpdateWorkspaceBundle'
{ $sel:bundleId:UpdateWorkspaceBundle' :: Maybe Text
bundleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageId:UpdateWorkspaceBundle' :: Maybe Text
imageId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
updateWorkspaceBundle_bundleId :: Lens.Lens' UpdateWorkspaceBundle (Prelude.Maybe Prelude.Text)
updateWorkspaceBundle_bundleId :: (Maybe Text -> f (Maybe Text))
-> UpdateWorkspaceBundle -> f UpdateWorkspaceBundle
updateWorkspaceBundle_bundleId = (UpdateWorkspaceBundle -> Maybe Text)
-> (UpdateWorkspaceBundle -> Maybe Text -> UpdateWorkspaceBundle)
-> Lens
UpdateWorkspaceBundle
UpdateWorkspaceBundle
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceBundle' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: UpdateWorkspaceBundle
s@UpdateWorkspaceBundle' {} Maybe Text
a -> UpdateWorkspaceBundle
s {$sel:bundleId:UpdateWorkspaceBundle' :: Maybe Text
bundleId = Maybe Text
a} :: UpdateWorkspaceBundle)
updateWorkspaceBundle_imageId :: Lens.Lens' UpdateWorkspaceBundle (Prelude.Maybe Prelude.Text)
updateWorkspaceBundle_imageId :: (Maybe Text -> f (Maybe Text))
-> UpdateWorkspaceBundle -> f UpdateWorkspaceBundle
updateWorkspaceBundle_imageId = (UpdateWorkspaceBundle -> Maybe Text)
-> (UpdateWorkspaceBundle -> Maybe Text -> UpdateWorkspaceBundle)
-> Lens
UpdateWorkspaceBundle
UpdateWorkspaceBundle
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceBundle' {Maybe Text
imageId :: Maybe Text
$sel:imageId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: UpdateWorkspaceBundle
s@UpdateWorkspaceBundle' {} Maybe Text
a -> UpdateWorkspaceBundle
s {$sel:imageId:UpdateWorkspaceBundle' :: Maybe Text
imageId = Maybe Text
a} :: UpdateWorkspaceBundle)
instance Core.AWSRequest UpdateWorkspaceBundle where
type
AWSResponse UpdateWorkspaceBundle =
UpdateWorkspaceBundleResponse
request :: UpdateWorkspaceBundle -> Request UpdateWorkspaceBundle
request = Service -> UpdateWorkspaceBundle -> Request UpdateWorkspaceBundle
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateWorkspaceBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateWorkspaceBundle)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateWorkspaceBundle))
-> Logger
-> Service
-> Proxy UpdateWorkspaceBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateWorkspaceBundle)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateWorkspaceBundleResponse
UpdateWorkspaceBundleResponse'
(Int -> UpdateWorkspaceBundleResponse)
-> Either String Int -> Either String UpdateWorkspaceBundleResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateWorkspaceBundle
instance Prelude.NFData UpdateWorkspaceBundle
instance Core.ToHeaders UpdateWorkspaceBundle where
toHeaders :: UpdateWorkspaceBundle -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateWorkspaceBundle -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"WorkspacesService.UpdateWorkspaceBundle" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateWorkspaceBundle where
toJSON :: UpdateWorkspaceBundle -> Value
toJSON UpdateWorkspaceBundle' {Maybe Text
imageId :: Maybe Text
bundleId :: Maybe Text
$sel:imageId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
$sel:bundleId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"BundleId" 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
bundleId,
(Text
"ImageId" 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
imageId
]
)
instance Core.ToPath UpdateWorkspaceBundle where
toPath :: UpdateWorkspaceBundle -> ByteString
toPath = ByteString -> UpdateWorkspaceBundle -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateWorkspaceBundle where
toQuery :: UpdateWorkspaceBundle -> QueryString
toQuery = QueryString -> UpdateWorkspaceBundle -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateWorkspaceBundleResponse = UpdateWorkspaceBundleResponse'
{
UpdateWorkspaceBundleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool
(UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool)
-> (UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool)
-> Eq UpdateWorkspaceBundleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool
$c/= :: UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool
== :: UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool
$c== :: UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool
Prelude.Eq, ReadPrec [UpdateWorkspaceBundleResponse]
ReadPrec UpdateWorkspaceBundleResponse
Int -> ReadS UpdateWorkspaceBundleResponse
ReadS [UpdateWorkspaceBundleResponse]
(Int -> ReadS UpdateWorkspaceBundleResponse)
-> ReadS [UpdateWorkspaceBundleResponse]
-> ReadPrec UpdateWorkspaceBundleResponse
-> ReadPrec [UpdateWorkspaceBundleResponse]
-> Read UpdateWorkspaceBundleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWorkspaceBundleResponse]
$creadListPrec :: ReadPrec [UpdateWorkspaceBundleResponse]
readPrec :: ReadPrec UpdateWorkspaceBundleResponse
$creadPrec :: ReadPrec UpdateWorkspaceBundleResponse
readList :: ReadS [UpdateWorkspaceBundleResponse]
$creadList :: ReadS [UpdateWorkspaceBundleResponse]
readsPrec :: Int -> ReadS UpdateWorkspaceBundleResponse
$creadsPrec :: Int -> ReadS UpdateWorkspaceBundleResponse
Prelude.Read, Int -> UpdateWorkspaceBundleResponse -> ShowS
[UpdateWorkspaceBundleResponse] -> ShowS
UpdateWorkspaceBundleResponse -> String
(Int -> UpdateWorkspaceBundleResponse -> ShowS)
-> (UpdateWorkspaceBundleResponse -> String)
-> ([UpdateWorkspaceBundleResponse] -> ShowS)
-> Show UpdateWorkspaceBundleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkspaceBundleResponse] -> ShowS
$cshowList :: [UpdateWorkspaceBundleResponse] -> ShowS
show :: UpdateWorkspaceBundleResponse -> String
$cshow :: UpdateWorkspaceBundleResponse -> String
showsPrec :: Int -> UpdateWorkspaceBundleResponse -> ShowS
$cshowsPrec :: Int -> UpdateWorkspaceBundleResponse -> ShowS
Prelude.Show, (forall x.
UpdateWorkspaceBundleResponse
-> Rep UpdateWorkspaceBundleResponse x)
-> (forall x.
Rep UpdateWorkspaceBundleResponse x
-> UpdateWorkspaceBundleResponse)
-> Generic UpdateWorkspaceBundleResponse
forall x.
Rep UpdateWorkspaceBundleResponse x
-> UpdateWorkspaceBundleResponse
forall x.
UpdateWorkspaceBundleResponse
-> Rep UpdateWorkspaceBundleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateWorkspaceBundleResponse x
-> UpdateWorkspaceBundleResponse
$cfrom :: forall x.
UpdateWorkspaceBundleResponse
-> Rep UpdateWorkspaceBundleResponse x
Prelude.Generic)
newUpdateWorkspaceBundleResponse ::
Prelude.Int ->
UpdateWorkspaceBundleResponse
newUpdateWorkspaceBundleResponse :: Int -> UpdateWorkspaceBundleResponse
newUpdateWorkspaceBundleResponse Int
pHttpStatus_ =
UpdateWorkspaceBundleResponse' :: Int -> UpdateWorkspaceBundleResponse
UpdateWorkspaceBundleResponse'
{ $sel:httpStatus:UpdateWorkspaceBundleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateWorkspaceBundleResponse_httpStatus :: Lens.Lens' UpdateWorkspaceBundleResponse Prelude.Int
updateWorkspaceBundleResponse_httpStatus :: (Int -> f Int)
-> UpdateWorkspaceBundleResponse -> f UpdateWorkspaceBundleResponse
updateWorkspaceBundleResponse_httpStatus = (UpdateWorkspaceBundleResponse -> Int)
-> (UpdateWorkspaceBundleResponse
-> Int -> UpdateWorkspaceBundleResponse)
-> Lens
UpdateWorkspaceBundleResponse UpdateWorkspaceBundleResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceBundleResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateWorkspaceBundleResponse' :: UpdateWorkspaceBundleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateWorkspaceBundleResponse
s@UpdateWorkspaceBundleResponse' {} Int
a -> UpdateWorkspaceBundleResponse
s {$sel:httpStatus:UpdateWorkspaceBundleResponse' :: Int
httpStatus = Int
a} :: UpdateWorkspaceBundleResponse)
instance Prelude.NFData UpdateWorkspaceBundleResponse