{-# 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.Detective.Types.MemberDetail
-- 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.Detective.Types.MemberDetail where

import qualified Amazonka.Core as Core
import Amazonka.Detective.Types.MemberDisabledReason
import Amazonka.Detective.Types.MemberStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details about a member account that was invited to contribute to a
-- behavior graph.
--
-- /See:/ 'newMemberDetail' smart constructor.
data MemberDetail = MemberDetail'
  { -- | The date and time when the graph utilization percentage was last
    -- updated.
    MemberDetail -> Maybe POSIX
percentOfGraphUtilizationUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | The current membership status of the member account. The status can have
    -- one of the following values:
    --
    -- -   @INVITED@ - Indicates that the member was sent an invitation but has
    --     not yet responded.
    --
    -- -   @VERIFICATION_IN_PROGRESS@ - Indicates that Detective is verifying
    --     that the account identifier and email address provided for the
    --     member account match. If they do match, then Detective sends the
    --     invitation. If the email address and account identifier don\'t
    --     match, then the member cannot be added to the behavior graph.
    --
    -- -   @VERIFICATION_FAILED@ - Indicates that the account and email address
    --     provided for the member account do not match, and Detective did not
    --     send an invitation to the account.
    --
    -- -   @ENABLED@ - Indicates that the member account accepted the
    --     invitation to contribute to the behavior graph.
    --
    -- -   @ACCEPTED_BUT_DISABLED@ - Indicates that the member account accepted
    --     the invitation but is prevented from contributing data to the
    --     behavior graph. @DisabledReason@ provides the reason why the member
    --     account is not enabled.
    --
    -- Member accounts that declined an invitation or that were removed from
    -- the behavior graph are not included.
    MemberDetail -> Maybe MemberStatus
status :: Prelude.Maybe MemberStatus,
    -- | The date and time that Detective sent the invitation to the member
    -- account. The value is in milliseconds since the epoch.
    MemberDetail -> Maybe POSIX
invitedTime :: Prelude.Maybe Core.POSIX,
    -- | The AWS account identifier of the administrator account for the behavior
    -- graph.
    MemberDetail -> Maybe Text
administratorId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the behavior graph that the member account was invited to.
    MemberDetail -> Maybe Text
graphArn :: Prelude.Maybe Prelude.Text,
    -- | The AWS account identifier of the administrator account for the behavior
    -- graph.
    MemberDetail -> Maybe Text
masterId :: Prelude.Maybe Prelude.Text,
    -- | The AWS account identifier for the member account.
    MemberDetail -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | For member accounts with a status of @ACCEPTED_BUT_DISABLED@, the reason
    -- that the member account is not enabled.
    --
    -- The reason can have one of the following values:
    --
    -- -   @VOLUME_TOO_HIGH@ - Indicates that adding the member account would
    --     cause the data volume for the behavior graph to be too high.
    --
    -- -   @VOLUME_UNKNOWN@ - Indicates that Detective is unable to verify the
    --     data volume for the member account. This is usually because the
    --     member account is not enrolled in Amazon GuardDuty.
    MemberDetail -> Maybe MemberDisabledReason
disabledReason :: Prelude.Maybe MemberDisabledReason,
    -- | The member account data volume as a percentage of the maximum allowed
    -- data volume. 0 indicates 0 percent, and 100 indicates 100 percent.
    --
    -- Note that this is not the percentage of the behavior graph data volume.
    --
    -- For example, the data volume for the behavior graph is 80 GB per day.
    -- The maximum data volume is 160 GB per day. If the data volume for the
    -- member account is 40 GB per day, then @PercentOfGraphUtilization@ is 25.
    -- It represents 25% of the maximum allowed data volume.
    MemberDetail -> Maybe Double
percentOfGraphUtilization :: Prelude.Maybe Prelude.Double,
    -- | The AWS account root user email address for the member account.
    MemberDetail -> Maybe Text
emailAddress :: Prelude.Maybe Prelude.Text,
    -- | The data and time when the member account data volume was last updated.
    MemberDetail -> Maybe POSIX
volumeUsageUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | The date and time that the member account was last updated. The value is
    -- in milliseconds since the epoch.
    MemberDetail -> Maybe POSIX
updatedTime :: Prelude.Maybe Core.POSIX,
    -- | The data volume in bytes per day for the member account.
    MemberDetail -> Maybe Integer
volumeUsageInBytes :: Prelude.Maybe Prelude.Integer
  }
  deriving (MemberDetail -> MemberDetail -> Bool
(MemberDetail -> MemberDetail -> Bool)
-> (MemberDetail -> MemberDetail -> Bool) -> Eq MemberDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemberDetail -> MemberDetail -> Bool
$c/= :: MemberDetail -> MemberDetail -> Bool
== :: MemberDetail -> MemberDetail -> Bool
$c== :: MemberDetail -> MemberDetail -> Bool
Prelude.Eq, ReadPrec [MemberDetail]
ReadPrec MemberDetail
Int -> ReadS MemberDetail
ReadS [MemberDetail]
(Int -> ReadS MemberDetail)
-> ReadS [MemberDetail]
-> ReadPrec MemberDetail
-> ReadPrec [MemberDetail]
-> Read MemberDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MemberDetail]
$creadListPrec :: ReadPrec [MemberDetail]
readPrec :: ReadPrec MemberDetail
$creadPrec :: ReadPrec MemberDetail
readList :: ReadS [MemberDetail]
$creadList :: ReadS [MemberDetail]
readsPrec :: Int -> ReadS MemberDetail
$creadsPrec :: Int -> ReadS MemberDetail
Prelude.Read, Int -> MemberDetail -> ShowS
[MemberDetail] -> ShowS
MemberDetail -> String
(Int -> MemberDetail -> ShowS)
-> (MemberDetail -> String)
-> ([MemberDetail] -> ShowS)
-> Show MemberDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MemberDetail] -> ShowS
$cshowList :: [MemberDetail] -> ShowS
show :: MemberDetail -> String
$cshow :: MemberDetail -> String
showsPrec :: Int -> MemberDetail -> ShowS
$cshowsPrec :: Int -> MemberDetail -> ShowS
Prelude.Show, (forall x. MemberDetail -> Rep MemberDetail x)
-> (forall x. Rep MemberDetail x -> MemberDetail)
-> Generic MemberDetail
forall x. Rep MemberDetail x -> MemberDetail
forall x. MemberDetail -> Rep MemberDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MemberDetail x -> MemberDetail
$cfrom :: forall x. MemberDetail -> Rep MemberDetail x
Prelude.Generic)

-- |
-- Create a value of 'MemberDetail' 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:
--
-- 'percentOfGraphUtilizationUpdatedTime', 'memberDetail_percentOfGraphUtilizationUpdatedTime' - The date and time when the graph utilization percentage was last
-- updated.
--
-- 'status', 'memberDetail_status' - The current membership status of the member account. The status can have
-- one of the following values:
--
-- -   @INVITED@ - Indicates that the member was sent an invitation but has
--     not yet responded.
--
-- -   @VERIFICATION_IN_PROGRESS@ - Indicates that Detective is verifying
--     that the account identifier and email address provided for the
--     member account match. If they do match, then Detective sends the
--     invitation. If the email address and account identifier don\'t
--     match, then the member cannot be added to the behavior graph.
--
-- -   @VERIFICATION_FAILED@ - Indicates that the account and email address
--     provided for the member account do not match, and Detective did not
--     send an invitation to the account.
--
-- -   @ENABLED@ - Indicates that the member account accepted the
--     invitation to contribute to the behavior graph.
--
-- -   @ACCEPTED_BUT_DISABLED@ - Indicates that the member account accepted
--     the invitation but is prevented from contributing data to the
--     behavior graph. @DisabledReason@ provides the reason why the member
--     account is not enabled.
--
-- Member accounts that declined an invitation or that were removed from
-- the behavior graph are not included.
--
-- 'invitedTime', 'memberDetail_invitedTime' - The date and time that Detective sent the invitation to the member
-- account. The value is in milliseconds since the epoch.
--
-- 'administratorId', 'memberDetail_administratorId' - The AWS account identifier of the administrator account for the behavior
-- graph.
--
-- 'graphArn', 'memberDetail_graphArn' - The ARN of the behavior graph that the member account was invited to.
--
-- 'masterId', 'memberDetail_masterId' - The AWS account identifier of the administrator account for the behavior
-- graph.
--
-- 'accountId', 'memberDetail_accountId' - The AWS account identifier for the member account.
--
-- 'disabledReason', 'memberDetail_disabledReason' - For member accounts with a status of @ACCEPTED_BUT_DISABLED@, the reason
-- that the member account is not enabled.
--
-- The reason can have one of the following values:
--
-- -   @VOLUME_TOO_HIGH@ - Indicates that adding the member account would
--     cause the data volume for the behavior graph to be too high.
--
-- -   @VOLUME_UNKNOWN@ - Indicates that Detective is unable to verify the
--     data volume for the member account. This is usually because the
--     member account is not enrolled in Amazon GuardDuty.
--
-- 'percentOfGraphUtilization', 'memberDetail_percentOfGraphUtilization' - The member account data volume as a percentage of the maximum allowed
-- data volume. 0 indicates 0 percent, and 100 indicates 100 percent.
--
-- Note that this is not the percentage of the behavior graph data volume.
--
-- For example, the data volume for the behavior graph is 80 GB per day.
-- The maximum data volume is 160 GB per day. If the data volume for the
-- member account is 40 GB per day, then @PercentOfGraphUtilization@ is 25.
-- It represents 25% of the maximum allowed data volume.
--
-- 'emailAddress', 'memberDetail_emailAddress' - The AWS account root user email address for the member account.
--
-- 'volumeUsageUpdatedTime', 'memberDetail_volumeUsageUpdatedTime' - The data and time when the member account data volume was last updated.
--
-- 'updatedTime', 'memberDetail_updatedTime' - The date and time that the member account was last updated. The value is
-- in milliseconds since the epoch.
--
-- 'volumeUsageInBytes', 'memberDetail_volumeUsageInBytes' - The data volume in bytes per day for the member account.
newMemberDetail ::
  MemberDetail
newMemberDetail :: MemberDetail
newMemberDetail =
  MemberDetail' :: Maybe POSIX
-> Maybe MemberStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe MemberDisabledReason
-> Maybe Double
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Integer
-> MemberDetail
MemberDetail'
    { $sel:percentOfGraphUtilizationUpdatedTime:MemberDetail' :: Maybe POSIX
percentOfGraphUtilizationUpdatedTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:MemberDetail' :: Maybe MemberStatus
status = Maybe MemberStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:invitedTime:MemberDetail' :: Maybe POSIX
invitedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:administratorId:MemberDetail' :: Maybe Text
administratorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:graphArn:MemberDetail' :: Maybe Text
graphArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:masterId:MemberDetail' :: Maybe Text
masterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:MemberDetail' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disabledReason:MemberDetail' :: Maybe MemberDisabledReason
disabledReason = Maybe MemberDisabledReason
forall a. Maybe a
Prelude.Nothing,
      $sel:percentOfGraphUtilization:MemberDetail' :: Maybe Double
percentOfGraphUtilization = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:emailAddress:MemberDetail' :: Maybe Text
emailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeUsageUpdatedTime:MemberDetail' :: Maybe POSIX
volumeUsageUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedTime:MemberDetail' :: Maybe POSIX
updatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeUsageInBytes:MemberDetail' :: Maybe Integer
volumeUsageInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time when the graph utilization percentage was last
-- updated.
memberDetail_percentOfGraphUtilizationUpdatedTime :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.UTCTime)
memberDetail_percentOfGraphUtilizationUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail -> f MemberDetail
memberDetail_percentOfGraphUtilizationUpdatedTime = (MemberDetail -> Maybe POSIX)
-> (MemberDetail -> Maybe POSIX -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe POSIX
percentOfGraphUtilizationUpdatedTime :: Maybe POSIX
$sel:percentOfGraphUtilizationUpdatedTime:MemberDetail' :: MemberDetail -> Maybe POSIX
percentOfGraphUtilizationUpdatedTime} -> Maybe POSIX
percentOfGraphUtilizationUpdatedTime) (\s :: MemberDetail
s@MemberDetail' {} Maybe POSIX
a -> MemberDetail
s {$sel:percentOfGraphUtilizationUpdatedTime:MemberDetail' :: Maybe POSIX
percentOfGraphUtilizationUpdatedTime = Maybe POSIX
a} :: MemberDetail) ((Maybe POSIX -> f (Maybe POSIX))
 -> MemberDetail -> f MemberDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail
-> f MemberDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The current membership status of the member account. The status can have
-- one of the following values:
--
-- -   @INVITED@ - Indicates that the member was sent an invitation but has
--     not yet responded.
--
-- -   @VERIFICATION_IN_PROGRESS@ - Indicates that Detective is verifying
--     that the account identifier and email address provided for the
--     member account match. If they do match, then Detective sends the
--     invitation. If the email address and account identifier don\'t
--     match, then the member cannot be added to the behavior graph.
--
-- -   @VERIFICATION_FAILED@ - Indicates that the account and email address
--     provided for the member account do not match, and Detective did not
--     send an invitation to the account.
--
-- -   @ENABLED@ - Indicates that the member account accepted the
--     invitation to contribute to the behavior graph.
--
-- -   @ACCEPTED_BUT_DISABLED@ - Indicates that the member account accepted
--     the invitation but is prevented from contributing data to the
--     behavior graph. @DisabledReason@ provides the reason why the member
--     account is not enabled.
--
-- Member accounts that declined an invitation or that were removed from
-- the behavior graph are not included.
memberDetail_status :: Lens.Lens' MemberDetail (Prelude.Maybe MemberStatus)
memberDetail_status :: (Maybe MemberStatus -> f (Maybe MemberStatus))
-> MemberDetail -> f MemberDetail
memberDetail_status = (MemberDetail -> Maybe MemberStatus)
-> (MemberDetail -> Maybe MemberStatus -> MemberDetail)
-> Lens
     MemberDetail MemberDetail (Maybe MemberStatus) (Maybe MemberStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe MemberStatus
status :: Maybe MemberStatus
$sel:status:MemberDetail' :: MemberDetail -> Maybe MemberStatus
status} -> Maybe MemberStatus
status) (\s :: MemberDetail
s@MemberDetail' {} Maybe MemberStatus
a -> MemberDetail
s {$sel:status:MemberDetail' :: Maybe MemberStatus
status = Maybe MemberStatus
a} :: MemberDetail)

-- | The date and time that Detective sent the invitation to the member
-- account. The value is in milliseconds since the epoch.
memberDetail_invitedTime :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.UTCTime)
memberDetail_invitedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail -> f MemberDetail
memberDetail_invitedTime = (MemberDetail -> Maybe POSIX)
-> (MemberDetail -> Maybe POSIX -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe POSIX
invitedTime :: Maybe POSIX
$sel:invitedTime:MemberDetail' :: MemberDetail -> Maybe POSIX
invitedTime} -> Maybe POSIX
invitedTime) (\s :: MemberDetail
s@MemberDetail' {} Maybe POSIX
a -> MemberDetail
s {$sel:invitedTime:MemberDetail' :: Maybe POSIX
invitedTime = Maybe POSIX
a} :: MemberDetail) ((Maybe POSIX -> f (Maybe POSIX))
 -> MemberDetail -> f MemberDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail
-> f MemberDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The AWS account identifier of the administrator account for the behavior
-- graph.
memberDetail_administratorId :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.Text)
memberDetail_administratorId :: (Maybe Text -> f (Maybe Text)) -> MemberDetail -> f MemberDetail
memberDetail_administratorId = (MemberDetail -> Maybe Text)
-> (MemberDetail -> Maybe Text -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe Text
administratorId :: Maybe Text
$sel:administratorId:MemberDetail' :: MemberDetail -> Maybe Text
administratorId} -> Maybe Text
administratorId) (\s :: MemberDetail
s@MemberDetail' {} Maybe Text
a -> MemberDetail
s {$sel:administratorId:MemberDetail' :: Maybe Text
administratorId = Maybe Text
a} :: MemberDetail)

-- | The ARN of the behavior graph that the member account was invited to.
memberDetail_graphArn :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.Text)
memberDetail_graphArn :: (Maybe Text -> f (Maybe Text)) -> MemberDetail -> f MemberDetail
memberDetail_graphArn = (MemberDetail -> Maybe Text)
-> (MemberDetail -> Maybe Text -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe Text
graphArn :: Maybe Text
$sel:graphArn:MemberDetail' :: MemberDetail -> Maybe Text
graphArn} -> Maybe Text
graphArn) (\s :: MemberDetail
s@MemberDetail' {} Maybe Text
a -> MemberDetail
s {$sel:graphArn:MemberDetail' :: Maybe Text
graphArn = Maybe Text
a} :: MemberDetail)

-- | The AWS account identifier of the administrator account for the behavior
-- graph.
memberDetail_masterId :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.Text)
memberDetail_masterId :: (Maybe Text -> f (Maybe Text)) -> MemberDetail -> f MemberDetail
memberDetail_masterId = (MemberDetail -> Maybe Text)
-> (MemberDetail -> Maybe Text -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe Text
masterId :: Maybe Text
$sel:masterId:MemberDetail' :: MemberDetail -> Maybe Text
masterId} -> Maybe Text
masterId) (\s :: MemberDetail
s@MemberDetail' {} Maybe Text
a -> MemberDetail
s {$sel:masterId:MemberDetail' :: Maybe Text
masterId = Maybe Text
a} :: MemberDetail)

-- | The AWS account identifier for the member account.
memberDetail_accountId :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.Text)
memberDetail_accountId :: (Maybe Text -> f (Maybe Text)) -> MemberDetail -> f MemberDetail
memberDetail_accountId = (MemberDetail -> Maybe Text)
-> (MemberDetail -> Maybe Text -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe Text
accountId :: Maybe Text
$sel:accountId:MemberDetail' :: MemberDetail -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: MemberDetail
s@MemberDetail' {} Maybe Text
a -> MemberDetail
s {$sel:accountId:MemberDetail' :: Maybe Text
accountId = Maybe Text
a} :: MemberDetail)

-- | For member accounts with a status of @ACCEPTED_BUT_DISABLED@, the reason
-- that the member account is not enabled.
--
-- The reason can have one of the following values:
--
-- -   @VOLUME_TOO_HIGH@ - Indicates that adding the member account would
--     cause the data volume for the behavior graph to be too high.
--
-- -   @VOLUME_UNKNOWN@ - Indicates that Detective is unable to verify the
--     data volume for the member account. This is usually because the
--     member account is not enrolled in Amazon GuardDuty.
memberDetail_disabledReason :: Lens.Lens' MemberDetail (Prelude.Maybe MemberDisabledReason)
memberDetail_disabledReason :: (Maybe MemberDisabledReason -> f (Maybe MemberDisabledReason))
-> MemberDetail -> f MemberDetail
memberDetail_disabledReason = (MemberDetail -> Maybe MemberDisabledReason)
-> (MemberDetail -> Maybe MemberDisabledReason -> MemberDetail)
-> Lens
     MemberDetail
     MemberDetail
     (Maybe MemberDisabledReason)
     (Maybe MemberDisabledReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe MemberDisabledReason
disabledReason :: Maybe MemberDisabledReason
$sel:disabledReason:MemberDetail' :: MemberDetail -> Maybe MemberDisabledReason
disabledReason} -> Maybe MemberDisabledReason
disabledReason) (\s :: MemberDetail
s@MemberDetail' {} Maybe MemberDisabledReason
a -> MemberDetail
s {$sel:disabledReason:MemberDetail' :: Maybe MemberDisabledReason
disabledReason = Maybe MemberDisabledReason
a} :: MemberDetail)

-- | The member account data volume as a percentage of the maximum allowed
-- data volume. 0 indicates 0 percent, and 100 indicates 100 percent.
--
-- Note that this is not the percentage of the behavior graph data volume.
--
-- For example, the data volume for the behavior graph is 80 GB per day.
-- The maximum data volume is 160 GB per day. If the data volume for the
-- member account is 40 GB per day, then @PercentOfGraphUtilization@ is 25.
-- It represents 25% of the maximum allowed data volume.
memberDetail_percentOfGraphUtilization :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.Double)
memberDetail_percentOfGraphUtilization :: (Maybe Double -> f (Maybe Double))
-> MemberDetail -> f MemberDetail
memberDetail_percentOfGraphUtilization = (MemberDetail -> Maybe Double)
-> (MemberDetail -> Maybe Double -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe Double
percentOfGraphUtilization :: Maybe Double
$sel:percentOfGraphUtilization:MemberDetail' :: MemberDetail -> Maybe Double
percentOfGraphUtilization} -> Maybe Double
percentOfGraphUtilization) (\s :: MemberDetail
s@MemberDetail' {} Maybe Double
a -> MemberDetail
s {$sel:percentOfGraphUtilization:MemberDetail' :: Maybe Double
percentOfGraphUtilization = Maybe Double
a} :: MemberDetail)

-- | The AWS account root user email address for the member account.
memberDetail_emailAddress :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.Text)
memberDetail_emailAddress :: (Maybe Text -> f (Maybe Text)) -> MemberDetail -> f MemberDetail
memberDetail_emailAddress = (MemberDetail -> Maybe Text)
-> (MemberDetail -> Maybe Text -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe Text
emailAddress :: Maybe Text
$sel:emailAddress:MemberDetail' :: MemberDetail -> Maybe Text
emailAddress} -> Maybe Text
emailAddress) (\s :: MemberDetail
s@MemberDetail' {} Maybe Text
a -> MemberDetail
s {$sel:emailAddress:MemberDetail' :: Maybe Text
emailAddress = Maybe Text
a} :: MemberDetail)

