{-# 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.BillingConductor.Types.AccountAssociationsListElement
-- 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.BillingConductor.Types.AccountAssociationsListElement 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

-- | A representation of a linked account.
--
-- /See:/ 'newAccountAssociationsListElement' smart constructor.
data AccountAssociationsListElement = AccountAssociationsListElement'
  { -- | The Amazon Web Services account email.
    AccountAssociationsListElement -> Maybe (Sensitive Text)
accountEmail :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The associating array of account IDs.
    AccountAssociationsListElement -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account name.
    AccountAssociationsListElement -> Maybe (Sensitive Text)
accountName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The Billing Group Arn that the linked account is associated to.
    AccountAssociationsListElement -> Maybe Text
billingGroupArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AccountAssociationsListElement
-> AccountAssociationsListElement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountAssociationsListElement
-> AccountAssociationsListElement -> Bool
$c/= :: AccountAssociationsListElement
-> AccountAssociationsListElement -> Bool
== :: AccountAssociationsListElement
-> AccountAssociationsListElement -> Bool
$c== :: AccountAssociationsListElement
-> AccountAssociationsListElement -> Bool
Prelude.Eq, Int -> AccountAssociationsListElement -> ShowS
[AccountAssociationsListElement] -> ShowS
AccountAssociationsListElement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountAssociationsListElement] -> ShowS
$cshowList :: [AccountAssociationsListElement] -> ShowS
show :: AccountAssociationsListElement -> String
$cshow :: AccountAssociationsListElement -> String
showsPrec :: Int -> AccountAssociationsListElement -> ShowS
$cshowsPrec :: Int -> AccountAssociationsListElement -> ShowS
Prelude.Show, forall x.
Rep AccountAssociationsListElement x
-> AccountAssociationsListElement
forall x.
AccountAssociationsListElement
-> Rep AccountAssociationsListElement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AccountAssociationsListElement x
-> AccountAssociationsListElement
$cfrom :: forall x.
AccountAssociationsListElement
-> Rep AccountAssociationsListElement x
Prelude.Generic)

-- |
-- Create a value of 'AccountAssociationsListElement' 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:
--
-- 'accountEmail', 'accountAssociationsListElement_accountEmail' - The Amazon Web Services account email.
--
-- 'accountId', 'accountAssociationsListElement_accountId' - The associating array of account IDs.
--
-- 'accountName', 'accountAssociationsListElement_accountName' - The Amazon Web Services account name.
--
-- 'billingGroupArn', 'accountAssociationsListElement_billingGroupArn' - The Billing Group Arn that the linked account is associated to.
newAccountAssociationsListElement ::
  AccountAssociationsListElement
newAccountAssociationsListElement :: AccountAssociationsListElement
newAccountAssociationsListElement =
  AccountAssociationsListElement'
    { $sel:accountEmail:AccountAssociationsListElement' :: Maybe (Sensitive Text)
accountEmail =
        forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:AccountAssociationsListElement' :: Maybe Text
accountId = forall a. Maybe a
Prelude.Nothing,
      $sel:accountName:AccountAssociationsListElement' :: Maybe (Sensitive Text)
accountName = forall a. Maybe a
Prelude.Nothing,
      $sel:billingGroupArn:AccountAssociationsListElement' :: Maybe Text
billingGroupArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Web Services account email.
accountAssociationsListElement_accountEmail :: Lens.Lens' AccountAssociationsListElement (Prelude.Maybe Prelude.Text)
accountAssociationsListElement_accountEmail :: Lens' AccountAssociationsListElement (Maybe Text)
accountAssociationsListElement_accountEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssociationsListElement' {Maybe (Sensitive Text)
accountEmail :: Maybe (Sensitive Text)
$sel:accountEmail:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe (Sensitive Text)
accountEmail} -> Maybe (Sensitive Text)
accountEmail) (\s :: AccountAssociationsListElement
s@AccountAssociationsListElement' {} Maybe (Sensitive Text)
a -> AccountAssociationsListElement
s {$sel:accountEmail:AccountAssociationsListElement' :: Maybe (Sensitive Text)
accountEmail = Maybe (Sensitive Text)
a} :: AccountAssociationsListElement) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The associating array of account IDs.
accountAssociationsListElement_accountId :: Lens.Lens' AccountAssociationsListElement (Prelude.Maybe Prelude.Text)
accountAssociationsListElement_accountId :: Lens' AccountAssociationsListElement (Maybe Text)
accountAssociationsListElement_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssociationsListElement' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AccountAssociationsListElement
s@AccountAssociationsListElement' {} Maybe Text
a -> AccountAssociationsListElement
s {$sel:accountId:AccountAssociationsListElement' :: Maybe Text
accountId = Maybe Text
a} :: AccountAssociationsListElement)

