{-# 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.ServiceCatalog.Types.ProvisioningArtifactSummary
-- 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.ServiceCatalog.Types.ProvisioningArtifactSummary 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

-- | Summary information about a provisioning artifact (also known as a
-- version) for a product.
--
-- /See:/ 'newProvisioningArtifactSummary' smart constructor.
data ProvisioningArtifactSummary = ProvisioningArtifactSummary'
  { -- | The UTC time stamp of the creation time.
    ProvisioningArtifactSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
    -- | The description of the provisioning artifact.
    ProvisioningArtifactSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the provisioning artifact.
    ProvisioningArtifactSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the provisioning artifact.
    ProvisioningArtifactSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The metadata for the provisioning artifact. This is used with Amazon Web
    -- Services Marketplace products.
    ProvisioningArtifactSummary -> Maybe (HashMap Text Text)
provisioningArtifactMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (ProvisioningArtifactSummary -> ProvisioningArtifactSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningArtifactSummary -> ProvisioningArtifactSummary -> Bool
$c/= :: ProvisioningArtifactSummary -> ProvisioningArtifactSummary -> Bool
== :: ProvisioningArtifactSummary -> ProvisioningArtifactSummary -> Bool
$c== :: ProvisioningArtifactSummary -> ProvisioningArtifactSummary -> Bool
Prelude.Eq, ReadPrec [ProvisioningArtifactSummary]
ReadPrec ProvisioningArtifactSummary
Int -> ReadS ProvisioningArtifactSummary
ReadS [ProvisioningArtifactSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningArtifactSummary]
$creadListPrec :: ReadPrec [ProvisioningArtifactSummary]
readPrec :: ReadPrec ProvisioningArtifactSummary
$creadPrec :: ReadPrec ProvisioningArtifactSummary
readList :: ReadS [ProvisioningArtifactSummary]
$creadList :: ReadS [ProvisioningArtifactSummary]
readsPrec :: Int -> ReadS ProvisioningArtifactSummary
$creadsPrec :: Int -> ReadS ProvisioningArtifactSummary
Prelude.Read, Int -> ProvisioningArtifactSummary -> ShowS
[ProvisioningArtifactSummary] -> ShowS
ProvisioningArtifactSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningArtifactSummary] -> ShowS
$cshowList :: [ProvisioningArtifactSummary] -> ShowS
show :: ProvisioningArtifactSummary -> String
$cshow :: ProvisioningArtifactSummary -> String
showsPrec :: Int -> ProvisioningArtifactSummary -> ShowS
$cshowsPrec :: Int -> ProvisioningArtifactSummary -> ShowS
Prelude.Show, forall x.
Rep ProvisioningArtifactSummary x -> ProvisioningArtifactSummary
forall x.
ProvisioningArtifactSummary -> Rep ProvisioningArtifactSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisioningArtifactSummary x -> ProvisioningArtifactSummary
$cfrom :: forall x.
ProvisioningArtifactSummary -> Rep ProvisioningArtifactSummary x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningArtifactSummary' 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:
--
-- 'createdTime', 'provisioningArtifactSummary_createdTime' - The UTC time stamp of the creation time.
--
-- 'description', 'provisioningArtifactSummary_description' - The description of the provisioning artifact.
--
-- 'id', 'provisioningArtifactSummary_id' - The identifier of the provisioning artifact.
--
-- 'name', 'provisioningArtifactSummary_name' - The name of the provisioning artifact.
--
-- 'provisioningArtifactMetadata', 'provisioningArtifactSummary_provisioningArtifactMetadata' - The metadata for the provisioning artifact. This is used with Amazon Web
-- Services Marketplace products.
newProvisioningArtifactSummary ::
  ProvisioningArtifactSummary
newProvisioningArtifactSummary :: ProvisioningArtifactSummary
newProvisioningArtifactSummary =
  ProvisioningArtifactSummary'
    { $sel:createdTime:ProvisioningArtifactSummary' :: Maybe POSIX
createdTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProvisioningArtifactSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ProvisioningArtifactSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ProvisioningArtifactSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningArtifactMetadata:ProvisioningArtifactSummary' :: Maybe (HashMap Text Text)
provisioningArtifactMetadata = forall a. Maybe a
Prelude.Nothing
    }

-- | The UTC time stamp of the creation time.
provisioningArtifactSummary_createdTime :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.UTCTime)
provisioningArtifactSummary_createdTime :: Lens' ProvisioningArtifactSummary (Maybe UTCTime)
provisioningArtifactSummary_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: ProvisioningArtifactSummary
s@ProvisioningArtifactSummary' {} Maybe POSIX
a -> ProvisioningArtifactSummary
s {$sel:createdTime:ProvisioningArtifactSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: ProvisioningArtifactSummary) 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 description of the provisioning artifact.
provisioningArtifactSummary_description :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.Text)
provisioningArtifactSummary_description :: Lens' ProvisioningArtifactSummary (Maybe Text)
provisioningArtifactSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactSummary' {Maybe Text
description :: Maybe Text
$sel:description:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ProvisioningArtifactSummary
s@ProvisioningArtifactSummary' {} Maybe Text
a -> ProvisioningArtifactSummary
s {$sel:description:ProvisioningArtifactSummary' :: Maybe Text
description = Maybe Text
a} :: ProvisioningArtifactSummary)

-- | The identifier of the provisioning artifact.
provisioningArtifactSummary_id :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.Text)
provisioningArtifactSummary_id :: Lens' ProvisioningArtifactSummary (Maybe Text)
provisioningArtifactSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactSummary' {Maybe Text
id :: Maybe Text
$sel:id:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ProvisioningArtifactSummary
s@ProvisioningArtifactSummary' {} Maybe Text
a -> ProvisioningArtifactSummary
s {$sel:id:ProvisioningArtifactSummary' :: Maybe Text
id = Maybe Text
a} :: ProvisioningArtifactSummary)

-- | The name of the provisioning artifact.
provisioningArtifactSummary_name :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.Text)
provisioningArtifactSummary_name :: Lens' ProvisioningArtifactSummary (Maybe Text)
provisioningArtifactSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactSummary' {Maybe Text
name :: Maybe Text
$sel:name:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ProvisioningArtifactSummary
s@ProvisioningArtifactSummary' {} Maybe Text
a -> ProvisioningArtifactSummary
s {$sel:name:ProvisioningArtifactSummary' :: Maybe Text
name = Maybe Text
a} :: ProvisioningArtifactSummary)

-- | The metadata for the provisioning artifact. This is used with Amazon Web
-- Services Marketplace products.
provisioningArtifactSummary_provisioningArtifactMetadata :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
provisioningArtifactSummary_provisioningArtifactMetadata :: Lens' ProvisioningArtifactSummary (Maybe (HashMap Text Text))
provisioningArtifactSummary_provisioningArtifactMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactSummary' {Maybe (HashMap Text Text)
provisioningArtifactMetadata :: Maybe (HashMap Text Text)
$sel:provisioningArtifactMetadata:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe (HashMap Text Text)
provisioningArtifactMetadata} -> Maybe (HashMap Text Text)
provisioningArtifactMetadata) (\s :: ProvisioningArtifactSummary
s@ProvisioningArtifactSummary' {} Maybe (HashMap Text Text)
a -> ProvisioningArtifactSummary
s {$sel:provisioningArtifactMetadata:ProvisioningArtifactSummary' :: Maybe (HashMap Text Text)
provisioningArtifactMetadata = Maybe (HashMap Text Text)
a} :: ProvisioningArtifactSummary) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON ProvisioningArtifactSummary where
  parseJSON :: Value -> Parser ProvisioningArtifactSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProvisioningArtifactSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ProvisioningArtifactSummary
ProvisioningArtifactSummary'
            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
"CreatedTime")
            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
"Description")
            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
"Id")
            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
"Name")
            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
"ProvisioningArtifactMetadata"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ProvisioningArtifactSummary where
  hashWithSalt :: Int -> ProvisioningArtifactSummary -> Int
hashWithSalt Int
_salt ProvisioningArtifactSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
provisioningArtifactMetadata :: Maybe (HashMap Text Text)
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
createdTime :: Maybe POSIX
$sel:provisioningArtifactMetadata:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe (HashMap Text Text)
$sel:name:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
$sel:id:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
$sel:description:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
$sel:createdTime:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
provisioningArtifactMetadata

instance Prelude.NFData ProvisioningArtifactSummary where
  rnf :: ProvisioningArtifactSummary -> ()
rnf ProvisioningArtifactSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
provisioningArtifactMetadata :: Maybe (HashMap Text Text)
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
createdTime :: Maybe POSIX
$sel:provisioningArtifactMetadata:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe (HashMap Text Text)
$sel:name:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
$sel:id:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
$sel:description:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe Text
$sel:createdTime:ProvisioningArtifactSummary' :: ProvisioningArtifactSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
provisioningArtifactMetadata