{-# 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.DrS.Types.Account
-- 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.DrS.Types.Account 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

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

-- |
-- Create a value of 'Account' 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:
--
-- 'accountID', 'account_accountID' - Account ID of AWS account.
newAccount ::
  Account
newAccount :: Account
newAccount = Account' {$sel:accountID:Account' :: Maybe Text
accountID = forall a. Maybe a
Prelude.Nothing}

-- | Account ID of AWS account.
account_accountID :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_accountID :: Lens' Account (Maybe Text)
account_accountID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe Text
accountID :: Maybe Text
$sel:accountID:Account' :: Account -> Maybe Text
accountID} -> Maybe Text
accountID) (\s :: Account
s@Account' {} Maybe Text
a -> Account
s {$sel:accountID:Account' :: Maybe Text
accountID = Maybe Text
a} :: Account)

instance Data.FromJSON Account where
  parseJSON :: Value -> Parser Account
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Account"
      ( \Object
x ->
          Maybe Text -> Account
Account' 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
"accountID")
      )

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

instance Prelude.NFData Account where
  rnf :: Account -> ()
rnf Account' {Maybe Text
accountID :: Maybe Text
$sel:accountID:Account' :: Account -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountID