{-# 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.DeleteImagePermissions
(
DeleteImagePermissions (..),
newDeleteImagePermissions,
deleteImagePermissions_name,
deleteImagePermissions_sharedAccountId,
DeleteImagePermissionsResponse (..),
newDeleteImagePermissionsResponse,
deleteImagePermissionsResponse_httpStatus,
)
where
import Amazonka.AppStream.Types
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
data DeleteImagePermissions = DeleteImagePermissions'
{
DeleteImagePermissions -> Text
name :: Prelude.Text,
DeleteImagePermissions -> Text
sharedAccountId :: Prelude.Text
}
deriving (DeleteImagePermissions -> DeleteImagePermissions -> Bool
(DeleteImagePermissions -> DeleteImagePermissions -> Bool)
-> (DeleteImagePermissions -> DeleteImagePermissions -> Bool)
-> Eq DeleteImagePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteImagePermissions -> DeleteImagePermissions -> Bool
$c/= :: DeleteImagePermissions -> DeleteImagePermissions -> Bool
== :: DeleteImagePermissions -> DeleteImagePermissions -> Bool
$c== :: DeleteImagePermissions -> DeleteImagePermissions -> Bool
Prelude.Eq, ReadPrec [DeleteImagePermissions]
ReadPrec DeleteImagePermissions
Int -> ReadS DeleteImagePermissions
ReadS [DeleteImagePermissions]
(Int -> ReadS DeleteImagePermissions)
-> ReadS [DeleteImagePermissions]
-> ReadPrec DeleteImagePermissions
-> ReadPrec [DeleteImagePermissions]
-> Read DeleteImagePermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteImagePermissions]
$creadListPrec :: ReadPrec [DeleteImagePermissions]
readPrec :: ReadPrec DeleteImagePermissions
$creadPrec :: ReadPrec DeleteImagePermissions
readList :: ReadS [DeleteImagePermissions]
$creadList :: ReadS [DeleteImagePermissions]
readsPrec :: Int -> ReadS DeleteImagePermissions
$creadsPrec :: Int -> ReadS DeleteImagePermissions
Prelude.Read, Int -> DeleteImagePermissions -> ShowS
[DeleteImagePermissions] -> ShowS
DeleteImagePermissions -> String
(Int -> DeleteImagePermissions -> ShowS)
-> (DeleteImagePermissions -> String)
-> ([DeleteImagePermissions] -> ShowS)
-> Show DeleteImagePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteImagePermissions] -> ShowS
$cshowList :: [DeleteImagePermissions] -> ShowS
show :: DeleteImagePermissions -> String
$cshow :: DeleteImagePermissions -> String
showsPrec :: Int -> DeleteImagePermissions -> ShowS
$cshowsPrec :: Int -> DeleteImagePermissions -> ShowS
Prelude.Show, (forall x. DeleteImagePermissions -> Rep DeleteImagePermissions x)
-> (forall x.
Rep DeleteImagePermissions x -> DeleteImagePermissions)
-> Generic DeleteImagePermissions
forall x. Rep DeleteImagePermissions x -> DeleteImagePermissions
forall x. DeleteImagePermissions -> Rep DeleteImagePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteImagePermissions x -> DeleteImagePermissions
$cfrom :: forall x. DeleteImagePermissions -> Rep DeleteImagePermissions x
Prelude.Generic)
newDeleteImagePermissions ::
Prelude.Text ->
Prelude.Text ->
DeleteImagePermissions
newDeleteImagePermissions :: Text -> Text -> DeleteImagePermissions
newDeleteImagePermissions Text
pName_ Text
pSharedAccountId_ =
DeleteImagePermissions' :: Text -> Text -> DeleteImagePermissions
DeleteImagePermissions'
{ $sel:name:DeleteImagePermissions' :: Text
name = Text
pName_,
$sel:sharedAccountId:DeleteImagePermissions' :: Text
sharedAccountId = Text
pSharedAccountId_
}
deleteImagePermissions_name :: Lens.Lens' DeleteImagePermissions Prelude.Text
deleteImagePermissions_name :: (Text -> f Text)
-> DeleteImagePermissions -> f DeleteImagePermissions
deleteImagePermissions_name = (DeleteImagePermissions -> Text)
-> (DeleteImagePermissions -> Text -> DeleteImagePermissions)
-> Lens DeleteImagePermissions DeleteImagePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImagePermissions' {Text
name :: Text
$sel:name:DeleteImagePermissions' :: DeleteImagePermissions -> Text
name} -> Text
name) (\s :: DeleteImagePermissions
s@DeleteImagePermissions' {} Text
a -> DeleteImagePermissions
s {$sel:name:DeleteImagePermissions' :: Text
name = Text
a} :: DeleteImagePermissions)
deleteImagePermissions_sharedAccountId :: Lens.Lens' DeleteImagePermissions Prelude.Text
deleteImagePermissions_sharedAccountId :: (Text -> f Text)
-> DeleteImagePermissions -> f DeleteImagePermissions
deleteImagePermissions_sharedAccountId = (DeleteImagePermissions -> Text)
-> (DeleteImagePermissions -> Text -> DeleteImagePermissions)
-> Lens DeleteImagePermissions DeleteImagePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImagePermissions' {Text
sharedAccountId :: Text
$sel:sharedAccountId:DeleteImagePermissions' :: DeleteImagePermissions -> Text
sharedAccountId} -> Text
sharedAccountId) (\s :: DeleteImagePermissions
s@DeleteImagePermissions' {} Text
a -> DeleteImagePermissions
s {$sel:sharedAccountId:DeleteImagePermissions' :: Text
sharedAccountId = Text
a} :: DeleteImagePermissions)
instance Core.AWSRequest DeleteImagePermissions where
type
AWSResponse DeleteImagePermissions =
DeleteImagePermissionsResponse
request :: DeleteImagePermissions -> Request DeleteImagePermissions
request = Service -> DeleteImagePermissions -> Request DeleteImagePermissions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteImagePermissions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteImagePermissions)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteImagePermissions))
-> Logger
-> Service
-> Proxy DeleteImagePermissions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteImagePermissions)))
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 -> DeleteImagePermissionsResponse
DeleteImagePermissionsResponse'
(Int -> DeleteImagePermissionsResponse)
-> Either String Int
-> Either String DeleteImagePermissionsResponse
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 DeleteImagePermissions
instance Prelude.NFData DeleteImagePermissions
instance Core.ToHeaders DeleteImagePermissions where
toHeaders :: DeleteImagePermissions -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteImagePermissions -> 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
"PhotonAdminProxyService.DeleteImagePermissions" ::
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 DeleteImagePermissions where
toJSON :: DeleteImagePermissions -> Value
toJSON DeleteImagePermissions' {Text
sharedAccountId :: Text
name :: Text
$sel:sharedAccountId:DeleteImagePermissions' :: DeleteImagePermissions -> Text
$sel:name:DeleteImagePermissions' :: DeleteImagePermissions -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
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 DeleteImagePermissions where
toPath :: DeleteImagePermissions -> ByteString
toPath = ByteString -> DeleteImagePermissions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteImagePermissions where
toQuery :: DeleteImagePermissions -> QueryString
toQuery = QueryString -> DeleteImagePermissions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteImagePermissionsResponse = DeleteImagePermissionsResponse'
{
DeleteImagePermissionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteImagePermissionsResponse
-> DeleteImagePermissionsResponse -> Bool
(DeleteImagePermissionsResponse
-> DeleteImagePermissionsResponse -> Bool)
-> (DeleteImagePermissionsResponse
-> DeleteImagePermissionsResponse -> Bool)
-> Eq DeleteImagePermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteImagePermissionsResponse
-> DeleteImagePermissionsResponse -> Bool
$c/= :: DeleteImagePermissionsResponse
-> DeleteImagePermissionsResponse -> Bool
== :: DeleteImagePermissionsResponse
-> DeleteImagePermissionsResponse -> Bool
$c== :: DeleteImagePermissionsResponse
-> DeleteImagePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [DeleteImagePermissionsResponse]
ReadPrec DeleteImagePermissionsResponse
Int -> ReadS DeleteImagePermissionsResponse
ReadS [DeleteImagePermissionsResponse]
(Int -> ReadS DeleteImagePermissionsResponse)
-> ReadS [DeleteImagePermissionsResponse]
-> ReadPrec DeleteImagePermissionsResponse
-> ReadPrec [DeleteImagePermissionsResponse]
-> Read DeleteImagePermissionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteImagePermissionsResponse]
$creadListPrec :: ReadPrec [DeleteImagePermissionsResponse]
readPrec :: ReadPrec DeleteImagePermissionsResponse
$creadPrec :: ReadPrec DeleteImagePermissionsResponse
readList :: ReadS [DeleteImagePermissionsResponse]
$creadList :: ReadS [DeleteImagePermissionsResponse]
readsPrec :: Int -> ReadS DeleteImagePermissionsResponse
$creadsPrec :: Int -> ReadS DeleteImagePermissionsResponse
Prelude.Read, Int -> DeleteImagePermissionsResponse -> ShowS
[DeleteImagePermissionsResponse] -> ShowS
DeleteImagePermissionsResponse -> String
(Int -> DeleteImagePermissionsResponse -> ShowS)
-> (DeleteImagePermissionsResponse -> String)
-> ([DeleteImagePermissionsResponse] -> ShowS)
-> Show DeleteImagePermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteImagePermissionsResponse] -> ShowS
$cshowList :: [DeleteImagePermissionsResponse] -> ShowS
show :: DeleteImagePermissionsResponse -> String
$cshow :: DeleteImagePermissionsResponse -> String
showsPrec :: Int -> DeleteImagePermissionsResponse -> ShowS
$cshowsPrec :: Int -> DeleteImagePermissionsResponse -> ShowS
Prelude.Show, (forall x.
DeleteImagePermissionsResponse
-> Rep DeleteImagePermissionsResponse x)
-> (forall x.
Rep DeleteImagePermissionsResponse x
-> DeleteImagePermissionsResponse)
-> Generic DeleteImagePermissionsResponse
forall x.
Rep DeleteImagePermissionsResponse x
-> DeleteImagePermissionsResponse
forall x.
DeleteImagePermissionsResponse
-> Rep DeleteImagePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteImagePermissionsResponse x
-> DeleteImagePermissionsResponse
$cfrom :: forall x.
DeleteImagePermissionsResponse
-> Rep DeleteImagePermissionsResponse x
Prelude.Generic)
newDeleteImagePermissionsResponse ::
Prelude.Int ->
DeleteImagePermissionsResponse
newDeleteImagePermissionsResponse :: Int -> DeleteImagePermissionsResponse
newDeleteImagePermissionsResponse Int
pHttpStatus_ =
DeleteImagePermissionsResponse' :: Int -> DeleteImagePermissionsResponse
DeleteImagePermissionsResponse'
{ $sel:httpStatus:DeleteImagePermissionsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteImagePermissionsResponse_httpStatus :: Lens.Lens' DeleteImagePermissionsResponse Prelude.Int
deleteImagePermissionsResponse_httpStatus :: (Int -> f Int)
-> DeleteImagePermissionsResponse
-> f DeleteImagePermissionsResponse
deleteImagePermissionsResponse_httpStatus = (DeleteImagePermissionsResponse -> Int)
-> (DeleteImagePermissionsResponse
-> Int -> DeleteImagePermissionsResponse)
-> Lens
DeleteImagePermissionsResponse
DeleteImagePermissionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImagePermissionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteImagePermissionsResponse' :: DeleteImagePermissionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteImagePermissionsResponse
s@DeleteImagePermissionsResponse' {} Int
a -> DeleteImagePermissionsResponse
s {$sel:httpStatus:DeleteImagePermissionsResponse' :: Int
httpStatus = Int
a} :: DeleteImagePermissionsResponse)
instance
Prelude.NFData
DeleteImagePermissionsResponse