{-# 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.AppStream.UpdateImagePermissions
(
UpdateImagePermissions (..),
newUpdateImagePermissions,
updateImagePermissions_name,
updateImagePermissions_sharedAccountId,
updateImagePermissions_imagePermissions,
UpdateImagePermissionsResponse (..),
newUpdateImagePermissionsResponse,
updateImagePermissionsResponse_httpStatus,
)
where
import Amazonka.AppStream.Types
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
data UpdateImagePermissions = UpdateImagePermissions'
{
UpdateImagePermissions -> Text
name :: Prelude.Text,
UpdateImagePermissions -> Text
sharedAccountId :: Prelude.Text,
UpdateImagePermissions -> ImagePermissions
imagePermissions :: ImagePermissions
}
deriving (UpdateImagePermissions -> UpdateImagePermissions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateImagePermissions -> UpdateImagePermissions -> Bool
$c/= :: UpdateImagePermissions -> UpdateImagePermissions -> Bool
== :: UpdateImagePermissions -> UpdateImagePermissions -> Bool
$c== :: UpdateImagePermissions -> UpdateImagePermissions -> Bool
Prelude.Eq, ReadPrec [UpdateImagePermissions]
ReadPrec UpdateImagePermissions
Int -> ReadS UpdateImagePermissions
ReadS [UpdateImagePermissions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateImagePermissions]
$creadListPrec :: ReadPrec [UpdateImagePermissions]
readPrec :: ReadPrec UpdateImagePermissions
$creadPrec :: ReadPrec UpdateImagePermissions
readList :: ReadS [UpdateImagePermissions]
$creadList :: ReadS [UpdateImagePermissions]
readsPrec :: Int -> ReadS UpdateImagePermissions
$creadsPrec :: Int -> ReadS UpdateImagePermissions
Prelude.Read, Int -> UpdateImagePermissions -> ShowS
[UpdateImagePermissions] -> ShowS
UpdateImagePermissions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateImagePermissions] -> ShowS
$cshowList :: [UpdateImagePermissions] -> ShowS
show :: UpdateImagePermissions -> String
$cshow :: UpdateImagePermissions -> String
showsPrec :: Int -> UpdateImagePermissions -> ShowS
$cshowsPrec :: Int -> UpdateImagePermissions -> ShowS
Prelude.Show, forall x. Rep UpdateImagePermissions x -> UpdateImagePermissions
forall x. UpdateImagePermissions -> Rep UpdateImagePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateImagePermissions x -> UpdateImagePermissions
$cfrom :: forall x. UpdateImagePermissions -> Rep UpdateImagePermissions x
Prelude.Generic)
newUpdateImagePermissions ::
Prelude.Text ->
Prelude.Text ->
ImagePermissions ->
UpdateImagePermissions
newUpdateImagePermissions :: Text -> Text -> ImagePermissions -> UpdateImagePermissions
newUpdateImagePermissions
Text
pName_
Text
pSharedAccountId_
ImagePermissions
pImagePermissions_ =
UpdateImagePermissions'
{ $sel:name:UpdateImagePermissions' :: Text
name = Text
pName_,
$sel:sharedAccountId:UpdateImagePermissions' :: Text
sharedAccountId = Text
pSharedAccountId_,
$sel:imagePermissions:UpdateImagePermissions' :: ImagePermissions
imagePermissions = ImagePermissions
pImagePermissions_
}
updateImagePermissions_name :: Lens.Lens' UpdateImagePermissions Prelude.Text
updateImagePermissions_name :: Lens' UpdateImagePermissions Text
updateImagePermissions_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePermissions' {Text
name :: Text
$sel:name:UpdateImagePermissions' :: UpdateImagePermissions -> Text
name} -> Text
name) (\s :: UpdateImagePermissions
s@UpdateImagePermissions' {} Text
a -> UpdateImagePermissions
s {$sel:name:UpdateImagePermissions' :: Text
name = Text
a} :: UpdateImagePermissions)
updateImagePermissions_sharedAccountId :: Lens.Lens' UpdateImagePermissions Prelude.Text
updateImagePermissions_sharedAccountId :: Lens' UpdateImagePermissions Text
updateImagePermissions_sharedAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePermissions' {Text
sharedAccountId :: Text
$sel:sharedAccountId:UpdateImagePermissions' :: UpdateImagePermissions -> Text
sharedAccountId} -> Text
sharedAccountId) (\s :: UpdateImagePermissions
s@UpdateImagePermissions' {} Text
a -> UpdateImagePermissions
s {$sel:sharedAccountId:UpdateImagePermissions' :: Text
sharedAccountId = Text
a} :: UpdateImagePermissions)
updateImagePermissions_imagePermissions :: Lens.Lens' UpdateImagePermissions ImagePermissions
updateImagePermissions_imagePermissions :: Lens' UpdateImagePermissions ImagePermissions
updateImagePermissions_imagePermissions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePermissions' {ImagePermissions
imagePermissions :: ImagePermissions
$sel:imagePermissions:UpdateImagePermissions' :: UpdateImagePermissions -> ImagePermissions
imagePermissions} -> ImagePermissions
imagePermissions) (\s :: UpdateImagePermissions
s@UpdateImagePermissions' {} ImagePermissions
a -> UpdateImagePermissions
s {$sel:imagePermissions:UpdateImagePermissions' :: ImagePermissions
imagePermissions = ImagePermissions
a} :: UpdateImagePermissions)
instance Core.AWSRequest UpdateImagePermissions where
type
AWSResponse UpdateImagePermissions =
UpdateImagePermissionsResponse
request :: (Service -> Service)
-> UpdateImagePermissions -> Request UpdateImagePermissions
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 UpdateImagePermissions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateImagePermissions)))
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 -> UpdateImagePermissionsResponse
UpdateImagePermissionsResponse'
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 UpdateImagePermissions where
hashWithSalt :: Int -> UpdateImagePermissions -> Int
hashWithSalt Int
_salt UpdateImagePermissions' {Text
ImagePermissions
imagePermissions :: ImagePermissions
sharedAccountId :: Text
name :: Text
$sel:imagePermissions:UpdateImagePermissions' :: UpdateImagePermissions -> ImagePermissions
$sel:sharedAccountId:UpdateImagePermissions' :: UpdateImagePermissions -> Text
$sel:name:UpdateImagePermissions' :: UpdateImagePermissions -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sharedAccountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImagePermissions
imagePermissions
instance Prelude.NFData UpdateImagePermissions where
rnf :: UpdateImagePermissions -> ()
rnf UpdateImagePermissions' {Text
ImagePermissions
imagePermissions :: ImagePermissions
sharedAccountId :: Text
name :: Text
$sel:imagePermissions:UpdateImagePermissions' :: UpdateImagePermissions -> ImagePermissions
$sel:sharedAccountId:UpdateImagePermissions' :: UpdateImagePermissions -> Text
$sel:name:UpdateImagePermissions' :: UpdateImagePermissions -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sharedAccountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImagePermissions
imagePermissions
instance Data.ToHeaders UpdateImagePermissions where
toHeaders :: UpdateImagePermissions -> 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
"PhotonAdminProxyService.UpdateImagePermissions" ::
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 UpdateImagePermissions where
toJSON :: UpdateImagePermissions -> Value
toJSON UpdateImagePermissions' {Text
ImagePermissions
imagePermissions :: ImagePermissions
sharedAccountId :: Text
name :: Text
$sel:imagePermissions:UpdateImagePermissions' :: UpdateImagePermissions -> ImagePermissions
$sel:sharedAccountId:UpdateImagePermissions' :: UpdateImagePermissions -> Text
$sel:name:UpdateImagePermissions' :: UpdateImagePermissions -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just
(Key
"SharedAccountId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sharedAccountId),
forall a. a -> Maybe a
Prelude.Just
(Key
"ImagePermissions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ImagePermissions
imagePermissions)
]
)
instance Data.ToPath UpdateImagePermissions where
toPath :: UpdateImagePermissions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateImagePermissions where
toQuery :: UpdateImagePermissions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateImagePermissionsResponse = UpdateImagePermissionsResponse'
{
UpdateImagePermissionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateImagePermissionsResponse
-> UpdateImagePermissionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateImagePermissionsResponse
-> UpdateImagePermissionsResponse -> Bool
$c/= :: UpdateImagePermissionsResponse
-> UpdateImagePermissionsResponse -> Bool
== :: UpdateImagePermissionsResponse
-> UpdateImagePermissionsResponse -> Bool
$c== :: UpdateImagePermissionsResponse
-> UpdateImagePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateImagePermissionsResponse]
ReadPrec UpdateImagePermissionsResponse
Int -> ReadS UpdateImagePermissionsResponse
ReadS [UpdateImagePermissionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateImagePermissionsResponse]
$creadListPrec :: ReadPrec [UpdateImagePermissionsResponse]
readPrec :: ReadPrec UpdateImagePermissionsResponse
$creadPrec :: ReadPrec UpdateImagePermissionsResponse
readList :: ReadS [UpdateImagePermissionsResponse]
$creadList :: ReadS [UpdateImagePermissionsResponse]
readsPrec :: Int -> ReadS UpdateImagePermissionsResponse
$creadsPrec :: Int -> ReadS UpdateImagePermissionsResponse
Prelude.Read, Int -> UpdateImagePermissionsResponse -> ShowS
[UpdateImagePermissionsResponse] -> ShowS
UpdateImagePermissionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateImagePermissionsResponse] -> ShowS
$cshowList :: [UpdateImagePermissionsResponse] -> ShowS
show :: UpdateImagePermissionsResponse -> String
$cshow :: UpdateImagePermissionsResponse -> String
showsPrec :: Int -> UpdateImagePermissionsResponse -> ShowS
$cshowsPrec :: Int -> UpdateImagePermissionsResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateImagePermissionsResponse x
-> UpdateImagePermissionsResponse
forall x.
UpdateImagePermissionsResponse
-> Rep UpdateImagePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateImagePermissionsResponse x
-> UpdateImagePermissionsResponse
$cfrom :: forall x.
UpdateImagePermissionsResponse
-> Rep UpdateImagePermissionsResponse x
Prelude.Generic)
newUpdateImagePermissionsResponse ::
Prelude.Int ->
UpdateImagePermissionsResponse
newUpdateImagePermissionsResponse :: Int -> UpdateImagePermissionsResponse
newUpdateImagePermissionsResponse Int
pHttpStatus_ =
UpdateImagePermissionsResponse'
{ $sel:httpStatus:UpdateImagePermissionsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateImagePermissionsResponse_httpStatus :: Lens.Lens' UpdateImagePermissionsResponse Prelude.Int
updateImagePermissionsResponse_httpStatus :: Lens' UpdateImagePermissionsResponse Int
updateImagePermissionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePermissionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateImagePermissionsResponse' :: UpdateImagePermissionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateImagePermissionsResponse
s@UpdateImagePermissionsResponse' {} Int
a -> UpdateImagePermissionsResponse
s {$sel:httpStatus:UpdateImagePermissionsResponse' :: Int
httpStatus = Int
a} :: UpdateImagePermissionsResponse)
instance
Prelude.NFData
UpdateImagePermissionsResponse
where
rnf :: UpdateImagePermissionsResponse -> ()
rnf UpdateImagePermissionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateImagePermissionsResponse' :: UpdateImagePermissionsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus