{-# 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.SSM.Types.OpsItemIdentity
-- 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.SSM.Types.OpsItemIdentity 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

-- | Information about the user or resource that created an OpsItem event.
--
-- /See:/ 'newOpsItemIdentity' smart constructor.
data OpsItemIdentity = OpsItemIdentity'
  { -- | The Amazon Resource Name (ARN) of the IAM entity that created the
    -- OpsItem event.
    OpsItemIdentity -> Maybe Text
arn :: Prelude.Maybe Prelude.Text
  }
  deriving (OpsItemIdentity -> OpsItemIdentity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpsItemIdentity -> OpsItemIdentity -> Bool
$c/= :: OpsItemIdentity -> OpsItemIdentity -> Bool
== :: OpsItemIdentity -> OpsItemIdentity -> Bool
$c== :: OpsItemIdentity -> OpsItemIdentity -> Bool
Prelude.Eq, ReadPrec [OpsItemIdentity]
ReadPrec OpsItemIdentity
Int -> ReadS OpsItemIdentity
ReadS [OpsItemIdentity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpsItemIdentity]
$creadListPrec :: ReadPrec [OpsItemIdentity]
readPrec :: ReadPrec OpsItemIdentity
$creadPrec :: ReadPrec OpsItemIdentity
readList :: ReadS [OpsItemIdentity]
$creadList :: ReadS [OpsItemIdentity]
readsPrec :: Int -> ReadS OpsItemIdentity
$creadsPrec :: Int -> ReadS OpsItemIdentity
Prelude.Read, Int -> OpsItemIdentity -> ShowS
[OpsItemIdentity] -> ShowS
OpsItemIdentity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpsItemIdentity] -> ShowS
$cshowList :: [OpsItemIdentity] -> ShowS
show :: OpsItemIdentity -> String
$cshow :: OpsItemIdentity -> String
showsPrec :: Int -> OpsItemIdentity -> ShowS
$cshowsPrec :: Int -> OpsItemIdentity -> ShowS
Prelude.Show, forall x. Rep OpsItemIdentity x -> OpsItemIdentity
forall x. OpsItemIdentity -> Rep OpsItemIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpsItemIdentity x -> OpsItemIdentity
$cfrom :: forall x. OpsItemIdentity -> Rep OpsItemIdentity x
Prelude.Generic)

-- |
-- Create a value of 'OpsItemIdentity' 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:
--
-- 'arn', 'opsItemIdentity_arn' - The Amazon Resource Name (ARN) of the IAM entity that created the
-- OpsItem event.
newOpsItemIdentity ::
  OpsItemIdentity
newOpsItemIdentity :: OpsItemIdentity
newOpsItemIdentity =
  OpsItemIdentity' {$sel:arn:OpsItemIdentity' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing}

-- | The Amazon Resource Name (ARN) of the IAM entity that created the
-- OpsItem event.
opsItemIdentity_arn :: Lens.Lens' OpsItemIdentity (Prelude.Maybe Prelude.Text)
opsItemIdentity_arn :: Lens' OpsItemIdentity (Maybe Text)
opsItemIdentity_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemIdentity' {Maybe Text
arn :: Maybe Text
$sel:arn:OpsItemIdentity' :: OpsItemIdentity -> Maybe Text
arn} -> Maybe Text
arn) (\s :: OpsItemIdentity
s@OpsItemIdentity' {} Maybe Text
a -> OpsItemIdentity
s {$sel:arn:OpsItemIdentity' :: Maybe Text
arn = Maybe Text
a} :: OpsItemIdentity)

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

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

instance Prelude.NFData OpsItemIdentity where
  rnf :: OpsItemIdentity -> ()
rnf OpsItemIdentity' {Maybe Text
arn :: Maybe Text
$sel:arn:OpsItemIdentity' :: OpsItemIdentity -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn