{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:bundleId:UpdateWorkspaceBundle' :: Maybe Text
bundleId = forall a. Maybe a
Prelude.Nothing,
$sel:imageId:UpdateWorkspaceBundle' :: Maybe Text
imageId = forall a. Maybe a
Prelude.Nothing
}
updateWorkspaceBundle_bundleId :: Lens.Lens' UpdateWorkspaceBundle (Prelude.Maybe Prelude.Text)
updateWorkspaceBundle_bundleId :: Lens' UpdateWorkspaceBundle (Maybe Text)
updateWorkspaceBundle_bundleId = 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 :: Lens' UpdateWorkspaceBundle (Maybe Text)
updateWorkspaceBundle_imageId = 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 :: (Service -> Service)
-> UpdateWorkspaceBundle -> Request UpdateWorkspaceBundle
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateWorkspaceBundle
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateWorkspaceBundle)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateWorkspaceBundleResponse
UpdateWorkspaceBundleResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateWorkspaceBundle where
hashWithSalt :: Int -> UpdateWorkspaceBundle -> Int
hashWithSalt Int
_salt UpdateWorkspaceBundle' {Maybe Text
imageId :: Maybe Text
bundleId :: Maybe Text
$sel:imageId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
$sel:bundleId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bundleId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageId
instance Prelude.NFData UpdateWorkspaceBundle where
rnf :: UpdateWorkspaceBundle -> ()
rnf UpdateWorkspaceBundle' {Maybe Text
imageId :: Maybe Text
bundleId :: Maybe Text
$sel:imageId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
$sel:bundleId:UpdateWorkspaceBundle' :: UpdateWorkspaceBundle -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bundleId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageId
instance Data.ToHeaders UpdateWorkspaceBundle where
toHeaders :: UpdateWorkspaceBundle -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkspacesService.UpdateWorkspaceBundle" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BundleId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bundleId,
(Key
"ImageId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imageId
]
)
instance Data.ToPath UpdateWorkspaceBundle where
toPath :: UpdateWorkspaceBundle -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateWorkspaceBundle where
toQuery :: UpdateWorkspaceBundle -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateWorkspaceBundleResponse = UpdateWorkspaceBundleResponse'
{
UpdateWorkspaceBundleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateWorkspaceBundleResponse
-> UpdateWorkspaceBundleResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:UpdateWorkspaceBundleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateWorkspaceBundleResponse_httpStatus :: Lens.Lens' UpdateWorkspaceBundleResponse Prelude.Int
updateWorkspaceBundleResponse_httpStatus :: Lens' UpdateWorkspaceBundleResponse Int
updateWorkspaceBundleResponse_httpStatus = 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 where
rnf :: UpdateWorkspaceBundleResponse -> ()
rnf UpdateWorkspaceBundleResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateWorkspaceBundleResponse' :: UpdateWorkspaceBundleResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus