amazonka-connect-2.0: gen/Amazonka/Connect/DeleteInstance.hs
{-# 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.Connect.DeleteInstance
-- Copyright : (c) 2013-2023 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Deletes the Amazon Connect instance.
--
-- Amazon Connect enforces a limit on the total number of instances that
-- you can create or delete in 30 days. If you exceed this limit, you will
-- get an error message indicating there has been an excessive number of
-- attempts at creating or deleting instances. You must wait 30 days before
-- you can restart creating and deleting instances in your account.
module Amazonka.Connect.DeleteInstance
( -- * Creating a Request
DeleteInstance (..),
newDeleteInstance,
-- * Request Lenses
deleteInstance_instanceId,
-- * Destructuring the Response
DeleteInstanceResponse (..),
newDeleteInstanceResponse,
)
where
import Amazonka.Connect.Types
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
-- | /See:/ 'newDeleteInstance' smart constructor.
data DeleteInstance = DeleteInstance'
{ -- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
instanceId :: Prelude.Text
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteInstance' 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:
--
-- 'instanceId', 'deleteInstance_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
newDeleteInstance ::
-- | 'instanceId'
Prelude.Text ->
DeleteInstance
newDeleteInstance pInstanceId_ =
DeleteInstance' {instanceId = pInstanceId_}
-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
deleteInstance_instanceId :: Lens.Lens' DeleteInstance Prelude.Text
deleteInstance_instanceId = Lens.lens (\DeleteInstance' {instanceId} -> instanceId) (\s@DeleteInstance' {} a -> s {instanceId = a} :: DeleteInstance)
instance Core.AWSRequest DeleteInstance where
type
AWSResponse DeleteInstance =
DeleteInstanceResponse
request overrides =
Request.delete (overrides defaultService)
response =
Response.receiveNull DeleteInstanceResponse'
instance Prelude.Hashable DeleteInstance where
hashWithSalt _salt DeleteInstance' {..} =
_salt `Prelude.hashWithSalt` instanceId
instance Prelude.NFData DeleteInstance where
rnf DeleteInstance' {..} = Prelude.rnf instanceId
instance Data.ToHeaders DeleteInstance where
toHeaders =
Prelude.const
( Prelude.mconcat
[ "Content-Type"
Data.=# ( "application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteInstance where
toPath DeleteInstance' {..} =
Prelude.mconcat
["/instance/", Data.toBS instanceId]
instance Data.ToQuery DeleteInstance where
toQuery = Prelude.const Prelude.mempty
-- | /See:/ 'newDeleteInstanceResponse' smart constructor.
data DeleteInstanceResponse = DeleteInstanceResponse'
{
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteInstanceResponse' 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.
newDeleteInstanceResponse ::
DeleteInstanceResponse
newDeleteInstanceResponse = DeleteInstanceResponse'
instance Prelude.NFData DeleteInstanceResponse where
rnf _ = ()