{-# 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.Config.DeletePendingAggregationRequest
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes pending authorization requests for a specified aggregator
-- account in a specified region.
module Amazonka.Config.DeletePendingAggregationRequest
  ( -- * Creating a Request
    DeletePendingAggregationRequest (..),
    newDeletePendingAggregationRequest,

    -- * Request Lenses
    deletePendingAggregationRequest_requesterAccountId,
    deletePendingAggregationRequest_requesterAwsRegion,

    -- * Destructuring the Response
    DeletePendingAggregationRequestResponse (..),
    newDeletePendingAggregationRequestResponse,
  )
where

import Amazonka.Config.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeletePendingAggregationRequest' smart constructor.
data DeletePendingAggregationRequest = DeletePendingAggregationRequest'
  { -- | The 12-digit account ID of the account requesting to aggregate data.
    DeletePendingAggregationRequest -> Text
requesterAccountId :: Prelude.Text,
    -- | The region requesting to aggregate data.
    DeletePendingAggregationRequest -> Text
requesterAwsRegion :: Prelude.Text
  }
  deriving (DeletePendingAggregationRequest
-> DeletePendingAggregationRequest -> Bool
(DeletePendingAggregationRequest
 -> DeletePendingAggregationRequest -> Bool)
-> (DeletePendingAggregationRequest
    -> DeletePendingAggregationRequest -> Bool)
-> Eq DeletePendingAggregationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePendingAggregationRequest
-> DeletePendingAggregationRequest -> Bool
$c/= :: DeletePendingAggregationRequest
-> DeletePendingAggregationRequest -> Bool
== :: DeletePendingAggregationRequest
-> DeletePendingAggregationRequest -> Bool
$c== :: DeletePendingAggregationRequest
-> DeletePendingAggregationRequest -> Bool
Prelude.Eq, ReadPrec [DeletePendingAggregationRequest]
ReadPrec DeletePendingAggregationRequest
Int -> ReadS DeletePendingAggregationRequest
ReadS [DeletePendingAggregationRequest]
(Int -> ReadS DeletePendingAggregationRequest)
-> ReadS [DeletePendingAggregationRequest]
-> ReadPrec DeletePendingAggregationRequest
-> ReadPrec [DeletePendingAggregationRequest]
-> Read DeletePendingAggregationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePendingAggregationRequest]
$creadListPrec :: ReadPrec [DeletePendingAggregationRequest]
readPrec :: ReadPrec DeletePendingAggregationRequest
$creadPrec :: ReadPrec DeletePendingAggregationRequest
readList :: ReadS [DeletePendingAggregationRequest]
$creadList :: ReadS [DeletePendingAggregationRequest]
readsPrec :: Int -> ReadS DeletePendingAggregationRequest
$creadsPrec :: Int -> ReadS DeletePendingAggregationRequest
Prelude.Read, Int -> DeletePendingAggregationRequest -> ShowS
[DeletePendingAggregationRequest] -> ShowS
DeletePendingAggregationRequest -> String
(Int -> DeletePendingAggregationRequest -> ShowS)
-> (DeletePendingAggregationRequest -> String)
-> ([DeletePendingAggregationRequest] -> ShowS)
-> Show DeletePendingAggregationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePendingAggregationRequest] -> ShowS
$cshowList :: [DeletePendingAggregationRequest] -> ShowS
show :: DeletePendingAggregationRequest -> String
$cshow :: DeletePendingAggregationRequest -> String
showsPrec :: Int -> DeletePendingAggregationRequest -> ShowS
$cshowsPrec :: Int -> DeletePendingAggregationRequest -> ShowS
Prelude.Show, (forall x.
 DeletePendingAggregationRequest
 -> Rep DeletePendingAggregationRequest x)
-> (forall x.
    Rep DeletePendingAggregationRequest x
    -> DeletePendingAggregationRequest)
-> Generic DeletePendingAggregationRequest
forall x.
Rep DeletePendingAggregationRequest x
-> DeletePendingAggregationRequest
forall x.
DeletePendingAggregationRequest
-> Rep DeletePendingAggregationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePendingAggregationRequest x
-> DeletePendingAggregationRequest
$cfrom :: forall x.
DeletePendingAggregationRequest
-> Rep DeletePendingAggregationRequest x
Prelude.Generic)

-- |
-- Create a value of 'DeletePendingAggregationRequest' 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:
--
-- 'requesterAccountId', 'deletePendingAggregationRequest_requesterAccountId' - The 12-digit account ID of the account requesting to aggregate data.
--
-- 'requesterAwsRegion', 'deletePendingAggregationRequest_requesterAwsRegion' - The region requesting to aggregate data.
newDeletePendingAggregationRequest ::
  -- | 'requesterAccountId'
  Prelude.Text ->
  -- | 'requesterAwsRegion'
  Prelude.Text ->
  DeletePendingAggregationRequest
