{-# 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.DeleteStudio
(
DeleteStudio (..),
newDeleteStudio,
deleteStudio_clientToken,
deleteStudio_studioId,
DeleteStudioResponse (..),
newDeleteStudioResponse,
deleteStudioResponse_httpStatus,
deleteStudioResponse_studio,
)
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 DeleteStudio = DeleteStudio'
{
DeleteStudio -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
DeleteStudio -> Text
studioId :: Prelude.Text
}
deriving (DeleteStudio -> DeleteStudio -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStudio -> DeleteStudio -> Bool
$c/= :: DeleteStudio -> DeleteStudio -> Bool
== :: DeleteStudio -> DeleteStudio -> Bool
$c== :: DeleteStudio -> DeleteStudio -> Bool
Prelude.Eq, ReadPrec [DeleteStudio]
ReadPrec DeleteStudio
Int -> ReadS DeleteStudio
ReadS [DeleteStudio]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStudio]
$creadListPrec :: ReadPrec [DeleteStudio]
readPrec :: ReadPrec DeleteStudio
$creadPrec :: ReadPrec DeleteStudio
readList :: ReadS [DeleteStudio]
$creadList :: ReadS [DeleteStudio]
readsPrec :: Int -> ReadS DeleteStudio
$creadsPrec :: Int -> ReadS DeleteStudio
Prelude.Read, Int -> DeleteStudio -> ShowS
[DeleteStudio] -> ShowS
DeleteStudio -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStudio] -> ShowS
$cshowList :: [DeleteStudio] -> ShowS
show :: DeleteStudio -> String
$cshow :: DeleteStudio -> String
showsPrec :: Int -> DeleteStudio -> ShowS
$cshowsPrec :: Int -> DeleteStudio -> ShowS
Prelude.Show, forall x. Rep DeleteStudio x -> DeleteStudio
forall x. DeleteStudio -> Rep DeleteStudio x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStudio x -> DeleteStudio
$cfrom :: forall x. DeleteStudio -> Rep DeleteStudio x
Prelude.Generic)
newDeleteStudio ::
Prelude.Text ->
DeleteStudio
newDeleteStudio :: Text -> DeleteStudio
newDeleteStudio Text
pStudioId_ =
DeleteStudio'
{ $sel:clientToken:DeleteStudio' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
$sel:studioId:DeleteStudio' :: Text
studioId = Text
pStudioId_
}
deleteStudio_clientToken :: Lens.Lens' DeleteStudio (Prelude.Maybe Prelude.Text)
deleteStudio_clientToken :: Lens' DeleteStudio (Maybe Text)
deleteStudio_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStudio' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteStudio' :: DeleteStudio -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteStudio
s@DeleteStudio' {} Maybe Text
a -> DeleteStudio
s {$sel:clientToken:DeleteStudio' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteStudio)
deleteStudio_studioId :: Lens.Lens' DeleteStudio Prelude.Text
deleteStudio_studioId :: Lens' DeleteStudio Text
deleteStudio_studioId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStudio' {Text
studioId :: Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
studioId} -> Text
studioId) (\s :: DeleteStudio
s@DeleteStudio' {} Text
a -> DeleteStudio
s {$sel:studioId:DeleteStudio' :: Text
studioId = Text
a} :: DeleteStudio)
instance Core.AWSRequest DeleteStudio where
type AWSResponse DeleteStudio = DeleteStudioResponse
request :: (Service -> Service) -> DeleteStudio -> Request DeleteStudio
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteStudio
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteStudio)))
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 ->
Int -> Studio -> DeleteStudioResponse
DeleteStudioResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"studio")
)
instance Prelude.Hashable DeleteStudio where
hashWithSalt :: Int -> DeleteStudio -> Int
hashWithSalt Int
_salt DeleteStudio' {Maybe Text
Text
studioId :: Text
clientToken :: Maybe Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
$sel:clientToken:DeleteStudio' :: DeleteStudio -> 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` Text
studioId
instance Prelude.NFData DeleteStudio where
rnf :: DeleteStudio -> ()
rnf DeleteStudio' {Maybe Text
Text
studioId :: Text
clientToken :: Maybe Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
$sel:clientToken:DeleteStudio' :: DeleteStudio -> 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 Text
studioId
instance Data.ToHeaders DeleteStudio where
toHeaders :: DeleteStudio -> ResponseHeaders
toHeaders DeleteStudio' {Maybe Text
Text
studioId :: Text
clientToken :: Maybe Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
$sel:clientToken:DeleteStudio' :: DeleteStudio -> 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.ToPath DeleteStudio where
toPath :: DeleteStudio -> ByteString
toPath DeleteStudio' {Maybe Text
Text
studioId :: Text
clientToken :: Maybe Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
$sel:clientToken:DeleteStudio' :: DeleteStudio -> 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]
instance Data.ToQuery DeleteStudio where
toQuery :: DeleteStudio -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteStudioResponse = DeleteStudioResponse'
{
DeleteStudioResponse -> Int
httpStatus :: Prelude.Int,
DeleteStudioResponse -> Studio
studio :: Studio
}
deriving (DeleteStudioResponse -> DeleteStudioResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStudioResponse -> DeleteStudioResponse -> Bool
$c/= :: DeleteStudioResponse -> DeleteStudioResponse -> Bool
== :: DeleteStudioResponse -> DeleteStudioResponse -> Bool
$c== :: DeleteStudioResponse -> DeleteStudioResponse -> Bool
Prelude.Eq, Int -> DeleteStudioResponse -> ShowS
[DeleteStudioResponse] -> ShowS
DeleteStudioResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStudioResponse] -> ShowS
$cshowList :: [DeleteStudioResponse] -> ShowS
show :: DeleteStudioResponse -> String
$cshow :: DeleteStudioResponse -> String
showsPrec :: Int -> DeleteStudioResponse -> ShowS
$cshowsPrec :: Int -> DeleteStudioResponse -> ShowS
Prelude.Show, forall x. Rep DeleteStudioResponse x -> DeleteStudioResponse
forall x. DeleteStudioResponse -> Rep DeleteStudioResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStudioResponse x -> DeleteStudioResponse
$cfrom :: forall x. DeleteStudioResponse -> Rep DeleteStudioResponse x
Prelude.Generic)
newDeleteStudioResponse ::
Prelude.Int ->
Studio ->
DeleteStudioResponse
newDeleteStudioResponse :: Int -> Studio -> DeleteStudioResponse
newDeleteStudioResponse Int
pHttpStatus_ Studio
pStudio_ =
DeleteStudioResponse'
{ $sel:httpStatus:DeleteStudioResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:studio:DeleteStudioResponse' :: Studio
studio = Studio
pStudio_
}
deleteStudioResponse_httpStatus :: Lens.Lens' DeleteStudioResponse Prelude.Int
deleteStudioResponse_httpStatus :: Lens' DeleteStudioResponse Int
deleteStudioResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStudioResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteStudioResponse' :: DeleteStudioResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteStudioResponse
s@DeleteStudioResponse' {} Int
a -> DeleteStudioResponse
s {$sel:httpStatus:DeleteStudioResponse' :: Int
httpStatus = Int
a} :: DeleteStudioResponse)
deleteStudioResponse_studio :: Lens.Lens' DeleteStudioResponse Studio
deleteStudioResponse_studio :: Lens' DeleteStudioResponse Studio
deleteStudioResponse_studio = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStudioResponse' {Studio
studio :: Studio
$sel:studio:DeleteStudioResponse' :: DeleteStudioResponse -> Studio
studio} -> Studio
studio) (\s :: DeleteStudioResponse
s@DeleteStudioResponse' {} Studio
a -> DeleteStudioResponse
s {$sel:studio:DeleteStudioResponse' :: Studio
studio = Studio
a} :: DeleteStudioResponse)
instance Prelude.NFData DeleteStudioResponse where
rnf :: DeleteStudioResponse -> ()
rnf DeleteStudioResponse' {Int
Studio
studio :: Studio
httpStatus :: Int
$sel:studio:DeleteStudioResponse' :: DeleteStudioResponse -> Studio
$sel:httpStatus:DeleteStudioResponse' :: DeleteStudioResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Studio
studio