{-# 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.GuardDuty.Types.AccountFreeTrialInfo
-- 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.GuardDuty.Types.AccountFreeTrialInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GuardDuty.Types.DataSourcesFreeTrial
import qualified Amazonka.Prelude as Prelude

-- | Provides details of the GuardDuty member account that uses a free trial
-- service.
--
-- /See:/ 'newAccountFreeTrialInfo' smart constructor.
data AccountFreeTrialInfo = AccountFreeTrialInfo'
  { -- | The account identifier of the GuardDuty member account.
    AccountFreeTrialInfo -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | Describes the data source enabled for the GuardDuty member account.
    AccountFreeTrialInfo -> Maybe DataSourcesFreeTrial
dataSources :: Prelude.Maybe DataSourcesFreeTrial
  }
  deriving (AccountFreeTrialInfo -> AccountFreeTrialInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountFreeTrialInfo -> AccountFreeTrialInfo -> Bool
$c/= :: AccountFreeTrialInfo -> AccountFreeTrialInfo -> Bool
== :: AccountFreeTrialInfo -> AccountFreeTrialInfo -> Bool
$c== :: AccountFreeTrialInfo -> AccountFreeTrialInfo -> Bool
Prelude.Eq, ReadPrec [AccountFreeTrialInfo]
ReadPrec AccountFreeTrialInfo
Int -> ReadS AccountFreeTrialInfo
ReadS [AccountFreeTrialInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountFreeTrialInfo]
$creadListPrec :: ReadPrec [AccountFreeTrialInfo]
readPrec :: ReadPrec AccountFreeTrialInfo
$creadPrec :: ReadPrec AccountFreeTrialInfo
readList :: ReadS [AccountFreeTrialInfo]
$creadList :: ReadS [AccountFreeTrialInfo]
readsPrec :: Int -> ReadS AccountFreeTrialInfo
$creadsPrec :: Int -> ReadS AccountFreeTrialInfo
Prelude.Read, Int -> AccountFreeTrialInfo -> ShowS
[AccountFreeTrialInfo] -> ShowS
AccountFreeTrialInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountFreeTrialInfo] -> ShowS
$cshowList :: [AccountFreeTrialInfo] -> ShowS
show :: AccountFreeTrialInfo -> String
$cshow :: AccountFreeTrialInfo -> String
showsPrec :: Int -> AccountFreeTrialInfo -> ShowS
$cshowsPrec :: Int -> AccountFreeTrialInfo -> ShowS
Prelude.Show, forall x. Rep AccountFreeTrialInfo x -> AccountFreeTrialInfo
forall x. AccountFreeTrialInfo -> Rep AccountFreeTrialInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountFreeTrialInfo x -> AccountFreeTrialInfo
$cfrom :: forall x. AccountFreeTrialInfo -> Rep AccountFreeTrialInfo x
Prelude.Generic)

-- |
-- Create a value of 'AccountFreeTrialInfo' 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', 'accountFreeTrialInfo_accountId' - The account identifier of the GuardDuty member account.
--
-- 'dataSources', 'accountFreeTrialInfo_dataSources' - Describes the data source enabled for the GuardDuty member account.
newAccountFreeTrialInfo ::
  AccountFreeTrialInfo
newAccountFreeTrialInfo :: AccountFreeTrialInfo
newAccountFreeTrialInfo =
  AccountFreeTrialInfo'
    { $sel:accountId:AccountFreeTrialInfo' :: Maybe Text
accountId = forall a. Maybe a
Prelude.Nothing,
      $sel:dataSources:AccountFreeTrialInfo' :: Maybe DataSourcesFreeTrial
dataSources = forall a. Maybe a
Prelude.Nothing
    }

-- | The account identifier of the GuardDuty member account.
accountFreeTrialInfo_accountId :: Lens.Lens' AccountFreeTrialInfo (Prelude.Maybe Prelude.Text)
accountFreeTrialInfo_accountId :: Lens' AccountFreeTrialInfo (Maybe Text)
accountFreeTrialInfo_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountFreeTrialInfo' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AccountFreeTrialInfo' :: AccountFreeTrialInfo -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AccountFreeTrialInfo
s@AccountFreeTrialInfo' {} Maybe Text
a -> AccountFreeTrialInfo
s {$sel:accountId:AccountFreeTrialInfo' :: Maybe Text
accountId = Maybe Text
a} :: AccountFreeTrialInfo)

-- | Describes the data source enabled for the GuardDuty member account.
accountFreeTrialInfo_dataSources :: Lens.Lens' AccountFreeTrialInfo (Prelude.Maybe DataSourcesFreeTrial)
accountFreeTrialInfo_dataSources :: Lens' AccountFreeTrialInfo (Maybe DataSourcesFreeTrial)
accountFreeTrialInfo_dataSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountFreeTrialInfo' {Maybe DataSourcesFreeTrial
dataSources :: Maybe DataSourcesFreeTrial
$sel:dataSources:AccountFreeTrialInfo' :: AccountFreeTrialInfo -> Maybe DataSourcesFreeTrial
dataSources} -> Maybe DataSourcesFreeTrial
dataSources) (\s :: AccountFreeTrialInfo
s@AccountFreeTrialInfo' {} Maybe DataSourcesFreeTrial
a -> AccountFreeTrialInfo
s {$sel:dataSources:AccountFreeTrialInfo' :: Maybe DataSourcesFreeTrial
dataSources = Maybe DataSourcesFreeTrial
a} :: AccountFreeTrialInfo)

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

instance Prelude.Hashable AccountFreeTrialInfo where
  hashWithSalt :: Int -> AccountFreeTrialInfo -> Int
hashWithSalt Int
_salt AccountFreeTrialInfo' {Maybe Text
Maybe DataSourcesFreeTrial
dataSources :: Maybe DataSourcesFreeTrial
accountId :: Maybe Text
$sel:dataSources:AccountFreeTrialInfo' :: AccountFreeTrialInfo -> Maybe DataSourcesFreeTrial
$sel:accountId:AccountFreeTrialInfo' :: AccountFreeTrialInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataSourcesFreeTrial
dataSources

instance Prelude.NFData AccountFreeTrialInfo where
  rnf :: AccountFreeTrialInfo -> ()
rnf AccountFreeTrialInfo' {Maybe Text
Maybe DataSourcesFreeTrial
dataSources :: Maybe DataSourcesFreeTrial
accountId :: Maybe Text
$sel:dataSources:AccountFreeTrialInfo' :: AccountFreeTrialInfo -> Maybe DataSourcesFreeTrial
$sel:accountId:AccountFreeTrialInfo' :: AccountFreeTrialInfo -> Maybe Text
..} =
    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 DataSourcesFreeTrial
dataSources