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

-- | Operational metadata for an application in Application Manager.
--
-- /See:/ 'newOpsMetadata' smart constructor.
data OpsMetadata = OpsMetadata'
  { -- | The date the OpsMetadata objects was created.
    OpsMetadata -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | The date the OpsMetadata object was last updated.
    OpsMetadata -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Data.POSIX,
    -- | The user name who last updated the OpsMetadata object.
    OpsMetadata -> Maybe Text
lastModifiedUser :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the OpsMetadata Object or blob.
    OpsMetadata -> Maybe Text
opsMetadataArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Application Manager application.
    OpsMetadata -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text
  }
  deriving (OpsMetadata -> OpsMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpsMetadata -> OpsMetadata -> Bool
$c/= :: OpsMetadata -> OpsMetadata -> Bool
== :: OpsMetadata -> OpsMetadata -> Bool
$c== :: OpsMetadata -> OpsMetadata -> Bool
Prelude.Eq, ReadPrec [OpsMetadata]
ReadPrec OpsMetadata
Int -> ReadS OpsMetadata
ReadS [OpsMetadata]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpsMetadata]
$creadListPrec :: ReadPrec [OpsMetadata]
readPrec :: ReadPrec OpsMetadata
$creadPrec :: ReadPrec OpsMetadata
readList :: ReadS [OpsMetadata]
$creadList :: ReadS [OpsMetadata]
readsPrec :: Int -> ReadS OpsMetadata
$creadsPrec :: Int -> ReadS OpsMetadata
Prelude.Read, Int -> OpsMetadata -> ShowS
[OpsMetadata] -> ShowS
OpsMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpsMetadata] -> ShowS
$cshowList :: [OpsMetadata] -> ShowS
show :: OpsMetadata -> String
$cshow :: OpsMetadata -> String
showsPrec :: Int -> OpsMetadata -> ShowS
$cshowsPrec :: Int -> OpsMetadata -> ShowS
Prelude.Show, forall x. Rep OpsMetadata x -> OpsMetadata
forall x. OpsMetadata -> Rep OpsMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpsMetadata x -> OpsMetadata
$cfrom :: forall x. OpsMetadata -> Rep OpsMetadata x
Prelude.Generic)

-- |
-- Create a value of 'OpsMetadata' 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:
--
-- 'creationDate', 'opsMetadata_creationDate' - The date the OpsMetadata objects was created.
--
-- 'lastModifiedDate', 'opsMetadata_lastModifiedDate' - The date the OpsMetadata object was last updated.
--
-- 'lastModifiedUser', 'opsMetadata_lastModifiedUser' - The user name who last updated the OpsMetadata object.
--
-- 'opsMetadataArn', 'opsMetadata_opsMetadataArn' - The Amazon Resource Name (ARN) of the OpsMetadata Object or blob.
--
-- 'resourceId', 'opsMetadata_resourceId' - The ID of the Application Manager application.
newOpsMetadata ::
  OpsMetadata
newOpsMetadata :: OpsMetadata
newOpsMetadata =
  OpsMetadata'
    { $sel:creationDate:OpsMetadata' :: Maybe POSIX
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:OpsMetadata' :: Maybe POSIX
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedUser:OpsMetadata' :: Maybe Text
lastModifiedUser = forall a. Maybe a
Prelude.Nothing,
      $sel:opsMetadataArn:OpsMetadata' :: Maybe Text
opsMetadataArn = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:OpsMetadata' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing
    }

-- | The date the OpsMetadata objects was created.
opsMetadata_creationDate :: Lens.Lens' OpsMetadata (Prelude.Maybe Prelude.UTCTime)
opsMetadata_creationDate :: Lens' OpsMetadata (Maybe UTCTime)
opsMetadata_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsMetadata' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:OpsMetadata' :: OpsMetadata -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: OpsMetadata
s@OpsMetadata' {} Maybe POSIX
a -> OpsMetadata
s {$sel:creationDate:OpsMetadata' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: OpsMetadata) 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 :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date the OpsMetadata object was last updated.
opsMetadata_lastModifiedDate :: Lens.Lens' OpsMetadata (Prelude.Maybe Prelude.UTCTime)
opsMetadata_lastModifiedDate :: Lens' OpsMetadata (Maybe UTCTime)
opsMetadata_lastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsMetadata' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:OpsMetadata' :: OpsMetadata -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: OpsMetadata
s@OpsMetadata' {} Maybe POSIX
a -> OpsMetadata
s {$sel:lastModifiedDate:OpsMetadata' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: OpsMetadata) 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 :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The user name who last updated the OpsMetadata object.
opsMetadata_lastModifiedUser :: Lens.Lens' OpsMetadata (Prelude.Maybe Prelude.Text)
opsMetadata_lastModifiedUser :: Lens' OpsMetadata (Maybe Text)
opsMetadata_lastModifiedUser = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsMetadata' {Maybe Text
lastModifiedUser :: Maybe Text
$sel:lastModifiedUser:OpsMetadata' :: OpsMetadata -> Maybe Text
lastModifiedUser} -> Maybe Text
lastModifiedUser) (\s :: OpsMetadata
s@OpsMetadata' {} Maybe Text
a -> OpsMetadata
s {$sel:lastModifiedUser:OpsMetadata' :: Maybe Text
lastModifiedUser = Maybe Text
a} :: OpsMetadata)