-- | The Amazon Web Services account name.
accountAssociationsListElement_accountName :: Lens.Lens' AccountAssociationsListElement (Prelude.Maybe Prelude.Text)
accountAssociationsListElement_accountName :: Lens' AccountAssociationsListElement (Maybe Text)
accountAssociationsListElement_accountName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssociationsListElement' {Maybe (Sensitive Text)
accountName :: Maybe (Sensitive Text)
$sel:accountName:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe (Sensitive Text)
accountName} -> Maybe (Sensitive Text)
accountName) (\s :: AccountAssociationsListElement
s@AccountAssociationsListElement' {} Maybe (Sensitive Text)
a -> AccountAssociationsListElement
s {$sel:accountName:AccountAssociationsListElement' :: Maybe (Sensitive Text)
accountName = Maybe (Sensitive Text)
a} :: AccountAssociationsListElement) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The Billing Group Arn that the linked account is associated to.
accountAssociationsListElement_billingGroupArn :: Lens.Lens' AccountAssociationsListElement (Prelude.Maybe Prelude.Text)
accountAssociationsListElement_billingGroupArn :: Lens' AccountAssociationsListElement (Maybe Text)
accountAssociationsListElement_billingGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssociationsListElement' {Maybe Text
billingGroupArn :: Maybe Text
$sel:billingGroupArn:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe Text
billingGroupArn} -> Maybe Text
billingGroupArn) (\s :: AccountAssociationsListElement
s@AccountAssociationsListElement' {} Maybe Text
a -> AccountAssociationsListElement
s {$sel:billingGroupArn:AccountAssociationsListElement' :: Maybe Text
billingGroupArn = Maybe Text
a} :: AccountAssociationsListElement)

instance Data.FromJSON AccountAssociationsListElement where
  parseJSON :: Value -> Parser AccountAssociationsListElement
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AccountAssociationsListElement"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> AccountAssociationsListElement
AccountAssociationsListElement'
            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
"AccountEmail")
            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
"AccountId")
            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
"AccountName")
            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
"BillingGroupArn")
      )

instance
  Prelude.Hashable
    AccountAssociationsListElement
  where
  hashWithSalt :: Int -> AccountAssociationsListElement -> Int
hashWithSalt
    Int
_salt
    AccountAssociationsListElement' {Maybe Text
Maybe (Sensitive Text)
billingGroupArn :: Maybe Text
accountName :: Maybe (Sensitive Text)
accountId :: Maybe Text
accountEmail :: Maybe (Sensitive Text)
$sel:billingGroupArn:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe Text
$sel:accountName:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe (Sensitive Text)
$sel:accountId:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe Text
$sel:accountEmail:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe (Sensitive Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
accountEmail
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
accountName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
billingGroupArn

instance
  Prelude.NFData
    AccountAssociationsListElement
  where
  rnf :: AccountAssociationsListElement -> ()
rnf AccountAssociationsListElement' {Maybe Text
Maybe (Sensitive Text)
billingGroupArn :: Maybe Text
accountName :: Maybe (Sensitive Text)
accountId :: Maybe Text
accountEmail :: Maybe (Sensitive Text)
$sel:billingGroupArn:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe Text
$sel:accountName:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe (Sensitive Text)
$sel:accountId:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe Text
$sel:accountEmail:AccountAssociationsListElement' :: AccountAssociationsListElement -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
accountEmail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
accountName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
billingGroupArn