{-# 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.Nimble.GetStudioMember
(
GetStudioMember (..),
newGetStudioMember,
getStudioMember_studioId,
getStudioMember_principalId,
GetStudioMemberResponse (..),
newGetStudioMemberResponse,
getStudioMemberResponse_member,
getStudioMemberResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Nimble.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetStudioMember = GetStudioMember'
{
GetStudioMember -> Text
studioId :: Prelude.Text,
GetStudioMember -> Text
principalId :: Prelude.Text
}
deriving (GetStudioMember -> GetStudioMember -> Bool
(GetStudioMember -> GetStudioMember -> Bool)
-> (GetStudioMember -> GetStudioMember -> Bool)
-> Eq GetStudioMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStudioMember -> GetStudioMember -> Bool
$c/= :: GetStudioMember -> GetStudioMember -> Bool
== :: GetStudioMember -> GetStudioMember -> Bool
$c== :: GetStudioMember -> GetStudioMember -> Bool
Prelude.Eq, ReadPrec [GetStudioMember]
ReadPrec GetStudioMember
Int -> ReadS GetStudioMember
ReadS [GetStudioMember]
(Int -> ReadS GetStudioMember)
-> ReadS [GetStudioMember]
-> ReadPrec GetStudioMember
-> ReadPrec [GetStudioMember]
-> Read GetStudioMember
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStudioMember]
$creadListPrec :: ReadPrec [GetStudioMember]
readPrec :: ReadPrec GetStudioMember
$creadPrec :: ReadPrec GetStudioMember
readList :: ReadS [GetStudioMember]
$creadList :: ReadS [GetStudioMember]
readsPrec :: Int -> ReadS GetStudioMember
$creadsPrec :: Int -> ReadS GetStudioMember
Prelude.Read, Int -> GetStudioMember -> ShowS
[GetStudioMember] -> ShowS
GetStudioMember -> String
(Int -> GetStudioMember -> ShowS)
-> (GetStudioMember -> String)
-> ([GetStudioMember] -> ShowS)
-> Show GetStudioMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStudioMember] -> ShowS
$cshowList :: [GetStudioMember] -> ShowS
show :: GetStudioMember -> String
$cshow :: GetStudioMember -> String
showsPrec :: Int -> GetStudioMember -> ShowS
$cshowsPrec :: Int -> GetStudioMember -> ShowS
Prelude.Show, (forall x. GetStudioMember -> Rep GetStudioMember x)
-> (forall x. Rep GetStudioMember x -> GetStudioMember)
-> Generic GetStudioMember
forall x. Rep GetStudioMember x -> GetStudioMember
forall x. GetStudioMember -> Rep GetStudioMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetStudioMember x -> GetStudioMember
$cfrom :: forall x. GetStudioMember -> Rep GetStudioMember x
Prelude.Generic)
newGetStudioMember ::
Prelude.Text ->
Prelude.Text ->
GetStudioMember
newGetStudioMember :: Text -> Text -> GetStudioMember
newGetStudioMember Text
pStudioId_ Text
pPrincipalId_ =
GetStudioMember' :: Text -> Text -> GetStudioMember
GetStudioMember'
{ $sel:studioId:GetStudioMember' :: Text
studioId = Text
pStudioId_,
$sel:principalId:GetStudioMember' :: Text
principalId = Text
pPrincipalId_
}
getStudioMember_studioId :: Lens.Lens' GetStudioMember Prelude.Text
getStudioMember_studioId :: (Text -> f Text) -> GetStudioMember -> f GetStudioMember
getStudioMember_studioId = (GetStudioMember -> Text)
-> (GetStudioMember -> Text -> GetStudioMember)
-> Lens GetStudioMember GetStudioMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioMember' {Text
studioId :: Text
$sel:studioId:GetStudioMember' :: GetStudioMember -> Text
studioId} -> Text
studioId) (\s :: GetStudioMember
s@GetStudioMember' {} Text
a -> GetStudioMember
s {$sel:studioId:GetStudioMember' :: Text
studioId = Text
a} :: GetStudioMember)
getStudioMember_principalId :: Lens.Lens' GetStudioMember Prelude.Text
getStudioMember_principalId :: (Text -> f Text) -> GetStudioMember -> f GetStudioMember
getStudioMember_principalId = (GetStudioMember -> Text)
-> (GetStudioMember -> Text -> GetStudioMember)
-> Lens GetStudioMember GetStudioMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioMember' {Text
principalId :: Text
$sel:principalId:GetStudioMember' :: GetStudioMember -> Text
principalId} -> Text
principalId) (\s :: GetStudioMember
s@GetStudioMember' {} Text
a -> GetStudioMember
s {$sel:principalId:GetStudioMember' :: Text
principalId = Text
a} :: GetStudioMember)
instance Core.AWSRequest GetStudioMember where
type
AWSResponse GetStudioMember =
GetStudioMemberResponse
request :: GetStudioMember -> Request GetStudioMember
request = Service -> GetStudioMember -> Request GetStudioMember
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetStudioMember
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetStudioMember)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetStudioMember))
-> Logger
-> Service
-> Proxy GetStudioMember
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetStudioMember)))
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 StudioMembership -> Int -> GetStudioMemberResponse
GetStudioMemberResponse'
(Maybe StudioMembership -> Int -> GetStudioMemberResponse)
-> Either String (Maybe StudioMembership)
-> Either String (Int -> GetStudioMemberResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe StudioMembership)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"member")
Either String (Int -> GetStudioMemberResponse)
-> Either String Int -> Either String GetStudioMemberResponse
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 GetStudioMember
instance Prelude.NFData GetStudioMember
instance Core.ToHeaders GetStudioMember where
toHeaders :: GetStudioMember -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetStudioMember -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetStudioMember where
toPath :: GetStudioMember -> ByteString
toPath GetStudioMember' {Text
principalId :: Text
studioId :: Text
$sel:principalId:GetStudioMember' :: GetStudioMember -> Text
$sel:studioId:GetStudioMember' :: GetStudioMember -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-08-01/studios/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
studioId,
ByteString
"/membership/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
principalId
]
instance Core.ToQuery GetStudioMember where
toQuery :: GetStudioMember -> QueryString
toQuery = QueryString -> GetStudioMember -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetStudioMemberResponse = GetStudioMemberResponse'
{
GetStudioMemberResponse -> Maybe StudioMembership
member :: Prelude.Maybe StudioMembership,
GetStudioMemberResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetStudioMemberResponse -> GetStudioMemberResponse -> Bool
(GetStudioMemberResponse -> GetStudioMemberResponse -> Bool)
-> (GetStudioMemberResponse -> GetStudioMemberResponse -> Bool)
-> Eq GetStudioMemberResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStudioMemberResponse -> GetStudioMemberResponse -> Bool
$c/= :: GetStudioMemberResponse -> GetStudioMemberResponse -> Bool
== :: GetStudioMemberResponse -> GetStudioMemberResponse -> Bool
$c== :: GetStudioMemberResponse -> GetStudioMemberResponse -> Bool
Prelude.Eq, ReadPrec [GetStudioMemberResponse]
ReadPrec GetStudioMemberResponse
Int -> ReadS GetStudioMemberResponse
ReadS [GetStudioMemberResponse]
(Int -> ReadS GetStudioMemberResponse)
-> ReadS [GetStudioMemberResponse]
-> ReadPrec GetStudioMemberResponse
-> ReadPrec [GetStudioMemberResponse]
-> Read GetStudioMemberResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStudioMemberResponse]
$creadListPrec :: ReadPrec [GetStudioMemberResponse]
readPrec :: ReadPrec GetStudioMemberResponse
$creadPrec :: ReadPrec GetStudioMemberResponse
readList :: ReadS [GetStudioMemberResponse]
$creadList :: ReadS [GetStudioMemberResponse]
readsPrec :: Int -> ReadS GetStudioMemberResponse
$creadsPrec :: Int -> ReadS GetStudioMemberResponse
Prelude.Read, Int -> GetStudioMemberResponse -> ShowS
[GetStudioMemberResponse] -> ShowS
GetStudioMemberResponse -> String
(Int -> GetStudioMemberResponse -> ShowS)
-> (GetStudioMemberResponse -> String)
-> ([GetStudioMemberResponse] -> ShowS)
-> Show GetStudioMemberResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStudioMemberResponse] -> ShowS
$cshowList :: [GetStudioMemberResponse] -> ShowS
show :: GetStudioMemberResponse -> String
$cshow :: GetStudioMemberResponse -> String
showsPrec :: Int -> GetStudioMemberResponse -> ShowS
$cshowsPrec :: Int -> GetStudioMemberResponse -> ShowS
Prelude.Show, (forall x.
GetStudioMemberResponse -> Rep GetStudioMemberResponse x)
-> (forall x.
Rep GetStudioMemberResponse x -> GetStudioMemberResponse)
-> Generic GetStudioMemberResponse
forall x. Rep GetStudioMemberResponse x -> GetStudioMemberResponse
forall x. GetStudioMemberResponse -> Rep GetStudioMemberResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetStudioMemberResponse x -> GetStudioMemberResponse
$cfrom :: forall x. GetStudioMemberResponse -> Rep GetStudioMemberResponse x
Prelude.Generic)
newGetStudioMemberResponse ::
Prelude.Int ->
GetStudioMemberResponse
newGetStudioMemberResponse :: Int -> GetStudioMemberResponse
newGetStudioMemberResponse Int
pHttpStatus_ =
GetStudioMemberResponse' :: Maybe StudioMembership -> Int -> GetStudioMemberResponse
GetStudioMemberResponse'
{ $sel:member:GetStudioMemberResponse' :: Maybe StudioMembership
member = Maybe StudioMembership
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetStudioMemberResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getStudioMemberResponse_member :: Lens.Lens' GetStudioMemberResponse (Prelude.Maybe StudioMembership)
getStudioMemberResponse_member :: (Maybe StudioMembership -> f (Maybe StudioMembership))
-> GetStudioMemberResponse -> f GetStudioMemberResponse
getStudioMemberResponse_member = (GetStudioMemberResponse -> Maybe StudioMembership)
-> (GetStudioMemberResponse
-> Maybe StudioMembership -> GetStudioMemberResponse)
-> Lens
GetStudioMemberResponse
GetStudioMemberResponse
(Maybe StudioMembership)
(Maybe StudioMembership)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioMemberResponse' {Maybe StudioMembership
member :: Maybe StudioMembership
$sel:member:GetStudioMemberResponse' :: GetStudioMemberResponse -> Maybe StudioMembership
member} -> Maybe StudioMembership
member) (\s :: GetStudioMemberResponse
s@GetStudioMemberResponse' {} Maybe StudioMembership
a -> GetStudioMemberResponse
s {$sel:member:GetStudioMemberResponse' :: Maybe StudioMembership
member = Maybe StudioMembership
a} :: GetStudioMemberResponse)
getStudioMemberResponse_httpStatus :: Lens.Lens' GetStudioMemberResponse Prelude.Int
getStudioMemberResponse_httpStatus :: (Int -> f Int)
-> GetStudioMemberResponse -> f GetStudioMemberResponse
getStudioMemberResponse_httpStatus = (GetStudioMemberResponse -> Int)
-> (GetStudioMemberResponse -> Int -> GetStudioMemberResponse)
-> Lens GetStudioMemberResponse GetStudioMemberResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStudioMemberResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetStudioMemberResponse' :: GetStudioMemberResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetStudioMemberResponse
s@GetStudioMemberResponse' {} Int
a -> GetStudioMemberResponse
s {$sel:httpStatus:GetStudioMemberResponse' :: Int
httpStatus = Int
a} :: GetStudioMemberResponse)
instance Prelude.NFData GetStudioMemberResponse