-- | The Amazon Resource Name (ARN) of the OpsMetadata Object or blob.
opsMetadata_opsMetadataArn :: Lens.Lens' OpsMetadata (Prelude.Maybe Prelude.Text)
opsMetadata_opsMetadataArn :: Lens' OpsMetadata (Maybe Text)
opsMetadata_opsMetadataArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsMetadata' {Maybe Text
opsMetadataArn :: Maybe Text
$sel:opsMetadataArn:OpsMetadata' :: OpsMetadata -> Maybe Text
opsMetadataArn} -> Maybe Text
opsMetadataArn) (\s :: OpsMetadata
s@OpsMetadata' {} Maybe Text
a -> OpsMetadata
s {$sel:opsMetadataArn:OpsMetadata' :: Maybe Text
opsMetadataArn = Maybe Text
a} :: OpsMetadata)

-- | The ID of the Application Manager application.
opsMetadata_resourceId :: Lens.Lens' OpsMetadata (Prelude.Maybe Prelude.Text)
opsMetadata_resourceId :: Lens' OpsMetadata (Maybe Text)
opsMetadata_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsMetadata' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:OpsMetadata' :: OpsMetadata -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: OpsMetadata
s@OpsMetadata' {} Maybe Text
a -> OpsMetadata
s {$sel:resourceId:OpsMetadata' :: Maybe Text
resourceId = Maybe Text
a} :: OpsMetadata)

instance Data.FromJSON OpsMetadata where
  parseJSON :: Value -> Parser OpsMetadata
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OpsMetadata"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OpsMetadata
OpsMetadata'
            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
"CreationDate")
            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
"LastModifiedDate")
            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
"LastModifiedUser")
            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
"OpsMetadataArn")
            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
"ResourceId")
      )

instance Prelude.Hashable OpsMetadata where
  hashWithSalt :: Int -> OpsMetadata -> Int
hashWithSalt Int
_salt OpsMetadata' {Maybe Text
Maybe POSIX
resourceId :: Maybe Text
opsMetadataArn :: Maybe Text
lastModifiedUser :: Maybe Text
lastModifiedDate :: Maybe POSIX
creationDate :: Maybe POSIX
$sel:resourceId:OpsMetadata' :: OpsMetadata -> Maybe Text
$sel:opsMetadataArn:OpsMetadata' :: OpsMetadata -> Maybe Text
$sel:lastModifiedUser:OpsMetadata' :: OpsMetadata -> Maybe Text
$sel:lastModifiedDate:OpsMetadata' :: OpsMetadata -> Maybe POSIX
$sel:creationDate:OpsMetadata' :: OpsMetadata -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastModifiedUser
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
opsMetadataArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId

instance Prelude.NFData OpsMetadata where
  rnf :: OpsMetadata -> ()
rnf OpsMetadata' {Maybe Text
Maybe POSIX
resourceId :: Maybe Text
opsMetadataArn :: Maybe Text
lastModifiedUser :: Maybe Text
lastModifiedDate :: Maybe POSIX
creationDate :: Maybe POSIX
$sel:resourceId:OpsMetadata' :: OpsMetadata -> Maybe Text
$sel:opsMetadataArn:OpsMetadata' :: OpsMetadata -> Maybe Text
$sel:lastModifiedUser:OpsMetadata' :: OpsMetadata -> Maybe Text
$sel:lastModifiedDate:OpsMetadata' :: OpsMetadata -> Maybe POSIX
$sel:creationDate:OpsMetadata' :: OpsMetadata -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastModifiedUser
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
opsMetadataArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId