{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EMR.DeleteStudio
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Removes an Amazon EMR Studio from the Studio metadata store.
module Amazonka.EMR.DeleteStudio
  ( -- * Creating a Request
    DeleteStudio (..),
    newDeleteStudio,

    -- * Request Lenses
    deleteStudio_studioId,

    -- * Destructuring the Response
    DeleteStudioResponse (..),
    newDeleteStudioResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMR.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteStudio' smart constructor.
data DeleteStudio = DeleteStudio'
  { -- | The ID of the Amazon EMR Studio.
    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)

-- |
-- Create a value of 'DeleteStudio' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'studioId', 'deleteStudio_studioId' - The ID of the Amazon EMR Studio.
newDeleteStudio ::
  -- | 'studioId'
  Prelude.Text ->
  DeleteStudio
newDeleteStudio :: Text -> DeleteStudio
newDeleteStudio Text
pStudioId_ =
  DeleteStudio' {$sel:studioId:DeleteStudio' :: Text
studioId = Text
pStudioId_}

-- | The ID of the Amazon EMR Studio.
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, ToJSON a) => Service -> a -> Request a
Request.postJSON (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 =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteStudioResponse
DeleteStudioResponse'

instance Prelude.Hashable DeleteStudio where
  hashWithSalt :: Int -> DeleteStudio -> Int
hashWithSalt Int
_salt DeleteStudio' {Text
studioId :: Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
studioId

instance Prelude.NFData DeleteStudio where
  rnf :: DeleteStudio -> ()
rnf DeleteStudio' {Text
studioId :: Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
studioId

instance Data.ToHeaders DeleteStudio where
  toHeaders :: DeleteStudio -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"ElasticMapReduce.DeleteStudio" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteStudio where
  toJSON :: DeleteStudio -> Value
toJSON DeleteStudio' {Text
studioId :: Text
$sel:studioId:DeleteStudio' :: DeleteStudio -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"StudioId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
studioId)]
      )

instance Data.ToPath DeleteStudio where
  toPath :: DeleteStudio -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DeleteStudio where
  toQuery :: DeleteStudio -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteStudioResponse' smart constructor.
data DeleteStudioResponse = DeleteStudioResponse'
  {
  }
  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, ReadPrec [DeleteStudioResponse]
ReadPrec DeleteStudioResponse
Int -> ReadS DeleteStudioResponse
ReadS [DeleteStudioResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStudioResponse]
$creadListPrec :: ReadPrec [DeleteStudioResponse]
readPrec :: ReadPrec DeleteStudioResponse
$creadPrec :: ReadPrec DeleteStudioResponse
readList :: ReadS [DeleteStudioResponse]
$creadList :: ReadS [DeleteStudioResponse]
readsPrec :: Int -> ReadS DeleteStudioResponse
$creadsPrec :: Int -> ReadS DeleteStudioResponse
Prelude.Read, 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)

-- |
-- Create a value of 'DeleteStudioResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newDeleteStudioResponse ::
  DeleteStudioResponse
newDeleteStudioResponse :: DeleteStudioResponse
newDeleteStudioResponse = DeleteStudioResponse
DeleteStudioResponse'

instance Prelude.NFData DeleteStudioResponse where
  rnf :: DeleteStudioResponse -> ()
rnf DeleteStudioResponse
_ = ()