{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateProvisioningArtifact
-- 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)
--
-- Updates the specified provisioning artifact (also known as a version)
-- for the specified product.
--
-- You cannot update a provisioning artifact for a product that was shared
-- with you.
module Amazonka.ServiceCatalog.UpdateProvisioningArtifact
  ( -- * Creating a Request
    UpdateProvisioningArtifact (..),
    newUpdateProvisioningArtifact,

    -- * Request Lenses
    updateProvisioningArtifact_active,
    updateProvisioningArtifact_name,
    updateProvisioningArtifact_acceptLanguage,
    updateProvisioningArtifact_guidance,
    updateProvisioningArtifact_description,
    updateProvisioningArtifact_productId,
    updateProvisioningArtifact_provisioningArtifactId,

    -- * Destructuring the Response
    UpdateProvisioningArtifactResponse (..),
    newUpdateProvisioningArtifactResponse,

    -- * Response Lenses
    updateProvisioningArtifactResponse_status,
    updateProvisioningArtifactResponse_info,
    updateProvisioningArtifactResponse_provisioningArtifactDetail,
    updateProvisioningArtifactResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalog.Types

-- | /See:/ 'newUpdateProvisioningArtifact' smart constructor.
data UpdateProvisioningArtifact = UpdateProvisioningArtifact'
  { -- | Indicates whether the product version is active.
    --
    -- Inactive provisioning artifacts are invisible to end users. End users
    -- cannot launch or update a provisioned product from an inactive
    -- provisioning artifact.
    UpdateProvisioningArtifact -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
    -- | The updated name of the provisioning artifact.
    UpdateProvisioningArtifact -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    UpdateProvisioningArtifact -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | Information set by the administrator to provide guidance to end users
    -- about which provisioning artifacts to use.
    --
    -- The @DEFAULT@ value indicates that the product version is active.
    --
    -- The administrator can set the guidance to @DEPRECATED@ to inform users
    -- that the product version is deprecated. Users are able to make updates
    -- to a provisioned product of a deprecated version but cannot launch new
    -- provisioned products using a deprecated version.
    UpdateProvisioningArtifact -> Maybe ProvisioningArtifactGuidance
guidance :: Prelude.Maybe ProvisioningArtifactGuidance,
    -- | The updated description of the provisioning artifact.
    UpdateProvisioningArtifact -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The product identifier.
    UpdateProvisioningArtifact -> Text
productId :: Prelude.Text,
    -- | The identifier of the provisioning artifact.
    UpdateProvisioningArtifact -> Text
provisioningArtifactId :: Prelude.Text
  }
  deriving (UpdateProvisioningArtifact -> UpdateProvisioningArtifact -> Bool
(UpdateProvisioningArtifact -> UpdateProvisioningArtifact -> Bool)
-> (UpdateProvisioningArtifact
    -> UpdateProvisioningArtifact -> Bool)
-> Eq UpdateProvisioningArtifact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProvisioningArtifact -> UpdateProvisioningArtifact -> Bool
$c/= :: UpdateProvisioningArtifact -> UpdateProvisioningArtifact -> Bool
== :: UpdateProvisioningArtifact -> UpdateProvisioningArtifact -> Bool
$c== :: UpdateProvisioningArtifact -> UpdateProvisioningArtifact -> Bool
Prelude.Eq, ReadPrec [UpdateProvisioningArtifact]
ReadPrec UpdateProvisioningArtifact
Int -> ReadS UpdateProvisioningArtifact
ReadS [UpdateProvisioningArtifact]
(Int -> ReadS UpdateProvisioningArtifact)
-> ReadS [UpdateProvisioningArtifact]
-> ReadPrec UpdateProvisioningArtifact
-> ReadPrec [UpdateProvisioningArtifact]
-> Read UpdateProvisioningArtifact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProvisioningArtifact]
$creadListPrec :: ReadPrec [UpdateProvisioningArtifact]
readPrec :: ReadPrec UpdateProvisioningArtifact
$creadPrec :: ReadPrec UpdateProvisioningArtifact
readList :: ReadS [UpdateProvisioningArtifact]
$creadList :: ReadS [UpdateProvisioningArtifact]
readsPrec :: Int -> ReadS UpdateProvisioningArtifact
$creadsPrec :: Int -> ReadS UpdateProvisioningArtifact
Prelude.Read, Int -> UpdateProvisioningArtifact -> ShowS
[UpdateProvisioningArtifact] -> ShowS
UpdateProvisioningArtifact -> String
(Int -> UpdateProvisioningArtifact -> ShowS)
-> (UpdateProvisioningArtifact -> String)
-> ([UpdateProvisioningArtifact] -> ShowS)
-> Show UpdateProvisioningArtifact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProvisioningArtifact] -> ShowS
$cshowList :: [UpdateProvisioningArtifact] -> ShowS
show :: UpdateProvisioningArtifact -> String
$cshow :: UpdateProvisioningArtifact -> String
showsPrec :: Int -> UpdateProvisioningArtifact -> ShowS
$cshowsPrec :: Int -> UpdateProvisioningArtifact -> ShowS
Prelude.Show, (forall x.
 UpdateProvisioningArtifact -> Rep UpdateProvisioningArtifact x)
