{-# 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.DataBrew.DeleteProject -- 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 an existing DataBrew project. module Amazonka.DataBrew.DeleteProject ( -- * Creating a Request DeleteProject (..), newDeleteProject, -- * Request Lenses deleteProject_name, -- * Destructuring the Response DeleteProjectResponse (..), newDeleteProjectResponse, -- * Response Lenses deleteProjectResponse_httpStatus, deleteProjectResponse_name, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.DataBrew.Types import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newDeleteProject' smart constructor. data DeleteProject = DeleteProject' { -- | The name of the project to be deleted. name :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DeleteProject' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'name', 'deleteProject_name' - The name of the project to be deleted. newDeleteProject :: -- | 'name' Prelude.Text -> DeleteProject newDeleteProject pName_ = DeleteProject' {name = pName_} -- | The name of the project to be deleted. deleteProject_name :: Lens.Lens' DeleteProject Prelude.Text deleteProject_name = Lens.lens (\DeleteProject' {name} -> name) (\s@DeleteProject' {} a -> s {name = a} :: DeleteProject) instance Core.AWSRequest DeleteProject where type AWSResponse DeleteProject = DeleteProjectResponse request overrides = Request.delete (overrides defaultService) response = Response.receiveJSON ( \s h x -> DeleteProjectResponse' Prelude.<$> (Prelude.pure (Prelude.fromEnum s)) Prelude.<*> (x Data..:> "Name") ) instance Prelude.Hashable DeleteProject where hashWithSalt _salt DeleteProject' {..} = _salt `Prelude.hashWithSalt` name instance Prelude.NFData DeleteProject where rnf DeleteProject' {..} = Prelude.rnf name instance Data.ToHeaders DeleteProject where toHeaders = Prelude.const ( Prelude.mconcat [ "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToPath DeleteProject where toPath DeleteProject' {..} = Prelude.mconcat ["/projects/", Data.toBS name] instance Data.ToQuery DeleteProject where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newDeleteProjectResponse' smart constructor. data DeleteProjectResponse = DeleteProjectResponse' { -- | The response's http status code. httpStatus :: Prelude.Int, -- | The name of the project that you deleted. name :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DeleteProjectResponse' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'httpStatus', 'deleteProjectResponse_httpStatus' - The response's http status code. -- -- 'name', 'deleteProjectResponse_name' - The name of the project that you deleted. newDeleteProjectResponse :: -- | 'httpStatus' Prelude.Int -> -- | 'name' Prelude.Text -> DeleteProjectResponse newDeleteProjectResponse pHttpStatus_ pName_ = DeleteProjectResponse' { httpStatus = pHttpStatus_, name = pName_ } -- | The response's http status code. deleteProjectResponse_httpStatus :: Lens.Lens' DeleteProjectResponse Prelude.Int deleteProjectResponse_httpStatus = Lens.lens (\DeleteProjectResponse' {httpStatus} -> httpStatus) (\s@DeleteProjectResponse' {} a -> s {httpStatus = a} :: DeleteProjectResponse) -- | The name of the project that you deleted. deleteProjectResponse_name :: Lens.Lens' DeleteProjectResponse Prelude.Text deleteProjectResponse_name = Lens.lens (\DeleteProjectResponse' {name} -> name) (\s@DeleteProjectResponse' {} a -> s {name = a} :: DeleteProjectResponse) instance Prelude.NFData DeleteProjectResponse where rnf DeleteProjectResponse' {..} = Prelude.rnf httpStatus `Prelude.seq` Prelude.rnf name