{-# 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.HoneyCode.Types.ImportJobSubmitter
-- 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.HoneyCode.Types.ImportJobSubmitter 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

-- | An object that contains the attributes of the submitter of the import
-- job.
--
-- /See:/ 'newImportJobSubmitter' smart constructor.
data ImportJobSubmitter = ImportJobSubmitter'
  { -- | The email id of the submitter of the import job, if available.
    ImportJobSubmitter -> Maybe (Sensitive Text)
email :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The AWS user ARN of the submitter of the import job, if available.
    ImportJobSubmitter -> Maybe Text
userArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ImportJobSubmitter -> ImportJobSubmitter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportJobSubmitter -> ImportJobSubmitter -> Bool
$c/= :: ImportJobSubmitter -> ImportJobSubmitter -> Bool
== :: ImportJobSubmitter -> ImportJobSubmitter -> Bool
$c== :: ImportJobSubmitter -> ImportJobSubmitter -> Bool
Prelude.Eq, Int -> ImportJobSubmitter -> ShowS
[ImportJobSubmitter] -> ShowS
ImportJobSubmitter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportJobSubmitter] -> ShowS
$cshowList :: [ImportJobSubmitter] -> ShowS
show :: ImportJobSubmitter -> String
$cshow :: ImportJobSubmitter -> String
showsPrec :: Int -> ImportJobSubmitter -> ShowS
$cshowsPrec :: Int -> ImportJobSubmitter -> ShowS
Prelude.Show, forall x. Rep ImportJobSubmitter x -> ImportJobSubmitter
forall x. ImportJobSubmitter -> Rep ImportJobSubmitter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportJobSubmitter x -> ImportJobSubmitter
$cfrom :: forall x. ImportJobSubmitter -> Rep ImportJobSubmitter x
Prelude.Generic)

-- |
-- Create a value of 'ImportJobSubmitter' 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:
--
-- 'email', 'importJobSubmitter_email' - The email id of the submitter of the import job, if available.
--
-- 'userArn', 'importJobSubmitter_userArn' - The AWS user ARN of the submitter of the import job, if available.
newImportJobSubmitter ::
  ImportJobSubmitter
newImportJobSubmitter :: ImportJobSubmitter
newImportJobSubmitter =
  ImportJobSubmitter'
    { $sel:email:ImportJobSubmitter' :: Maybe (Sensitive Text)
email = forall a. Maybe a
Prelude.Nothing,
      $sel:userArn:ImportJobSubmitter' :: Maybe Text
userArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The email id of the submitter of the import job, if available.
importJobSubmitter_email :: Lens.Lens' ImportJobSubmitter (Prelude.Maybe Prelude.Text)
importJobSubmitter_email :: Lens' ImportJobSubmitter (Maybe Text)
importJobSubmitter_email = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobSubmitter' {Maybe (Sensitive Text)
email :: Maybe (Sensitive Text)
$sel:email:ImportJobSubmitter' :: ImportJobSubmitter -> Maybe (Sensitive Text)
email} -> Maybe (Sensitive Text)
email) (\s :: ImportJobSubmitter
s@ImportJobSubmitter' {} Maybe (Sensitive Text)
a -> ImportJobSubmitter
s {$sel:email:ImportJobSubmitter' :: Maybe (Sensitive Text)
email = Maybe (Sensitive Text)
a} :: ImportJobSubmitter) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The AWS user ARN of the submitter of the import job, if available.
importJobSubmitter_userArn :: Lens.Lens' ImportJobSubmitter (Prelude.Maybe Prelude.Text)
importJobSubmitter_userArn :: Lens' ImportJobSubmitter (Maybe Text)
importJobSubmitter_userArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobSubmitter' {Maybe Text
userArn :: Maybe Text
$sel:userArn:ImportJobSubmitter' :: ImportJobSubmitter -> Maybe Text
userArn} -> Maybe Text
userArn) (\s :: ImportJobSubmitter
s@ImportJobSubmitter' {} Maybe Text
a -> ImportJobSubmitter
s {$sel:userArn:ImportJobSubmitter' :: Maybe Text
userArn = Maybe Text
a} :: ImportJobSubmitter)

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

instance Prelude.Hashable ImportJobSubmitter where
  hashWithSalt :: Int -> ImportJobSubmitter -> Int
hashWithSalt Int
_salt ImportJobSubmitter' {Maybe Text
Maybe (Sensitive Text)
userArn :: Maybe Text
email :: Maybe (Sensitive Text)
$sel:userArn:ImportJobSubmitter' :: ImportJobSubmitter -> Maybe Text
$sel:email:ImportJobSubmitter' :: ImportJobSubmitter -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
email
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userArn

instance Prelude.NFData ImportJobSubmitter where
  rnf :: ImportJobSubmitter -> ()
rnf ImportJobSubmitter' {Maybe Text
Maybe (Sensitive Text)
userArn :: Maybe Text
email :: Maybe (Sensitive Text)
$sel:userArn:ImportJobSubmitter' :: ImportJobSubmitter -> Maybe Text
$sel:email:ImportJobSubmitter' :: ImportJobSubmitter -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
email seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userArn