-- | The data and time when the member account data volume was last updated.
memberDetail_volumeUsageUpdatedTime :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.UTCTime)
memberDetail_volumeUsageUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail -> f MemberDetail
memberDetail_volumeUsageUpdatedTime = (MemberDetail -> Maybe POSIX)
-> (MemberDetail -> Maybe POSIX -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe POSIX
volumeUsageUpdatedTime :: Maybe POSIX
$sel:volumeUsageUpdatedTime:MemberDetail' :: MemberDetail -> Maybe POSIX
volumeUsageUpdatedTime} -> Maybe POSIX
volumeUsageUpdatedTime) (\s :: MemberDetail
s@MemberDetail' {} Maybe POSIX
a -> MemberDetail
s {$sel:volumeUsageUpdatedTime:MemberDetail' :: Maybe POSIX
volumeUsageUpdatedTime = Maybe POSIX
a} :: MemberDetail) ((Maybe POSIX -> f (Maybe POSIX))
 -> MemberDetail -> f MemberDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail
-> f MemberDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The date and time that the member account was last updated. The value is
-- in milliseconds since the epoch.
memberDetail_updatedTime :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.UTCTime)
memberDetail_updatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail -> f MemberDetail
memberDetail_updatedTime = (MemberDetail -> Maybe POSIX)
-> (MemberDetail -> Maybe POSIX -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe POSIX
updatedTime :: Maybe POSIX
$sel:updatedTime:MemberDetail' :: MemberDetail -> Maybe POSIX
updatedTime} -> Maybe POSIX
updatedTime) (\s :: MemberDetail
s@MemberDetail' {} Maybe POSIX
a -> MemberDetail
s {$sel:updatedTime:MemberDetail' :: Maybe POSIX
updatedTime = Maybe POSIX
a} :: MemberDetail) ((Maybe POSIX -> f (Maybe POSIX))
 -> MemberDetail -> f MemberDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MemberDetail
-> f MemberDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The data volume in bytes per day for the member account.
memberDetail_volumeUsageInBytes :: Lens.Lens' MemberDetail (Prelude.Maybe Prelude.Integer)
memberDetail_volumeUsageInBytes :: (Maybe Integer -> f (Maybe Integer))
-> MemberDetail -> f MemberDetail
memberDetail_volumeUsageInBytes = (MemberDetail -> Maybe Integer)
-> (MemberDetail -> Maybe Integer -> MemberDetail)
-> Lens MemberDetail MemberDetail (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberDetail' {Maybe Integer
volumeUsageInBytes :: Maybe Integer
$sel:volumeUsageInBytes:MemberDetail' :: MemberDetail -> Maybe Integer
volumeUsageInBytes} -> Maybe Integer
volumeUsageInBytes) (\s :: MemberDetail
s@MemberDetail' {} Maybe Integer
a -> MemberDetail
s {$sel:volumeUsageInBytes:MemberDetail' :: Maybe Integer
volumeUsageInBytes = Maybe Integer
a} :: MemberDetail)

instance Core.FromJSON MemberDetail where
  parseJSON :: Value -> Parser MemberDetail
parseJSON =
    String
-> (Object -> Parser MemberDetail) -> Value -> Parser MemberDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MemberDetail"
      ( \Object
x ->
          Maybe POSIX
-> Maybe MemberStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe MemberDisabledReason
-> Maybe Double
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Integer
-> MemberDetail
MemberDetail'
            (Maybe POSIX
 -> Maybe MemberStatus
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe MemberDisabledReason
 -> Maybe Double
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Integer
 -> MemberDetail)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe MemberStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MemberDisabledReason
      -> Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PercentOfGraphUtilizationUpdatedTime")
            Parser
  (Maybe MemberStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MemberDisabledReason
   -> Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe MemberStatus)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MemberDisabledReason
      -> Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MemberStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MemberDisabledReason
   -> Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MemberDisabledReason
      -> Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InvitedTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MemberDisabledReason
   -> Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MemberDisabledReason
      -> Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
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
"AdministratorId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MemberDisabledReason
   -> Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe MemberDisabledReason
      -> Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
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
"GraphArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe MemberDisabledReason
   -> Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe MemberDisabledReason
      -> Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
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
"MasterId")
            Parser
  (Maybe Text
   -> Maybe MemberDisabledReason
   -> Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe MemberDisabledReason
      -> Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
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
"AccountId")
            Parser
  (Maybe MemberDisabledReason
   -> Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe MemberDisabledReason)
-> Parser
     (Maybe Double
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> MemberDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MemberDisabledReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisabledReason")
            Parser
  (Maybe Double
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> MemberDetail)
-> Parser (Maybe Double)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe POSIX -> Maybe Integer -> MemberDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PercentOfGraphUtilization")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe POSIX -> Maybe Integer -> MemberDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe POSIX -> Maybe Integer -> MemberDetail)
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
"EmailAddress")
            Parser
  (Maybe POSIX -> Maybe POSIX -> Maybe Integer -> MemberDetail)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe Integer -> MemberDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeUsageUpdatedTime")
            Parser (Maybe POSIX -> Maybe Integer -> MemberDetail)
-> Parser (Maybe POSIX) -> Parser (Maybe Integer -> MemberDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpdatedTime")
            Parser (Maybe Integer -> MemberDetail)
-> Parser (Maybe Integer) -> Parser MemberDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeUsageInBytes")
      )

instance Prelude.Hashable MemberDetail

instance Prelude.NFData MemberDetail