{-# 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.SimSpaceWeaver.DeleteSimulation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes all SimSpace Weaver resources assigned to the given simulation.
--
-- Your simulation uses resources in other Amazon Web Services services.
-- This API operation doesn\'t delete resources in other Amazon Web
-- Services services.
module Amazonka.SimSpaceWeaver.DeleteSimulation
  ( -- * Creating a Request
    DeleteSimulation (..),
    newDeleteSimulation,

    -- * Request Lenses
    deleteSimulation_simulation,

    -- * Destructuring the Response
    DeleteSimulationResponse (..),
    newDeleteSimulationResponse,

    -- * Response Lenses
    deleteSimulationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDeleteSimulation' smart constructor.
data DeleteSimulation = DeleteSimulation'
  { -- | The name of the simulation.
    DeleteSimulation -> Text
simulation :: Prelude.Text
  }
  deriving (DeleteSimulation -> DeleteSimulation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSimulation -> DeleteSimulation -> Bool
$c/= :: DeleteSimulation -> DeleteSimulation -> Bool
== :: DeleteSimulation -> DeleteSimulation -> Bool
$c== :: DeleteSimulation -> DeleteSimulation -> Bool
Prelude.Eq, ReadPrec [DeleteSimulation]
ReadPrec DeleteSimulation
Int -> ReadS DeleteSimulation
ReadS [DeleteSimulation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSimulation]
$creadListPrec :: ReadPrec [DeleteSimulation]
readPrec :: ReadPrec DeleteSimulation
$creadPrec :: ReadPrec DeleteSimulation
readList :: ReadS [DeleteSimulation]
$creadList :: ReadS [DeleteSimulation]
readsPrec :: Int -> ReadS DeleteSimulation
$creadsPrec :: Int -> ReadS DeleteSimulation
Prelude.Read, Int -> DeleteSimulation -> ShowS
[DeleteSimulation] -> ShowS
DeleteSimulation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSimulation] -> ShowS
$cshowList :: [DeleteSimulation] -> ShowS
show :: DeleteSimulation -> String
$cshow :: DeleteSimulation -> String
showsPrec :: Int -> DeleteSimulation -> ShowS
$cshowsPrec :: Int -> DeleteSimulation -> ShowS
Prelude.Show, forall x. Rep DeleteSimulation x -> DeleteSimulation
forall x. DeleteSimulation -> Rep DeleteSimulation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSimulation x -> DeleteSimulation
$cfrom :: forall x. DeleteSimulation -> Rep DeleteSimulation x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSimulation' 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:
--
-- 'simulation', 'deleteSimulation_simulation' - The name of the simulation.
newDeleteSimulation ::
  -- | 'simulation'
  Prelude.Text ->
  DeleteSimulation
newDeleteSimulation :: Text -> DeleteSimulation
newDeleteSimulation Text
pSimulation_ =
  DeleteSimulation' {$sel:simulation:DeleteSimulation' :: Text
simulation = Text
pSimulation_}

-- | The name of the simulation.
deleteSimulation_simulation :: Lens.Lens' DeleteSimulation Prelude.Text
deleteSimulation_simulation :: Lens' DeleteSimulation Text
deleteSimulation_simulation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSimulation' {Text
simulation :: Text
$sel:simulation:DeleteSimulation' :: DeleteSimulation -> Text
simulation} -> Text
simulation) (\s :: DeleteSimulation
s@DeleteSimulation' {} Text
a -> DeleteSimulation
s {$sel:simulation:DeleteSimulation' :: Text
simulation = Text
a} :: DeleteSimulation)

instance Core.AWSRequest DeleteSimulation where
  type
    AWSResponse DeleteSimulation =
      DeleteSimulationResponse
  request :: (Service -> Service)
-> DeleteSimulation -> Request DeleteSimulation
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 DeleteSimulation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSimulation)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteSimulationResponse
DeleteSimulationResponse'
            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))
      )

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

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

instance Data.ToHeaders DeleteSimulation where
  toHeaders :: DeleteSimulation -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

instance Data.ToQuery DeleteSimulation where
  toQuery :: DeleteSimulation -> QueryString
toQuery DeleteSimulation' {Text
simulation :: Text
$sel:simulation:DeleteSimulation' :: DeleteSimulation -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"simulation" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
simulation]

-- | /See:/ 'newDeleteSimulationResponse' smart constructor.
data DeleteSimulationResponse = DeleteSimulationResponse'
  { -- | The response's http status code.
    DeleteSimulationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteSimulationResponse -> DeleteSimulationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSimulationResponse -> DeleteSimulationResponse -> Bool
$c/= :: DeleteSimulationResponse -> DeleteSimulationResponse -> Bool
== :: DeleteSimulationResponse -> DeleteSimulationResponse -> Bool
$c== :: DeleteSimulationResponse -> DeleteSimulationResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSimulationResponse]
ReadPrec DeleteSimulationResponse
Int -> ReadS DeleteSimulationResponse
ReadS [DeleteSimulationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSimulationResponse]
$creadListPrec :: ReadPrec [DeleteSimulationResponse]
readPrec :: ReadPrec DeleteSimulationResponse
$creadPrec :: ReadPrec DeleteSimulationResponse
readList :: ReadS [DeleteSimulationResponse]
$creadList :: ReadS [DeleteSimulationResponse]
readsPrec :: Int -> ReadS DeleteSimulationResponse
$creadsPrec :: Int -> ReadS DeleteSimulationResponse
Prelude.Read, Int -> DeleteSimulationResponse -> ShowS
[DeleteSimulationResponse] -> ShowS
DeleteSimulationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSimulationResponse] -> ShowS
$cshowList :: [DeleteSimulationResponse] -> ShowS
show :: DeleteSimulationResponse -> String
$cshow :: DeleteSimulationResponse -> String
showsPrec :: Int -> DeleteSimulationResponse -> ShowS
$cshowsPrec :: Int -> DeleteSimulationResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteSimulationResponse x -> DeleteSimulationResponse
forall x.
DeleteSimulationResponse -> Rep DeleteSimulationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSimulationResponse x -> DeleteSimulationResponse
$cfrom :: forall x.
DeleteSimulationResponse -> Rep DeleteSimulationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSimulationResponse' 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:
--
-- 'httpStatus', 'deleteSimulationResponse_httpStatus' - The response's http status code.
newDeleteSimulationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteSimulationResponse
newDeleteSimulationResponse :: Int -> DeleteSimulationResponse
newDeleteSimulationResponse Int
pHttpStatus_ =
  DeleteSimulationResponse'
    { $sel:httpStatus:DeleteSimulationResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteSimulationResponse_httpStatus :: Lens.Lens' DeleteSimulationResponse Prelude.Int
deleteSimulationResponse_httpStatus :: Lens' DeleteSimulationResponse Int
deleteSimulationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSimulationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSimulationResponse' :: DeleteSimulationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSimulationResponse
s@DeleteSimulationResponse' {} Int
a -> DeleteSimulationResponse
s {$sel:httpStatus:DeleteSimulationResponse' :: Int
httpStatus = Int
a} :: DeleteSimulationResponse)

instance Prelude.NFData DeleteSimulationResponse where
  rnf :: DeleteSimulationResponse -> ()
rnf DeleteSimulationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSimulationResponse' :: DeleteSimulationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus