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

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

-- | Information about a provisioning artifact (also known as a version) for
-- a product.
--
-- /See:/ 'newProvisioningArtifactProperties' smart constructor.
data ProvisioningArtifactProperties = ProvisioningArtifactProperties'
  { -- | If set to true, AWS Service Catalog stops validating the specified
    -- provisioning artifact even if it is invalid.
    ProvisioningArtifactProperties -> Maybe Bool
disableTemplateValidation :: Prelude.Maybe Prelude.Bool,
    -- | The name of the provisioning artifact (for example, v1 v2beta). No
    -- spaces are allowed.
    ProvisioningArtifactProperties -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of provisioning artifact.
    --
    -- -   @CLOUD_FORMATION_TEMPLATE@ - AWS CloudFormation template
    --
    -- -   @MARKETPLACE_AMI@ - AWS Marketplace AMI
    --
    -- -   @MARKETPLACE_CAR@ - AWS Marketplace Clusters and AWS Resources
    ProvisioningArtifactProperties -> Maybe ProvisioningArtifactType
type' :: Prelude.Maybe ProvisioningArtifactType,
    -- | The description of the provisioning artifact, including how it differs
    -- from the previous provisioning artifact.
    ProvisioningArtifactProperties -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specify the template source with one of the following options, but not
    -- both. Keys accepted: [ @LoadTemplateFromURL@, @ImportFromPhysicalId@ ]
    --
    -- The URL of the CloudFormation template in Amazon S3. Specify the URL in
    -- JSON format as follows:
    --
    -- @\"LoadTemplateFromURL\": \"https:\/\/s3.amazonaws.com\/cf-templates-ozkq9d3hgiq2-us-east-1\/...\"@
    --
    -- @ImportFromPhysicalId@: The physical id of the resource that contains
    -- the template. Currently only supports CloudFormation stack arn. Specify
    -- the physical id in JSON format as follows:
    -- @ImportFromPhysicalId: “arn:aws:cloudformation:[us-east-1]:[accountId]:stack\/[StackName]\/[resourceId]@
    ProvisioningArtifactProperties -> HashMap Text Text
info :: Prelude.HashMap Prelude.Text Prelude.Text
  }
  deriving (ProvisioningArtifactProperties
-> ProvisioningArtifactProperties -> Bool
(ProvisioningArtifactProperties
 -> ProvisioningArtifactProperties -> Bool)
-> (ProvisioningArtifactProperties
    -> ProvisioningArtifactProperties -> Bool)
-> Eq ProvisioningArtifactProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningArtifactProperties
-> ProvisioningArtifactProperties -> Bool
$c/= :: ProvisioningArtifactProperties
-> ProvisioningArtifactProperties -> Bool
== :: ProvisioningArtifactProperties
-> ProvisioningArtifactProperties -> Bool
$c== :: ProvisioningArtifactProperties
-> ProvisioningArtifactProperties -> Bool
Prelude.Eq, ReadPrec [ProvisioningArtifactProperties]
ReadPrec ProvisioningArtifactProperties
Int -> ReadS ProvisioningArtifactProperties
ReadS [ProvisioningArtifactProperties]
(Int -> ReadS ProvisioningArtifactProperties)
-> ReadS [ProvisioningArtifactProperties]
-> ReadPrec ProvisioningArtifactProperties
-> ReadPrec [ProvisioningArtifactProperties]
-> Read ProvisioningArtifactProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningArtifactProperties]
$creadListPrec :: ReadPrec [ProvisioningArtifactProperties]
readPrec :: ReadPrec ProvisioningArtifactProperties
$creadPrec :: ReadPrec ProvisioningArtifactProperties
readList :: ReadS [ProvisioningArtifactProperties]
$creadList :: ReadS [ProvisioningArtifactProperties]
readsPrec :: Int -> ReadS ProvisioningArtifactProperties
$creadsPrec :: Int -> ReadS ProvisioningArtifactProperties
Prelude.Read, Int -> ProvisioningArtifactProperties -> ShowS
[ProvisioningArtifactProperties] -> ShowS
ProvisioningArtifactProperties -> String
(Int -> ProvisioningArtifactProperties -> ShowS)
-> (ProvisioningArtifactProperties -> String)
-> ([ProvisioningArtifactProperties] -> ShowS)
-> Show ProvisioningArtifactProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningArtifactProperties] -> ShowS
$cshowList :: [ProvisioningArtifactProperties] -> ShowS
show :: ProvisioningArtifactProperties -> String
$cshow :: ProvisioningArtifactProperties -> String
showsPrec :: Int -> ProvisioningArtifactProperties -> ShowS
$cshowsPrec :: Int -> ProvisioningArtifactProperties -> ShowS
Prelude.Show, (forall x.
 ProvisioningArtifactProperties
 -> Rep ProvisioningArtifactProperties x)
