{-# 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.UpdateStudio
(
UpdateStudio (..),
newUpdateStudio,
updateStudio_clientToken,
updateStudio_userRoleArn,
updateStudio_displayName,
updateStudio_adminRoleArn,
updateStudio_studioId,
UpdateStudioResponse (..),
newUpdateStudioResponse,
updateStudioResponse_studio,
updateStudioResponse_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 UpdateStudio = UpdateStudio'
{
UpdateStudio -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
UpdateStudio -> Maybe Text
userRoleArn :: Prelude.Maybe Prelude.Text,
UpdateStudio -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
UpdateStudio -> Maybe Text
adminRoleArn :: Prelude.Maybe Prelude.Text,
UpdateStudio -> Text
studioId :: Prelude.Text
}
deriving (UpdateStudio -> UpdateStudio -> Bool
(UpdateStudio -> UpdateStudio -> Bool)
-> (UpdateStudio -> UpdateStudio -> Bool) -> Eq UpdateStudio
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStudio -> UpdateStudio -> Bool
$c/= :: UpdateStudio -> UpdateStudio -> Bool
== :: UpdateStudio -> UpdateStudio -> Bool
$c== :: UpdateStudio -> UpdateStudio -> Bool
Prelude.Eq, ReadPrec [UpdateStudio]
ReadPrec UpdateStudio
Int -> ReadS UpdateStudio
ReadS [UpdateStudio]
(Int -> ReadS UpdateStudio)
-> ReadS [UpdateStudio]
-> ReadPrec UpdateStudio
-> ReadPrec [UpdateStudio]
-> Read UpdateStudio
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStudio]
$creadListPrec :: ReadPrec [UpdateStudio]
readPrec :: ReadPrec UpdateStudio
$creadPrec :: ReadPrec UpdateStudio
readList :: ReadS [UpdateStudio]
$creadList :: ReadS [UpdateStudio]
readsPrec :: Int -> ReadS UpdateStudio
$creadsPrec :: Int -> ReadS UpdateStudio
Prelude.Read, Int -> UpdateStudio -> ShowS
[UpdateStudio] -> ShowS
UpdateStudio -> String
(Int -> UpdateStudio -> ShowS)
-> (UpdateStudio -> String)
-> ([UpdateStudio] -> ShowS)
-> Show UpdateStudio
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStudio] -> ShowS
$cshowList :: [UpdateStudio] -> ShowS
show :: UpdateStudio -> String
$cshow :: UpdateStudio -> String
showsPrec :: Int -> UpdateStudio -> ShowS
$cshowsPrec :: Int -> UpdateStudio -> ShowS
Prelude.Show, (forall x. UpdateStudio -> Rep UpdateStudio x)
-> (forall x. Rep UpdateStudio x -> UpdateStudio)
-> Generic UpdateStudio
forall x. Rep UpdateStudio x -> UpdateStudio
forall x. UpdateStudio -> Rep UpdateStudio x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStudio x -> UpdateStudio
$cfrom :: forall x. UpdateStudio -> Rep UpdateStudio x
Prelude.Generic)
newUpdateStudio ::
Prelude.Text ->
UpdateStudio
newUpdateStudio :: Text -> UpdateStudio
newUpdateStudio Text
pStudioId_ =
UpdateStudio' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Text -> UpdateStudio
UpdateStudio'
{ $sel:clientToken:UpdateStudio' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userRoleArn:UpdateStudio' :: Maybe Text
userRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:displayName:UpdateStudio' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:adminRoleArn:UpdateStudio' :: Maybe Text
adminRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:studioId:UpdateStudio' :: Text
studioId = Text
pStudioId_
}
updateStudio_clientToken :: Lens.Lens' UpdateStudio (Prelude.Maybe Prelude.Text)
updateStudio_clientToken :: (Maybe Text -> f (Maybe Text)) -> UpdateStudio -> f UpdateStudio
updateStudio_clientToken = (UpdateStudio -> Maybe Text)
-> (UpdateStudio -> Maybe Text -> UpdateStudio)
-> Lens UpdateStudio UpdateStudio (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStudio' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateStudio' :: UpdateStudio -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe Text
a -> UpdateStudio
s {$sel:clientToken:UpdateStudio' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateStudio)
updateStudio_userRoleArn :: Lens.Lens' UpdateStudio (Prelude.Maybe Prelude.Text)
updateStudio_userRoleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateStudio -> f UpdateStudio
updateStudio_userRoleArn = (UpdateStudio -> Maybe Text)
-> (UpdateStudio -> Maybe Text -> UpdateStudio)
-> Lens UpdateStudio UpdateStudio (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStudio' {Maybe Text
userRoleArn :: Maybe Text
$sel:userRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
userRoleArn} -> Maybe Text
userRoleArn) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe Text
a -> UpdateStudio
s {$sel:userRoleArn:UpdateStudio' :: Maybe Text
userRoleArn = Maybe Text
a} :: UpdateStudio)
updateStudio_displayName :: Lens.Lens' UpdateStudio (Prelude.Maybe Prelude.Text)
updateStudio_displayName :: (Maybe Text -> f (Maybe Text)) -> UpdateStudio -> f UpdateStudio
updateStudio_displayName = (UpdateStudio -> Maybe Text)
-> (UpdateStudio -> Maybe Text -> UpdateStudio)
-> Lens UpdateStudio UpdateStudio (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStudio' {Maybe Text
displayName :: Maybe Text
$sel:displayName:UpdateStudio' :: UpdateStudio -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe Text
a -> UpdateStudio
s {$sel:displayName:UpdateStudio' :: Maybe Text
displayName = Maybe Text
a} :: UpdateStudio)
updateStudio_adminRoleArn :: Lens.Lens' UpdateStudio (Prelude.Maybe Prelude.Text)
updateStudio_adminRoleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateStudio -> f UpdateStudio
updateStudio_adminRoleArn = (UpdateStudio -> Maybe Text)
-> (UpdateStudio -> Maybe Text -> UpdateStudio)
-> Lens UpdateStudio UpdateStudio (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStudio' {Maybe Text
adminRoleArn :: Maybe Text
$sel:adminRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
adminRoleArn} -> Maybe Text
adminRoleArn) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe Text
a -> UpdateStudio
s {$sel:adminRoleArn:UpdateStudio' :: Maybe Text
adminRoleArn = Maybe Text
a} :: UpdateStudio)
updateStudio_studioId :: Lens.Lens' UpdateStudio Prelude.Text
updateStudio_studioId :: (Text -> f Text) -> UpdateStudio -> f UpdateStudio
updateStudio_studioId = (UpdateStudio -> Text)
-> (UpdateStudio -> Text -> UpdateStudio)
-> Lens UpdateStudio UpdateStudio Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStudio' {Text
studioId :: Text
$sel:studioId:UpdateStudio' :: UpdateStudio -> Text
studioId} -> Text
studioId) (\s :: UpdateStudio
s@UpdateStudio' {} Text
a -> UpdateStudio
s {$sel:studioId:UpdateStudio' :: Text
studioId = Text
a} :: UpdateStudio)
instance Core.AWSRequest UpdateStudio where
type AWSResponse UpdateStudio = UpdateStudioResponse
request :: UpdateStudio -> Request UpdateStudio
request = Service -> UpdateStudio -> Request UpdateStudio
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateStudio
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStudio)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateStudio))
-> Logger
-> Service
-> Proxy UpdateStudio
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStudio)))
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 Studio -> Int -> UpdateStudioResponse
UpdateStudioResponse'
(Maybe Studio -> Int -> UpdateStudioResponse)
-> Either String (Maybe Studio)
-> Either String (Int -> UpdateStudioResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Studio)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"studio")
Either String (Int -> UpdateStudioResponse)
-> Either String Int -> Either String UpdateStudioResponse
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 UpdateStudio
instance Prelude.NFData UpdateStudio
instance Core.ToHeaders UpdateStudio where
toHeaders :: UpdateStudio -> ResponseHeaders
toHeaders UpdateStudio' {Maybe Text
Text
studioId :: Text
adminRoleArn :: Maybe Text
displayName :: Maybe Text
userRoleArn :: Maybe Text
clientToken :: Maybe Text
$sel:studioId:UpdateStudio' :: UpdateStudio -> Text
$sel:adminRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:displayName:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:userRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:clientToken:UpdateStudio' :: UpdateStudio -> 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 UpdateStudio where
toJSON :: UpdateStudio -> Value
toJSON UpdateStudio' {Maybe Text
Text
studioId :: Text
adminRoleArn :: Maybe Text
displayName :: Maybe Text
userRoleArn :: Maybe Text
clientToken :: Maybe Text
$sel:studioId:UpdateStudio' :: UpdateStudio -> Text
$sel:adminRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:displayName:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:userRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:clientToken:UpdateStudio' :: UpdateStudio -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"userRoleArn" 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
userRoleArn,
(Text
"displayName" 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
displayName,
(Text
"adminRoleArn" 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
adminRoleArn
]
)
instance Core.ToPath UpdateStudio where
toPath :: UpdateStudio -> ByteString
toPath UpdateStudio' {Maybe Text
Text
studioId :: Text
adminRoleArn :: Maybe Text
displayName :: Maybe Text
userRoleArn :: Maybe Text
clientToken :: Maybe Text
$sel:studioId:UpdateStudio' :: UpdateStudio -> Text
$sel:adminRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:displayName:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:userRoleArn:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:clientToken:UpdateStudio' :: UpdateStudio -> 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]
instance Core.ToQuery UpdateStudio where
toQuery :: UpdateStudio -> QueryString
toQuery = QueryString -> UpdateStudio -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateStudioResponse = UpdateStudioResponse'
{
UpdateStudioResponse -> Maybe Studio
studio :: Prelude.Maybe Studio,
UpdateStudioResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateStudioResponse -> UpdateStudioResponse -> Bool
(UpdateStudioResponse -> UpdateStudioResponse -> Bool)
-> (UpdateStudioResponse -> UpdateStudioResponse -> Bool)
-> Eq UpdateStudioResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStudioResponse -> UpdateStudioResponse -> Bool
$c/= :: UpdateStudioResponse -> UpdateStudioResponse -> Bool
== :: UpdateStudioResponse -> UpdateStudioResponse -> Bool
$c== :: UpdateStudioResponse -> UpdateStudioResponse -> Bool
Prelude.Eq, ReadPrec [UpdateStudioResponse]
ReadPrec UpdateStudioResponse
Int -> ReadS UpdateStudioResponse
ReadS [UpdateStudioResponse]
(Int -> ReadS UpdateStudioResponse)
-> ReadS [UpdateStudioResponse]
-> ReadPrec UpdateStudioResponse
-> ReadPrec [UpdateStudioResponse]
-> Read UpdateStudioResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStudioResponse]
$creadListPrec :: ReadPrec [UpdateStudioResponse]
readPrec :: ReadPrec UpdateStudioResponse
$creadPrec :: ReadPrec UpdateStudioResponse
readList :: ReadS [UpdateStudioResponse]
$creadList :: ReadS [UpdateStudioResponse]
readsPrec :: Int -> ReadS UpdateStudioResponse
$creadsPrec :: Int -> ReadS UpdateStudioResponse
Prelude.Read, Int -> UpdateStudioResponse -> ShowS
[UpdateStudioResponse] -> ShowS
UpdateStudioResponse -> String
(Int -> UpdateStudioResponse -> ShowS)
-> (UpdateStudioResponse -> String)
-> ([UpdateStudioResponse] -> ShowS)
-> Show UpdateStudioResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStudioResponse] -> ShowS
$cshowList :: [UpdateStudioResponse] -> ShowS
show :: UpdateStudioResponse -> String
$cshow :: UpdateStudioResponse -> String
showsPrec :: Int -> UpdateStudioResponse -> ShowS
$cshowsPrec :: Int -> UpdateStudioResponse -> ShowS
Prelude.Show, (forall x. UpdateStudioResponse -> Rep UpdateStudioResponse x)
-> (forall x. Rep UpdateStudioResponse x -> UpdateStudioResponse)
-> Generic UpdateStudioResponse
forall x. Rep UpdateStudioResponse x -> UpdateStudioResponse
forall x. UpdateStudioResponse -> Rep UpdateStudioResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStudioResponse x -> UpdateStudioResponse
$cfrom :: forall x. UpdateStudioResponse -> Rep UpdateStudioResponse x
Prelude.Generic)
newUpdateStudioResponse ::
Prelude.Int ->
UpdateStudioResponse
newUpdateStudioResponse :: Int -> UpdateStudioResponse
newUpdateStudioResponse Int
pHttpStatus_ =
UpdateStudioResponse' :: Maybe Studio -> Int -> UpdateStudioResponse
UpdateStudioResponse'
{ $sel:studio:UpdateStudioResponse' :: Maybe Studio
studio = Maybe Studio
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateStudioResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateStudioResponse_studio :: Lens.Lens' UpdateStudioResponse (Prelude.Maybe Studio)
updateStudioResponse_studio :: (Maybe Studio -> f (Maybe Studio))
-> UpdateStudioResponse -> f UpdateStudioResponse
updateStudioResponse_studio = (UpdateStudioResponse -> Maybe Studio)
-> (UpdateStudioResponse -> Maybe Studio -> UpdateStudioResponse)
-> Lens
UpdateStudioResponse
UpdateStudioResponse
(Maybe Studio)
(Maybe Studio)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStudioResponse' {Maybe Studio
studio :: Maybe Studio
$sel:studio:UpdateStudioResponse' :: UpdateStudioResponse -> Maybe Studio
studio} -> Maybe Studio
studio) (\s :: UpdateStudioResponse
s@UpdateStudioResponse' {} Maybe Studio
a -> UpdateStudioResponse
s {$sel:studio:UpdateStudioResponse' :: Maybe Studio
studio = Maybe Studio
a} :: UpdateStudioResponse)
updateStudioResponse_httpStatus :: Lens.Lens' UpdateStudioResponse Prelude.Int
updateStudioResponse_httpStatus :: (Int -> f Int) -> UpdateStudioResponse -> f UpdateStudioResponse
updateStudioResponse_httpStatus = (UpdateStudioResponse -> Int)
-> (UpdateStudioResponse -> Int -> UpdateStudioResponse)
-> Lens UpdateStudioResponse UpdateStudioResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStudioResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateStudioResponse' :: UpdateStudioResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateStudioResponse
s@UpdateStudioResponse' {} Int
a -> UpdateStudioResponse
s {$sel:httpStatus:UpdateStudioResponse' :: Int
httpStatus = Int
a} :: UpdateStudioResponse)
instance Prelude.NFData UpdateStudioResponse