{-# 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.ProvisioningArtifact
-- 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.ProvisioningArtifact where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalog.Types.ProvisioningArtifactGuidance

-- | Information about a provisioning artifact. A provisioning artifact is
-- also known as a product version.
--
-- /See:/ 'newProvisioningArtifact' smart constructor.
data ProvisioningArtifact = ProvisioningArtifact'
  { -- | The UTC time stamp of the creation time.
    ProvisioningArtifact -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the provisioning artifact.
    ProvisioningArtifact -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the provisioning artifact.
    ProvisioningArtifact -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Information set by the administrator to provide guidance to end users
    -- about which provisioning artifacts to use.
    ProvisioningArtifact -> Maybe ProvisioningArtifactGuidance
guidance :: Prelude.Maybe ProvisioningArtifactGuidance,
    -- | The description of the provisioning artifact.
    ProvisioningArtifact -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ProvisioningArtifact -> ProvisioningArtifact -> Bool
(ProvisioningArtifact -> ProvisioningArtifact -> Bool)
-> (ProvisioningArtifact -> ProvisioningArtifact -> Bool)
-> Eq ProvisioningArtifact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningArtifact -> ProvisioningArtifact -> Bool
$c/= :: ProvisioningArtifact -> ProvisioningArtifact -> Bool
== :: ProvisioningArtifact -> ProvisioningArtifact -> Bool
$c== :: ProvisioningArtifact -> ProvisioningArtifact -> Bool
Prelude.Eq, ReadPrec [ProvisioningArtifact]
ReadPrec ProvisioningArtifact
Int -> ReadS ProvisioningArtifact
ReadS [ProvisioningArtifact]
(Int -> ReadS ProvisioningArtifact)
-> ReadS [ProvisioningArtifact]
-> ReadPrec ProvisioningArtifact
-> ReadPrec [ProvisioningArtifact]
-> Read ProvisioningArtifact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningArtifact]
$creadListPrec :: ReadPrec [ProvisioningArtifact]
readPrec :: ReadPrec ProvisioningArtifact
$creadPrec :: ReadPrec ProvisioningArtifact
readList :: ReadS [ProvisioningArtifact]
$creadList :: ReadS [ProvisioningArtifact]
readsPrec :: Int -> ReadS ProvisioningArtifact
$creadsPrec :: Int -> ReadS ProvisioningArtifact
Prelude.Read, Int -> ProvisioningArtifact -> ShowS
[ProvisioningArtifact] -> ShowS
ProvisioningArtifact -> String
(Int -> ProvisioningArtifact -> ShowS)
-> (ProvisioningArtifact -> String)
-> ([ProvisioningArtifact] -> ShowS)
-> Show ProvisioningArtifact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningArtifact] -> ShowS
$cshowList :: [ProvisioningArtifact] -> ShowS
show :: ProvisioningArtifact -> String
$cshow :: ProvisioningArtifact -> String
showsPrec :: Int -> ProvisioningArtifact -> ShowS
$cshowsPrec :: Int -> ProvisioningArtifact -> ShowS
Prelude.Show, (forall x. ProvisioningArtifact -> Rep ProvisioningArtifact x)
-> (forall x. Rep ProvisioningArtifact x -> ProvisioningArtifact)
-> Generic ProvisioningArtifact
forall x. Rep ProvisioningArtifact x -> ProvisioningArtifact
forall x. ProvisioningArtifact -> Rep ProvisioningArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProvisioningArtifact x -> ProvisioningArtifact
$cfrom :: forall x. ProvisioningArtifact -> Rep ProvisioningArtifact x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningArtifact' 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', 'provisioningArtifact_createdTime' - The UTC time stamp of the creation time.
--
-- 'name', 'provisioningArtifact_name' - The name of the provisioning artifact.
--
-- 'id', 'provisioningArtifact_id' - The identifier of the provisioning artifact.
--
-- 'guidance', 'provisioningArtifact_guidance' - Information set by the administrator to provide guidance to end users
-- about which provisioning artifacts to use.
--
-- 'description', 'provisioningArtifact_description' - The description of the provisioning artifact.
newProvisioningArtifact ::
  ProvisioningArtifact
newProvisioningArtifact :: ProvisioningArtifact
newProvisioningArtifact =
  ProvisioningArtifact' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ProvisioningArtifactGuidance
-> Maybe Text
-> ProvisioningArtifact
ProvisioningArtifact'
    { $sel:createdTime:ProvisioningArtifact' :: Maybe POSIX
createdTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ProvisioningArtifact' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ProvisioningArtifact' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:guidance:ProvisioningArtifact' :: Maybe ProvisioningArtifactGuidance
guidance = Maybe ProvisioningArtifactGuidance
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProvisioningArtifact' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The UTC time stamp of the creation time.
provisioningArtifact_createdTime :: Lens.Lens' ProvisioningArtifact (Prelude.Maybe Prelude.UTCTime)
provisioningArtifact_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisioningArtifact -> f ProvisioningArtifact
provisioningArtifact_createdTime = (ProvisioningArtifact -> Maybe POSIX)
-> (ProvisioningArtifact -> Maybe POSIX -> ProvisioningArtifact)
-> Lens
     ProvisioningArtifact
     ProvisioningArtifact
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifact' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:ProvisioningArtifact' :: ProvisioningArtifact -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: ProvisioningArtifact
s@ProvisioningArtifact' {} Maybe POSIX
a -> ProvisioningArtifact
s {$sel:createdTime:ProvisioningArtifact' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: ProvisioningArtifact) ((Maybe POSIX -> f (Maybe POSIX))
 -> ProvisioningArtifact -> f ProvisioningArtifact)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProvisioningArtifact
-> f ProvisioningArtifact
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.
provisioningArtifact_name :: Lens.Lens' ProvisioningArtifact (Prelude.Maybe Prelude.Text)
provisioningArtifact_name :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifact -> f ProvisioningArtifact
provisioningArtifact_name = (ProvisioningArtifact -> Maybe Text)
-> (ProvisioningArtifact -> Maybe Text -> ProvisioningArtifact)
-> Lens
     ProvisioningArtifact ProvisioningArtifact (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifact' {Maybe Text
name :: Maybe Text
$sel:name:ProvisioningArtifact' :: ProvisioningArtifact -> Maybe Text
name} -> Maybe Text
name) (\s :: ProvisioningArtifact
s@ProvisioningArtifact' {} Maybe Text
a -> ProvisioningArtifact
s {$sel:name:ProvisioningArtifact' :: Maybe Text
name = Maybe Text
a} :: ProvisioningArtifact)

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

-- | Information set by the administrator to provide guidance to end users
-- about which provisioning artifacts to use.
provisioningArtifact_guidance :: Lens.Lens' ProvisioningArtifact (Prelude.Maybe ProvisioningArtifactGuidance)
provisioningArtifact_guidance :: (Maybe ProvisioningArtifactGuidance
 -> f (Maybe ProvisioningArtifactGuidance))
-> ProvisioningArtifact -> f ProvisioningArtifact
provisioningArtifact_guidance = (ProvisioningArtifact -> Maybe ProvisioningArtifactGuidance)
-> (ProvisioningArtifact
    -> Maybe ProvisioningArtifactGuidance -> ProvisioningArtifact)
-> Lens
     ProvisioningArtifact
     ProvisioningArtifact
     (Maybe ProvisioningArtifactGuidance)
     (Maybe ProvisioningArtifactGuidance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifact' {Maybe ProvisioningArtifactGuidance
guidance :: Maybe ProvisioningArtifactGuidance
$sel:guidance:ProvisioningArtifact' :: ProvisioningArtifact -> Maybe ProvisioningArtifactGuidance
guidance} -> Maybe ProvisioningArtifactGuidance
guidance) (\s :: ProvisioningArtifact
s@ProvisioningArtifact' {} Maybe ProvisioningArtifactGuidance
a -> ProvisioningArtifact
s {$sel:guidance:ProvisioningArtifact' :: Maybe ProvisioningArtifactGuidance
guidance = Maybe ProvisioningArtifactGuidance
a} :: ProvisioningArtifact)

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

instance Core.FromJSON ProvisioningArtifact where
  parseJSON :: Value -> Parser ProvisioningArtifact
parseJSON =
    String
-> (Object -> Parser ProvisioningArtifact)
-> Value
-> Parser ProvisioningArtifact
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProvisioningArtifact"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ProvisioningArtifactGuidance
-> Maybe Text
-> ProvisioningArtifact
ProvisioningArtifact'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe ProvisioningArtifactGuidance
 -> Maybe Text
 -> ProvisioningArtifact)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ProvisioningArtifactGuidance
      -> Maybe Text
      -> ProvisioningArtifact)
forall (f :: * -> *) a b. Functor 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 ProvisioningArtifactGuidance
   -> Maybe Text
   -> ProvisioningArtifact)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ProvisioningArtifactGuidance
      -> Maybe Text
      -> ProvisioningArtifact)
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 ProvisioningArtifactGuidance
   -> Maybe Text
   -> ProvisioningArtifact)
-> Parser (Maybe Text)
-> Parser
     (Maybe ProvisioningArtifactGuidance
      -> Maybe Text -> ProvisioningArtifact)
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 ProvisioningArtifactGuidance
   -> Maybe Text -> ProvisioningArtifact)
-> Parser (Maybe ProvisioningArtifactGuidance)
-> Parser (Maybe Text -> ProvisioningArtifact)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProvisioningArtifactGuidance)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Guidance")
            Parser (Maybe Text -> ProvisioningArtifact)
-> Parser (Maybe Text) -> Parser ProvisioningArtifact
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 ProvisioningArtifact

instance Prelude.NFData ProvisioningArtifact