amazonka-organizations-2.0: gen/Amazonka/Organizations/DeleteOrganization.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.Organizations.DeleteOrganization
-- 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 the organization. You can delete an organization only by using
-- credentials from the management account. The organization must be empty
-- of member accounts.
module Amazonka.Organizations.DeleteOrganization
( -- * Creating a Request
DeleteOrganization (..),
newDeleteOrganization,
-- * Destructuring the Response
DeleteOrganizationResponse (..),
newDeleteOrganizationResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
-- | /See:/ 'newDeleteOrganization' smart constructor.
data DeleteOrganization = DeleteOrganization'
{
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteOrganization' 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.
newDeleteOrganization ::
DeleteOrganization
newDeleteOrganization = DeleteOrganization'
instance Core.AWSRequest DeleteOrganization where
type
AWSResponse DeleteOrganization =
DeleteOrganizationResponse
request overrides =
Request.postJSON (overrides defaultService)
response =
Response.receiveNull DeleteOrganizationResponse'
instance Prelude.Hashable DeleteOrganization where
hashWithSalt _salt _ =
_salt `Prelude.hashWithSalt` ()
instance Prelude.NFData DeleteOrganization where
rnf _ = ()
instance Data.ToHeaders DeleteOrganization where
toHeaders =
Prelude.const
( Prelude.mconcat
[ "X-Amz-Target"
Data.=# ( "AWSOrganizationsV20161128.DeleteOrganization" ::
Prelude.ByteString
),
"Content-Type"
Data.=# ( "application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteOrganization where
toJSON = Prelude.const (Data.Object Prelude.mempty)
instance Data.ToPath DeleteOrganization where
toPath = Prelude.const "/"
instance Data.ToQuery DeleteOrganization where
toQuery = Prelude.const Prelude.mempty
-- | /See:/ 'newDeleteOrganizationResponse' smart constructor.
data DeleteOrganizationResponse = DeleteOrganizationResponse'
{
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'DeleteOrganizationResponse' 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.
newDeleteOrganizationResponse ::
DeleteOrganizationResponse
newDeleteOrganizationResponse =
DeleteOrganizationResponse'
instance Prelude.NFData DeleteOrganizationResponse where
rnf _ = ()