-> (forall x.
    Rep UpdateProvisioningArtifact x -> UpdateProvisioningArtifact)
-> Generic UpdateProvisioningArtifact
forall x.
Rep UpdateProvisioningArtifact x -> UpdateProvisioningArtifact
forall x.
UpdateProvisioningArtifact -> Rep UpdateProvisioningArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateProvisioningArtifact x -> UpdateProvisioningArtifact
$cfrom :: forall x.
UpdateProvisioningArtifact -> Rep UpdateProvisioningArtifact x
Prelude.Generic)

-- |
-- Create a value of 'UpdateProvisioningArtifact' 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:
--
-- 'active', 'updateProvisioningArtifact_active' - Indicates whether the product version is active.
--
-- Inactive provisioning artifacts are invisible to end users. End users
-- cannot launch or update a provisioned product from an inactive
-- provisioning artifact.
--
-- 'name', 'updateProvisioningArtifact_name' - The updated name of the provisioning artifact.
--
-- 'acceptLanguage', 'updateProvisioningArtifact_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'guidance', 'updateProvisioningArtifact_guidance' - Information set by the administrator to provide guidance to end users
-- about which provisioning artifacts to use.
--
-- The @DEFAULT@ value indicates that the product version is active.
--
-- The administrator can set the guidance to @DEPRECATED@ to inform users
-- that the product version is deprecated. Users are able to make updates
-- to a provisioned product of a deprecated version but cannot launch new
-- provisioned products using a deprecated version.
--
-- 'description', 'updateProvisioningArtifact_description' - The updated description of the provisioning artifact.
--
-- 'productId', 'updateProvisioningArtifact_productId' - The product identifier.
--
-- 'provisioningArtifactId', 'updateProvisioningArtifact_provisioningArtifactId' - The identifier of the provisioning artifact.
newUpdateProvisioningArtifact ::
  -- | 'productId'
  Prelude.Text ->
  -- | 'provisioningArtifactId'
  Prelude.Text ->
  UpdateProvisioningArtifact
newUpdateProvisioningArtifact :: Text -> Text -> UpdateProvisioningArtifact
newUpdateProvisioningArtifact
  Text
pProductId_
  Text
pProvisioningArtifactId_ =
    UpdateProvisioningArtifact' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ProvisioningArtifactGuidance
-> Maybe Text
-> Text
-> Text
-> UpdateProvisioningArtifact
UpdateProvisioningArtifact'
      { $sel:active:UpdateProvisioningArtifact' :: Maybe Bool
active =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateProvisioningArtifact' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:acceptLanguage:UpdateProvisioningArtifact' :: Maybe Text
acceptLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:guidance:UpdateProvisioningArtifact' :: Maybe ProvisioningArtifactGuidance
guidance = Maybe ProvisioningArtifactGuidance
forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateProvisioningArtifact' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:productId:UpdateProvisioningArtifact' :: Text
productId = Text
pProductId_,
        $sel:provisioningArtifactId:UpdateProvisioningArtifact' :: Text
provisioningArtifactId =
          Text
pProvisioningArtifactId_
      }

-- | Indicates whether the product version is active.
--
-- Inactive provisioning artifacts are invisible to end users. End users
-- cannot launch or update a provisioned product from an inactive
-- provisioning artifact.
updateProvisioningArtifact_active :: Lens.Lens' UpdateProvisioningArtifact (Prelude.Maybe Prelude.Bool)
updateProvisioningArtifact_active :: (Maybe Bool -> f (Maybe Bool))
-> UpdateProvisioningArtifact -> f UpdateProvisioningArtifact
updateProvisioningArtifact_active = (UpdateProvisioningArtifact -> Maybe Bool)
-> (UpdateProvisioningArtifact
    -> Maybe Bool -> UpdateProvisioningArtifact)
-> Lens
     UpdateProvisioningArtifact
     UpdateProvisioningArtifact
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningArtifact' {Maybe Bool
active :: Maybe Bool
$sel:active:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe Bool
active} -> Maybe Bool
active) (\s :: UpdateProvisioningArtifact
s@UpdateProvisioningArtifact' {} Maybe Bool
a -> UpdateProvisioningArtifact
s {$sel:active:UpdateProvisioningArtifact' :: Maybe Bool
active = Maybe Bool
a} :: UpdateProvisioningArtifact)

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

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
updateProvisioningArtifact_acceptLanguage :: Lens.Lens' UpdateProvisioningArtifact (Prelude.Maybe Prelude.Text)
updateProvisioningArtifact_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> UpdateProvisioningArtifact -> f UpdateProvisioningArtifact
updateProvisioningArtifact_acceptLanguage = (UpdateProvisioningArtifact -> Maybe Text)
-> (UpdateProvisioningArtifact
    -> Maybe Text -> UpdateProvisioningArtifact)
-> Lens
     UpdateProvisioningArtifact
     UpdateProvisioningArtifact
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningArtifact' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: UpdateProvisioningArtifact
s@UpdateProvisioningArtifact' {} Maybe Text
a -> UpdateProvisioningArtifact
s {$sel:acceptLanguage:UpdateProvisioningArtifact' :: Maybe Text
acceptLanguage = Maybe Text
a} :: UpdateProvisioningArtifact)

-- | Information set by the administrator to provide guidance to end users
-- about which provisioning artifacts to use.
--
-- The @DEFAULT@ value indicates that the product version is active.
--
-- The administrator can set the guidance to @DEPRECATED@ to inform users
-- that the product version is deprecated. Users are able to make updates
-- to a provisioned product of a deprecated version but cannot launch new
-- provisioned products using a deprecated version.
updateProvisioningArtifact_guidance :: Lens.Lens' UpdateProvisioningArtifact (Prelude.Maybe ProvisioningArtifactGuidance)
updateProvisioningArtifact_guidance :: (Maybe ProvisioningArtifactGuidance
 -> f (Maybe ProvisioningArtifactGuidance))
-> UpdateProvisioningArtifact -> f UpdateProvisioningArtifact
updateProvisioningArtifact_guidance = (UpdateProvisioningArtifact -> Maybe ProvisioningArtifactGuidance)
-> (UpdateProvisioningArtifact
    -> Maybe ProvisioningArtifactGuidance
    -> UpdateProvisioningArtifact)
-> Lens
     UpdateProvisioningArtifact
     UpdateProvisioningArtifact
     (Maybe ProvisioningArtifactGuidance)
     (Maybe ProvisioningArtifactGuidance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningArtifact' {Maybe ProvisioningArtifactGuidance
guidance :: Maybe ProvisioningArtifactGuidance
$sel:guidance:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe ProvisioningArtifactGuidance
guidance} -> Maybe ProvisioningArtifactGuidance
guidance) (\s :: UpdateProvisioningArtifact
s@UpdateProvisioningArtifact' {} Maybe ProvisioningArtifactGuidance
a -> UpdateProvisioningArtifact
s {$sel:guidance:UpdateProvisioningArtifact' :: Maybe ProvisioningArtifactGuidance
guidance = Maybe ProvisioningArtifactGuidance
a} :: UpdateProvisioningArtifact)

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

-- | The product identifier.
updateProvisioningArtifact_productId :: Lens.Lens' UpdateProvisioningArtifact Prelude.Text
updateProvisioningArtifact_productId :: (Text -> f Text)
-> UpdateProvisioningArtifact -> f UpdateProvisioningArtifact
updateProvisioningArtifact_productId = (UpdateProvisioningArtifact -> Text)
-> (UpdateProvisioningArtifact
    -> Text -> UpdateProvisioningArtifact)
-> Lens
     UpdateProvisioningArtifact UpdateProvisioningArtifact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningArtifact' {Text
productId :: Text
$sel:productId:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Text
productId} -> Text
productId) (\s :: UpdateProvisioningArtifact
s@UpdateProvisioningArtifact' {} Text
a -> UpdateProvisioningArtifact
s {$sel:productId:UpdateProvisioningArtifact' :: Text
productId = Text
a} :: UpdateProvisioningArtifact)

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

instance Core.AWSRequest UpdateProvisioningArtifact where
  type
    AWSResponse UpdateProvisioningArtifact =
      UpdateProvisioningArtifactResponse
  request :: UpdateProvisioningArtifact -> Request UpdateProvisioningArtifact
request = Service
-> UpdateProvisioningArtifact -> Request UpdateProvisioningArtifact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateProvisioningArtifact
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateProvisioningArtifact)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateProvisioningArtifact))
-> Logger
-> Service
-> Proxy UpdateProvisioningArtifact
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateProvisioningArtifact)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe RequestStatus
-> Maybe (HashMap Text Text)
-> Maybe ProvisioningArtifactDetail
-> Int
-> UpdateProvisioningArtifactResponse
UpdateProvisioningArtifactResponse'
            (Maybe RequestStatus
 -> Maybe (HashMap Text Text)
 -> Maybe ProvisioningArtifactDetail
 -> Int
 -> UpdateProvisioningArtifactResponse)
-> Either String (Maybe RequestStatus)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe ProvisioningArtifactDetail
      -> Int
      -> UpdateProvisioningArtifactResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RequestStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe ProvisioningArtifactDetail
   -> Int
   -> UpdateProvisioningArtifactResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe ProvisioningArtifactDetail
      -> Int -> UpdateProvisioningArtifactResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Info" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe ProvisioningArtifactDetail
   -> Int -> UpdateProvisioningArtifactResponse)
-> Either String (Maybe ProvisioningArtifactDetail)
-> Either String (Int -> UpdateProvisioningArtifactResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ProvisioningArtifactDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProvisioningArtifactDetail")
            Either String (Int -> UpdateProvisioningArtifactResponse)
-> Either String Int
-> Either String UpdateProvisioningArtifactResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateProvisioningArtifact

instance Prelude.NFData UpdateProvisioningArtifact

instance Core.ToHeaders UpdateProvisioningArtifact where
  toHeaders :: UpdateProvisioningArtifact -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateProvisioningArtifact -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWS242ServiceCatalogService.UpdateProvisioningArtifact" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateProvisioningArtifact where
  toJSON :: UpdateProvisioningArtifact -> Value
toJSON UpdateProvisioningArtifact' {Maybe Bool
Maybe Text
Maybe ProvisioningArtifactGuidance
Text
provisioningArtifactId :: Text
productId :: Text
description :: Maybe Text
guidance :: Maybe ProvisioningArtifactGuidance
acceptLanguage :: Maybe Text
name :: Maybe Text
active :: Maybe Bool
$sel:provisioningArtifactId:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Text
$sel:productId:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Text
$sel:description:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe Text
$sel:guidance:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe ProvisioningArtifactGuidance
$sel:acceptLanguage:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe Text
$sel:name:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe Text
$sel:active:UpdateProvisioningArtifact' :: UpdateProvisioningArtifact -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Active" 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
active,
            (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
"AcceptLanguage" 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
acceptLanguage,
            (Text
"Guidance" Text -> ProvisioningArtifactGuidance -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ProvisioningArtifactGuidance -> Pair)
-> Maybe ProvisioningArtifactGuidance -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProvisioningArtifactGuidance
guidance,
            (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
"ProductId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
productId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ProvisioningArtifactId"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
provisioningArtifactId
              )
          ]
      )

