{-# 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.DAX.DeleteCluster -- 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 previously provisioned DAX cluster. /DeleteCluster/ deletes -- all associated nodes, node endpoints and the DAX cluster itself. When -- you receive a successful response from this action, DAX immediately -- begins deleting the cluster; you cannot cancel or revert this action. module Amazonka.DAX.DeleteCluster ( -- * Creating a Request DeleteCluster (..), newDeleteCluster, -- * Request Lenses deleteCluster_clusterName, -- * Destructuring the Response DeleteClusterResponse (..), newDeleteClusterResponse, -- * Response Lenses deleteClusterResponse_cluster, deleteClusterResponse_httpStatus, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import Amazonka.DAX.Types import qualified Amazonka.Data as Data import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newDeleteCluster' smart constructor. data DeleteCluster = DeleteCluster' { -- | The name of the cluster to be deleted. clusterName :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DeleteCluster' 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: -- -- 'clusterName', 'deleteCluster_clusterName' - The name of the cluster to be deleted. newDeleteCluster :: -- | 'clusterName' Prelude.Text -> DeleteCluster newDeleteCluster pClusterName_ = DeleteCluster' {clusterName = pClusterName_} -- | The name of the cluster to be deleted. deleteCluster_clusterName :: Lens.Lens' DeleteCluster Prelude.Text deleteCluster_clusterName = Lens.lens (\DeleteCluster' {clusterName} -> clusterName) (\s@DeleteCluster' {} a -> s {clusterName = a} :: DeleteCluster) instance Core.AWSRequest DeleteCluster where type AWSResponse DeleteCluster = DeleteClusterResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveJSON ( \s h x -> DeleteClusterResponse' Prelude.<$> (x Data..?> "Cluster") Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable DeleteCluster where hashWithSalt _salt DeleteCluster' {..} = _salt `Prelude.hashWithSalt` clusterName instance Prelude.NFData DeleteCluster where rnf DeleteCluster' {..} = Prelude.rnf clusterName instance Data.ToHeaders DeleteCluster where toHeaders = Prelude.const ( Prelude.mconcat [ "X-Amz-Target" Data.=# ("AmazonDAXV3.DeleteCluster" :: Prelude.ByteString), "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON DeleteCluster where toJSON DeleteCluster' {..} = Data.object ( Prelude.catMaybes [Prelude.Just ("ClusterName" Data..= clusterName)] ) instance Data.ToPath DeleteCluster where toPath = Prelude.const "/" instance Data.ToQuery DeleteCluster where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newDeleteClusterResponse' smart constructor. data DeleteClusterResponse = DeleteClusterResponse' { -- | A description of the DAX cluster that is being deleted. cluster :: Prelude.Maybe Cluster, -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DeleteClusterResponse' 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: -- -- 'cluster', 'deleteClusterResponse_cluster' - A description of the DAX cluster that is being deleted. -- -- 'httpStatus', 'deleteClusterResponse_httpStatus' - The response's http status code. newDeleteClusterResponse :: -- | 'httpStatus' Prelude.Int -> DeleteClusterResponse newDeleteClusterResponse pHttpStatus_ = DeleteClusterResponse' { cluster = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | A description of the DAX cluster that is being deleted. deleteClusterResponse_cluster :: Lens.Lens' DeleteClusterResponse (Prelude.Maybe Cluster) deleteClusterResponse_cluster = Lens.lens (\DeleteClusterResponse' {cluster} -> cluster) (\s@DeleteClusterResponse' {} a -> s {cluster = a} :: DeleteClusterResponse) -- | The response's http status code. deleteClusterResponse_httpStatus :: Lens.Lens' DeleteClusterResponse Prelude.Int deleteClusterResponse_httpStatus = Lens.lens (\DeleteClusterResponse' {httpStatus} -> httpStatus) (\s@DeleteClusterResponse' {} a -> s {httpStatus = a} :: DeleteClusterResponse) instance Prelude.NFData DeleteClusterResponse where rnf DeleteClusterResponse' {..} = Prelude.rnf cluster `Prelude.seq` Prelude.rnf httpStatus