{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.PendingAggregationRequest
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Config.Types.PendingAggregationRequest where

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

-- | An object that represents the account ID and region of an aggregator
-- account that is requesting authorization but is not yet authorized.
--
-- /See:/ 'newPendingAggregationRequest' smart constructor.
data PendingAggregationRequest = PendingAggregationRequest'
  { -- | The 12-digit account ID of the account requesting to aggregate data.
    PendingAggregationRequest -> Maybe Text
requesterAccountId :: Prelude.Maybe Prelude.Text,
    -- | The region requesting to aggregate data.
    PendingAggregationRequest -> Maybe Text
requesterAwsRegion :: Prelude.Maybe Prelude.Text
  }
  deriving (PendingAggregationRequest -> PendingAggregationRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PendingAggregationRequest -> PendingAggregationRequest -> Bool
$c/= :: PendingAggregationRequest -> PendingAggregationRequest -> Bool
== :: PendingAggregationRequest -> PendingAggregationRequest -> Bool
$c== :: PendingAggregationRequest -> PendingAggregationRequest -> Bool
Prelude.Eq, ReadPrec [PendingAggregationRequest]
ReadPrec PendingAggregationRequest
Int -> ReadS PendingAggregationRequest
ReadS [PendingAggregationRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PendingAggregationRequest]
$creadListPrec :: ReadPrec [PendingAggregationRequest]
readPrec :: ReadPrec PendingAggregationRequest
$creadPrec :: ReadPrec PendingAggregationRequest
readList :: ReadS [PendingAggregationRequest]
$creadList :: ReadS [PendingAggregationRequest]
readsPrec :: Int -> ReadS PendingAggregationRequest
$creadsPrec :: Int -> ReadS PendingAggregationRequest
Prelude.Read, Int -> PendingAggregationRequest -> ShowS
[PendingAggregationRequest] -> ShowS
PendingAggregationRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PendingAggregationRequest] -> ShowS
$cshowList :: [PendingAggregationRequest] -> ShowS
show :: PendingAggregationRequest -> String
$cshow :: PendingAggregationRequest -> String
showsPrec :: Int -> PendingAggregationRequest -> ShowS
$cshowsPrec :: Int -> PendingAggregationRequest -> ShowS
Prelude.Show, forall x.
Rep PendingAggregationRequest x -> PendingAggregationRequest
forall x.
PendingAggregationRequest -> Rep PendingAggregationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PendingAggregationRequest x -> PendingAggregationRequest
$cfrom :: forall x.
PendingAggregationRequest -> Rep PendingAggregationRequest x
Prelude.Generic)

-- |
-- Create a value of 'PendingAggregationRequest' 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', 'pendingAggregationRequest_requesterAccountId' - The 12-digit account ID of the account requesting to aggregate data.
--
-- 'requesterAwsRegion', 'pendingAggregationRequest_requesterAwsRegion' - The region requesting to aggregate data.
newPendingAggregationRequest ::
  PendingAggregationRequest
newPendingAggregationRequest :: PendingAggregationRequest
newPendingAggregationRequest =
  PendingAggregationRequest'
    { $sel:requesterAccountId:PendingAggregationRequest' :: Maybe Text
requesterAccountId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:requesterAwsRegion:PendingAggregationRequest' :: Maybe Text
requesterAwsRegion = forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Data.FromJSON PendingAggregationRequest where
  parseJSON :: Value -> Parser PendingAggregationRequest
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PendingAggregationRequest"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> PendingAggregationRequest
PendingAggregationRequest'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RequesterAccountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RequesterAwsRegion")
      )

instance Prelude.Hashable PendingAggregationRequest where
  hashWithSalt :: Int -> PendingAggregationRequest -> Int
hashWithSalt Int
_salt PendingAggregationRequest' {Maybe Text
requesterAwsRegion :: Maybe Text
requesterAccountId :: Maybe Text
$sel:requesterAwsRegion:PendingAggregationRequest' :: PendingAggregationRequest -> Maybe Text
$sel:requesterAccountId:PendingAggregationRequest' :: PendingAggregationRequest -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
requesterAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
requesterAwsRegion

instance Prelude.NFData PendingAggregationRequest where
  rnf :: PendingAggregationRequest -> ()
rnf PendingAggregationRequest' {Maybe Text
requesterAwsRegion :: Maybe Text
requesterAccountId :: Maybe Text
$sel:requesterAwsRegion:PendingAggregationRequest' :: PendingAggregationRequest -> Maybe Text
$sel:requesterAccountId:PendingAggregationRequest' :: PendingAggregationRequest -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requesterAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requesterAwsRegion