{-# 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.EMR.CreateStudioSessionMapping
(
CreateStudioSessionMapping (..),
newCreateStudioSessionMapping,
createStudioSessionMapping_identityId,
createStudioSessionMapping_identityName,
createStudioSessionMapping_studioId,
createStudioSessionMapping_identityType,
createStudioSessionMapping_sessionPolicyArn,
CreateStudioSessionMappingResponse (..),
newCreateStudioSessionMappingResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types
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 CreateStudioSessionMapping = CreateStudioSessionMapping'
{
CreateStudioSessionMapping -> Maybe Text
identityId :: Prelude.Maybe Prelude.Text,
CreateStudioSessionMapping -> Maybe Text
identityName :: Prelude.Maybe Prelude.Text,
CreateStudioSessionMapping -> Text
studioId :: Prelude.Text,
CreateStudioSessionMapping -> IdentityType
identityType :: IdentityType,
CreateStudioSessionMapping -> Text
sessionPolicyArn :: Prelude.Text
}
deriving (CreateStudioSessionMapping -> CreateStudioSessionMapping -> Bool
(CreateStudioSessionMapping -> CreateStudioSessionMapping -> Bool)
-> (CreateStudioSessionMapping
-> CreateStudioSessionMapping -> Bool)
-> Eq CreateStudioSessionMapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStudioSessionMapping -> CreateStudioSessionMapping -> Bool
$c/= :: CreateStudioSessionMapping -> CreateStudioSessionMapping -> Bool
== :: CreateStudioSessionMapping -> CreateStudioSessionMapping -> Bool
$c== :: CreateStudioSessionMapping -> CreateStudioSessionMapping -> Bool
Prelude.Eq, ReadPrec [CreateStudioSessionMapping]
ReadPrec CreateStudioSessionMapping
Int -> ReadS CreateStudioSessionMapping
ReadS [CreateStudioSessionMapping]
(Int -> ReadS CreateStudioSessionMapping)
-> ReadS [CreateStudioSessionMapping]
-> ReadPrec CreateStudioSessionMapping
-> ReadPrec [CreateStudioSessionMapping]
-> Read CreateStudioSessionMapping
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStudioSessionMapping]
$creadListPrec :: ReadPrec [CreateStudioSessionMapping]
readPrec :: ReadPrec CreateStudioSessionMapping
$creadPrec :: ReadPrec CreateStudioSessionMapping
readList :: ReadS [CreateStudioSessionMapping]
$creadList :: ReadS [CreateStudioSessionMapping]
readsPrec :: Int -> ReadS CreateStudioSessionMapping
$creadsPrec :: Int -> ReadS CreateStudioSessionMapping
Prelude.Read, Int -> CreateStudioSessionMapping -> ShowS
[CreateStudioSessionMapping] -> ShowS
CreateStudioSessionMapping -> String
(Int -> CreateStudioSessionMapping -> ShowS)
-> (CreateStudioSessionMapping -> String)
-> ([CreateStudioSessionMapping] -> ShowS)
-> Show CreateStudioSessionMapping
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStudioSessionMapping] -> ShowS
$cshowList :: [CreateStudioSessionMapping] -> ShowS
show :: CreateStudioSessionMapping -> String
$cshow :: CreateStudioSessionMapping -> String
showsPrec :: Int -> CreateStudioSessionMapping -> ShowS
$cshowsPrec :: Int -> CreateStudioSessionMapping -> ShowS
Prelude.Show, (forall x.
CreateStudioSessionMapping -> Rep CreateStudioSessionMapping x)
-> (forall x.
Rep CreateStudioSessionMapping x -> CreateStudioSessionMapping)
-> Generic CreateStudioSessionMapping
forall x.
Rep CreateStudioSessionMapping x -> CreateStudioSessionMapping
forall x.
CreateStudioSessionMapping -> Rep CreateStudioSessionMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateStudioSessionMapping x -> CreateStudioSessionMapping
$cfrom :: forall x.
CreateStudioSessionMapping -> Rep CreateStudioSessionMapping x
Prelude.Generic)
newCreateStudioSessionMapping ::
Prelude.Text ->
IdentityType ->
Prelude.Text ->
CreateStudioSessionMapping
newCreateStudioSessionMapping :: Text -> IdentityType -> Text -> CreateStudioSessionMapping
newCreateStudioSessionMapping
Text
pStudioId_
IdentityType
pIdentityType_
Text
pSessionPolicyArn_ =
CreateStudioSessionMapping' :: Maybe Text
-> Maybe Text
-> Text
-> IdentityType
-> Text
-> CreateStudioSessionMapping
CreateStudioSessionMapping'
{ $sel:identityId:CreateStudioSessionMapping' :: Maybe Text
identityId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identityName:CreateStudioSessionMapping' :: Maybe Text
identityName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:studioId:CreateStudioSessionMapping' :: Text
studioId = Text
pStudioId_,
$sel:identityType:CreateStudioSessionMapping' :: IdentityType
identityType = IdentityType
pIdentityType_,
$sel:sessionPolicyArn:CreateStudioSessionMapping' :: Text
sessionPolicyArn = Text
pSessionPolicyArn_
}
createStudioSessionMapping_identityId :: Lens.Lens' CreateStudioSessionMapping (Prelude.Maybe Prelude.Text)
createStudioSessionMapping_identityId :: (Maybe Text -> f (Maybe Text))
-> CreateStudioSessionMapping -> f CreateStudioSessionMapping
createStudioSessionMapping_identityId = (CreateStudioSessionMapping -> Maybe Text)
-> (CreateStudioSessionMapping
-> Maybe Text -> CreateStudioSessionMapping)
-> Lens
CreateStudioSessionMapping
CreateStudioSessionMapping
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStudioSessionMapping' {Maybe Text
identityId :: Maybe Text
$sel:identityId:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Maybe Text
identityId} -> Maybe Text
identityId) (\s :: CreateStudioSessionMapping
s@CreateStudioSessionMapping' {} Maybe Text
a -> CreateStudioSessionMapping
s {$sel:identityId:CreateStudioSessionMapping' :: Maybe Text
identityId = Maybe Text
a} :: CreateStudioSessionMapping)
createStudioSessionMapping_identityName :: Lens.Lens' CreateStudioSessionMapping (Prelude.Maybe Prelude.Text)
createStudioSessionMapping_identityName :: (Maybe Text -> f (Maybe Text))
-> CreateStudioSessionMapping -> f CreateStudioSessionMapping
createStudioSessionMapping_identityName = (CreateStudioSessionMapping -> Maybe Text)
-> (CreateStudioSessionMapping
-> Maybe Text -> CreateStudioSessionMapping)
-> Lens
CreateStudioSessionMapping
CreateStudioSessionMapping
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStudioSessionMapping' {Maybe Text
identityName :: Maybe Text
$sel:identityName:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Maybe Text
identityName} -> Maybe Text
identityName) (\s :: CreateStudioSessionMapping
s@CreateStudioSessionMapping' {} Maybe Text
a -> CreateStudioSessionMapping
s {$sel:identityName:CreateStudioSessionMapping' :: Maybe Text
identityName = Maybe Text
a} :: CreateStudioSessionMapping)
createStudioSessionMapping_studioId :: Lens.Lens' CreateStudioSessionMapping Prelude.Text
createStudioSessionMapping_studioId :: (Text -> f Text)
-> CreateStudioSessionMapping -> f CreateStudioSessionMapping
createStudioSessionMapping_studioId = (CreateStudioSessionMapping -> Text)
-> (CreateStudioSessionMapping
-> Text -> CreateStudioSessionMapping)
-> Lens
CreateStudioSessionMapping CreateStudioSessionMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStudioSessionMapping' {Text
studioId :: Text
$sel:studioId:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Text
studioId} -> Text
studioId) (\s :: CreateStudioSessionMapping
s@CreateStudioSessionMapping' {} Text
a -> CreateStudioSessionMapping
s {$sel:studioId:CreateStudioSessionMapping' :: Text
studioId = Text
a} :: CreateStudioSessionMapping)
createStudioSessionMapping_identityType :: Lens.Lens' CreateStudioSessionMapping IdentityType
createStudioSessionMapping_identityType :: (IdentityType -> f IdentityType)
-> CreateStudioSessionMapping -> f CreateStudioSessionMapping
createStudioSessionMapping_identityType = (CreateStudioSessionMapping -> IdentityType)
-> (CreateStudioSessionMapping
-> IdentityType -> CreateStudioSessionMapping)
-> Lens
CreateStudioSessionMapping
CreateStudioSessionMapping
IdentityType
IdentityType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStudioSessionMapping' {IdentityType
identityType :: IdentityType
$sel:identityType:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> IdentityType
identityType} -> IdentityType
identityType) (\s :: CreateStudioSessionMapping
s@CreateStudioSessionMapping' {} IdentityType
a -> CreateStudioSessionMapping
s {$sel:identityType:CreateStudioSessionMapping' :: IdentityType
identityType = IdentityType
a} :: CreateStudioSessionMapping)
createStudioSessionMapping_sessionPolicyArn :: Lens.Lens' CreateStudioSessionMapping Prelude.Text
createStudioSessionMapping_sessionPolicyArn :: (Text -> f Text)
-> CreateStudioSessionMapping -> f CreateStudioSessionMapping
createStudioSessionMapping_sessionPolicyArn = (CreateStudioSessionMapping -> Text)
-> (CreateStudioSessionMapping
-> Text -> CreateStudioSessionMapping)
-> Lens
CreateStudioSessionMapping CreateStudioSessionMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStudioSessionMapping' {Text
sessionPolicyArn :: Text
$sel:sessionPolicyArn:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Text
sessionPolicyArn} -> Text
sessionPolicyArn) (\s :: CreateStudioSessionMapping
s@CreateStudioSessionMapping' {} Text
a -> CreateStudioSessionMapping
s {$sel:sessionPolicyArn:CreateStudioSessionMapping' :: Text
sessionPolicyArn = Text
a} :: CreateStudioSessionMapping)
instance Core.AWSRequest CreateStudioSessionMapping where
type
AWSResponse CreateStudioSessionMapping =
CreateStudioSessionMappingResponse
request :: CreateStudioSessionMapping -> Request CreateStudioSessionMapping
request = Service
-> CreateStudioSessionMapping -> Request CreateStudioSessionMapping
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateStudioSessionMapping
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateStudioSessionMapping)))
response =
AWSResponse CreateStudioSessionMapping
-> Logger
-> Service
-> Proxy CreateStudioSessionMapping
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateStudioSessionMapping)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse CreateStudioSessionMapping
CreateStudioSessionMappingResponse
CreateStudioSessionMappingResponse'
instance Prelude.Hashable CreateStudioSessionMapping
instance Prelude.NFData CreateStudioSessionMapping
instance Core.ToHeaders CreateStudioSessionMapping where
toHeaders :: CreateStudioSessionMapping -> [Header]
toHeaders =
[Header] -> CreateStudioSessionMapping -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"ElasticMapReduce.CreateStudioSessionMapping" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateStudioSessionMapping where
toJSON :: CreateStudioSessionMapping -> Value
toJSON CreateStudioSessionMapping' {Maybe Text
Text
IdentityType
sessionPolicyArn :: Text
identityType :: IdentityType
studioId :: Text
identityName :: Maybe Text
identityId :: Maybe Text
$sel:sessionPolicyArn:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Text
$sel:identityType:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> IdentityType
$sel:studioId:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Text
$sel:identityName:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Maybe Text
$sel:identityId:CreateStudioSessionMapping' :: CreateStudioSessionMapping -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IdentityId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identityId,
(Text
"IdentityName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
identityName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StudioId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
studioId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IdentityType" Text -> IdentityType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= IdentityType
identityType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SessionPolicyArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sessionPolicyArn)
]
)
instance Core.ToPath CreateStudioSessionMapping where
toPath :: CreateStudioSessionMapping -> ByteString
toPath = ByteString -> CreateStudioSessionMapping -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateStudioSessionMapping where
toQuery :: CreateStudioSessionMapping -> QueryString
toQuery = QueryString -> CreateStudioSessionMapping -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateStudioSessionMappingResponse = CreateStudioSessionMappingResponse'
{
}
deriving (CreateStudioSessionMappingResponse
-> CreateStudioSessionMappingResponse -> Bool
(CreateStudioSessionMappingResponse
-> CreateStudioSessionMappingResponse -> Bool)
-> (CreateStudioSessionMappingResponse
-> CreateStudioSessionMappingResponse -> Bool)
-> Eq CreateStudioSessionMappingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStudioSessionMappingResponse
-> CreateStudioSessionMappingResponse -> Bool
$c/= :: CreateStudioSessionMappingResponse
-> CreateStudioSessionMappingResponse -> Bool
== :: CreateStudioSessionMappingResponse
-> CreateStudioSessionMappingResponse -> Bool
$c== :: CreateStudioSessionMappingResponse
-> CreateStudioSessionMappingResponse -> Bool
Prelude.Eq, ReadPrec [CreateStudioSessionMappingResponse]
ReadPrec CreateStudioSessionMappingResponse
Int -> ReadS CreateStudioSessionMappingResponse
ReadS [CreateStudioSessionMappingResponse]
(Int -> ReadS CreateStudioSessionMappingResponse)
-> ReadS [CreateStudioSessionMappingResponse]
-> ReadPrec CreateStudioSessionMappingResponse
-> ReadPrec [CreateStudioSessionMappingResponse]
-> Read CreateStudioSessionMappingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStudioSessionMappingResponse]
$creadListPrec :: ReadPrec [CreateStudioSessionMappingResponse]
readPrec :: ReadPrec CreateStudioSessionMappingResponse
$creadPrec :: ReadPrec CreateStudioSessionMappingResponse
readList :: ReadS [CreateStudioSessionMappingResponse]
$creadList :: ReadS [CreateStudioSessionMappingResponse]
readsPrec :: Int -> ReadS CreateStudioSessionMappingResponse
$creadsPrec :: Int -> ReadS CreateStudioSessionMappingResponse
Prelude.Read, Int -> CreateStudioSessionMappingResponse -> ShowS
[CreateStudioSessionMappingResponse] -> ShowS
CreateStudioSessionMappingResponse -> String
(Int -> CreateStudioSessionMappingResponse -> ShowS)
-> (CreateStudioSessionMappingResponse -> String)
-> ([CreateStudioSessionMappingResponse] -> ShowS)
-> Show CreateStudioSessionMappingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStudioSessionMappingResponse] -> ShowS
$cshowList :: [CreateStudioSessionMappingResponse] -> ShowS
show :: CreateStudioSessionMappingResponse -> String
$cshow :: CreateStudioSessionMappingResponse -> String
showsPrec :: Int -> CreateStudioSessionMappingResponse -> ShowS
$cshowsPrec :: Int -> CreateStudioSessionMappingResponse -> ShowS
Prelude.Show, (forall x.
CreateStudioSessionMappingResponse
-> Rep CreateStudioSessionMappingResponse x)
-> (forall x.
Rep CreateStudioSessionMappingResponse x
-> CreateStudioSessionMappingResponse)
-> Generic CreateStudioSessionMappingResponse
forall x.
Rep CreateStudioSessionMappingResponse x
-> CreateStudioSessionMappingResponse
forall x.
CreateStudioSessionMappingResponse
-> Rep CreateStudioSessionMappingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateStudioSessionMappingResponse x
-> CreateStudioSessionMappingResponse
$cfrom :: forall x.
CreateStudioSessionMappingResponse
-> Rep CreateStudioSessionMappingResponse x
Prelude.Generic)
newCreateStudioSessionMappingResponse ::
CreateStudioSessionMappingResponse
newCreateStudioSessionMappingResponse :: CreateStudioSessionMappingResponse
newCreateStudioSessionMappingResponse =
CreateStudioSessionMappingResponse
CreateStudioSessionMappingResponse'
instance
Prelude.NFData
CreateStudioSessionMappingResponse