packages feed

amazonka-guardduty-2.0: gen/Amazonka/GuardDuty/Types/OrganizationMalwareProtectionConfiguration.hs

{-# 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.OrganizationMalwareProtectionConfiguration
-- 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.OrganizationMalwareProtectionConfiguration 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.OrganizationScanEc2InstanceWithFindings
import qualified Amazonka.Prelude as Prelude

-- | Organization-wide Malware Protection configurations.
--
-- /See:/ 'newOrganizationMalwareProtectionConfiguration' smart constructor.
data OrganizationMalwareProtectionConfiguration = OrganizationMalwareProtectionConfiguration'
  { -- | Whether Malware Protection for EC2 instances with findings should be
    -- auto-enabled for new members joining the organization.
    scanEc2InstanceWithFindings :: Prelude.Maybe OrganizationScanEc2InstanceWithFindings
  }
  deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)

-- |
-- Create a value of 'OrganizationMalwareProtectionConfiguration' 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:
--
-- 'scanEc2InstanceWithFindings', 'organizationMalwareProtectionConfiguration_scanEc2InstanceWithFindings' - Whether Malware Protection for EC2 instances with findings should be
-- auto-enabled for new members joining the organization.
newOrganizationMalwareProtectionConfiguration ::
  OrganizationMalwareProtectionConfiguration
newOrganizationMalwareProtectionConfiguration =
  OrganizationMalwareProtectionConfiguration'
    { scanEc2InstanceWithFindings =
        Prelude.Nothing
    }

-- | Whether Malware Protection for EC2 instances with findings should be
-- auto-enabled for new members joining the organization.
organizationMalwareProtectionConfiguration_scanEc2InstanceWithFindings :: Lens.Lens' OrganizationMalwareProtectionConfiguration (Prelude.Maybe OrganizationScanEc2InstanceWithFindings)
organizationMalwareProtectionConfiguration_scanEc2InstanceWithFindings = Lens.lens (\OrganizationMalwareProtectionConfiguration' {scanEc2InstanceWithFindings} -> scanEc2InstanceWithFindings) (\s@OrganizationMalwareProtectionConfiguration' {} a -> s {scanEc2InstanceWithFindings = a} :: OrganizationMalwareProtectionConfiguration)

instance
  Prelude.Hashable
    OrganizationMalwareProtectionConfiguration
  where
  hashWithSalt
    _salt
    OrganizationMalwareProtectionConfiguration' {..} =
      _salt
        `Prelude.hashWithSalt` scanEc2InstanceWithFindings

instance
  Prelude.NFData
    OrganizationMalwareProtectionConfiguration
  where
  rnf OrganizationMalwareProtectionConfiguration' {..} =
    Prelude.rnf scanEc2InstanceWithFindings

instance
  Data.ToJSON
    OrganizationMalwareProtectionConfiguration
  where
  toJSON
    OrganizationMalwareProtectionConfiguration' {..} =
      Data.object
        ( Prelude.catMaybes
            [ ("scanEc2InstanceWithFindings" Data..=)
                Prelude.<$> scanEc2InstanceWithFindings
            ]
        )