{-# 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.MGN.DeleteJob -- 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 a single Job by ID. module Amazonka.MGN.DeleteJob ( -- * Creating a Request DeleteJob (..), newDeleteJob, -- * Request Lenses deleteJob_jobID, -- * Destructuring the Response DeleteJobResponse (..), newDeleteJobResponse, -- * Response Lenses deleteJobResponse_httpStatus, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.MGN.Types import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newDeleteJob' smart constructor. data DeleteJob = DeleteJob' { -- | Request to delete Job from service by Job ID. jobID :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DeleteJob' 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: -- -- 'jobID', 'deleteJob_jobID' - Request to delete Job from service by Job ID. newDeleteJob :: -- | 'jobID' Prelude.Text -> DeleteJob newDeleteJob pJobID_ = DeleteJob' {jobID = pJobID_} -- | Request to delete Job from service by Job ID. deleteJob_jobID :: Lens.Lens' DeleteJob Prelude.Text deleteJob_jobID = Lens.lens (\DeleteJob' {jobID} -> jobID) (\s@DeleteJob' {} a -> s {jobID = a} :: DeleteJob) instance Core.AWSRequest DeleteJob where type AWSResponse DeleteJob = DeleteJobResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveEmpty ( \s h x -> DeleteJobResponse' Prelude.<$> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable DeleteJob where hashWithSalt _salt DeleteJob' {..} = _salt `Prelude.hashWithSalt` jobID instance Prelude.NFData DeleteJob where rnf DeleteJob' {..} = Prelude.rnf jobID instance Data.ToHeaders DeleteJob where toHeaders = Prelude.const ( Prelude.mconcat [ "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON DeleteJob where toJSON DeleteJob' {..} = Data.object ( Prelude.catMaybes [Prelude.Just ("jobID" Data..= jobID)] ) instance Data.ToPath DeleteJob where toPath = Prelude.const "/DeleteJob" instance Data.ToQuery DeleteJob where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newDeleteJobResponse' smart constructor. data DeleteJobResponse = DeleteJobResponse' { -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DeleteJobResponse' 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', 'deleteJobResponse_httpStatus' - The response's http status code. newDeleteJobResponse :: -- | 'httpStatus' Prelude.Int -> DeleteJobResponse newDeleteJobResponse pHttpStatus_ = DeleteJobResponse' {httpStatus = pHttpStatus_} -- | The response's http status code. deleteJobResponse_httpStatus :: Lens.Lens' DeleteJobResponse Prelude.Int deleteJobResponse_httpStatus = Lens.lens (\DeleteJobResponse' {httpStatus} -> httpStatus) (\s@DeleteJobResponse' {} a -> s {httpStatus = a} :: DeleteJobResponse) instance Prelude.NFData DeleteJobResponse where rnf DeleteJobResponse' {..} = Prelude.rnf httpStatus