-> (forall x.
    Rep ProvisioningArtifactProperties x
    -> ProvisioningArtifactProperties)
-> Generic ProvisioningArtifactProperties
forall x.
Rep ProvisioningArtifactProperties x
-> ProvisioningArtifactProperties
forall x.
ProvisioningArtifactProperties
-> Rep ProvisioningArtifactProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisioningArtifactProperties x
-> ProvisioningArtifactProperties
$cfrom :: forall x.
ProvisioningArtifactProperties
-> Rep ProvisioningArtifactProperties x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningArtifactProperties' 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:
--
-- 'disableTemplateValidation', 'provisioningArtifactProperties_disableTemplateValidation' - If set to true, AWS Service Catalog stops validating the specified
-- provisioning artifact even if it is invalid.
--
-- 'name', 'provisioningArtifactProperties_name' - The name of the provisioning artifact (for example, v1 v2beta). No
-- spaces are allowed.
--
-- 'type'', 'provisioningArtifactProperties_type' - The type of provisioning artifact.
--
-- -   @CLOUD_FORMATION_TEMPLATE@ - AWS CloudFormation template
--
-- -   @MARKETPLACE_AMI@ - AWS Marketplace AMI
--
-- -   @MARKETPLACE_CAR@ - AWS Marketplace Clusters and AWS Resources
--
-- 'description', 'provisioningArtifactProperties_description' - The description of the provisioning artifact, including how it differs
-- from the previous provisioning artifact.
--
-- 'info', 'provisioningArtifactProperties_info' - Specify the template source with one of the following options, but not
-- both. Keys accepted: [ @LoadTemplateFromURL@, @ImportFromPhysicalId@ ]
--
-- The URL of the CloudFormation template in Amazon S3. Specify the URL in
-- JSON format as follows:
--
-- @\"LoadTemplateFromURL\": \"https:\/\/s3.amazonaws.com\/cf-templates-ozkq9d3hgiq2-us-east-1\/...\"@
--
-- @ImportFromPhysicalId@: The physical id of the resource that contains
-- the template. Currently only supports CloudFormation stack arn. Specify
-- the physical id in JSON format as follows:
-- @ImportFromPhysicalId: “arn:aws:cloudformation:[us-east-1]:[accountId]:stack\/[StackName]\/[resourceId]@
newProvisioningArtifactProperties ::
  ProvisioningArtifactProperties
newProvisioningArtifactProperties :: ProvisioningArtifactProperties
newProvisioningArtifactProperties =
  ProvisioningArtifactProperties' :: Maybe Bool
-> Maybe Text
-> Maybe ProvisioningArtifactType
-> Maybe Text
-> HashMap Text Text
-> ProvisioningArtifactProperties
ProvisioningArtifactProperties'
    { $sel:disableTemplateValidation:ProvisioningArtifactProperties' :: Maybe Bool
disableTemplateValidation =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ProvisioningArtifactProperties' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ProvisioningArtifactProperties' :: Maybe ProvisioningArtifactType
type' = Maybe ProvisioningArtifactType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProvisioningArtifactProperties' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:info:ProvisioningArtifactProperties' :: HashMap Text Text
info = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty
    }

-- | If set to true, AWS Service Catalog stops validating the specified
-- provisioning artifact even if it is invalid.
provisioningArtifactProperties_disableTemplateValidation :: Lens.Lens' ProvisioningArtifactProperties (Prelude.Maybe Prelude.Bool)
provisioningArtifactProperties_disableTemplateValidation :: (Maybe Bool -> f (Maybe Bool))
-> ProvisioningArtifactProperties
-> f ProvisioningArtifactProperties
provisioningArtifactProperties_disableTemplateValidation = (ProvisioningArtifactProperties -> Maybe Bool)
-> (ProvisioningArtifactProperties
    -> Maybe Bool -> ProvisioningArtifactProperties)
-> Lens
     ProvisioningArtifactProperties
     ProvisioningArtifactProperties
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactProperties' {Maybe Bool
disableTemplateValidation :: Maybe Bool
$sel:disableTemplateValidation:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe Bool
disableTemplateValidation} -> Maybe Bool
disableTemplateValidation) (\s :: ProvisioningArtifactProperties
s@ProvisioningArtifactProperties' {} Maybe Bool
a -> ProvisioningArtifactProperties
s {$sel:disableTemplateValidation:ProvisioningArtifactProperties' :: Maybe Bool
disableTemplateValidation = Maybe Bool
a} :: ProvisioningArtifactProperties)

-- | The name of the provisioning artifact (for example, v1 v2beta). No
-- spaces are allowed.
provisioningArtifactProperties_name :: Lens.Lens' ProvisioningArtifactProperties (Prelude.Maybe Prelude.Text)
provisioningArtifactProperties_name :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactProperties
-> f ProvisioningArtifactProperties
provisioningArtifactProperties_name = (ProvisioningArtifactProperties -> Maybe Text)
-> (ProvisioningArtifactProperties
    -> Maybe Text -> ProvisioningArtifactProperties)
-> Lens
     ProvisioningArtifactProperties
     ProvisioningArtifactProperties
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactProperties' {Maybe Text
name :: Maybe Text
$sel:name:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe Text
name} -> Maybe Text
name) (\s :: ProvisioningArtifactProperties
s@ProvisioningArtifactProperties' {} Maybe Text
a -> ProvisioningArtifactProperties
s {$sel:name:ProvisioningArtifactProperties' :: Maybe Text
name = Maybe Text
a} :: ProvisioningArtifactProperties)

-- | The type of provisioning artifact.
--
-- -   @CLOUD_FORMATION_TEMPLATE@ - AWS CloudFormation template
--
-- -   @MARKETPLACE_AMI@ - AWS Marketplace AMI
--
-- -   @MARKETPLACE_CAR@ - AWS Marketplace Clusters and AWS Resources
provisioningArtifactProperties_type :: Lens.Lens' ProvisioningArtifactProperties (Prelude.Maybe ProvisioningArtifactType)
provisioningArtifactProperties_type :: (Maybe ProvisioningArtifactType
 -> f (Maybe ProvisioningArtifactType))
-> ProvisioningArtifactProperties
-> f ProvisioningArtifactProperties
provisioningArtifactProperties_type = (ProvisioningArtifactProperties -> Maybe ProvisioningArtifactType)
-> (ProvisioningArtifactProperties
    -> Maybe ProvisioningArtifactType
    -> ProvisioningArtifactProperties)
-> Lens
     ProvisioningArtifactProperties
     ProvisioningArtifactProperties
     (Maybe ProvisioningArtifactType)
     (Maybe ProvisioningArtifactType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactProperties' {Maybe ProvisioningArtifactType
type' :: Maybe ProvisioningArtifactType
$sel:type':ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe ProvisioningArtifactType
type'} -> Maybe ProvisioningArtifactType
type') (\s :: ProvisioningArtifactProperties
s@ProvisioningArtifactProperties' {} Maybe ProvisioningArtifactType
a -> ProvisioningArtifactProperties
s {$sel:type':ProvisioningArtifactProperties' :: Maybe ProvisioningArtifactType
type' = Maybe ProvisioningArtifactType
a} :: ProvisioningArtifactProperties)

-- | The description of the provisioning artifact, including how it differs
-- from the previous provisioning artifact.
provisioningArtifactProperties_description :: Lens.Lens' ProvisioningArtifactProperties (Prelude.Maybe Prelude.Text)
provisioningArtifactProperties_description :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactProperties
-> f ProvisioningArtifactProperties
provisioningArtifactProperties_description = (ProvisioningArtifactProperties -> Maybe Text)
-> (ProvisioningArtifactProperties
    -> Maybe Text -> ProvisioningArtifactProperties)
-> Lens
     ProvisioningArtifactProperties
     ProvisioningArtifactProperties
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactProperties' {Maybe Text
description :: Maybe Text
$sel:description:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe Text
description} -> Maybe Text
description) (\s :: ProvisioningArtifactProperties
s@ProvisioningArtifactProperties' {} Maybe Text
a -> ProvisioningArtifactProperties
s {$sel:description:ProvisioningArtifactProperties' :: Maybe Text
description = Maybe Text
a} :: ProvisioningArtifactProperties)

-- | Specify the template source with one of the following options, but not
-- both. Keys accepted: [ @LoadTemplateFromURL@, @ImportFromPhysicalId@ ]
--
-- The URL of the CloudFormation template in Amazon S3. Specify the URL in
-- JSON format as follows:
--
-- @\"LoadTemplateFromURL\": \"https:\/\/s3.amazonaws.com\/cf-templates-ozkq9d3hgiq2-us-east-1\/...\"@
--
-- @ImportFromPhysicalId@: The physical id of the resource that contains
-- the template. Currently only supports CloudFormation stack arn. Specify
-- the physical id in JSON format as follows:
-- @ImportFromPhysicalId: “arn:aws:cloudformation:[us-east-1]:[accountId]:stack\/[StackName]\/[resourceId]@
provisioningArtifactProperties_info :: Lens.Lens' ProvisioningArtifactProperties (Prelude.HashMap Prelude.Text Prelude.Text)
provisioningArtifactProperties_info :: (HashMap Text Text -> f (HashMap Text Text))
-> ProvisioningArtifactProperties
-> f ProvisioningArtifactProperties
provisioningArtifactProperties_info = (ProvisioningArtifactProperties -> HashMap Text Text)
-> (ProvisioningArtifactProperties
    -> HashMap Text Text -> ProvisioningArtifactProperties)
-> Lens
     ProvisioningArtifactProperties
     ProvisioningArtifactProperties
     (HashMap Text Text)
     (HashMap Text Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactProperties' {HashMap Text Text
info :: HashMap Text Text
$sel:info:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> HashMap Text Text
info} -> HashMap Text Text
info) (\s :: ProvisioningArtifactProperties
s@ProvisioningArtifactProperties' {} HashMap Text Text
a -> ProvisioningArtifactProperties
s {$sel:info:ProvisioningArtifactProperties' :: HashMap Text Text
info = HashMap Text Text
a} :: ProvisioningArtifactProperties) ((HashMap Text Text -> f (HashMap Text Text))
 -> ProvisioningArtifactProperties
 -> f ProvisioningArtifactProperties)
-> ((HashMap Text Text -> f (HashMap Text Text))
    -> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> ProvisioningArtifactProperties
-> f ProvisioningArtifactProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.Hashable
    ProvisioningArtifactProperties

instance
  Prelude.NFData
    ProvisioningArtifactProperties

instance Core.ToJSON ProvisioningArtifactProperties where
  toJSON :: ProvisioningArtifactProperties -> Value
toJSON ProvisioningArtifactProperties' {Maybe Bool
Maybe Text
Maybe ProvisioningArtifactType
HashMap Text Text
info :: HashMap Text Text
description :: Maybe Text
type' :: Maybe ProvisioningArtifactType
name :: Maybe Text
disableTemplateValidation :: Maybe Bool
$sel:info:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> HashMap Text Text
$sel:description:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe Text
$sel:type':ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe ProvisioningArtifactType
$sel:name:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe Text
$sel:disableTemplateValidation:ProvisioningArtifactProperties' :: ProvisioningArtifactProperties -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DisableTemplateValidation" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableTemplateValidation,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"Type" Text -> ProvisioningArtifactType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ProvisioningArtifactType -> Pair)
-> Maybe ProvisioningArtifactType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProvisioningArtifactType
type',
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Info" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text Text
info)
          ]
      )