newDeletePendingAggregationRequest :: Text -> Text -> DeletePendingAggregationRequest
newDeletePendingAggregationRequest
  Text
pRequesterAccountId_
  Text
pRequesterAwsRegion_ =
    DeletePendingAggregationRequest' :: Text -> Text -> DeletePendingAggregationRequest
DeletePendingAggregationRequest'
      { $sel:requesterAccountId:DeletePendingAggregationRequest' :: Text
requesterAccountId =
          Text
pRequesterAccountId_,
        $sel:requesterAwsRegion:DeletePendingAggregationRequest' :: Text
requesterAwsRegion = Text
pRequesterAwsRegion_
      }

-- | The 12-digit account ID of the account requesting to aggregate data.
deletePendingAggregationRequest_requesterAccountId :: Lens.Lens' DeletePendingAggregationRequest Prelude.Text
deletePendingAggregationRequest_requesterAccountId :: (Text -> f Text)
-> DeletePendingAggregationRequest
-> f DeletePendingAggregationRequest
deletePendingAggregationRequest_requesterAccountId = (DeletePendingAggregationRequest -> Text)
-> (DeletePendingAggregationRequest
    -> Text -> DeletePendingAggregationRequest)
-> Lens
     DeletePendingAggregationRequest
     DeletePendingAggregationRequest
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePendingAggregationRequest' {Text
requesterAccountId :: Text
$sel:requesterAccountId:DeletePendingAggregationRequest' :: DeletePendingAggregationRequest -> Text
requesterAccountId} -> Text
requesterAccountId) (\s :: DeletePendingAggregationRequest
s@DeletePendingAggregationRequest' {} Text
a -> DeletePendingAggregationRequest
s {$sel:requesterAccountId:DeletePendingAggregationRequest' :: Text
requesterAccountId = Text
a} :: DeletePendingAggregationRequest)

-- | The region requesting to aggregate data.
deletePendingAggregationRequest_requesterAwsRegion :: Lens.Lens' DeletePendingAggregationRequest Prelude.Text
deletePendingAggregationRequest_requesterAwsRegion :: (Text -> f Text)
-> DeletePendingAggregationRequest
-> f DeletePendingAggregationRequest
deletePendingAggregationRequest_requesterAwsRegion = (DeletePendingAggregationRequest -> Text)
-> (DeletePendingAggregationRequest
    -> Text -> DeletePendingAggregationRequest)
-> Lens
     DeletePendingAggregationRequest
     DeletePendingAggregationRequest
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePendingAggregationRequest' {Text
requesterAwsRegion :: Text
$sel:requesterAwsRegion:DeletePendingAggregationRequest' :: DeletePendingAggregationRequest -> Text
requesterAwsRegion} -> Text
requesterAwsRegion) (\s :: DeletePendingAggregationRequest
s@DeletePendingAggregationRequest' {} Text
a -> DeletePendingAggregationRequest
s {$sel:requesterAwsRegion:DeletePendingAggregationRequest' :: Text
requesterAwsRegion = Text
a} :: DeletePendingAggregationRequest)

instance
  Core.AWSRequest
    DeletePendingAggregationRequest
  where
  type
    AWSResponse DeletePendingAggregationRequest =
      DeletePendingAggregationRequestResponse
  request :: DeletePendingAggregationRequest
-> Request DeletePendingAggregationRequest
request = Service
-> DeletePendingAggregationRequest
-> Request DeletePendingAggregationRequest
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeletePendingAggregationRequest
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeletePendingAggregationRequest)))
response =
    AWSResponse DeletePendingAggregationRequest
-> Logger
-> Service
-> Proxy DeletePendingAggregationRequest
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeletePendingAggregationRequest)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeletePendingAggregationRequest
DeletePendingAggregationRequestResponse
DeletePendingAggregationRequestResponse'

instance
  Prelude.Hashable
    DeletePendingAggregationRequest

instance
  Prelude.NFData
    DeletePendingAggregationRequest

instance
  Core.ToHeaders
    DeletePendingAggregationRequest
  where
  toHeaders :: DeletePendingAggregationRequest -> [Header]
toHeaders =
    [Header] -> DeletePendingAggregationRequest -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"StarlingDoveService.DeletePendingAggregationRequest" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeletePendingAggregationRequest where
  toJSON :: DeletePendingAggregationRequest -> Value
toJSON DeletePendingAggregationRequest' {Text
requesterAwsRegion :: Text
requesterAccountId :: Text
$sel:requesterAwsRegion:DeletePendingAggregationRequest' :: DeletePendingAggregationRequest -> Text
$sel:requesterAccountId:DeletePendingAggregationRequest' :: DeletePendingAggregationRequest -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RequesterAccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
requesterAccountId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RequesterAwsRegion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
requesterAwsRegion)
          ]
      )

instance Core.ToPath DeletePendingAggregationRequest where
  toPath :: DeletePendingAggregationRequest -> ByteString
toPath = ByteString -> DeletePendingAggregationRequest -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DeletePendingAggregationRequest where
  toQuery :: DeletePendingAggregationRequest -> QueryString
toQuery = QueryString -> DeletePendingAggregationRequest -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeletePendingAggregationRequestResponse' smart constructor.
data DeletePendingAggregationRequestResponse = DeletePendingAggregationRequestResponse'
  {
  }
  deriving (DeletePendingAggregationRequestResponse
-> DeletePendingAggregationRequestResponse -> Bool
(DeletePendingAggregationRequestResponse
 -> DeletePendingAggregationRequestResponse -> Bool)
-> (DeletePendingAggregationRequestResponse
    -> DeletePendingAggregationRequestResponse -> Bool)
-> Eq DeletePendingAggregationRequestResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePendingAggregationRequestResponse
-> DeletePendingAggregationRequestResponse -> Bool
$c/= :: DeletePendingAggregationRequestResponse
-> DeletePendingAggregationRequestResponse -> Bool
== :: DeletePendingAggregationRequestResponse
-> DeletePendingAggregationRequestResponse -> Bool
$c== :: DeletePendingAggregationRequestResponse
-> DeletePendingAggregationRequestResponse -> Bool
Prelude.Eq, ReadPrec [DeletePendingAggregationRequestResponse]
ReadPrec DeletePendingAggregationRequestResponse
Int -> ReadS DeletePendingAggregationRequestResponse
ReadS [DeletePendingAggregationRequestResponse]
(Int -> ReadS DeletePendingAggregationRequestResponse)
-> ReadS [DeletePendingAggregationRequestResponse]
-> ReadPrec DeletePendingAggregationRequestResponse
-> ReadPrec [DeletePendingAggregationRequestResponse]
-> Read DeletePendingAggregationRequestResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePendingAggregationRequestResponse]
$creadListPrec :: ReadPrec [DeletePendingAggregationRequestResponse]
readPrec :: ReadPrec DeletePendingAggregationRequestResponse
$creadPrec :: ReadPrec DeletePendingAggregationRequestResponse
readList :: ReadS [DeletePendingAggregationRequestResponse]
$creadList :: ReadS [DeletePendingAggregationRequestResponse]
readsPrec :: Int -> ReadS DeletePendingAggregationRequestResponse
$creadsPrec :: Int -> ReadS DeletePendingAggregationRequestResponse
Prelude.Read, Int -> DeletePendingAggregationRequestResponse -> ShowS
[DeletePendingAggregationRequestResponse] -> ShowS
DeletePendingAggregationRequestResponse -> String
(Int -> DeletePendingAggregationRequestResponse -> ShowS)
-> (DeletePendingAggregationRequestResponse -> String)
-> ([DeletePendingAggregationRequestResponse] -> ShowS)
-> Show DeletePendingAggregationRequestResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePendingAggregationRequestResponse] -> ShowS
$cshowList :: [DeletePendingAggregationRequestResponse] -> ShowS
show :: DeletePendingAggregationRequestResponse -> String
$cshow :: DeletePendingAggregationRequestResponse -> String
showsPrec :: Int -> DeletePendingAggregationRequestResponse -> ShowS
$cshowsPrec :: Int -> DeletePendingAggregationRequestResponse -> ShowS
Prelude.Show, (forall x.
 DeletePendingAggregationRequestResponse
 -> Rep DeletePendingAggregationRequestResponse x)
-> (forall x.
    Rep DeletePendingAggregationRequestResponse x
    -> DeletePendingAggregationRequestResponse)
-> Generic DeletePendingAggregationRequestResponse
forall x.
Rep DeletePendingAggregationRequestResponse x
-> DeletePendingAggregationRequestResponse
forall x.
DeletePendingAggregationRequestResponse
-> Rep DeletePendingAggregationRequestResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePendingAggregationRequestResponse x
-> DeletePendingAggregationRequestResponse
$cfrom :: forall x.
DeletePendingAggregationRequestResponse
-> Rep DeletePendingAggregationRequestResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeletePendingAggregationRequestResponse' 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.
newDeletePendingAggregationRequestResponse ::
  DeletePendingAggregationRequestResponse
newDeletePendingAggregationRequestResponse :: DeletePendingAggregationRequestResponse
newDeletePendingAggregationRequestResponse =
  DeletePendingAggregationRequestResponse
DeletePendingAggregationRequestResponse'

instance
  Prelude.NFData
    DeletePendingAggregationRequestResponse