instance Core.ToPath UpdateProvisioningArtifact where
  toPath :: UpdateProvisioningArtifact -> ByteString
toPath = ByteString -> UpdateProvisioningArtifact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery UpdateProvisioningArtifact where
  toQuery :: UpdateProvisioningArtifact -> QueryString
toQuery = QueryString -> UpdateProvisioningArtifact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateProvisioningArtifactResponse' smart constructor.
data UpdateProvisioningArtifactResponse = UpdateProvisioningArtifactResponse'
  { -- | The status of the current request.
    UpdateProvisioningArtifactResponse -> Maybe RequestStatus
status :: Prelude.Maybe RequestStatus,
    -- | The URL of the CloudFormation template in Amazon S3.
    UpdateProvisioningArtifactResponse -> Maybe (HashMap Text Text)
info :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Information about the provisioning artifact.
    UpdateProvisioningArtifactResponse
-> Maybe ProvisioningArtifactDetail
provisioningArtifactDetail :: Prelude.Maybe ProvisioningArtifactDetail,
    -- | The response's http status code.
    UpdateProvisioningArtifactResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateProvisioningArtifactResponse
-> UpdateProvisioningArtifactResponse -> Bool
(UpdateProvisioningArtifactResponse
 -> UpdateProvisioningArtifactResponse -> Bool)
-> (UpdateProvisioningArtifactResponse
    -> UpdateProvisioningArtifactResponse -> Bool)
-> Eq UpdateProvisioningArtifactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProvisioningArtifactResponse
-> UpdateProvisioningArtifactResponse -> Bool
$c/= :: UpdateProvisioningArtifactResponse
-> UpdateProvisioningArtifactResponse -> Bool
== :: UpdateProvisioningArtifactResponse
-> UpdateProvisioningArtifactResponse -> Bool
$c== :: UpdateProvisioningArtifactResponse
-> UpdateProvisioningArtifactResponse -> Bool
Prelude.Eq, ReadPrec [UpdateProvisioningArtifactResponse]
ReadPrec UpdateProvisioningArtifactResponse
Int -> ReadS UpdateProvisioningArtifactResponse
ReadS [UpdateProvisioningArtifactResponse]
(Int -> ReadS UpdateProvisioningArtifactResponse)
-> ReadS [UpdateProvisioningArtifactResponse]
-> ReadPrec UpdateProvisioningArtifactResponse
-> ReadPrec [UpdateProvisioningArtifactResponse]
-> Read UpdateProvisioningArtifactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProvisioningArtifactResponse]
$creadListPrec :: ReadPrec [UpdateProvisioningArtifactResponse]
readPrec :: ReadPrec UpdateProvisioningArtifactResponse
$creadPrec :: ReadPrec UpdateProvisioningArtifactResponse
readList :: ReadS [UpdateProvisioningArtifactResponse]
$creadList :: ReadS [UpdateProvisioningArtifactResponse]
readsPrec :: Int -> ReadS UpdateProvisioningArtifactResponse
$creadsPrec :: Int -> ReadS UpdateProvisioningArtifactResponse
Prelude.Read, Int -> UpdateProvisioningArtifactResponse -> ShowS
[UpdateProvisioningArtifactResponse] -> ShowS
UpdateProvisioningArtifactResponse -> String
(Int -> UpdateProvisioningArtifactResponse -> ShowS)
-> (UpdateProvisioningArtifactResponse -> String)
-> ([UpdateProvisioningArtifactResponse] -> ShowS)
-> Show UpdateProvisioningArtifactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProvisioningArtifactResponse] -> ShowS
$cshowList :: [UpdateProvisioningArtifactResponse] -> ShowS
show :: UpdateProvisioningArtifactResponse -> String
$cshow :: UpdateProvisioningArtifactResponse -> String
showsPrec :: Int -> UpdateProvisioningArtifactResponse -> ShowS
$cshowsPrec :: Int -> UpdateProvisioningArtifactResponse -> ShowS
Prelude.Show, (forall x.
 UpdateProvisioningArtifactResponse
 -> Rep UpdateProvisioningArtifactResponse x)
-> (forall x.
    Rep UpdateProvisioningArtifactResponse x
    -> UpdateProvisioningArtifactResponse)
-> Generic UpdateProvisioningArtifactResponse
forall x.
Rep UpdateProvisioningArtifactResponse x
-> UpdateProvisioningArtifactResponse
forall x.
UpdateProvisioningArtifactResponse
-> Rep UpdateProvisioningArtifactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateProvisioningArtifactResponse x
-> UpdateProvisioningArtifactResponse
$cfrom :: forall x.
UpdateProvisioningArtifactResponse
-> Rep UpdateProvisioningArtifactResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateProvisioningArtifactResponse' 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:
--
-- 'status', 'updateProvisioningArtifactResponse_status' - The status of the current request.
--
-- 'info', 'updateProvisioningArtifactResponse_info' - The URL of the CloudFormation template in Amazon S3.
--
-- 'provisioningArtifactDetail', 'updateProvisioningArtifactResponse_provisioningArtifactDetail' - Information about the provisioning artifact.
--
-- 'httpStatus', 'updateProvisioningArtifactResponse_httpStatus' - The response's http status code.
newUpdateProvisioningArtifactResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateProvisioningArtifactResponse
newUpdateProvisioningArtifactResponse :: Int -> UpdateProvisioningArtifactResponse
newUpdateProvisioningArtifactResponse Int
pHttpStatus_ =
  UpdateProvisioningArtifactResponse' :: Maybe RequestStatus
-> Maybe (HashMap Text Text)
-> Maybe ProvisioningArtifactDetail
-> Int
-> UpdateProvisioningArtifactResponse
UpdateProvisioningArtifactResponse'
    { $sel:status:UpdateProvisioningArtifactResponse' :: Maybe RequestStatus
status =
        Maybe RequestStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:info:UpdateProvisioningArtifactResponse' :: Maybe (HashMap Text Text)
info = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningArtifactDetail:UpdateProvisioningArtifactResponse' :: Maybe ProvisioningArtifactDetail
provisioningArtifactDetail =
        Maybe ProvisioningArtifactDetail
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateProvisioningArtifactResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the current request.
updateProvisioningArtifactResponse_status :: Lens.Lens' UpdateProvisioningArtifactResponse (Prelude.Maybe RequestStatus)
updateProvisioningArtifactResponse_status :: (Maybe RequestStatus -> f (Maybe RequestStatus))
-> UpdateProvisioningArtifactResponse
-> f UpdateProvisioningArtifactResponse
updateProvisioningArtifactResponse_status = (UpdateProvisioningArtifactResponse -> Maybe RequestStatus)
-> (UpdateProvisioningArtifactResponse
    -> Maybe RequestStatus -> UpdateProvisioningArtifactResponse)
-> Lens
     UpdateProvisioningArtifactResponse
     UpdateProvisioningArtifactResponse
     (Maybe RequestStatus)
     (Maybe RequestStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningArtifactResponse' {Maybe RequestStatus
status :: Maybe RequestStatus
$sel:status:UpdateProvisioningArtifactResponse' :: UpdateProvisioningArtifactResponse -> Maybe RequestStatus
status} -> Maybe RequestStatus
status) (\s :: UpdateProvisioningArtifactResponse
s@UpdateProvisioningArtifactResponse' {} Maybe RequestStatus
a -> UpdateProvisioningArtifactResponse
s {$sel:status:UpdateProvisioningArtifactResponse' :: Maybe RequestStatus
status = Maybe RequestStatus
a} :: UpdateProvisioningArtifactResponse)

-- | The URL of the CloudFormation template in Amazon S3.
updateProvisioningArtifactResponse_info :: Lens.Lens' UpdateProvisioningArtifactResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateProvisioningArtifactResponse_info :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateProvisioningArtifactResponse
-> f UpdateProvisioningArtifactResponse
updateProvisioningArtifactResponse_info = (UpdateProvisioningArtifactResponse -> Maybe (HashMap Text Text))
-> (UpdateProvisioningArtifactResponse
    -> Maybe (HashMap Text Text) -> UpdateProvisioningArtifactResponse)
