{-# 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.UpdateStreamingImage
(
UpdateStreamingImage (..),
newUpdateStreamingImage,
updateStreamingImage_clientToken,
updateStreamingImage_description,
updateStreamingImage_name,
updateStreamingImage_streamingImageId,
updateStreamingImage_studioId,
UpdateStreamingImageResponse (..),
newUpdateStreamingImageResponse,
updateStreamingImageResponse_streamingImage,
updateStreamingImageResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Nimble.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateStreamingImage = UpdateStreamingImage'
{
UpdateStreamingImage -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
UpdateStreamingImage -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateStreamingImage -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateStreamingImage -> Text
streamingImageId :: Prelude.Text,
UpdateStreamingImage -> Text
studioId :: Prelude.Text
}
deriving (UpdateStreamingImage -> UpdateStreamingImage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStreamingImage -> UpdateStreamingImage -> Bool
$c/= :: UpdateStreamingImage -> UpdateStreamingImage -> Bool
== :: UpdateStreamingImage -> UpdateStreamingImage -> Bool
$c== :: UpdateStreamingImage -> UpdateStreamingImage -> Bool
Prelude.Eq, Int -> UpdateStreamingImage -> ShowS
[UpdateStreamingImage] -> ShowS
UpdateStreamingImage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStreamingImage] -> ShowS
$cshowList :: [UpdateStreamingImage] -> ShowS
show :: UpdateStreamingImage -> String
$cshow :: UpdateStreamingImage -> String
showsPrec :: Int -> UpdateStreamingImage -> ShowS
$cshowsPrec :: Int -> UpdateStreamingImage -> ShowS
Prelude.Show, forall x. Rep UpdateStreamingImage x -> UpdateStreamingImage
forall x. UpdateStreamingImage -> Rep UpdateStreamingImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStreamingImage x -> UpdateStreamingImage
$cfrom :: forall x. UpdateStreamingImage -> Rep UpdateStreamingImage x
Prelude.Generic)
newUpdateStreamingImage ::
Prelude.Text ->
Prelude.Text ->
UpdateStreamingImage
newUpdateStreamingImage :: Text -> Text -> UpdateStreamingImage
newUpdateStreamingImage Text
pStreamingImageId_ Text
pStudioId_ =
UpdateStreamingImage'
{ $sel:clientToken:UpdateStreamingImage' :: Maybe Text
clientToken =
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateStreamingImage' :: Maybe (Sensitive Text)
description = forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateStreamingImage' :: Maybe (Sensitive Text)
name = forall a. Maybe a
Prelude.Nothing,
$sel:streamingImageId:UpdateStreamingImage' :: Text
streamingImageId = Text
pStreamingImageId_,
$sel:studioId:UpdateStreamingImage' :: Text
studioId = Text
pStudioId_
}
updateStreamingImage_clientToken :: Lens.Lens' UpdateStreamingImage (Prelude.Maybe Prelude.Text)
updateStreamingImage_clientToken :: Lens' UpdateStreamingImage (Maybe Text)
updateStreamingImage_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamingImage' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateStreamingImage
s@UpdateStreamingImage' {} Maybe Text
a -> UpdateStreamingImage
s {$sel:clientToken:UpdateStreamingImage' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateStreamingImage)
updateStreamingImage_description :: Lens.Lens' UpdateStreamingImage (Prelude.Maybe Prelude.Text)
updateStreamingImage_description :: Lens' UpdateStreamingImage (Maybe Text)
updateStreamingImage_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamingImage' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateStreamingImage
s@UpdateStreamingImage' {} Maybe (Sensitive Text)
a -> UpdateStreamingImage
s {$sel:description:UpdateStreamingImage' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateStreamingImage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
updateStreamingImage_name :: Lens.Lens' UpdateStreamingImage (Prelude.Maybe Prelude.Text)
updateStreamingImage_name :: Lens' UpdateStreamingImage (Maybe Text)
updateStreamingImage_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamingImage' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: UpdateStreamingImage
s@UpdateStreamingImage' {} Maybe (Sensitive Text)
a -> UpdateStreamingImage
s {$sel:name:UpdateStreamingImage' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: UpdateStreamingImage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
updateStreamingImage_streamingImageId :: Lens.Lens' UpdateStreamingImage Prelude.Text
updateStreamingImage_streamingImageId :: Lens' UpdateStreamingImage Text
updateStreamingImage_streamingImageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamingImage' {Text
streamingImageId :: Text
$sel:streamingImageId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
streamingImageId} -> Text
streamingImageId) (\s :: UpdateStreamingImage
s@UpdateStreamingImage' {} Text
a -> UpdateStreamingImage
s {$sel:streamingImageId:UpdateStreamingImage' :: Text
streamingImageId = Text
a} :: UpdateStreamingImage)
updateStreamingImage_studioId :: Lens.Lens' UpdateStreamingImage Prelude.Text
updateStreamingImage_studioId :: Lens' UpdateStreamingImage Text
updateStreamingImage_studioId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamingImage' {Text
studioId :: Text
$sel:studioId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
studioId} -> Text
studioId) (\s :: UpdateStreamingImage
s@UpdateStreamingImage' {} Text
a -> UpdateStreamingImage
s {$sel:studioId:UpdateStreamingImage' :: Text
studioId = Text
a} :: UpdateStreamingImage)
instance Core.AWSRequest UpdateStreamingImage where
type
AWSResponse UpdateStreamingImage =
UpdateStreamingImageResponse
request :: (Service -> Service)
-> UpdateStreamingImage -> Request UpdateStreamingImage
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateStreamingImage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateStreamingImage)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe StreamingImage -> Int -> UpdateStreamingImageResponse
UpdateStreamingImageResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"streamingImage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateStreamingImage where
hashWithSalt :: Int -> UpdateStreamingImage -> Int
hashWithSalt Int
_salt UpdateStreamingImage' {Maybe Text
Maybe (Sensitive Text)
Text
studioId :: Text
streamingImageId :: Text
name :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
clientToken :: Maybe Text
$sel:studioId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:streamingImageId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:name:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:description:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:clientToken:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
streamingImageId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
studioId
instance Prelude.NFData UpdateStreamingImage where
rnf :: UpdateStreamingImage -> ()
rnf UpdateStreamingImage' {Maybe Text
Maybe (Sensitive Text)
Text
studioId :: Text
streamingImageId :: Text
name :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
clientToken :: Maybe Text
$sel:studioId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:streamingImageId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:name:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:description:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:clientToken:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
streamingImageId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
studioId
instance Data.ToHeaders UpdateStreamingImage where
toHeaders :: UpdateStreamingImage -> ResponseHeaders
toHeaders UpdateStreamingImage' {Maybe Text
Maybe (Sensitive Text)
Text
studioId :: Text
streamingImageId :: Text
name :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
clientToken :: Maybe Text
$sel:studioId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:streamingImageId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:name:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:description:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:clientToken:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Client-Token" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
clientToken,
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"application/x-amz-json-1.1" :: Prelude.ByteString)
]
instance Data.ToJSON UpdateStreamingImage where
toJSON :: UpdateStreamingImage -> Value
toJSON UpdateStreamingImage' {Maybe Text
Maybe (Sensitive Text)
Text
studioId :: Text
streamingImageId :: Text
name :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
clientToken :: Maybe Text
$sel:studioId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:streamingImageId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:name:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:description:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:clientToken:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
(Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
name
]
)
instance Data.ToPath UpdateStreamingImage where
toPath :: UpdateStreamingImage -> ByteString
toPath UpdateStreamingImage' {Maybe Text
Maybe (Sensitive Text)
Text
studioId :: Text
streamingImageId :: Text
name :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
clientToken :: Maybe Text
$sel:studioId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:streamingImageId:UpdateStreamingImage' :: UpdateStreamingImage -> Text
$sel:name:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:description:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe (Sensitive Text)
$sel:clientToken:UpdateStreamingImage' :: UpdateStreamingImage -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-08-01/studios/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
studioId,
ByteString
"/streaming-images/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
streamingImageId
]
instance Data.ToQuery UpdateStreamingImage where
toQuery :: UpdateStreamingImage -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateStreamingImageResponse = UpdateStreamingImageResponse'
{ UpdateStreamingImageResponse -> Maybe StreamingImage
streamingImage :: Prelude.Maybe StreamingImage,
UpdateStreamingImageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateStreamingImageResponse
-> UpdateStreamingImageResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStreamingImageResponse
-> UpdateStreamingImageResponse -> Bool
$c/= :: UpdateStreamingImageResponse
-> UpdateStreamingImageResponse -> Bool
== :: UpdateStreamingImageResponse
-> UpdateStreamingImageResponse -> Bool
$c== :: UpdateStreamingImageResponse
-> UpdateStreamingImageResponse -> Bool
Prelude.Eq, Int -> UpdateStreamingImageResponse -> ShowS
[UpdateStreamingImageResponse] -> ShowS
UpdateStreamingImageResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStreamingImageResponse] -> ShowS
$cshowList :: [UpdateStreamingImageResponse] -> ShowS
show :: UpdateStreamingImageResponse -> String
$cshow :: UpdateStreamingImageResponse -> String
showsPrec :: Int -> UpdateStreamingImageResponse -> ShowS
$cshowsPrec :: Int -> UpdateStreamingImageResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateStreamingImageResponse x -> UpdateStreamingImageResponse
forall x.
UpdateStreamingImageResponse -> Rep UpdateStreamingImageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateStreamingImageResponse x -> UpdateStreamingImageResponse
$cfrom :: forall x.
UpdateStreamingImageResponse -> Rep UpdateStreamingImageResponse x
Prelude.Generic)
newUpdateStreamingImageResponse ::
Prelude.Int ->
UpdateStreamingImageResponse
newUpdateStreamingImageResponse :: Int -> UpdateStreamingImageResponse
newUpdateStreamingImageResponse Int
pHttpStatus_ =
UpdateStreamingImageResponse'
{ $sel:streamingImage:UpdateStreamingImageResponse' :: Maybe StreamingImage
streamingImage =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateStreamingImageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateStreamingImageResponse_streamingImage :: Lens.Lens' UpdateStreamingImageResponse (Prelude.Maybe StreamingImage)
updateStreamingImageResponse_streamingImage :: Lens' UpdateStreamingImageResponse (Maybe StreamingImage)
updateStreamingImageResponse_streamingImage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamingImageResponse' {Maybe StreamingImage
streamingImage :: Maybe StreamingImage
$sel:streamingImage:UpdateStreamingImageResponse' :: UpdateStreamingImageResponse -> Maybe StreamingImage
streamingImage} -> Maybe StreamingImage
streamingImage) (\s :: UpdateStreamingImageResponse
s@UpdateStreamingImageResponse' {} Maybe StreamingImage
a -> UpdateStreamingImageResponse
s {$sel:streamingImage:UpdateStreamingImageResponse' :: Maybe StreamingImage
streamingImage = Maybe StreamingImage
a} :: UpdateStreamingImageResponse)
updateStreamingImageResponse_httpStatus :: Lens.Lens' UpdateStreamingImageResponse Prelude.Int
updateStreamingImageResponse_httpStatus :: Lens' UpdateStreamingImageResponse Int
updateStreamingImageResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStreamingImageResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateStreamingImageResponse' :: UpdateStreamingImageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateStreamingImageResponse
s@UpdateStreamingImageResponse' {} Int
a -> UpdateStreamingImageResponse
s {$sel:httpStatus:UpdateStreamingImageResponse' :: Int
httpStatus = Int
a} :: UpdateStreamingImageResponse)
instance Prelude.NFData UpdateStreamingImageResponse where
rnf :: UpdateStreamingImageResponse -> ()
rnf UpdateStreamingImageResponse' {Int
Maybe StreamingImage
httpStatus :: Int
streamingImage :: Maybe StreamingImage
$sel:httpStatus:UpdateStreamingImageResponse' :: UpdateStreamingImageResponse -> Int
$sel:streamingImage:UpdateStreamingImageResponse' :: UpdateStreamingImageResponse -> Maybe StreamingImage
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingImage
streamingImage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus