{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServiceCatalog.Types.ProvisioningArtifactSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 metadata for the provisioning artifact. This is used with AWS
    -- Marketplace products.
    ProvisioningArtifactSummary -> Maybe (HashMap Text Text)
provisioningArtifactMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The UTC time stamp of the creation time.
    ProvisioningArtifactSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the provisioning artifact.
    ProvisioningArtifactSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the provisioning artifact.
    ProvisioningArtifactSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The description of the provisioning artifact.
    ProvisioningArtifactSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ProvisioningArtifactSummary -> ProvisioningArtifactSummary -> Bool
(ProvisioningArtifactSummary
 -> ProvisioningArtifactSummary -> Bool)
-> (ProvisioningArtifactSummary
    -> ProvisioningArtifactSummary -> Bool)
-> Eq ProvisioningArtifactSummary
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]
(Int -> ReadS ProvisioningArtifactSummary)
-> ReadS [ProvisioningArtifactSummary]
-> ReadPrec ProvisioningArtifactSummary
-> ReadPrec [ProvisioningArtifactSummary]
-> Read 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
(Int -> ProvisioningArtifactSummary -> ShowS)
-> (ProvisioningArtifactSummary -> String)
-> ([ProvisioningArtifactSummary] -> ShowS)
-> Show ProvisioningArtifactSummary
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.
 ProvisioningArtifactSummary -> Rep ProvisioningArtifactSummary x)
-> (forall x.
    Rep ProvisioningArtifactSummary x -> ProvisioningArtifactSummary)
-> Generic ProvisioningArtifactSummary
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:
--
-- 'provisioningArtifactMetadata', 'provisioningArtifactSummary_provisioningArtifactMetadata' - The metadata for the provisioning artifact. This is used with AWS
-- Marketplace products.
--
-- 'createdTime', 'provisioningArtifactSummary_createdTime' - The UTC time stamp of the creation time.
--
-- 'name', 'provisioningArtifactSummary_name' - The name of the provisioning artifact.
--
-- 'id', 'provisioningArtifactSummary_id' - The identifier of the provisioning artifact.
--
-- 'description', 'provisioningArtifactSummary_description' - The description of the provisioning artifact.
newProvisioningArtifactSummary ::
  ProvisioningArtifactSummary
newProvisioningArtifactSummary :: ProvisioningArtifactSummary
newProvisioningArtifactSummary =
  ProvisioningArtifactSummary' :: Maybe (HashMap Text Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ProvisioningArtifactSummary
ProvisioningArtifactSummary'
    { $sel:provisioningArtifactMetadata:ProvisioningArtifactSummary' :: Maybe (HashMap Text Text)
provisioningArtifactMetadata =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:ProvisioningArtifactSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ProvisioningArtifactSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ProvisioningArtifactSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProvisioningArtifactSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The metadata for the provisioning artifact. This is used with AWS
-- Marketplace products.
provisioningArtifactSummary_provisioningArtifactMetadata :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
provisioningArtifactSummary_provisioningArtifactMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ProvisioningArtifactSummary -> f ProvisioningArtifactSummary
provisioningArtifactSummary_provisioningArtifactMetadata = (ProvisioningArtifactSummary -> Maybe (HashMap Text Text))
-> (ProvisioningArtifactSummary
    -> Maybe (HashMap Text Text) -> ProvisioningArtifactSummary)
-> Lens
     ProvisioningArtifactSummary
     ProvisioningArtifactSummary
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ProvisioningArtifactSummary -> f ProvisioningArtifactSummary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ProvisioningArtifactSummary
-> f ProvisioningArtifactSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The UTC time stamp of the creation time.
provisioningArtifactSummary_createdTime :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.UTCTime)
provisioningArtifactSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisioningArtifactSummary -> f ProvisioningArtifactSummary
provisioningArtifactSummary_createdTime = (ProvisioningArtifactSummary -> Maybe POSIX)
-> (ProvisioningArtifactSummary
    -> Maybe POSIX -> ProvisioningArtifactSummary)
-> Lens
     ProvisioningArtifactSummary
     ProvisioningArtifactSummary
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> ProvisioningArtifactSummary -> f ProvisioningArtifactSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisioningArtifactSummary
-> f ProvisioningArtifactSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the provisioning artifact.
provisioningArtifactSummary_name :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.Text)
provisioningArtifactSummary_name :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactSummary -> f ProvisioningArtifactSummary
provisioningArtifactSummary_name = (ProvisioningArtifactSummary -> Maybe Text)
-> (ProvisioningArtifactSummary
    -> Maybe Text -> ProvisioningArtifactSummary)
-> Lens
     ProvisioningArtifactSummary
     ProvisioningArtifactSummary
     (Maybe Text)
     (Maybe Text)
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 identifier of the provisioning artifact.
provisioningArtifactSummary_id :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.Text)
provisioningArtifactSummary_id :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactSummary -> f ProvisioningArtifactSummary
provisioningArtifactSummary_id = (ProvisioningArtifactSummary -> Maybe Text)
-> (ProvisioningArtifactSummary
    -> Maybe Text -> ProvisioningArtifactSummary)
-> Lens
     ProvisioningArtifactSummary
     ProvisioningArtifactSummary
     (Maybe Text)
     (Maybe Text)
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 description of the provisioning artifact.
provisioningArtifactSummary_description :: Lens.Lens' ProvisioningArtifactSummary (Prelude.Maybe Prelude.Text)
provisioningArtifactSummary_description :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactSummary -> f ProvisioningArtifactSummary
provisioningArtifactSummary_description = (ProvisioningArtifactSummary -> Maybe Text)
-> (ProvisioningArtifactSummary
    -> Maybe Text -> ProvisioningArtifactSummary)
-> Lens
     ProvisioningArtifactSummary
     ProvisioningArtifactSummary
     (Maybe Text)
     (Maybe Text)
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)

instance Core.FromJSON ProvisioningArtifactSummary where
  parseJSON :: Value -> Parser ProvisioningArtifactSummary
parseJSON =
    String
-> (Object -> Parser ProvisioningArtifactSummary)
-> Value
-> Parser ProvisioningArtifactSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProvisioningArtifactSummary"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ProvisioningArtifactSummary
ProvisioningArtifactSummary'
            (Maybe (HashMap Text Text)
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ProvisioningArtifactSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ProvisioningArtifactSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisioningArtifactMetadata"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ProvisioningArtifactSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> ProvisioningArtifactSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> ProvisioningArtifactSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ProvisioningArtifactSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> Maybe Text -> ProvisioningArtifactSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ProvisioningArtifactSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe Text -> ProvisioningArtifactSummary)
-> Parser (Maybe Text) -> Parser ProvisioningArtifactSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
      )

instance Prelude.Hashable ProvisioningArtifactSummary

instance Prelude.NFData ProvisioningArtifactSummary