{-# 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-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)
module Amazonka.Config.Types.PendingAggregationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(PendingAggregationRequest -> PendingAggregationRequest -> Bool)
-> (PendingAggregationRequest -> PendingAggregationRequest -> Bool)
-> Eq PendingAggregationRequest
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]
(Int -> ReadS PendingAggregationRequest)
-> ReadS [PendingAggregationRequest]
-> ReadPrec PendingAggregationRequest
-> ReadPrec [PendingAggregationRequest]
-> Read 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
(Int -> PendingAggregationRequest -> ShowS)
-> (PendingAggregationRequest -> String)
-> ([PendingAggregationRequest] -> ShowS)
-> Show PendingAggregationRequest
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.
 PendingAggregationRequest -> Rep PendingAggregationRequest x)
-> (forall x.
    Rep PendingAggregationRequest x -> PendingAggregationRequest)
-> Generic PendingAggregationRequest
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' :: Maybe Text -> Maybe Text -> PendingAggregationRequest
PendingAggregationRequest'
    { $sel:requesterAccountId:PendingAggregationRequest' :: Maybe Text
requesterAccountId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requesterAwsRegion:PendingAggregationRequest' :: Maybe Text
requesterAwsRegion = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> PendingAggregationRequest -> f PendingAggregationRequest
pendingAggregationRequest_requesterAccountId = (PendingAggregationRequest -> Maybe Text)
-> (PendingAggregationRequest
    -> Maybe Text -> PendingAggregationRequest)
-> Lens
     PendingAggregationRequest
     PendingAggregationRequest
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> PendingAggregationRequest -> f PendingAggregationRequest
pendingAggregationRequest_requesterAwsRegion = (PendingAggregationRequest -> Maybe Text)
-> (PendingAggregationRequest
    -> Maybe Text -> PendingAggregationRequest)
-> Lens
     PendingAggregationRequest
     PendingAggregationRequest
     (Maybe Text)
     (Maybe Text)
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 Core.FromJSON PendingAggregationRequest where
  parseJSON :: Value -> Parser PendingAggregationRequest
parseJSON =
    String
-> (Object -> Parser PendingAggregationRequest)
-> Value
-> Parser PendingAggregationRequest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PendingAggregationRequest"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> PendingAggregationRequest
PendingAggregationRequest'
            (Maybe Text -> Maybe Text -> PendingAggregationRequest)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PendingAggregationRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequesterAccountId")
            Parser (Maybe Text -> PendingAggregationRequest)
-> Parser (Maybe Text) -> Parser PendingAggregationRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequesterAwsRegion")
      )

instance Prelude.Hashable PendingAggregationRequest

instance Prelude.NFData PendingAggregationRequest