-> Lens
     UpdateProvisioningArtifactResponse
     UpdateProvisioningArtifactResponse
     (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 (\UpdateProvisioningArtifactResponse' {Maybe (HashMap Text Text)
info :: Maybe (HashMap Text Text)
$sel:info:UpdateProvisioningArtifactResponse' :: UpdateProvisioningArtifactResponse -> Maybe (HashMap Text Text)
info} -> Maybe (HashMap Text Text)
info) (\s :: UpdateProvisioningArtifactResponse
s@UpdateProvisioningArtifactResponse' {} Maybe (HashMap Text Text)
a -> UpdateProvisioningArtifactResponse
s {$sel:info:UpdateProvisioningArtifactResponse' :: Maybe (HashMap Text Text)
info = Maybe (HashMap Text Text)
a} :: UpdateProvisioningArtifactResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateProvisioningArtifactResponse
 -> f UpdateProvisioningArtifactResponse)
-> ((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)))
-> UpdateProvisioningArtifactResponse
-> f UpdateProvisioningArtifactResponse
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

-- | Information about the provisioning artifact.
updateProvisioningArtifactResponse_provisioningArtifactDetail :: Lens.Lens' UpdateProvisioningArtifactResponse (Prelude.Maybe ProvisioningArtifactDetail)
updateProvisioningArtifactResponse_provisioningArtifactDetail :: (Maybe ProvisioningArtifactDetail
 -> f (Maybe ProvisioningArtifactDetail))
-> UpdateProvisioningArtifactResponse
-> f UpdateProvisioningArtifactResponse
updateProvisioningArtifactResponse_provisioningArtifactDetail = (UpdateProvisioningArtifactResponse
 -> Maybe ProvisioningArtifactDetail)
-> (UpdateProvisioningArtifactResponse
    -> Maybe ProvisioningArtifactDetail
    -> UpdateProvisioningArtifactResponse)
-> Lens
     UpdateProvisioningArtifactResponse
     UpdateProvisioningArtifactResponse
     (Maybe ProvisioningArtifactDetail)
     (Maybe ProvisioningArtifactDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningArtifactResponse' {Maybe ProvisioningArtifactDetail
provisioningArtifactDetail :: Maybe ProvisioningArtifactDetail
$sel:provisioningArtifactDetail:UpdateProvisioningArtifactResponse' :: UpdateProvisioningArtifactResponse
-> Maybe ProvisioningArtifactDetail
provisioningArtifactDetail} -> Maybe ProvisioningArtifactDetail
provisioningArtifactDetail) (\s :: UpdateProvisioningArtifactResponse
s@UpdateProvisioningArtifactResponse' {} Maybe ProvisioningArtifactDetail
a -> UpdateProvisioningArtifactResponse
s {$sel:provisioningArtifactDetail:UpdateProvisioningArtifactResponse' :: Maybe ProvisioningArtifactDetail
provisioningArtifactDetail = Maybe ProvisioningArtifactDetail
a} :: UpdateProvisioningArtifactResponse)

-- | The response's http status code.
updateProvisioningArtifactResponse_httpStatus :: Lens.Lens' UpdateProvisioningArtifactResponse Prelude.Int
updateProvisioningArtifactResponse_httpStatus :: (Int -> f Int)
-> UpdateProvisioningArtifactResponse
-> f UpdateProvisioningArtifactResponse
updateProvisioningArtifactResponse_httpStatus = (UpdateProvisioningArtifactResponse -> Int)
-> (UpdateProvisioningArtifactResponse
    -> Int -> UpdateProvisioningArtifactResponse)
-> Lens
     UpdateProvisioningArtifactResponse
     UpdateProvisioningArtifactResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningArtifactResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateProvisioningArtifactResponse' :: UpdateProvisioningArtifactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateProvisioningArtifactResponse
s@UpdateProvisioningArtifactResponse' {} Int
a -> UpdateProvisioningArtifactResponse
s {$sel:httpStatus:UpdateProvisioningArtifactResponse' :: Int
httpStatus = Int
a} :: UpdateProvisioningArtifactResponse)

instance
  Prelude.NFData
    UpdateProvisioningArtifactResponse