{-# 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.UpdateStudio
(
UpdateStudio (..),
newUpdateStudio,
updateStudio_subnetIds,
updateStudio_defaultS3Location,
updateStudio_name,
updateStudio_description,
updateStudio_studioId,
UpdateStudioResponse (..),
newUpdateStudioResponse,
)
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 UpdateStudio = UpdateStudio'
{
UpdateStudio -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
UpdateStudio -> Maybe Text
defaultS3Location :: Prelude.Maybe Prelude.Text,
UpdateStudio -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateStudio -> Maybe Text
description :: 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:subnetIds:UpdateStudio' :: Maybe [Text]
subnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:defaultS3Location:UpdateStudio' :: Maybe Text
defaultS3Location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateStudio' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateStudio' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:studioId:UpdateStudio' :: Text
studioId = Text
pStudioId_
}
updateStudio_subnetIds :: Lens.Lens' UpdateStudio (Prelude.Maybe [Prelude.Text])
updateStudio_subnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateStudio -> f UpdateStudio
updateStudio_subnetIds = (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]
subnetIds :: Maybe [Text]
$sel:subnetIds:UpdateStudio' :: UpdateStudio -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe [Text]
a -> UpdateStudio
s {$sel:subnetIds:UpdateStudio' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: UpdateStudio) ((Maybe [Text] -> f (Maybe [Text]))
-> UpdateStudio -> f UpdateStudio)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateStudio
-> f UpdateStudio
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateStudio_defaultS3Location :: Lens.Lens' UpdateStudio (Prelude.Maybe Prelude.Text)
updateStudio_defaultS3Location :: (Maybe Text -> f (Maybe Text)) -> UpdateStudio -> f UpdateStudio
updateStudio_defaultS3Location = (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
defaultS3Location :: Maybe Text
$sel:defaultS3Location:UpdateStudio' :: UpdateStudio -> Maybe Text
defaultS3Location} -> Maybe Text
defaultS3Location) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe Text
a -> UpdateStudio
s {$sel:defaultS3Location:UpdateStudio' :: Maybe Text
defaultS3Location = Maybe Text
a} :: UpdateStudio)
updateStudio_name :: Lens.Lens' UpdateStudio (Prelude.Maybe Prelude.Text)
updateStudio_name :: (Maybe Text -> f (Maybe Text)) -> UpdateStudio -> f UpdateStudio
updateStudio_name = (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
name :: Maybe Text
$sel:name:UpdateStudio' :: UpdateStudio -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe Text
a -> UpdateStudio
s {$sel:name:UpdateStudio' :: Maybe Text
name = Maybe Text
a} :: UpdateStudio)
updateStudio_description :: Lens.Lens' UpdateStudio (Prelude.Maybe Prelude.Text)
updateStudio_description :: (Maybe Text -> f (Maybe Text)) -> UpdateStudio -> f UpdateStudio
updateStudio_description = (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
description :: Maybe Text
$sel:description:UpdateStudio' :: UpdateStudio -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateStudio
s@UpdateStudio' {} Maybe Text
a -> UpdateStudio
s {$sel:description:UpdateStudio' :: Maybe Text
description = 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.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateStudio
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStudio)))
response = AWSResponse UpdateStudio
-> Logger
-> Service
-> Proxy UpdateStudio
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStudio)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateStudio
UpdateStudioResponse
UpdateStudioResponse'
instance Prelude.Hashable UpdateStudio
instance Prelude.NFData UpdateStudio
instance Core.ToHeaders UpdateStudio where
toHeaders :: UpdateStudio -> [Header]
toHeaders =
[Header] -> UpdateStudio -> [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.UpdateStudio" ::
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 UpdateStudio where
toJSON :: UpdateStudio -> Value
toJSON UpdateStudio' {Maybe [Text]
Maybe Text
Text
studioId :: Text
description :: Maybe Text
name :: Maybe Text
defaultS3Location :: Maybe Text
subnetIds :: Maybe [Text]
$sel:studioId:UpdateStudio' :: UpdateStudio -> Text
$sel:description:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:name:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:defaultS3Location:UpdateStudio' :: UpdateStudio -> Maybe Text
$sel:subnetIds:UpdateStudio' :: UpdateStudio -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SubnetIds" 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]
subnetIds,
(Text
"DefaultS3Location" 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
defaultS3Location,
(Text
"Name" 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
name,
(Text
"Description" 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
description,
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)
]
)
instance Core.ToPath UpdateStudio where
toPath :: UpdateStudio -> ByteString
toPath = ByteString -> UpdateStudio -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
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'
{
}
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 ::
UpdateStudioResponse
newUpdateStudioResponse :: UpdateStudioResponse
newUpdateStudioResponse = UpdateStudioResponse
UpdateStudioResponse'
instance Prelude.NFData UpdateStudioResponse