{-# 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.MigrationHubOrchestrator.DeleteWorkflowStepGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete a step group in a migration workflow.
module Amazonka.MigrationHubOrchestrator.DeleteWorkflowStepGroup
  ( -- * Creating a Request
    DeleteWorkflowStepGroup (..),
    newDeleteWorkflowStepGroup,

    -- * Request Lenses
    deleteWorkflowStepGroup_workflowId,
    deleteWorkflowStepGroup_id,

    -- * Destructuring the Response
    DeleteWorkflowStepGroupResponse (..),
    newDeleteWorkflowStepGroupResponse,

    -- * Response Lenses
    deleteWorkflowStepGroupResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDeleteWorkflowStepGroup' smart constructor.
data DeleteWorkflowStepGroup = DeleteWorkflowStepGroup'
  { -- | The ID of the migration workflow.
    DeleteWorkflowStepGroup -> Text
workflowId :: Prelude.Text,
    -- | The ID of the step group you want to delete.
    DeleteWorkflowStepGroup -> Text
id :: Prelude.Text
  }
  deriving (DeleteWorkflowStepGroup -> DeleteWorkflowStepGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWorkflowStepGroup -> DeleteWorkflowStepGroup -> Bool
$c/= :: DeleteWorkflowStepGroup -> DeleteWorkflowStepGroup -> Bool
== :: DeleteWorkflowStepGroup -> DeleteWorkflowStepGroup -> Bool
$c== :: DeleteWorkflowStepGroup -> DeleteWorkflowStepGroup -> Bool
Prelude.Eq, ReadPrec [DeleteWorkflowStepGroup]
ReadPrec DeleteWorkflowStepGroup
Int -> ReadS DeleteWorkflowStepGroup
ReadS [DeleteWorkflowStepGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWorkflowStepGroup]
$creadListPrec :: ReadPrec [DeleteWorkflowStepGroup]
readPrec :: ReadPrec DeleteWorkflowStepGroup
$creadPrec :: ReadPrec DeleteWorkflowStepGroup
readList :: ReadS [DeleteWorkflowStepGroup]
$creadList :: ReadS [DeleteWorkflowStepGroup]
readsPrec :: Int -> ReadS DeleteWorkflowStepGroup
$creadsPrec :: Int -> ReadS DeleteWorkflowStepGroup
Prelude.Read, Int -> DeleteWorkflowStepGroup -> ShowS
[DeleteWorkflowStepGroup] -> ShowS
DeleteWorkflowStepGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWorkflowStepGroup] -> ShowS
$cshowList :: [DeleteWorkflowStepGroup] -> ShowS
show :: DeleteWorkflowStepGroup -> String
$cshow :: DeleteWorkflowStepGroup -> String
showsPrec :: Int -> DeleteWorkflowStepGroup -> ShowS
$cshowsPrec :: Int -> DeleteWorkflowStepGroup -> ShowS
Prelude.Show, forall x. Rep DeleteWorkflowStepGroup x -> DeleteWorkflowStepGroup
forall x. DeleteWorkflowStepGroup -> Rep DeleteWorkflowStepGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteWorkflowStepGroup x -> DeleteWorkflowStepGroup
$cfrom :: forall x. DeleteWorkflowStepGroup -> Rep DeleteWorkflowStepGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteWorkflowStepGroup' 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:
--
-- 'workflowId', 'deleteWorkflowStepGroup_workflowId' - The ID of the migration workflow.
--
-- 'id', 'deleteWorkflowStepGroup_id' - The ID of the step group you want to delete.
newDeleteWorkflowStepGroup ::
  -- | 'workflowId'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  DeleteWorkflowStepGroup
newDeleteWorkflowStepGroup :: Text -> Text -> DeleteWorkflowStepGroup
newDeleteWorkflowStepGroup Text
pWorkflowId_ Text
pId_ =
  DeleteWorkflowStepGroup'
    { $sel:workflowId:DeleteWorkflowStepGroup' :: Text
workflowId = Text
pWorkflowId_,
      $sel:id:DeleteWorkflowStepGroup' :: Text
id = Text
pId_
    }

-- | The ID of the migration workflow.
deleteWorkflowStepGroup_workflowId :: Lens.Lens' DeleteWorkflowStepGroup Prelude.Text
deleteWorkflowStepGroup_workflowId :: Lens' DeleteWorkflowStepGroup Text
deleteWorkflowStepGroup_workflowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorkflowStepGroup' {Text
workflowId :: Text
$sel:workflowId:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
workflowId} -> Text
workflowId) (\s :: DeleteWorkflowStepGroup
s@DeleteWorkflowStepGroup' {} Text
a -> DeleteWorkflowStepGroup
s {$sel:workflowId:DeleteWorkflowStepGroup' :: Text
workflowId = Text
a} :: DeleteWorkflowStepGroup)

-- | The ID of the step group you want to delete.
deleteWorkflowStepGroup_id :: Lens.Lens' DeleteWorkflowStepGroup Prelude.Text
deleteWorkflowStepGroup_id :: Lens' DeleteWorkflowStepGroup Text
deleteWorkflowStepGroup_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorkflowStepGroup' {Text
id :: Text
$sel:id:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
id} -> Text
id) (\s :: DeleteWorkflowStepGroup
s@DeleteWorkflowStepGroup' {} Text
a -> DeleteWorkflowStepGroup
s {$sel:id:DeleteWorkflowStepGroup' :: Text
id = Text
a} :: DeleteWorkflowStepGroup)

instance Core.AWSRequest DeleteWorkflowStepGroup where
  type
    AWSResponse DeleteWorkflowStepGroup =
      DeleteWorkflowStepGroupResponse
  request :: (Service -> Service)
-> DeleteWorkflowStepGroup -> Request DeleteWorkflowStepGroup
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 DeleteWorkflowStepGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteWorkflowStepGroup)))
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 -> DeleteWorkflowStepGroupResponse
DeleteWorkflowStepGroupResponse'
            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 DeleteWorkflowStepGroup where
  hashWithSalt :: Int -> DeleteWorkflowStepGroup -> Int
hashWithSalt Int
_salt DeleteWorkflowStepGroup' {Text
id :: Text
workflowId :: Text
$sel:id:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
$sel:workflowId:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workflowId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

instance Prelude.NFData DeleteWorkflowStepGroup where
  rnf :: DeleteWorkflowStepGroup -> ()
rnf DeleteWorkflowStepGroup' {Text
id :: Text
workflowId :: Text
$sel:id:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
$sel:workflowId:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
workflowId seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id

instance Data.ToHeaders DeleteWorkflowStepGroup where
  toHeaders :: DeleteWorkflowStepGroup -> 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 DeleteWorkflowStepGroup where
  toPath :: DeleteWorkflowStepGroup -> ByteString
toPath DeleteWorkflowStepGroup' {Text
id :: Text
workflowId :: Text
$sel:id:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
$sel:workflowId:DeleteWorkflowStepGroup' :: DeleteWorkflowStepGroup -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/workflowstepgroup/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]

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

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

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

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

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