{-# 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.GetStudioSessionMapping
(
GetStudioSessionMapping (..),
newGetStudioSessionMapping,
getStudioSessionMapping_identityId,
getStudioSessionMapping_identityName,
getStudioSessionMapping_studioId,
getStudioSessionMapping_identityType,
GetStudioSessionMappingResponse (..),
newGetStudioSessionMappingResponse,
getStudioSessionMappingResponse_sessionMapping,
getStudioSessionMappingResponse_httpStatus,
)
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 GetStudioSessionMapping = GetStudioSessionMapping'
{
GetStudioSessionMapping -> Maybe Text
identityId :: Prelude.Maybe Prelude.Text,
GetStudioSessionMapping -> Maybe Text
identityName :: Prelude.Maybe Prelude.Text,
GetStudioSessionMapping -> Text
studioId :: Prelude.Text,
GetStudioSessionMapping -> IdentityType
identityType :: IdentityType
}
deriving (GetStudioSessionMapping -> GetStudioSessionMapping -> Bool
(GetStudioSessionMapping -> GetStudioSessionMapping -> Bool)
-> (GetStudioSessionMapping -> GetStudioSessionMapping -> Bool)
-> Eq GetStudioSessionMapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStudioSessionMapping -> GetStudioSessionMapping -> Bool
$c/= :: GetStudioSessionMapping -> GetStudioSessionMapping -> Bool
== :: GetStudioSessionMapping -> GetStudioSessionMapping -> Bool
$c== :: GetStudioSessionMapping -> GetStudioSessionMapping -> Bool
Prelude.Eq, ReadPrec [GetStudioSessionMapping]
ReadPrec GetStudioSessionMapping
Int -> ReadS GetStudioSessionMapping
ReadS [GetStudioSessionMapping]
(Int -> ReadS GetStudioSessionMapping)
-> ReadS [GetStudioSessionMapping]
-> ReadPrec GetStudioSessionMapping
-> ReadPrec [GetStudioSessionMapping]
-> Read GetStudioSessionMapping
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStudioSessionMapping]
$creadListPrec :: ReadPrec [GetStudioSessionMapping]
readPrec :: ReadPrec GetStudioSessionMapping
$creadPrec :: ReadPrec GetStudioSessionMapping
readList :: ReadS [GetStudioSessionMapping]
$creadList :: ReadS [GetStudioSessionMapping]
readsPrec :: Int -> ReadS GetStudioSessionMapping
$creadsPrec :: Int -> ReadS GetStudioSessionMapping
Prelude.Read, Int -> GetStudioSessionMapping -> ShowS
[GetStudioSessionMapping] -> ShowS
GetStudioSessionMapping -> String
(Int -> GetStudioSessionMapping -> ShowS)
-> (GetStudioSessionMapping -> String)
-> ([GetStudioSessionMapping] -> ShowS)
-> Show GetStudioSessionMapping
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStudioSessionMapping] -> ShowS
$cshowList :: [GetStudioSessionMapping] -> ShowS
show :: GetStudioSessionMapping -> String
$cshow :: GetStudioSessionMapping -> String
showsPrec :: Int -> GetStudioSessionMapping -> ShowS
$cshowsPrec :: Int -> GetStudioSessionMapping -> ShowS
Prelude.Show, (forall x.
GetStudioSessionMapping -> Rep GetStudioSessionMapping x)
-> (forall x.
Rep GetStudioSessionMapping x -> GetStudioSessionMapping)
-> Generic GetStudioSessionMapping
forall x. Rep GetStudioSessionMapping x -> GetStudioSessionMapping
forall x. GetStudioSessionMapping -> Rep GetStudioSessionMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetStudioSessionMapping x -> GetStudioSessionMapping
$cfrom :: forall x. GetStudioSessionMapping -> Rep GetStudioSessionMapping x
Prelude.Generic)
newGetStudioSessionMapping ::
Prelude.Text ->
IdentityType ->
GetStudioSessionMapping
newGetStudioSessionMapping :: Text -> IdentityType -> GetStudioSessionMapping
newGetStudioSessionMapping Text
pStudioId_ IdentityType
pIdentityType_ =
GetStudioSessionMapping' :: Maybe Text
-> Maybe Text -> Text -> IdentityType -> GetStudioSessionMapping
GetStudioSessionMapping'
{ $sel:identityId:GetStudioSessionMapping' :: Maybe Text
identityId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identityName:GetStudioSessionMapping' :: Maybe Text
identityName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:studioId:GetStudioSessionMapping' :: Text
studioId = Text
pStudioId_,
$sel:identityType:GetStudioSessionMapping' :: IdentityType
identityType = IdentityType
pIdentityType_
}
getStudioSessionMapping_identityId :: Lens.Lens' GetStudioSessionMapping (Prelude.Maybe Prelude.Text)
getStudioSessionMapping_identityId :: (Maybe Text -> f (Maybe Text))
-> GetStudioSessionMapping -> f GetStudioSessionMapping
getStudioSessionMapping_identityId = (GetStudioSessionMapping -> Maybe Text)
-> (GetStudioSessionMapping
-> Maybe Text -> GetStudioSessionMapping)
-> Lens
GetStudioSessionMapping
GetStudioSessionMapping
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioSessionMapping' {Maybe Text
identityId :: Maybe Text
$sel:identityId:GetStudioSessionMapping' :: GetStudioSessionMapping -> Maybe Text
identityId} -> Maybe Text
identityId) (\s :: GetStudioSessionMapping
s@GetStudioSessionMapping' {} Maybe Text
a -> GetStudioSessionMapping
s {$sel:identityId:GetStudioSessionMapping' :: Maybe Text
identityId = Maybe Text
a} :: GetStudioSessionMapping)
getStudioSessionMapping_identityName :: Lens.Lens' GetStudioSessionMapping (Prelude.Maybe Prelude.Text)
getStudioSessionMapping_identityName :: (Maybe Text -> f (Maybe Text))
-> GetStudioSessionMapping -> f GetStudioSessionMapping
getStudioSessionMapping_identityName = (GetStudioSessionMapping -> Maybe Text)
-> (GetStudioSessionMapping
-> Maybe Text -> GetStudioSessionMapping)
-> Lens
GetStudioSessionMapping
GetStudioSessionMapping
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioSessionMapping' {Maybe Text
identityName :: Maybe Text
$sel:identityName:GetStudioSessionMapping' :: GetStudioSessionMapping -> Maybe Text
identityName} -> Maybe Text
identityName) (\s :: GetStudioSessionMapping
s@GetStudioSessionMapping' {} Maybe Text
a -> GetStudioSessionMapping
s {$sel:identityName:GetStudioSessionMapping' :: Maybe Text
identityName = Maybe Text
a} :: GetStudioSessionMapping)
getStudioSessionMapping_studioId :: Lens.Lens' GetStudioSessionMapping Prelude.Text
getStudioSessionMapping_studioId :: (Text -> f Text)
-> GetStudioSessionMapping -> f GetStudioSessionMapping
getStudioSessionMapping_studioId = (GetStudioSessionMapping -> Text)
-> (GetStudioSessionMapping -> Text -> GetStudioSessionMapping)
-> Lens GetStudioSessionMapping GetStudioSessionMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioSessionMapping' {Text
studioId :: Text
$sel:studioId:GetStudioSessionMapping' :: GetStudioSessionMapping -> Text
studioId} -> Text
studioId) (\s :: GetStudioSessionMapping
s@GetStudioSessionMapping' {} Text
a -> GetStudioSessionMapping
s {$sel:studioId:GetStudioSessionMapping' :: Text
studioId = Text
a} :: GetStudioSessionMapping)
getStudioSessionMapping_identityType :: Lens.Lens' GetStudioSessionMapping IdentityType
getStudioSessionMapping_identityType :: (IdentityType -> f IdentityType)
-> GetStudioSessionMapping -> f GetStudioSessionMapping
getStudioSessionMapping_identityType = (GetStudioSessionMapping -> IdentityType)
-> (GetStudioSessionMapping
-> IdentityType -> GetStudioSessionMapping)
-> Lens
GetStudioSessionMapping
GetStudioSessionMapping
IdentityType
IdentityType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioSessionMapping' {IdentityType
identityType :: IdentityType
$sel:identityType:GetStudioSessionMapping' :: GetStudioSessionMapping -> IdentityType
identityType} -> IdentityType
identityType) (\s :: GetStudioSessionMapping
s@GetStudioSessionMapping' {} IdentityType
a -> GetStudioSessionMapping
s {$sel:identityType:GetStudioSessionMapping' :: IdentityType
identityType = IdentityType
a} :: GetStudioSessionMapping)
instance Core.AWSRequest GetStudioSessionMapping where
type
AWSResponse GetStudioSessionMapping =
GetStudioSessionMappingResponse
request :: GetStudioSessionMapping -> Request GetStudioSessionMapping
request = Service
-> GetStudioSessionMapping -> Request GetStudioSessionMapping
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetStudioSessionMapping
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetStudioSessionMapping)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetStudioSessionMapping))
-> Logger
-> Service
-> Proxy GetStudioSessionMapping
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetStudioSessionMapping)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe SessionMappingDetail
-> Int -> GetStudioSessionMappingResponse
GetStudioSessionMappingResponse'
(Maybe SessionMappingDetail
-> Int -> GetStudioSessionMappingResponse)
-> Either String (Maybe SessionMappingDetail)
-> Either String (Int -> GetStudioSessionMappingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe SessionMappingDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SessionMapping")
Either String (Int -> GetStudioSessionMappingResponse)
-> Either String Int
-> Either String GetStudioSessionMappingResponse
forall (f :: * -> *) a b. Applicative f => 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 GetStudioSessionMapping
instance Prelude.NFData GetStudioSessionMapping
instance Core.ToHeaders GetStudioSessionMapping where
toHeaders :: GetStudioSessionMapping -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetStudioSessionMapping -> 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
"ElasticMapReduce.GetStudioSessionMapping" ::
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 GetStudioSessionMapping where
toJSON :: GetStudioSessionMapping -> Value
toJSON GetStudioSessionMapping' {Maybe Text
Text
IdentityType
identityType :: IdentityType
studioId :: Text
identityName :: Maybe Text
identityId :: Maybe Text
$sel:identityType:GetStudioSessionMapping' :: GetStudioSessionMapping -> IdentityType
$sel:studioId:GetStudioSessionMapping' :: GetStudioSessionMapping -> Text
$sel:identityName:GetStudioSessionMapping' :: GetStudioSessionMapping -> Maybe Text
$sel:identityId:GetStudioSessionMapping' :: GetStudioSessionMapping -> 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)
]
)
instance Core.ToPath GetStudioSessionMapping where
toPath :: GetStudioSessionMapping -> ByteString
toPath = ByteString -> GetStudioSessionMapping -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetStudioSessionMapping where
toQuery :: GetStudioSessionMapping -> QueryString
toQuery = QueryString -> GetStudioSessionMapping -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetStudioSessionMappingResponse = GetStudioSessionMappingResponse'
{
GetStudioSessionMappingResponse -> Maybe SessionMappingDetail
sessionMapping :: Prelude.Maybe SessionMappingDetail,
GetStudioSessionMappingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetStudioSessionMappingResponse
-> GetStudioSessionMappingResponse -> Bool
(GetStudioSessionMappingResponse
-> GetStudioSessionMappingResponse -> Bool)
-> (GetStudioSessionMappingResponse
-> GetStudioSessionMappingResponse -> Bool)
-> Eq GetStudioSessionMappingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStudioSessionMappingResponse
-> GetStudioSessionMappingResponse -> Bool
$c/= :: GetStudioSessionMappingResponse
-> GetStudioSessionMappingResponse -> Bool
== :: GetStudioSessionMappingResponse
-> GetStudioSessionMappingResponse -> Bool
$c== :: GetStudioSessionMappingResponse
-> GetStudioSessionMappingResponse -> Bool
Prelude.Eq, ReadPrec [GetStudioSessionMappingResponse]
ReadPrec GetStudioSessionMappingResponse
Int -> ReadS GetStudioSessionMappingResponse
ReadS [GetStudioSessionMappingResponse]
(Int -> ReadS GetStudioSessionMappingResponse)
-> ReadS [GetStudioSessionMappingResponse]
-> ReadPrec GetStudioSessionMappingResponse
-> ReadPrec [GetStudioSessionMappingResponse]
-> Read GetStudioSessionMappingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStudioSessionMappingResponse]
$creadListPrec :: ReadPrec [GetStudioSessionMappingResponse]
readPrec :: ReadPrec GetStudioSessionMappingResponse
$creadPrec :: ReadPrec GetStudioSessionMappingResponse
readList :: ReadS [GetStudioSessionMappingResponse]
$creadList :: ReadS [GetStudioSessionMappingResponse]
readsPrec :: Int -> ReadS GetStudioSessionMappingResponse
$creadsPrec :: Int -> ReadS GetStudioSessionMappingResponse
Prelude.Read, Int -> GetStudioSessionMappingResponse -> ShowS
[GetStudioSessionMappingResponse] -> ShowS
GetStudioSessionMappingResponse -> String
(Int -> GetStudioSessionMappingResponse -> ShowS)
-> (GetStudioSessionMappingResponse -> String)
-> ([GetStudioSessionMappingResponse] -> ShowS)
-> Show GetStudioSessionMappingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStudioSessionMappingResponse] -> ShowS
$cshowList :: [GetStudioSessionMappingResponse] -> ShowS
show :: GetStudioSessionMappingResponse -> String
$cshow :: GetStudioSessionMappingResponse -> String
showsPrec :: Int -> GetStudioSessionMappingResponse -> ShowS
$cshowsPrec :: Int -> GetStudioSessionMappingResponse -> ShowS
Prelude.Show, (forall x.
GetStudioSessionMappingResponse
-> Rep GetStudioSessionMappingResponse x)
-> (forall x.
Rep GetStudioSessionMappingResponse x
-> GetStudioSessionMappingResponse)
-> Generic GetStudioSessionMappingResponse
forall x.
Rep GetStudioSessionMappingResponse x
-> GetStudioSessionMappingResponse
forall x.
GetStudioSessionMappingResponse
-> Rep GetStudioSessionMappingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetStudioSessionMappingResponse x
-> GetStudioSessionMappingResponse
$cfrom :: forall x.
GetStudioSessionMappingResponse
-> Rep GetStudioSessionMappingResponse x
Prelude.Generic)
newGetStudioSessionMappingResponse ::
Prelude.Int ->
GetStudioSessionMappingResponse
newGetStudioSessionMappingResponse :: Int -> GetStudioSessionMappingResponse
newGetStudioSessionMappingResponse Int
pHttpStatus_ =
GetStudioSessionMappingResponse' :: Maybe SessionMappingDetail
-> Int -> GetStudioSessionMappingResponse
GetStudioSessionMappingResponse'
{ $sel:sessionMapping:GetStudioSessionMappingResponse' :: Maybe SessionMappingDetail
sessionMapping =
Maybe SessionMappingDetail
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetStudioSessionMappingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getStudioSessionMappingResponse_sessionMapping :: Lens.Lens' GetStudioSessionMappingResponse (Prelude.Maybe SessionMappingDetail)
getStudioSessionMappingResponse_sessionMapping :: (Maybe SessionMappingDetail -> f (Maybe SessionMappingDetail))
-> GetStudioSessionMappingResponse
-> f GetStudioSessionMappingResponse
getStudioSessionMappingResponse_sessionMapping = (GetStudioSessionMappingResponse -> Maybe SessionMappingDetail)
-> (GetStudioSessionMappingResponse
-> Maybe SessionMappingDetail -> GetStudioSessionMappingResponse)
-> Lens
GetStudioSessionMappingResponse
GetStudioSessionMappingResponse
(Maybe SessionMappingDetail)
(Maybe SessionMappingDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioSessionMappingResponse' {Maybe SessionMappingDetail
sessionMapping :: Maybe SessionMappingDetail
$sel:sessionMapping:GetStudioSessionMappingResponse' :: GetStudioSessionMappingResponse -> Maybe SessionMappingDetail
sessionMapping} -> Maybe SessionMappingDetail
sessionMapping) (\s :: GetStudioSessionMappingResponse
s@GetStudioSessionMappingResponse' {} Maybe SessionMappingDetail
a -> GetStudioSessionMappingResponse
s {$sel:sessionMapping:GetStudioSessionMappingResponse' :: Maybe SessionMappingDetail
sessionMapping = Maybe SessionMappingDetail
a} :: GetStudioSessionMappingResponse)
getStudioSessionMappingResponse_httpStatus :: Lens.Lens' GetStudioSessionMappingResponse Prelude.Int
getStudioSessionMappingResponse_httpStatus :: (Int -> f Int)
-> GetStudioSessionMappingResponse
-> f GetStudioSessionMappingResponse
getStudioSessionMappingResponse_httpStatus = (GetStudioSessionMappingResponse -> Int)
-> (GetStudioSessionMappingResponse
-> Int -> GetStudioSessionMappingResponse)
-> Lens
GetStudioSessionMappingResponse
GetStudioSessionMappingResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioSessionMappingResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetStudioSessionMappingResponse' :: GetStudioSessionMappingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetStudioSessionMappingResponse
s@GetStudioSessionMappingResponse' {} Int
a -> GetStudioSessionMappingResponse
s {$sel:httpStatus:GetStudioSessionMappingResponse' :: Int
httpStatus = Int
a} :: GetStudioSessionMappingResponse)
instance
Prelude.NFData
GetStudioSessionMappingResponse