{-# 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.UpdateConnectionAliasPermission
(
UpdateConnectionAliasPermission (..),
newUpdateConnectionAliasPermission,
updateConnectionAliasPermission_aliasId,
updateConnectionAliasPermission_connectionAliasPermission,
UpdateConnectionAliasPermissionResponse (..),
newUpdateConnectionAliasPermissionResponse,
updateConnectionAliasPermissionResponse_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 UpdateConnectionAliasPermission = UpdateConnectionAliasPermission'
{
UpdateConnectionAliasPermission -> Text
aliasId :: Prelude.Text,
UpdateConnectionAliasPermission -> ConnectionAliasPermission
connectionAliasPermission :: ConnectionAliasPermission
}
deriving (UpdateConnectionAliasPermission
-> UpdateConnectionAliasPermission -> Bool
(UpdateConnectionAliasPermission
-> UpdateConnectionAliasPermission -> Bool)
-> (UpdateConnectionAliasPermission
-> UpdateConnectionAliasPermission -> Bool)
-> Eq UpdateConnectionAliasPermission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnectionAliasPermission
-> UpdateConnectionAliasPermission -> Bool
$c/= :: UpdateConnectionAliasPermission
-> UpdateConnectionAliasPermission -> Bool
== :: UpdateConnectionAliasPermission
-> UpdateConnectionAliasPermission -> Bool
$c== :: UpdateConnectionAliasPermission
-> UpdateConnectionAliasPermission -> Bool
Prelude.Eq, ReadPrec [UpdateConnectionAliasPermission]
ReadPrec UpdateConnectionAliasPermission
Int -> ReadS UpdateConnectionAliasPermission
ReadS [UpdateConnectionAliasPermission]
(Int -> ReadS UpdateConnectionAliasPermission)
-> ReadS [UpdateConnectionAliasPermission]
-> ReadPrec UpdateConnectionAliasPermission
-> ReadPrec [UpdateConnectionAliasPermission]
-> Read UpdateConnectionAliasPermission
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnectionAliasPermission]
$creadListPrec :: ReadPrec [UpdateConnectionAliasPermission]
readPrec :: ReadPrec UpdateConnectionAliasPermission
$creadPrec :: ReadPrec UpdateConnectionAliasPermission
readList :: ReadS [UpdateConnectionAliasPermission]
$creadList :: ReadS [UpdateConnectionAliasPermission]
readsPrec :: Int -> ReadS UpdateConnectionAliasPermission
$creadsPrec :: Int -> ReadS UpdateConnectionAliasPermission
Prelude.Read, Int -> UpdateConnectionAliasPermission -> ShowS
[UpdateConnectionAliasPermission] -> ShowS
UpdateConnectionAliasPermission -> String
(Int -> UpdateConnectionAliasPermission -> ShowS)
-> (UpdateConnectionAliasPermission -> String)
-> ([UpdateConnectionAliasPermission] -> ShowS)
-> Show UpdateConnectionAliasPermission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnectionAliasPermission] -> ShowS
$cshowList :: [UpdateConnectionAliasPermission] -> ShowS
show :: UpdateConnectionAliasPermission -> String
$cshow :: UpdateConnectionAliasPermission -> String
showsPrec :: Int -> UpdateConnectionAliasPermission -> ShowS
$cshowsPrec :: Int -> UpdateConnectionAliasPermission -> ShowS
Prelude.Show, (forall x.
UpdateConnectionAliasPermission
-> Rep UpdateConnectionAliasPermission x)
-> (forall x.
Rep UpdateConnectionAliasPermission x
-> UpdateConnectionAliasPermission)
-> Generic UpdateConnectionAliasPermission
forall x.
Rep UpdateConnectionAliasPermission x
-> UpdateConnectionAliasPermission
forall x.
UpdateConnectionAliasPermission
-> Rep UpdateConnectionAliasPermission x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConnectionAliasPermission x
-> UpdateConnectionAliasPermission
$cfrom :: forall x.
UpdateConnectionAliasPermission
-> Rep UpdateConnectionAliasPermission x
Prelude.Generic)
newUpdateConnectionAliasPermission ::
Prelude.Text ->
ConnectionAliasPermission ->
UpdateConnectionAliasPermission
newUpdateConnectionAliasPermission :: Text
-> ConnectionAliasPermission -> UpdateConnectionAliasPermission
newUpdateConnectionAliasPermission
Text
pAliasId_
ConnectionAliasPermission
pConnectionAliasPermission_ =
UpdateConnectionAliasPermission' :: Text
-> ConnectionAliasPermission -> UpdateConnectionAliasPermission
UpdateConnectionAliasPermission'
{ $sel:aliasId:UpdateConnectionAliasPermission' :: Text
aliasId =
Text
pAliasId_,
$sel:connectionAliasPermission:UpdateConnectionAliasPermission' :: ConnectionAliasPermission
connectionAliasPermission =
ConnectionAliasPermission
pConnectionAliasPermission_
}
updateConnectionAliasPermission_aliasId :: Lens.Lens' UpdateConnectionAliasPermission Prelude.Text
updateConnectionAliasPermission_aliasId :: (Text -> f Text)
-> UpdateConnectionAliasPermission
-> f UpdateConnectionAliasPermission
updateConnectionAliasPermission_aliasId = (UpdateConnectionAliasPermission -> Text)
-> (UpdateConnectionAliasPermission
-> Text -> UpdateConnectionAliasPermission)
-> Lens
UpdateConnectionAliasPermission
UpdateConnectionAliasPermission
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionAliasPermission' {Text
aliasId :: Text
$sel:aliasId:UpdateConnectionAliasPermission' :: UpdateConnectionAliasPermission -> Text
aliasId} -> Text
aliasId) (\s :: UpdateConnectionAliasPermission
s@UpdateConnectionAliasPermission' {} Text
a -> UpdateConnectionAliasPermission
s {$sel:aliasId:UpdateConnectionAliasPermission' :: Text
aliasId = Text
a} :: UpdateConnectionAliasPermission)
updateConnectionAliasPermission_connectionAliasPermission :: Lens.Lens' UpdateConnectionAliasPermission ConnectionAliasPermission
updateConnectionAliasPermission_connectionAliasPermission :: (ConnectionAliasPermission -> f ConnectionAliasPermission)
-> UpdateConnectionAliasPermission
-> f UpdateConnectionAliasPermission
updateConnectionAliasPermission_connectionAliasPermission = (UpdateConnectionAliasPermission -> ConnectionAliasPermission)
-> (UpdateConnectionAliasPermission
-> ConnectionAliasPermission -> UpdateConnectionAliasPermission)
-> Lens
UpdateConnectionAliasPermission
UpdateConnectionAliasPermission
ConnectionAliasPermission
ConnectionAliasPermission
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionAliasPermission' {ConnectionAliasPermission
connectionAliasPermission :: ConnectionAliasPermission
$sel:connectionAliasPermission:UpdateConnectionAliasPermission' :: UpdateConnectionAliasPermission -> ConnectionAliasPermission
connectionAliasPermission} -> ConnectionAliasPermission
connectionAliasPermission) (\s :: UpdateConnectionAliasPermission
s@UpdateConnectionAliasPermission' {} ConnectionAliasPermission
a -> UpdateConnectionAliasPermission
s {$sel:connectionAliasPermission:UpdateConnectionAliasPermission' :: ConnectionAliasPermission
connectionAliasPermission = ConnectionAliasPermission
a} :: UpdateConnectionAliasPermission)
instance
Core.AWSRequest
UpdateConnectionAliasPermission
where
type
AWSResponse UpdateConnectionAliasPermission =
UpdateConnectionAliasPermissionResponse
request :: UpdateConnectionAliasPermission
-> Request UpdateConnectionAliasPermission
request = Service
-> UpdateConnectionAliasPermission
-> Request UpdateConnectionAliasPermission
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateConnectionAliasPermission
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateConnectionAliasPermission)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateConnectionAliasPermission))
-> Logger
-> Service
-> Proxy UpdateConnectionAliasPermission
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateConnectionAliasPermission)))
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 -> UpdateConnectionAliasPermissionResponse
UpdateConnectionAliasPermissionResponse'
(Int -> UpdateConnectionAliasPermissionResponse)
-> Either String Int
-> Either String UpdateConnectionAliasPermissionResponse
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
UpdateConnectionAliasPermission
instance
Prelude.NFData
UpdateConnectionAliasPermission
instance
Core.ToHeaders
UpdateConnectionAliasPermission
where
toHeaders :: UpdateConnectionAliasPermission -> ResponseHeaders
toHeaders =
ResponseHeaders
-> UpdateConnectionAliasPermission -> 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.UpdateConnectionAliasPermission" ::
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 UpdateConnectionAliasPermission where
toJSON :: UpdateConnectionAliasPermission -> Value
toJSON UpdateConnectionAliasPermission' {Text
ConnectionAliasPermission
connectionAliasPermission :: ConnectionAliasPermission
aliasId :: Text
$sel:connectionAliasPermission:UpdateConnectionAliasPermission' :: UpdateConnectionAliasPermission -> ConnectionAliasPermission
$sel:aliasId:UpdateConnectionAliasPermission' :: UpdateConnectionAliasPermission -> 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
"AliasId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
aliasId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ConnectionAliasPermission"
Text -> ConnectionAliasPermission -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectionAliasPermission
connectionAliasPermission
)
]
)
instance Core.ToPath UpdateConnectionAliasPermission where
toPath :: UpdateConnectionAliasPermission -> ByteString
toPath = ByteString -> UpdateConnectionAliasPermission -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateConnectionAliasPermission where
toQuery :: UpdateConnectionAliasPermission -> QueryString
toQuery = QueryString -> UpdateConnectionAliasPermission -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateConnectionAliasPermissionResponse = UpdateConnectionAliasPermissionResponse'
{
UpdateConnectionAliasPermissionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateConnectionAliasPermissionResponse
-> UpdateConnectionAliasPermissionResponse -> Bool
(UpdateConnectionAliasPermissionResponse
-> UpdateConnectionAliasPermissionResponse -> Bool)
-> (UpdateConnectionAliasPermissionResponse
-> UpdateConnectionAliasPermissionResponse -> Bool)
-> Eq UpdateConnectionAliasPermissionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnectionAliasPermissionResponse
-> UpdateConnectionAliasPermissionResponse -> Bool
$c/= :: UpdateConnectionAliasPermissionResponse
-> UpdateConnectionAliasPermissionResponse -> Bool
== :: UpdateConnectionAliasPermissionResponse
-> UpdateConnectionAliasPermissionResponse -> Bool
$c== :: UpdateConnectionAliasPermissionResponse
-> UpdateConnectionAliasPermissionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateConnectionAliasPermissionResponse]
ReadPrec UpdateConnectionAliasPermissionResponse
Int -> ReadS UpdateConnectionAliasPermissionResponse
ReadS [UpdateConnectionAliasPermissionResponse]
(Int -> ReadS UpdateConnectionAliasPermissionResponse)
-> ReadS [UpdateConnectionAliasPermissionResponse]
-> ReadPrec UpdateConnectionAliasPermissionResponse
-> ReadPrec [UpdateConnectionAliasPermissionResponse]
-> Read UpdateConnectionAliasPermissionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnectionAliasPermissionResponse]
$creadListPrec :: ReadPrec [UpdateConnectionAliasPermissionResponse]
readPrec :: ReadPrec UpdateConnectionAliasPermissionResponse
$creadPrec :: ReadPrec UpdateConnectionAliasPermissionResponse
readList :: ReadS [UpdateConnectionAliasPermissionResponse]
$creadList :: ReadS [UpdateConnectionAliasPermissionResponse]
readsPrec :: Int -> ReadS UpdateConnectionAliasPermissionResponse
$creadsPrec :: Int -> ReadS UpdateConnectionAliasPermissionResponse
Prelude.Read, Int -> UpdateConnectionAliasPermissionResponse -> ShowS
[UpdateConnectionAliasPermissionResponse] -> ShowS
UpdateConnectionAliasPermissionResponse -> String
(Int -> UpdateConnectionAliasPermissionResponse -> ShowS)
-> (UpdateConnectionAliasPermissionResponse -> String)
-> ([UpdateConnectionAliasPermissionResponse] -> ShowS)
-> Show UpdateConnectionAliasPermissionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnectionAliasPermissionResponse] -> ShowS
$cshowList :: [UpdateConnectionAliasPermissionResponse] -> ShowS
show :: UpdateConnectionAliasPermissionResponse -> String
$cshow :: UpdateConnectionAliasPermissionResponse -> String
showsPrec :: Int -> UpdateConnectionAliasPermissionResponse -> ShowS
$cshowsPrec :: Int -> UpdateConnectionAliasPermissionResponse -> ShowS
Prelude.Show, (forall x.
UpdateConnectionAliasPermissionResponse
-> Rep UpdateConnectionAliasPermissionResponse x)
-> (forall x.
Rep UpdateConnectionAliasPermissionResponse x
-> UpdateConnectionAliasPermissionResponse)
-> Generic UpdateConnectionAliasPermissionResponse
forall x.
Rep UpdateConnectionAliasPermissionResponse x
-> UpdateConnectionAliasPermissionResponse
forall x.
UpdateConnectionAliasPermissionResponse
-> Rep UpdateConnectionAliasPermissionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConnectionAliasPermissionResponse x
-> UpdateConnectionAliasPermissionResponse
$cfrom :: forall x.
UpdateConnectionAliasPermissionResponse
-> Rep UpdateConnectionAliasPermissionResponse x
Prelude.Generic)
newUpdateConnectionAliasPermissionResponse ::
Prelude.Int ->
UpdateConnectionAliasPermissionResponse
newUpdateConnectionAliasPermissionResponse :: Int -> UpdateConnectionAliasPermissionResponse
newUpdateConnectionAliasPermissionResponse
Int
pHttpStatus_ =
UpdateConnectionAliasPermissionResponse' :: Int -> UpdateConnectionAliasPermissionResponse
UpdateConnectionAliasPermissionResponse'
{ $sel:httpStatus:UpdateConnectionAliasPermissionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateConnectionAliasPermissionResponse_httpStatus :: Lens.Lens' UpdateConnectionAliasPermissionResponse Prelude.Int
updateConnectionAliasPermissionResponse_httpStatus :: (Int -> f Int)
-> UpdateConnectionAliasPermissionResponse
-> f UpdateConnectionAliasPermissionResponse
updateConnectionAliasPermissionResponse_httpStatus = (UpdateConnectionAliasPermissionResponse -> Int)
-> (UpdateConnectionAliasPermissionResponse
-> Int -> UpdateConnectionAliasPermissionResponse)
-> Lens
UpdateConnectionAliasPermissionResponse
UpdateConnectionAliasPermissionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionAliasPermissionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateConnectionAliasPermissionResponse' :: UpdateConnectionAliasPermissionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateConnectionAliasPermissionResponse
s@UpdateConnectionAliasPermissionResponse' {} Int
a -> UpdateConnectionAliasPermissionResponse
s {$sel:httpStatus:UpdateConnectionAliasPermissionResponse' :: Int
httpStatus = Int
a} :: UpdateConnectionAliasPermissionResponse)
instance
Prelude.NFData
UpdateConnectionAliasPermissionResponse