{-# 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.UpdateWorkspaceImagePermission
(
UpdateWorkspaceImagePermission (..),
newUpdateWorkspaceImagePermission,
updateWorkspaceImagePermission_imageId,
updateWorkspaceImagePermission_allowCopyImage,
updateWorkspaceImagePermission_sharedAccountId,
UpdateWorkspaceImagePermissionResponse (..),
newUpdateWorkspaceImagePermissionResponse,
updateWorkspaceImagePermissionResponse_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 UpdateWorkspaceImagePermission = UpdateWorkspaceImagePermission'
{
UpdateWorkspaceImagePermission -> Text
imageId :: Prelude.Text,
UpdateWorkspaceImagePermission -> Bool
allowCopyImage :: Prelude.Bool,
UpdateWorkspaceImagePermission -> Text
sharedAccountId :: Prelude.Text
}
deriving (UpdateWorkspaceImagePermission
-> UpdateWorkspaceImagePermission -> Bool
(UpdateWorkspaceImagePermission
-> UpdateWorkspaceImagePermission -> Bool)
-> (UpdateWorkspaceImagePermission
-> UpdateWorkspaceImagePermission -> Bool)
-> Eq UpdateWorkspaceImagePermission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkspaceImagePermission
-> UpdateWorkspaceImagePermission -> Bool
$c/= :: UpdateWorkspaceImagePermission
-> UpdateWorkspaceImagePermission -> Bool
== :: UpdateWorkspaceImagePermission
-> UpdateWorkspaceImagePermission -> Bool
$c== :: UpdateWorkspaceImagePermission
-> UpdateWorkspaceImagePermission -> Bool
Prelude.Eq, ReadPrec [UpdateWorkspaceImagePermission]
ReadPrec UpdateWorkspaceImagePermission
Int -> ReadS UpdateWorkspaceImagePermission
ReadS [UpdateWorkspaceImagePermission]
(Int -> ReadS UpdateWorkspaceImagePermission)
-> ReadS [UpdateWorkspaceImagePermission]
-> ReadPrec UpdateWorkspaceImagePermission
-> ReadPrec [UpdateWorkspaceImagePermission]
-> Read UpdateWorkspaceImagePermission
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWorkspaceImagePermission]
$creadListPrec :: ReadPrec [UpdateWorkspaceImagePermission]
readPrec :: ReadPrec UpdateWorkspaceImagePermission
$creadPrec :: ReadPrec UpdateWorkspaceImagePermission
readList :: ReadS [UpdateWorkspaceImagePermission]
$creadList :: ReadS [UpdateWorkspaceImagePermission]
readsPrec :: Int -> ReadS UpdateWorkspaceImagePermission
$creadsPrec :: Int -> ReadS UpdateWorkspaceImagePermission
Prelude.Read, Int -> UpdateWorkspaceImagePermission -> ShowS
[UpdateWorkspaceImagePermission] -> ShowS
UpdateWorkspaceImagePermission -> String
(Int -> UpdateWorkspaceImagePermission -> ShowS)
-> (UpdateWorkspaceImagePermission -> String)
-> ([UpdateWorkspaceImagePermission] -> ShowS)
-> Show UpdateWorkspaceImagePermission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkspaceImagePermission] -> ShowS
$cshowList :: [UpdateWorkspaceImagePermission] -> ShowS
show :: UpdateWorkspaceImagePermission -> String
$cshow :: UpdateWorkspaceImagePermission -> String
showsPrec :: Int -> UpdateWorkspaceImagePermission -> ShowS
$cshowsPrec :: Int -> UpdateWorkspaceImagePermission -> ShowS
Prelude.Show, (forall x.
UpdateWorkspaceImagePermission
-> Rep UpdateWorkspaceImagePermission x)
-> (forall x.
Rep UpdateWorkspaceImagePermission x
-> UpdateWorkspaceImagePermission)
-> Generic UpdateWorkspaceImagePermission
forall x.
Rep UpdateWorkspaceImagePermission x
-> UpdateWorkspaceImagePermission
forall x.
UpdateWorkspaceImagePermission
-> Rep UpdateWorkspaceImagePermission x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateWorkspaceImagePermission x
-> UpdateWorkspaceImagePermission
$cfrom :: forall x.
UpdateWorkspaceImagePermission
-> Rep UpdateWorkspaceImagePermission x
Prelude.Generic)
newUpdateWorkspaceImagePermission ::
Prelude.Text ->
Prelude.Bool ->
Prelude.Text ->
UpdateWorkspaceImagePermission
newUpdateWorkspaceImagePermission :: Text -> Bool -> Text -> UpdateWorkspaceImagePermission
newUpdateWorkspaceImagePermission
Text
pImageId_
Bool
pAllowCopyImage_
Text
pSharedAccountId_ =
UpdateWorkspaceImagePermission' :: Text -> Bool -> Text -> UpdateWorkspaceImagePermission
UpdateWorkspaceImagePermission'
{ $sel:imageId:UpdateWorkspaceImagePermission' :: Text
imageId =
Text
pImageId_,
$sel:allowCopyImage:UpdateWorkspaceImagePermission' :: Bool
allowCopyImage = Bool
pAllowCopyImage_,
$sel:sharedAccountId:UpdateWorkspaceImagePermission' :: Text
sharedAccountId = Text
pSharedAccountId_
}
updateWorkspaceImagePermission_imageId :: Lens.Lens' UpdateWorkspaceImagePermission Prelude.Text
updateWorkspaceImagePermission_imageId :: (Text -> f Text)
-> UpdateWorkspaceImagePermission
-> f UpdateWorkspaceImagePermission
updateWorkspaceImagePermission_imageId = (UpdateWorkspaceImagePermission -> Text)
-> (UpdateWorkspaceImagePermission
-> Text -> UpdateWorkspaceImagePermission)
-> Lens
UpdateWorkspaceImagePermission
UpdateWorkspaceImagePermission
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceImagePermission' {Text
imageId :: Text
$sel:imageId:UpdateWorkspaceImagePermission' :: UpdateWorkspaceImagePermission -> Text
imageId} -> Text
imageId) (\s :: UpdateWorkspaceImagePermission
s@UpdateWorkspaceImagePermission' {} Text
a -> UpdateWorkspaceImagePermission
s {$sel:imageId:UpdateWorkspaceImagePermission' :: Text
imageId = Text
a} :: UpdateWorkspaceImagePermission)
updateWorkspaceImagePermission_allowCopyImage :: Lens.Lens' UpdateWorkspaceImagePermission Prelude.Bool
updateWorkspaceImagePermission_allowCopyImage :: (Bool -> f Bool)
-> UpdateWorkspaceImagePermission
-> f UpdateWorkspaceImagePermission
updateWorkspaceImagePermission_allowCopyImage = (UpdateWorkspaceImagePermission -> Bool)
-> (UpdateWorkspaceImagePermission
-> Bool -> UpdateWorkspaceImagePermission)
-> Lens
UpdateWorkspaceImagePermission
UpdateWorkspaceImagePermission
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceImagePermission' {Bool
allowCopyImage :: Bool
$sel:allowCopyImage:UpdateWorkspaceImagePermission' :: UpdateWorkspaceImagePermission -> Bool
allowCopyImage} -> Bool
allowCopyImage) (\s :: UpdateWorkspaceImagePermission
s@UpdateWorkspaceImagePermission' {} Bool
a -> UpdateWorkspaceImagePermission
s {$sel:allowCopyImage:UpdateWorkspaceImagePermission' :: Bool
allowCopyImage = Bool
a} :: UpdateWorkspaceImagePermission)
updateWorkspaceImagePermission_sharedAccountId :: Lens.Lens' UpdateWorkspaceImagePermission Prelude.Text
updateWorkspaceImagePermission_sharedAccountId :: (Text -> f Text)
-> UpdateWorkspaceImagePermission
-> f UpdateWorkspaceImagePermission
updateWorkspaceImagePermission_sharedAccountId = (UpdateWorkspaceImagePermission -> Text)
-> (UpdateWorkspaceImagePermission
-> Text -> UpdateWorkspaceImagePermission)
-> Lens
UpdateWorkspaceImagePermission
UpdateWorkspaceImagePermission
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceImagePermission' {Text
sharedAccountId :: Text
$sel:sharedAccountId:UpdateWorkspaceImagePermission' :: UpdateWorkspaceImagePermission -> Text
sharedAccountId} -> Text
sharedAccountId) (\s :: UpdateWorkspaceImagePermission
s@UpdateWorkspaceImagePermission' {} Text
a -> UpdateWorkspaceImagePermission
s {$sel:sharedAccountId:UpdateWorkspaceImagePermission' :: Text
sharedAccountId = Text
a} :: UpdateWorkspaceImagePermission)
instance
Core.AWSRequest
UpdateWorkspaceImagePermission
where
type
AWSResponse UpdateWorkspaceImagePermission =
UpdateWorkspaceImagePermissionResponse
request :: UpdateWorkspaceImagePermission
-> Request UpdateWorkspaceImagePermission
request = Service
-> UpdateWorkspaceImagePermission
-> Request UpdateWorkspaceImagePermission
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateWorkspaceImagePermission
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateWorkspaceImagePermission)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateWorkspaceImagePermission))
-> Logger
-> Service
-> Proxy UpdateWorkspaceImagePermission
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateWorkspaceImagePermission)))
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 -> UpdateWorkspaceImagePermissionResponse
UpdateWorkspaceImagePermissionResponse'
(Int -> UpdateWorkspaceImagePermissionResponse)
-> Either String Int
-> Either String UpdateWorkspaceImagePermissionResponse
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
UpdateWorkspaceImagePermission
instance
Prelude.NFData
UpdateWorkspaceImagePermission
instance
Core.ToHeaders
UpdateWorkspaceImagePermission
where
toHeaders :: UpdateWorkspaceImagePermission -> ResponseHeaders
toHeaders =
ResponseHeaders
-> UpdateWorkspaceImagePermission -> 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.UpdateWorkspaceImagePermission" ::
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 UpdateWorkspaceImagePermission where
toJSON :: UpdateWorkspaceImagePermission -> Value
toJSON UpdateWorkspaceImagePermission' {Bool
Text
sharedAccountId :: Text
allowCopyImage :: Bool
imageId :: Text
$sel:sharedAccountId:UpdateWorkspaceImagePermission' :: UpdateWorkspaceImagePermission -> Text
$sel:allowCopyImage:UpdateWorkspaceImagePermission' :: UpdateWorkspaceImagePermission -> Bool
$sel:imageId:UpdateWorkspaceImagePermission' :: UpdateWorkspaceImagePermission -> 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
"ImageId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imageId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AllowCopyImage" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
allowCopyImage),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SharedAccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sharedAccountId)
]
)
instance Core.ToPath UpdateWorkspaceImagePermission where
toPath :: UpdateWorkspaceImagePermission -> ByteString
toPath = ByteString -> UpdateWorkspaceImagePermission -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateWorkspaceImagePermission where
toQuery :: UpdateWorkspaceImagePermission -> QueryString
toQuery = QueryString -> UpdateWorkspaceImagePermission -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateWorkspaceImagePermissionResponse = UpdateWorkspaceImagePermissionResponse'
{
UpdateWorkspaceImagePermissionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateWorkspaceImagePermissionResponse
-> UpdateWorkspaceImagePermissionResponse -> Bool
(UpdateWorkspaceImagePermissionResponse
-> UpdateWorkspaceImagePermissionResponse -> Bool)
-> (UpdateWorkspaceImagePermissionResponse
-> UpdateWorkspaceImagePermissionResponse -> Bool)
-> Eq UpdateWorkspaceImagePermissionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkspaceImagePermissionResponse
-> UpdateWorkspaceImagePermissionResponse -> Bool
$c/= :: UpdateWorkspaceImagePermissionResponse
-> UpdateWorkspaceImagePermissionResponse -> Bool
== :: UpdateWorkspaceImagePermissionResponse
-> UpdateWorkspaceImagePermissionResponse -> Bool
$c== :: UpdateWorkspaceImagePermissionResponse
-> UpdateWorkspaceImagePermissionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateWorkspaceImagePermissionResponse]
ReadPrec UpdateWorkspaceImagePermissionResponse
Int -> ReadS UpdateWorkspaceImagePermissionResponse
ReadS [UpdateWorkspaceImagePermissionResponse]
(Int -> ReadS UpdateWorkspaceImagePermissionResponse)
-> ReadS [UpdateWorkspaceImagePermissionResponse]
-> ReadPrec UpdateWorkspaceImagePermissionResponse
-> ReadPrec [UpdateWorkspaceImagePermissionResponse]
-> Read UpdateWorkspaceImagePermissionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWorkspaceImagePermissionResponse]
$creadListPrec :: ReadPrec [UpdateWorkspaceImagePermissionResponse]
readPrec :: ReadPrec UpdateWorkspaceImagePermissionResponse
$creadPrec :: ReadPrec UpdateWorkspaceImagePermissionResponse
readList :: ReadS [UpdateWorkspaceImagePermissionResponse]
$creadList :: ReadS [UpdateWorkspaceImagePermissionResponse]
readsPrec :: Int -> ReadS UpdateWorkspaceImagePermissionResponse
$creadsPrec :: Int -> ReadS UpdateWorkspaceImagePermissionResponse
Prelude.Read, Int -> UpdateWorkspaceImagePermissionResponse -> ShowS
[UpdateWorkspaceImagePermissionResponse] -> ShowS
UpdateWorkspaceImagePermissionResponse -> String
(Int -> UpdateWorkspaceImagePermissionResponse -> ShowS)
-> (UpdateWorkspaceImagePermissionResponse -> String)
-> ([UpdateWorkspaceImagePermissionResponse] -> ShowS)
-> Show UpdateWorkspaceImagePermissionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkspaceImagePermissionResponse] -> ShowS
$cshowList :: [UpdateWorkspaceImagePermissionResponse] -> ShowS
show :: UpdateWorkspaceImagePermissionResponse -> String
$cshow :: UpdateWorkspaceImagePermissionResponse -> String
showsPrec :: Int -> UpdateWorkspaceImagePermissionResponse -> ShowS
$cshowsPrec :: Int -> UpdateWorkspaceImagePermissionResponse -> ShowS
Prelude.Show, (forall x.
UpdateWorkspaceImagePermissionResponse
-> Rep UpdateWorkspaceImagePermissionResponse x)
-> (forall x.
Rep UpdateWorkspaceImagePermissionResponse x
-> UpdateWorkspaceImagePermissionResponse)
-> Generic UpdateWorkspaceImagePermissionResponse
forall x.
Rep UpdateWorkspaceImagePermissionResponse x
-> UpdateWorkspaceImagePermissionResponse
forall x.
UpdateWorkspaceImagePermissionResponse
-> Rep UpdateWorkspaceImagePermissionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateWorkspaceImagePermissionResponse x
-> UpdateWorkspaceImagePermissionResponse
$cfrom :: forall x.
UpdateWorkspaceImagePermissionResponse
-> Rep UpdateWorkspaceImagePermissionResponse x
Prelude.Generic)
newUpdateWorkspaceImagePermissionResponse ::
Prelude.Int ->
UpdateWorkspaceImagePermissionResponse
newUpdateWorkspaceImagePermissionResponse :: Int -> UpdateWorkspaceImagePermissionResponse
newUpdateWorkspaceImagePermissionResponse
Int
pHttpStatus_ =
UpdateWorkspaceImagePermissionResponse' :: Int -> UpdateWorkspaceImagePermissionResponse
UpdateWorkspaceImagePermissionResponse'
{ $sel:httpStatus:UpdateWorkspaceImagePermissionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateWorkspaceImagePermissionResponse_httpStatus :: Lens.Lens' UpdateWorkspaceImagePermissionResponse Prelude.Int
updateWorkspaceImagePermissionResponse_httpStatus :: (Int -> f Int)
-> UpdateWorkspaceImagePermissionResponse
-> f UpdateWorkspaceImagePermissionResponse
updateWorkspaceImagePermissionResponse_httpStatus = (UpdateWorkspaceImagePermissionResponse -> Int)
-> (UpdateWorkspaceImagePermissionResponse
-> Int -> UpdateWorkspaceImagePermissionResponse)
-> Lens
UpdateWorkspaceImagePermissionResponse
UpdateWorkspaceImagePermissionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkspaceImagePermissionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateWorkspaceImagePermissionResponse' :: UpdateWorkspaceImagePermissionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateWorkspaceImagePermissionResponse
s@UpdateWorkspaceImagePermissionResponse' {} Int
a -> UpdateWorkspaceImagePermissionResponse
s {$sel:httpStatus:UpdateWorkspaceImagePermissionResponse' :: Int
httpStatus = Int
a} :: UpdateWorkspaceImagePermissionResponse)
instance
Prelude.NFData
UpdateWorkspaceImagePermissionResponse