{-# 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 #-}
module Amazonka.BillingConductor.Types.AccountGrouping 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
data AccountGrouping = AccountGrouping'
{
AccountGrouping -> NonEmpty Text
linkedAccountIds :: Prelude.NonEmpty Prelude.Text
}
deriving (AccountGrouping -> AccountGrouping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountGrouping -> AccountGrouping -> Bool
$c/= :: AccountGrouping -> AccountGrouping -> Bool
== :: AccountGrouping -> AccountGrouping -> Bool
$c== :: AccountGrouping -> AccountGrouping -> Bool
Prelude.Eq, ReadPrec [AccountGrouping]
ReadPrec AccountGrouping
Int -> ReadS AccountGrouping
ReadS [AccountGrouping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountGrouping]
$creadListPrec :: ReadPrec [AccountGrouping]
readPrec :: ReadPrec AccountGrouping
$creadPrec :: ReadPrec AccountGrouping
readList :: ReadS [AccountGrouping]
$creadList :: ReadS [AccountGrouping]
readsPrec :: Int -> ReadS AccountGrouping
$creadsPrec :: Int -> ReadS AccountGrouping
Prelude.Read, Int -> AccountGrouping -> ShowS
[AccountGrouping] -> ShowS
AccountGrouping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountGrouping] -> ShowS
$cshowList :: [AccountGrouping] -> ShowS
show :: AccountGrouping -> String
$cshow :: AccountGrouping -> String
showsPrec :: Int -> AccountGrouping -> ShowS
$cshowsPrec :: Int -> AccountGrouping -> ShowS
Prelude.Show, forall x. Rep AccountGrouping x -> AccountGrouping
forall x. AccountGrouping -> Rep AccountGrouping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountGrouping x -> AccountGrouping
$cfrom :: forall x. AccountGrouping -> Rep AccountGrouping x
Prelude.Generic)
newAccountGrouping ::
Prelude.NonEmpty Prelude.Text ->
AccountGrouping
newAccountGrouping :: NonEmpty Text -> AccountGrouping
newAccountGrouping NonEmpty Text
pLinkedAccountIds_ =
AccountGrouping'
{ $sel:linkedAccountIds:AccountGrouping' :: NonEmpty Text
linkedAccountIds =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pLinkedAccountIds_
}
accountGrouping_linkedAccountIds :: Lens.Lens' AccountGrouping (Prelude.NonEmpty Prelude.Text)
accountGrouping_linkedAccountIds :: Lens' AccountGrouping (NonEmpty Text)
accountGrouping_linkedAccountIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountGrouping' {NonEmpty Text
linkedAccountIds :: NonEmpty Text
$sel:linkedAccountIds:AccountGrouping' :: AccountGrouping -> NonEmpty Text
linkedAccountIds} -> NonEmpty Text
linkedAccountIds) (\s :: AccountGrouping
s@AccountGrouping' {} NonEmpty Text
a -> AccountGrouping
s {$sel:linkedAccountIds:AccountGrouping' :: NonEmpty Text
linkedAccountIds = NonEmpty Text
a} :: AccountGrouping) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable AccountGrouping where
hashWithSalt :: Int -> AccountGrouping -> Int
hashWithSalt Int
_salt AccountGrouping' {NonEmpty Text
linkedAccountIds :: NonEmpty Text
$sel:linkedAccountIds:AccountGrouping' :: AccountGrouping -> NonEmpty Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
linkedAccountIds
instance Prelude.NFData AccountGrouping where
rnf :: AccountGrouping -> ()
rnf AccountGrouping' {NonEmpty Text
linkedAccountIds :: NonEmpty Text
$sel:linkedAccountIds:AccountGrouping' :: AccountGrouping -> NonEmpty Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
linkedAccountIds
instance Data.ToJSON AccountGrouping where
toJSON :: AccountGrouping -> Value
toJSON AccountGrouping' {NonEmpty Text
linkedAccountIds :: NonEmpty Text
$sel:linkedAccountIds:AccountGrouping' :: AccountGrouping -> NonEmpty Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"LinkedAccountIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
linkedAccountIds)
]
)