{-# 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.PutStudioMembers
(
PutStudioMembers (..),
newPutStudioMembers,
putStudioMembers_clientToken,
putStudioMembers_studioId,
putStudioMembers_members,
putStudioMembers_identityStoreId,
PutStudioMembersResponse (..),
newPutStudioMembersResponse,
putStudioMembersResponse_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 PutStudioMembers = PutStudioMembers'
{
PutStudioMembers -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
PutStudioMembers -> Text
studioId :: Prelude.Text,
PutStudioMembers -> NonEmpty NewStudioMember
members :: Prelude.NonEmpty NewStudioMember,
PutStudioMembers -> Text
identityStoreId :: Prelude.Text
}
deriving (PutStudioMembers -> PutStudioMembers -> Bool
(PutStudioMembers -> PutStudioMembers -> Bool)
-> (PutStudioMembers -> PutStudioMembers -> Bool)
-> Eq PutStudioMembers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutStudioMembers -> PutStudioMembers -> Bool
$c/= :: PutStudioMembers -> PutStudioMembers -> Bool
== :: PutStudioMembers -> PutStudioMembers -> Bool
$c== :: PutStudioMembers -> PutStudioMembers -> Bool
Prelude.Eq, ReadPrec [PutStudioMembers]
ReadPrec PutStudioMembers
Int -> ReadS PutStudioMembers
ReadS [PutStudioMembers]
(Int -> ReadS PutStudioMembers)
-> ReadS [PutStudioMembers]
-> ReadPrec PutStudioMembers
-> ReadPrec [PutStudioMembers]
-> Read PutStudioMembers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutStudioMembers]
$creadListPrec :: ReadPrec [PutStudioMembers]
readPrec :: ReadPrec PutStudioMembers
$creadPrec :: ReadPrec PutStudioMembers
readList :: ReadS [PutStudioMembers]
$creadList :: ReadS [PutStudioMembers]
readsPrec :: Int -> ReadS PutStudioMembers
$creadsPrec :: Int -> ReadS PutStudioMembers
Prelude.Read, Int -> PutStudioMembers -> ShowS
[PutStudioMembers] -> ShowS
PutStudioMembers -> String
(Int -> PutStudioMembers -> ShowS)
-> (PutStudioMembers -> String)
-> ([PutStudioMembers] -> ShowS)
-> Show PutStudioMembers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutStudioMembers] -> ShowS
$cshowList :: [PutStudioMembers] -> ShowS
show :: PutStudioMembers -> String
$cshow :: PutStudioMembers -> String
showsPrec :: Int -> PutStudioMembers -> ShowS
$cshowsPrec :: Int -> PutStudioMembers -> ShowS
Prelude.Show, (forall x. PutStudioMembers -> Rep PutStudioMembers x)
-> (forall x. Rep PutStudioMembers x -> PutStudioMembers)
-> Generic PutStudioMembers
forall x. Rep PutStudioMembers x -> PutStudioMembers
forall x. PutStudioMembers -> Rep PutStudioMembers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutStudioMembers x -> PutStudioMembers
$cfrom :: forall x. PutStudioMembers -> Rep PutStudioMembers x
Prelude.Generic)
newPutStudioMembers ::
Prelude.Text ->
Prelude.NonEmpty NewStudioMember ->
Prelude.Text ->
PutStudioMembers
newPutStudioMembers :: Text -> NonEmpty NewStudioMember -> Text -> PutStudioMembers
newPutStudioMembers
Text
pStudioId_
NonEmpty NewStudioMember
pMembers_
Text
pIdentityStoreId_ =
PutStudioMembers' :: Maybe Text
-> Text -> NonEmpty NewStudioMember -> Text -> PutStudioMembers
PutStudioMembers'
{ $sel:clientToken:PutStudioMembers' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:studioId:PutStudioMembers' :: Text
studioId = Text
pStudioId_,
$sel:members:PutStudioMembers' :: NonEmpty NewStudioMember
members = Tagged
(NonEmpty NewStudioMember) (Identity (NonEmpty NewStudioMember))
-> Tagged
(NonEmpty NewStudioMember) (Identity (NonEmpty NewStudioMember))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty NewStudioMember) (Identity (NonEmpty NewStudioMember))
-> Tagged
(NonEmpty NewStudioMember) (Identity (NonEmpty NewStudioMember)))
-> NonEmpty NewStudioMember -> NonEmpty NewStudioMember
forall t b. AReview t b -> b -> t
Lens.# NonEmpty NewStudioMember
pMembers_,
$sel:identityStoreId:PutStudioMembers' :: Text
identityStoreId = Text
pIdentityStoreId_
}
putStudioMembers_clientToken :: Lens.Lens' PutStudioMembers (Prelude.Maybe Prelude.Text)
putStudioMembers_clientToken :: (Maybe Text -> f (Maybe Text))
-> PutStudioMembers -> f PutStudioMembers
putStudioMembers_clientToken = (PutStudioMembers -> Maybe Text)
-> (PutStudioMembers -> Maybe Text -> PutStudioMembers)
-> Lens PutStudioMembers PutStudioMembers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutStudioMembers' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:PutStudioMembers' :: PutStudioMembers -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: PutStudioMembers
s@PutStudioMembers' {} Maybe Text
a -> PutStudioMembers
s {$sel:clientToken:PutStudioMembers' :: Maybe Text
clientToken = Maybe Text
a} :: PutStudioMembers)
putStudioMembers_studioId :: Lens.Lens' PutStudioMembers Prelude.Text
putStudioMembers_studioId :: (Text -> f Text) -> PutStudioMembers -> f PutStudioMembers
putStudioMembers_studioId = (PutStudioMembers -> Text)
-> (PutStudioMembers -> Text -> PutStudioMembers)
-> Lens PutStudioMembers PutStudioMembers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutStudioMembers' {Text
studioId :: Text
$sel:studioId:PutStudioMembers' :: PutStudioMembers -> Text
studioId} -> Text
studioId) (\s :: PutStudioMembers
s@PutStudioMembers' {} Text
a -> PutStudioMembers
s {$sel:studioId:PutStudioMembers' :: Text
studioId = Text
a} :: PutStudioMembers)
putStudioMembers_members :: Lens.Lens' PutStudioMembers (Prelude.NonEmpty NewStudioMember)
putStudioMembers_members :: (NonEmpty NewStudioMember -> f (NonEmpty NewStudioMember))
-> PutStudioMembers -> f PutStudioMembers
putStudioMembers_members = (PutStudioMembers -> NonEmpty NewStudioMember)
-> (PutStudioMembers
-> NonEmpty NewStudioMember -> PutStudioMembers)
-> Lens
PutStudioMembers
PutStudioMembers
(NonEmpty NewStudioMember)
(NonEmpty NewStudioMember)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutStudioMembers' {NonEmpty NewStudioMember
members :: NonEmpty NewStudioMember
$sel:members:PutStudioMembers' :: PutStudioMembers -> NonEmpty NewStudioMember
members} -> NonEmpty NewStudioMember
members) (\s :: PutStudioMembers
s@PutStudioMembers' {} NonEmpty NewStudioMember
a -> PutStudioMembers
s {$sel:members:PutStudioMembers' :: NonEmpty NewStudioMember
members = NonEmpty NewStudioMember
a} :: PutStudioMembers) ((NonEmpty NewStudioMember -> f (NonEmpty NewStudioMember))
-> PutStudioMembers -> f PutStudioMembers)
-> ((NonEmpty NewStudioMember -> f (NonEmpty NewStudioMember))
-> NonEmpty NewStudioMember -> f (NonEmpty NewStudioMember))
-> (NonEmpty NewStudioMember -> f (NonEmpty NewStudioMember))
-> PutStudioMembers
-> f PutStudioMembers
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty NewStudioMember -> f (NonEmpty NewStudioMember))
-> NonEmpty NewStudioMember -> f (NonEmpty NewStudioMember)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putStudioMembers_identityStoreId :: Lens.Lens' PutStudioMembers Prelude.Text
putStudioMembers_identityStoreId :: (Text -> f Text) -> PutStudioMembers -> f PutStudioMembers
putStudioMembers_identityStoreId = (PutStudioMembers -> Text)
-> (PutStudioMembers -> Text -> PutStudioMembers)
-> Lens PutStudioMembers PutStudioMembers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutStudioMembers' {Text
identityStoreId :: Text
$sel:identityStoreId:PutStudioMembers' :: PutStudioMembers -> Text
identityStoreId} -> Text
identityStoreId) (\s :: PutStudioMembers
s@PutStudioMembers' {} Text
a -> PutStudioMembers
s {$sel:identityStoreId:PutStudioMembers' :: Text
identityStoreId = Text
a} :: PutStudioMembers)
instance Core.AWSRequest PutStudioMembers where
type
AWSResponse PutStudioMembers =
PutStudioMembersResponse
request :: PutStudioMembers -> Request PutStudioMembers
request = Service -> PutStudioMembers -> Request PutStudioMembers
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutStudioMembers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutStudioMembers)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutStudioMembers))
-> Logger
-> Service
-> Proxy PutStudioMembers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutStudioMembers)))
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 -> PutStudioMembersResponse
PutStudioMembersResponse'
(Int -> PutStudioMembersResponse)
-> Either String Int -> Either String PutStudioMembersResponse
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 PutStudioMembers
instance Prelude.NFData PutStudioMembers
instance Core.ToHeaders PutStudioMembers where
toHeaders :: PutStudioMembers -> ResponseHeaders
toHeaders PutStudioMembers' {Maybe Text
NonEmpty NewStudioMember
Text
identityStoreId :: Text
members :: NonEmpty NewStudioMember
studioId :: Text
clientToken :: Maybe Text
$sel:identityStoreId:PutStudioMembers' :: PutStudioMembers -> Text
$sel:members:PutStudioMembers' :: PutStudioMembers -> NonEmpty NewStudioMember
$sel:studioId:PutStudioMembers' :: PutStudioMembers -> Text
$sel:clientToken:PutStudioMembers' :: PutStudioMembers -> Maybe Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Client-Token" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
clientToken,
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 PutStudioMembers where
toJSON :: PutStudioMembers -> Value
toJSON PutStudioMembers' {Maybe Text
NonEmpty NewStudioMember
Text
identityStoreId :: Text
members :: NonEmpty NewStudioMember
studioId :: Text
clientToken :: Maybe Text
$sel:identityStoreId:PutStudioMembers' :: PutStudioMembers -> Text
$sel:members:PutStudioMembers' :: PutStudioMembers -> NonEmpty NewStudioMember
$sel:studioId:PutStudioMembers' :: PutStudioMembers -> Text
$sel:clientToken:PutStudioMembers' :: PutStudioMembers -> Maybe 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
"members" Text -> NonEmpty NewStudioMember -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty NewStudioMember
members),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"identityStoreId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityStoreId)
]
)
instance Core.ToPath PutStudioMembers where
toPath :: PutStudioMembers -> ByteString
toPath PutStudioMembers' {Maybe Text
NonEmpty NewStudioMember
Text
identityStoreId :: Text
members :: NonEmpty NewStudioMember
studioId :: Text
clientToken :: Maybe Text
$sel:identityStoreId:PutStudioMembers' :: PutStudioMembers -> Text
$sel:members:PutStudioMembers' :: PutStudioMembers -> NonEmpty NewStudioMember
$sel:studioId:PutStudioMembers' :: PutStudioMembers -> Text
$sel:clientToken:PutStudioMembers' :: PutStudioMembers -> Maybe 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"
]
instance Core.ToQuery PutStudioMembers where
toQuery :: PutStudioMembers -> QueryString
toQuery = QueryString -> PutStudioMembers -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutStudioMembersResponse = PutStudioMembersResponse'
{
PutStudioMembersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutStudioMembersResponse -> PutStudioMembersResponse -> Bool
(PutStudioMembersResponse -> PutStudioMembersResponse -> Bool)
-> (PutStudioMembersResponse -> PutStudioMembersResponse -> Bool)
-> Eq PutStudioMembersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutStudioMembersResponse -> PutStudioMembersResponse -> Bool
$c/= :: PutStudioMembersResponse -> PutStudioMembersResponse -> Bool
== :: PutStudioMembersResponse -> PutStudioMembersResponse -> Bool
$c== :: PutStudioMembersResponse -> PutStudioMembersResponse -> Bool
Prelude.Eq, ReadPrec [PutStudioMembersResponse]
ReadPrec PutStudioMembersResponse
Int -> ReadS PutStudioMembersResponse
ReadS [PutStudioMembersResponse]
(Int -> ReadS PutStudioMembersResponse)
-> ReadS [PutStudioMembersResponse]
-> ReadPrec PutStudioMembersResponse
-> ReadPrec [PutStudioMembersResponse]
-> Read PutStudioMembersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutStudioMembersResponse]
$creadListPrec :: ReadPrec [PutStudioMembersResponse]
readPrec :: ReadPrec PutStudioMembersResponse
$creadPrec :: ReadPrec PutStudioMembersResponse
readList :: ReadS [PutStudioMembersResponse]
$creadList :: ReadS [PutStudioMembersResponse]
readsPrec :: Int -> ReadS PutStudioMembersResponse
$creadsPrec :: Int -> ReadS PutStudioMembersResponse
Prelude.Read, Int -> PutStudioMembersResponse -> ShowS
[PutStudioMembersResponse] -> ShowS
PutStudioMembersResponse -> String
(Int -> PutStudioMembersResponse -> ShowS)
-> (PutStudioMembersResponse -> String)
-> ([PutStudioMembersResponse] -> ShowS)
-> Show PutStudioMembersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutStudioMembersResponse] -> ShowS
$cshowList :: [PutStudioMembersResponse] -> ShowS
show :: PutStudioMembersResponse -> String
$cshow :: PutStudioMembersResponse -> String
showsPrec :: Int -> PutStudioMembersResponse -> ShowS
$cshowsPrec :: Int -> PutStudioMembersResponse -> ShowS
Prelude.Show, (forall x.
PutStudioMembersResponse -> Rep PutStudioMembersResponse x)
-> (forall x.
Rep PutStudioMembersResponse x -> PutStudioMembersResponse)
-> Generic PutStudioMembersResponse
forall x.
Rep PutStudioMembersResponse x -> PutStudioMembersResponse
forall x.
PutStudioMembersResponse -> Rep PutStudioMembersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutStudioMembersResponse x -> PutStudioMembersResponse
$cfrom :: forall x.
PutStudioMembersResponse -> Rep PutStudioMembersResponse x
Prelude.Generic)
newPutStudioMembersResponse ::
Prelude.Int ->
PutStudioMembersResponse
newPutStudioMembersResponse :: Int -> PutStudioMembersResponse
newPutStudioMembersResponse Int
pHttpStatus_ =
PutStudioMembersResponse' :: Int -> PutStudioMembersResponse
PutStudioMembersResponse'
{ $sel:httpStatus:PutStudioMembersResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putStudioMembersResponse_httpStatus :: Lens.Lens' PutStudioMembersResponse Prelude.Int
putStudioMembersResponse_httpStatus :: (Int -> f Int)
-> PutStudioMembersResponse -> f PutStudioMembersResponse
putStudioMembersResponse_httpStatus = (PutStudioMembersResponse -> Int)
-> (PutStudioMembersResponse -> Int -> PutStudioMembersResponse)
-> Lens PutStudioMembersResponse PutStudioMembersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutStudioMembersResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutStudioMembersResponse' :: PutStudioMembersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutStudioMembersResponse
s@PutStudioMembersResponse' {} Int
a -> PutStudioMembersResponse
s {$sel:httpStatus:PutStudioMembersResponse' :: Int
httpStatus = Int
a} :: PutStudioMembersResponse)
instance Prelude.NFData PutStudioMembersResponse