{-# 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.ServiceAdditionalInfo
-- 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.ServiceAdditionalInfo 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

-- | Additional information about the generated finding.
--
-- /See:/ 'newServiceAdditionalInfo' smart constructor.
data ServiceAdditionalInfo = ServiceAdditionalInfo'
  { -- | Describes the type of the additional information.
    ServiceAdditionalInfo -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | This field specifies the value of the additional information.
    ServiceAdditionalInfo -> Maybe Text
value :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceAdditionalInfo -> ServiceAdditionalInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceAdditionalInfo -> ServiceAdditionalInfo -> Bool
$c/= :: ServiceAdditionalInfo -> ServiceAdditionalInfo -> Bool
== :: ServiceAdditionalInfo -> ServiceAdditionalInfo -> Bool
$c== :: ServiceAdditionalInfo -> ServiceAdditionalInfo -> Bool
Prelude.Eq, ReadPrec [ServiceAdditionalInfo]
ReadPrec ServiceAdditionalInfo
Int -> ReadS ServiceAdditionalInfo
ReadS [ServiceAdditionalInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceAdditionalInfo]
$creadListPrec :: ReadPrec [ServiceAdditionalInfo]
readPrec :: ReadPrec ServiceAdditionalInfo
$creadPrec :: ReadPrec ServiceAdditionalInfo
readList :: ReadS [ServiceAdditionalInfo]
$creadList :: ReadS [ServiceAdditionalInfo]
readsPrec :: Int -> ReadS ServiceAdditionalInfo
$creadsPrec :: Int -> ReadS ServiceAdditionalInfo
Prelude.Read, Int -> ServiceAdditionalInfo -> ShowS
[ServiceAdditionalInfo] -> ShowS
ServiceAdditionalInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceAdditionalInfo] -> ShowS
$cshowList :: [ServiceAdditionalInfo] -> ShowS
show :: ServiceAdditionalInfo -> String
$cshow :: ServiceAdditionalInfo -> String
showsPrec :: Int -> ServiceAdditionalInfo -> ShowS
$cshowsPrec :: Int -> ServiceAdditionalInfo -> ShowS
Prelude.Show, forall x. Rep ServiceAdditionalInfo x -> ServiceAdditionalInfo
forall x. ServiceAdditionalInfo -> Rep ServiceAdditionalInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceAdditionalInfo x -> ServiceAdditionalInfo
$cfrom :: forall x. ServiceAdditionalInfo -> Rep ServiceAdditionalInfo x
Prelude.Generic)

-- |
-- Create a value of 'ServiceAdditionalInfo' 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:
--
-- 'type'', 'serviceAdditionalInfo_type' - Describes the type of the additional information.
--
-- 'value', 'serviceAdditionalInfo_value' - This field specifies the value of the additional information.
newServiceAdditionalInfo ::
  ServiceAdditionalInfo
newServiceAdditionalInfo :: ServiceAdditionalInfo
newServiceAdditionalInfo =
  ServiceAdditionalInfo'
    { $sel:type':ServiceAdditionalInfo' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing,
      $sel:value:ServiceAdditionalInfo' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the type of the additional information.
serviceAdditionalInfo_type :: Lens.Lens' ServiceAdditionalInfo (Prelude.Maybe Prelude.Text)
serviceAdditionalInfo_type :: Lens' ServiceAdditionalInfo (Maybe Text)
serviceAdditionalInfo_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceAdditionalInfo' {Maybe Text
type' :: Maybe Text
$sel:type':ServiceAdditionalInfo' :: ServiceAdditionalInfo -> Maybe Text
type'} -> Maybe Text
type') (\s :: ServiceAdditionalInfo
s@ServiceAdditionalInfo' {} Maybe Text
a -> ServiceAdditionalInfo
s {$sel:type':ServiceAdditionalInfo' :: Maybe Text
type' = Maybe Text
a} :: ServiceAdditionalInfo)

-- | This field specifies the value of the additional information.
serviceAdditionalInfo_value :: Lens.Lens' ServiceAdditionalInfo (Prelude.Maybe Prelude.Text)
serviceAdditionalInfo_value :: Lens' ServiceAdditionalInfo (Maybe Text)
serviceAdditionalInfo_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceAdditionalInfo' {Maybe Text
value :: Maybe Text
$sel:value:ServiceAdditionalInfo' :: ServiceAdditionalInfo -> Maybe Text
value} -> Maybe Text
value) (\s :: ServiceAdditionalInfo
s@ServiceAdditionalInfo' {} Maybe Text
a -> ServiceAdditionalInfo
s {$sel:value:ServiceAdditionalInfo' :: Maybe Text
value = Maybe Text
a} :: ServiceAdditionalInfo)

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

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

instance Prelude.NFData ServiceAdditionalInfo where
  rnf :: ServiceAdditionalInfo -> ()
rnf ServiceAdditionalInfo' {Maybe Text
value :: Maybe Text
type' :: Maybe Text
$sel:value:ServiceAdditionalInfo' :: ServiceAdditionalInfo -> Maybe Text
$sel:type':ServiceAdditionalInfo' :: ServiceAdditionalInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value