{-# 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.UpdateProvisionedProductProperties
-- 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)
--
-- Requests updates to the properties of the specified provisioned product.
module Amazonka.ServiceCatalog.UpdateProvisionedProductProperties
  ( -- * Creating a Request
    UpdateProvisionedProductProperties (..),
    newUpdateProvisionedProductProperties,

    -- * Request Lenses
    updateProvisionedProductProperties_acceptLanguage,
    updateProvisionedProductProperties_provisionedProductId,
    updateProvisionedProductProperties_provisionedProductProperties,
    updateProvisionedProductProperties_idempotencyToken,

    -- * Destructuring the Response
    UpdateProvisionedProductPropertiesResponse (..),
    newUpdateProvisionedProductPropertiesResponse,

    -- * Response Lenses
    updateProvisionedProductPropertiesResponse_status,
    updateProvisionedProductPropertiesResponse_provisionedProductProperties,
    updateProvisionedProductPropertiesResponse_recordId,
    updateProvisionedProductPropertiesResponse_provisionedProductId,
    updateProvisionedProductPropertiesResponse_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:/ 'newUpdateProvisionedProductProperties' smart constructor.
data UpdateProvisionedProductProperties = UpdateProvisionedProductProperties'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    UpdateProvisionedProductProperties -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the provisioned product.
    UpdateProvisionedProductProperties -> Text
provisionedProductId :: Prelude.Text,
    -- | A map that contains the provisioned product properties to be updated.
    --
    -- The @LAUNCH_ROLE@ key accepts role ARNs. This key allows an
    -- administrator to call @UpdateProvisionedProductProperties@ to update the
    -- launch role that is associated with a provisioned product. This role is
    -- used when an end user calls a provisioning operation such as
    -- @UpdateProvisionedProduct@, @TerminateProvisionedProduct@, or
    -- @ExecuteProvisionedProductServiceAction@. Only a role ARN is valid. A
    -- user ARN is invalid.
    --
    -- The @OWNER@ key accepts user ARNs and role ARNs. The owner is the user
    -- that has permission to see, update, terminate, and execute service
    -- actions in the provisioned product.
    --
    -- The administrator can change the owner of a provisioned product to
    -- another IAM user within the same account. Both end user owners and
    -- administrators can see ownership history of the provisioned product
    -- using the @ListRecordHistory@ API. The new owner can describe all past
    -- records for the provisioned product using the @DescribeRecord@ API. The
    -- previous owner can no longer use @DescribeRecord@, but can still see the
    -- product\'s history from when he was an owner using @ListRecordHistory@.
    --
    -- If a provisioned product ownership is assigned to an end user, they can
    -- see and perform any action through the API or Service Catalog console
    -- such as update, terminate, and execute service actions. If an end user
    -- provisions a product and the owner is updated to someone else, they will
    -- no longer be able to see or perform any actions through API or the
    -- Service Catalog console on that provisioned product.
    UpdateProvisionedProductProperties -> HashMap PropertyKey Text
provisionedProductProperties :: Prelude.HashMap PropertyKey Prelude.Text,
    -- | The idempotency token that uniquely identifies the provisioning product
    -- update request.
    UpdateProvisionedProductProperties -> Text
idempotencyToken :: Prelude.Text
  }
  deriving (UpdateProvisionedProductProperties
-> UpdateProvisionedProductProperties -> Bool
(UpdateProvisionedProductProperties
 -> UpdateProvisionedProductProperties -> Bool)
-> (UpdateProvisionedProductProperties
    -> UpdateProvisionedProductProperties -> Bool)
-> Eq UpdateProvisionedProductProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProvisionedProductProperties
-> UpdateProvisionedProductProperties -> Bool
$c/= :: UpdateProvisionedProductProperties
-> UpdateProvisionedProductProperties -> Bool
== :: UpdateProvisionedProductProperties
-> UpdateProvisionedProductProperties -> Bool
$c== :: UpdateProvisionedProductProperties
-> UpdateProvisionedProductProperties -> Bool
Prelude.Eq, ReadPrec [UpdateProvisionedProductProperties]
ReadPrec UpdateProvisionedProductProperties
Int -> ReadS UpdateProvisionedProductProperties
ReadS [UpdateProvisionedProductProperties]
(Int -> ReadS UpdateProvisionedProductProperties)
-> ReadS [UpdateProvisionedProductProperties]
-> ReadPrec UpdateProvisionedProductProperties
-> ReadPrec [UpdateProvisionedProductProperties]
-> Read UpdateProvisionedProductProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProvisionedProductProperties]
$creadListPrec :: ReadPrec [UpdateProvisionedProductProperties]
readPrec :: ReadPrec UpdateProvisionedProductProperties
$creadPrec :: ReadPrec UpdateProvisionedProductProperties
readList :: ReadS [UpdateProvisionedProductProperties]
$creadList :: ReadS [UpdateProvisionedProductProperties]
readsPrec :: Int -> ReadS UpdateProvisionedProductProperties
$creadsPrec :: Int -> ReadS UpdateProvisionedProductProperties
Prelude.Read, Int -> UpdateProvisionedProductProperties -> ShowS
[UpdateProvisionedProductProperties] -> ShowS
UpdateProvisionedProductProperties -> String
(Int -> UpdateProvisionedProductProperties -> ShowS)
-> (UpdateProvisionedProductProperties -> String)
-> ([UpdateProvisionedProductProperties] -> ShowS)
-> Show UpdateProvisionedProductProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProvisionedProductProperties] -> ShowS
$cshowList :: [UpdateProvisionedProductProperties] -> ShowS
show :: UpdateProvisionedProductProperties -> String
$cshow :: UpdateProvisionedProductProperties -> String
showsPrec :: Int -> UpdateProvisionedProductProperties -> ShowS
$cshowsPrec :: Int -> UpdateProvisionedProductProperties -> ShowS
Prelude.Show, (forall x.
 UpdateProvisionedProductProperties
 -> Rep UpdateProvisionedProductProperties x)
-> (forall x.
    Rep UpdateProvisionedProductProperties x
    -> UpdateProvisionedProductProperties)
-> Generic UpdateProvisionedProductProperties
forall x.
Rep UpdateProvisionedProductProperties x
-> UpdateProvisionedProductProperties
forall x.
UpdateProvisionedProductProperties
-> Rep UpdateProvisionedProductProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateProvisionedProductProperties x
-> UpdateProvisionedProductProperties
$cfrom :: forall x.
UpdateProvisionedProductProperties
-> Rep UpdateProvisionedProductProperties x
Prelude.Generic)

-- |
-- Create a value of 'UpdateProvisionedProductProperties' 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:
--
-- 'acceptLanguage', 'updateProvisionedProductProperties_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'provisionedProductId', 'updateProvisionedProductProperties_provisionedProductId' - The identifier of the provisioned product.
--
-- 'provisionedProductProperties', 'updateProvisionedProductProperties_provisionedProductProperties' - A map that contains the provisioned product properties to be updated.
--
-- The @LAUNCH_ROLE@ key accepts role ARNs. This key allows an
-- administrator to call @UpdateProvisionedProductProperties@ to update the
-- launch role that is associated with a provisioned product. This role is
-- used when an end user calls a provisioning operation such as
-- @UpdateProvisionedProduct@, @TerminateProvisionedProduct@, or
-- @ExecuteProvisionedProductServiceAction@. Only a role ARN is valid. A
-- user ARN is invalid.
--
-- The @OWNER@ key accepts user ARNs and role ARNs. The owner is the user
-- that has permission to see, update, terminate, and execute service
-- actions in the provisioned product.
--
-- The administrator can change the owner of a provisioned product to
-- another IAM user within the same account. Both end user owners and
-- administrators can see ownership history of the provisioned product
-- using the @ListRecordHistory@ API. The new owner can describe all past
-- records for the provisioned product using the @DescribeRecord@ API. The
-- previous owner can no longer use @DescribeRecord@, but can still see the
-- product\'s history from when he was an owner using @ListRecordHistory@.
--
-- If a provisioned product ownership is assigned to an end user, they can
-- see and perform any action through the API or Service Catalog console
-- such as update, terminate, and execute service actions. If an end user
-- provisions a product and the owner is updated to someone else, they will
-- no longer be able to see or perform any actions through API or the
-- Service Catalog console on that provisioned product.
--
-- 'idempotencyToken', 'updateProvisionedProductProperties_idempotencyToken' - The idempotency token that uniquely identifies the provisioning product
-- update request.
newUpdateProvisionedProductProperties ::
  -- | 'provisionedProductId'
  Prelude.Text ->
  -- | 'idempotencyToken'
  Prelude.Text ->
  UpdateProvisionedProductProperties
newUpdateProvisionedProductProperties :: Text -> Text -> UpdateProvisionedProductProperties
newUpdateProvisionedProductProperties
  Text
pProvisionedProductId_
  Text
pIdempotencyToken_ =
    UpdateProvisionedProductProperties' :: Maybe Text
-> Text
-> HashMap PropertyKey Text
-> Text
-> UpdateProvisionedProductProperties
UpdateProvisionedProductProperties'
      { $sel:acceptLanguage:UpdateProvisionedProductProperties' :: Maybe Text
acceptLanguage =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:provisionedProductId:UpdateProvisionedProductProperties' :: Text
provisionedProductId =
          Text
pProvisionedProductId_,
        $sel:provisionedProductProperties:UpdateProvisionedProductProperties' :: HashMap PropertyKey Text
provisionedProductProperties =
          HashMap PropertyKey Text
forall a. Monoid a => a
Prelude.mempty,
        $sel:idempotencyToken:UpdateProvisionedProductProperties' :: Text
idempotencyToken = Text
pIdempotencyToken_
      }

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

-- | The identifier of the provisioned product.
updateProvisionedProductProperties_provisionedProductId :: Lens.Lens' UpdateProvisionedProductProperties Prelude.Text
updateProvisionedProductProperties_provisionedProductId :: (Text -> f Text)
-> UpdateProvisionedProductProperties
-> f UpdateProvisionedProductProperties
updateProvisionedProductProperties_provisionedProductId = (UpdateProvisionedProductProperties -> Text)
-> (UpdateProvisionedProductProperties
    -> Text -> UpdateProvisionedProductProperties)
-> Lens
     UpdateProvisionedProductProperties
     UpdateProvisionedProductProperties
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisionedProductProperties' {Text
provisionedProductId :: Text
$sel:provisionedProductId:UpdateProvisionedProductProperties' :: UpdateProvisionedProductProperties -> Text
provisionedProductId} -> Text
provisionedProductId) (\s :: UpdateProvisionedProductProperties
s@UpdateProvisionedProductProperties' {} Text
a -> UpdateProvisionedProductProperties
s {$sel:provisionedProductId:UpdateProvisionedProductProperties' :: Text
provisionedProductId = Text
a} :: UpdateProvisionedProductProperties)

-- | A map that contains the provisioned product properties to be updated.
--
-- The @LAUNCH_ROLE@ key accepts role ARNs. This key allows an
-- administrator to call @UpdateProvisionedProductProperties@ to update the
-- launch role that is associated with a provisioned product. This role is
-- used when an end user calls a provisioning operation such as
-- @UpdateProvisionedProduct@, @TerminateProvisionedProduct@, or
-- @ExecuteProvisionedProductServiceAction@. Only a role ARN is valid. A
-- user ARN is invalid.
--
-- The @OWNER@ key accepts user ARNs and role ARNs. The owner is the user
-- that has permission to see, update, terminate, and execute service
-- actions in the provisioned product.
--
-- The administrator can change the owner of a provisioned product to
-- another IAM user within the same account. Both end user owners and
-- administrators can see ownership history of the provisioned product
-- using the @ListRecordHistory@ API. The new owner can describe all past
-- records for the provisioned product using the @DescribeRecord@ API. The
-- previous owner can no longer use @DescribeRecord@, but can still see the
-- product\'s history from when he was an owner using @ListRecordHistory@.
--
-- If a provisioned product ownership is assigned to an end user, they can
-- see and perform any action through the API or Service Catalog console
-- such as update, terminate, and execute service actions. If an end user
-- provisions a product and the owner is updated to someone else, they will
-- no longer be able to see or perform any actions through API or the
-- Service Catalog console on that provisioned product.
updateProvisionedProductProperties_provisionedProductProperties :: Lens.Lens' UpdateProvisionedProductProperties (Prelude.HashMap PropertyKey Prelude.Text)
updateProvisionedProductProperties_provisionedProductProperties :: (HashMap PropertyKey Text -> f (HashMap PropertyKey Text))
-> UpdateProvisionedProductProperties
-> f UpdateProvisionedProductProperties
updateProvisionedProductProperties_provisionedProductProperties = (UpdateProvisionedProductProperties -> HashMap PropertyKey Text)
-> (UpdateProvisionedProductProperties
    -> HashMap PropertyKey Text -> UpdateProvisionedProductProperties)
-> Lens
     UpdateProvisionedProductProperties
     UpdateProvisionedProductProperties
     (HashMap PropertyKey Text)
     (HashMap PropertyKey Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisionedProductProperties' {HashMap PropertyKey Text
provisionedProductProperties :: HashMap PropertyKey Text
$sel:provisionedProductProperties:UpdateProvisionedProductProperties' :: UpdateProvisionedProductProperties -> HashMap PropertyKey Text
provisionedProductProperties} -> HashMap PropertyKey Text
provisionedProductProperties) (\s :: UpdateProvisionedProductProperties
s@UpdateProvisionedProductProperties' {} HashMap PropertyKey Text
a -> UpdateProvisionedProductProperties
s {$sel:provisionedProductProperties:UpdateProvisionedProductProperties' :: HashMap PropertyKey Text
provisionedProductProperties = HashMap PropertyKey Text
a} :: UpdateProvisionedProductProperties) ((HashMap PropertyKey Text -> f (HashMap PropertyKey Text))
 -> UpdateProvisionedProductProperties
 -> f UpdateProvisionedProductProperties)
-> ((HashMap PropertyKey Text -> f (HashMap PropertyKey Text))
    -> HashMap PropertyKey Text -> f (HashMap PropertyKey Text))
-> (HashMap PropertyKey Text -> f (HashMap PropertyKey Text))
-> UpdateProvisionedProductProperties
-> f UpdateProvisionedProductProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap PropertyKey Text -> f (HashMap PropertyKey Text))
-> HashMap PropertyKey Text -> f (HashMap PropertyKey Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The idempotency token that uniquely identifies the provisioning product
-- update request.
updateProvisionedProductProperties_idempotencyToken :: Lens.Lens' UpdateProvisionedProductProperties Prelude.Text
updateProvisionedProductProperties_idempotencyToken :: (Text -> f Text)
-> UpdateProvisionedProductProperties
-> f UpdateProvisionedProductProperties
updateProvisionedProductProperties_idempotencyToken = (UpdateProvisionedProductProperties -> Text)
-> (UpdateProvisionedProductProperties
    -> Text -> UpdateProvisionedProductProperties)
-> Lens
     UpdateProvisionedProductProperties
     UpdateProvisionedProductProperties
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisionedProductProperties' {Text
idempotencyToken :: Text
$sel:idempotencyToken:UpdateProvisionedProductProperties' :: UpdateProvisionedProductProperties -> Text
idempotencyToken} -> Text
idempotencyToken) (\s :: UpdateProvisionedProductProperties
s@UpdateProvisionedProductProperties' {} Text
a -> UpdateProvisionedProductProperties
s {$sel:idempotencyToken:UpdateProvisionedProductProperties' :: Text
idempotencyToken = Text
a} :: UpdateProvisionedProductProperties)

instance
  Core.AWSRequest
    UpdateProvisionedProductProperties
  where
  type
    AWSResponse UpdateProvisionedProductProperties =
      UpdateProvisionedProductPropertiesResponse
  request :: UpdateProvisionedProductProperties
-> Request UpdateProvisionedProductProperties
request = Service
-> UpdateProvisionedProductProperties
-> Request UpdateProvisionedProductProperties
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateProvisionedProductProperties
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse UpdateProvisionedProductProperties)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateProvisionedProductProperties))
-> Logger
-> Service
-> Proxy UpdateProvisionedProductProperties
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse UpdateProvisionedProductProperties)))
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 RecordStatus
-> Maybe (HashMap PropertyKey Text)
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateProvisionedProductPropertiesResponse
UpdateProvisionedProductPropertiesResponse'
            (Maybe RecordStatus
 -> Maybe (HashMap PropertyKey Text)
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateProvisionedProductPropertiesResponse)
-> Either String (Maybe RecordStatus)
-> Either
     String
     (Maybe (HashMap PropertyKey Text)
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateProvisionedProductPropertiesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RecordStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
              Either
  String
  (Maybe (HashMap PropertyKey Text)
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateProvisionedProductPropertiesResponse)
-> Either String (Maybe (HashMap PropertyKey Text))
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> UpdateProvisionedProductPropertiesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe (HashMap PropertyKey Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProvisionedProductProperties"
                              Either String (Maybe (Maybe (HashMap PropertyKey Text)))
-> Maybe (HashMap PropertyKey Text)
-> Either String (Maybe (HashMap PropertyKey Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap PropertyKey Text)
forall a. Monoid a => a
Prelude.mempty
                          )
              Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> UpdateProvisionedProductPropertiesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Int -> UpdateProvisionedProductPropertiesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RecordId")
              Either
  String
  (Maybe Text -> Int -> UpdateProvisionedProductPropertiesResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> UpdateProvisionedProductPropertiesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProvisionedProductId")
              Either String (Int -> UpdateProvisionedProductPropertiesResponse)
-> Either String Int
-> Either String UpdateProvisionedProductPropertiesResponse
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
    UpdateProvisionedProductProperties

instance
  Prelude.NFData
    UpdateProvisionedProductProperties

instance
  Core.ToHeaders
    UpdateProvisionedProductProperties
  where
  toHeaders :: UpdateProvisionedProductProperties -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> UpdateProvisionedProductProperties -> 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.UpdateProvisionedProductProperties" ::
                          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
    UpdateProvisionedProductProperties
  where
  toJSON :: UpdateProvisionedProductProperties -> Value
toJSON UpdateProvisionedProductProperties' {Maybe Text
Text
HashMap PropertyKey Text
idempotencyToken :: Text
provisionedProductProperties :: HashMap PropertyKey Text
provisionedProductId :: Text
acceptLanguage :: Maybe Text
$sel:idempotencyToken:UpdateProvisionedProductProperties' :: UpdateProvisionedProductProperties -> Text
$sel:provisionedProductProperties:UpdateProvisionedProductProperties' :: UpdateProvisionedProductProperties -> HashMap PropertyKey Text
$sel:provisionedProductId:UpdateProvisionedProductProperties' :: UpdateProvisionedProductProperties -> Text
$sel:acceptLanguage:UpdateProvisionedProductProperties' :: UpdateProvisionedProductProperties -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ProvisionedProductId"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
provisionedProductId
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ProvisionedProductProperties"
                  Text -> HashMap PropertyKey Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap PropertyKey Text
provisionedProductProperties
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdempotencyToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
idempotencyToken)
          ]
      )

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

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

-- | /See:/ 'newUpdateProvisionedProductPropertiesResponse' smart constructor.
data UpdateProvisionedProductPropertiesResponse = UpdateProvisionedProductPropertiesResponse'
  { -- | The status of the request.
    UpdateProvisionedProductPropertiesResponse -> Maybe RecordStatus
status :: Prelude.Maybe RecordStatus,
    -- | A map that contains the properties updated.
    UpdateProvisionedProductPropertiesResponse
-> Maybe (HashMap PropertyKey Text)
provisionedProductProperties :: Prelude.Maybe (Prelude.HashMap PropertyKey Prelude.Text),
    -- | The identifier of the record.
    UpdateProvisionedProductPropertiesResponse -> Maybe Text
recordId :: Prelude.Maybe Prelude.Text,
    -- | The provisioned product identifier.
    UpdateProvisionedProductPropertiesResponse -> Maybe Text
provisionedProductId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateProvisionedProductPropertiesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateProvisionedProductPropertiesResponse
-> UpdateProvisionedProductPropertiesResponse -> Bool
(UpdateProvisionedProductPropertiesResponse
 -> UpdateProvisionedProductPropertiesResponse -> Bool)
-> (UpdateProvisionedProductPropertiesResponse
    -> UpdateProvisionedProductPropertiesResponse -> Bool)
-> Eq UpdateProvisionedProductPropertiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProvisionedProductPropertiesResponse
-> UpdateProvisionedProductPropertiesResponse -> Bool
$c/= :: UpdateProvisionedProductPropertiesResponse
-> UpdateProvisionedProductPropertiesResponse -> Bool
== :: UpdateProvisionedProductPropertiesResponse
-> UpdateProvisionedProductPropertiesResponse -> Bool
$c== :: UpdateProvisionedProductPropertiesResponse
-> UpdateProvisionedProductPropertiesResponse -> Bool
Prelude.Eq, ReadPrec [UpdateProvisionedProductPropertiesResponse]
ReadPrec UpdateProvisionedProductPropertiesResponse
Int -> ReadS UpdateProvisionedProductPropertiesResponse
ReadS [UpdateProvisionedProductPropertiesResponse]
(Int -> ReadS UpdateProvisionedProductPropertiesResponse)
-> ReadS [UpdateProvisionedProductPropertiesResponse]
-> ReadPrec UpdateProvisionedProductPropertiesResponse
-> ReadPrec [UpdateProvisionedProductPropertiesResponse]
-> Read UpdateProvisionedProductPropertiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProvisionedProductPropertiesResponse]
$creadListPrec :: ReadPrec [UpdateProvisionedProductPropertiesResponse]
readPrec :: ReadPrec UpdateProvisionedProductPropertiesResponse
$creadPrec :: ReadPrec UpdateProvisionedProductPropertiesResponse
readList :: ReadS [UpdateProvisionedProductPropertiesResponse]
$creadList :: ReadS [UpdateProvisionedProductPropertiesResponse]
readsPrec :: Int -> ReadS UpdateProvisionedProductPropertiesResponse
$creadsPrec :: Int -> ReadS UpdateProvisionedProductPropertiesResponse
Prelude.Read, Int -> UpdateProvisionedProductPropertiesResponse -> ShowS
[UpdateProvisionedProductPropertiesResponse] -> ShowS
UpdateProvisionedProductPropertiesResponse -> String
(Int -> UpdateProvisionedProductPropertiesResponse -> ShowS)
-> (UpdateProvisionedProductPropertiesResponse -> String)
-> ([UpdateProvisionedProductPropertiesResponse] -> ShowS)
-> Show UpdateProvisionedProductPropertiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProvisionedProductPropertiesResponse] -> ShowS
$cshowList :: [UpdateProvisionedProductPropertiesResponse] -> ShowS
show :: UpdateProvisionedProductPropertiesResponse -> String
$cshow :: UpdateProvisionedProductPropertiesResponse -> String
showsPrec :: Int -> UpdateProvisionedProductPropertiesResponse -> ShowS
$cshowsPrec :: Int -> UpdateProvisionedProductPropertiesResponse -> ShowS
Prelude.Show, (forall x.
 UpdateProvisionedProductPropertiesResponse
 -> Rep UpdateProvisionedProductPropertiesResponse x)
-> (forall x.
    Rep UpdateProvisionedProductPropertiesResponse x
    -> UpdateProvisionedProductPropertiesResponse)
-> Generic UpdateProvisionedProductPropertiesResponse
forall x.
Rep UpdateProvisionedProductPropertiesResponse x
-> UpdateProvisionedProductPropertiesResponse
forall x.
UpdateProvisionedProductPropertiesResponse
-> Rep UpdateProvisionedProductPropertiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateProvisionedProductPropertiesResponse x
-> UpdateProvisionedProductPropertiesResponse
$cfrom :: forall x.
UpdateProvisionedProductPropertiesResponse
-> Rep UpdateProvisionedProductPropertiesResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateProvisionedProductPropertiesResponse' 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', 'updateProvisionedProductPropertiesResponse_status' - The status of the request.
--
-- 'provisionedProductProperties', 'updateProvisionedProductPropertiesResponse_provisionedProductProperties' - A map that contains the properties updated.
--
-- 'recordId', 'updateProvisionedProductPropertiesResponse_recordId' - The identifier of the record.
--
-- 'provisionedProductId', 'updateProvisionedProductPropertiesResponse_provisionedProductId' - The provisioned product identifier.
--
-- 'httpStatus', 'updateProvisionedProductPropertiesResponse_httpStatus' - The response's http status code.
newUpdateProvisionedProductPropertiesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateProvisionedProductPropertiesResponse
newUpdateProvisionedProductPropertiesResponse :: Int -> UpdateProvisionedProductPropertiesResponse
newUpdateProvisionedProductPropertiesResponse
  Int
pHttpStatus_ =
    UpdateProvisionedProductPropertiesResponse' :: Maybe RecordStatus
-> Maybe (HashMap PropertyKey Text)
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateProvisionedProductPropertiesResponse
UpdateProvisionedProductPropertiesResponse'
      { $sel:status:UpdateProvisionedProductPropertiesResponse' :: Maybe RecordStatus
status =
          Maybe RecordStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:provisionedProductProperties:UpdateProvisionedProductPropertiesResponse' :: Maybe (HashMap PropertyKey Text)
provisionedProductProperties =
          Maybe (HashMap PropertyKey Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:recordId:UpdateProvisionedProductPropertiesResponse' :: Maybe Text
recordId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:provisionedProductId:UpdateProvisionedProductPropertiesResponse' :: Maybe Text
provisionedProductId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateProvisionedProductPropertiesResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | A map that contains the properties updated.
updateProvisionedProductPropertiesResponse_provisionedProductProperties :: Lens.Lens' UpdateProvisionedProductPropertiesResponse (Prelude.Maybe (Prelude.HashMap PropertyKey Prelude.Text))
updateProvisionedProductPropertiesResponse_provisionedProductProperties :: (Maybe (HashMap PropertyKey Text)
 -> f (Maybe (HashMap PropertyKey Text)))
-> UpdateProvisionedProductPropertiesResponse
-> f UpdateProvisionedProductPropertiesResponse
updateProvisionedProductPropertiesResponse_provisionedProductProperties = (UpdateProvisionedProductPropertiesResponse
 -> Maybe (HashMap PropertyKey Text))
-> (UpdateProvisionedProductPropertiesResponse
    -> Maybe (HashMap PropertyKey Text)
    -> UpdateProvisionedProductPropertiesResponse)
-> Lens
     UpdateProvisionedProductPropertiesResponse
     UpdateProvisionedProductPropertiesResponse
     (Maybe (HashMap PropertyKey Text))
     (Maybe (HashMap PropertyKey Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisionedProductPropertiesResponse' {Maybe (HashMap PropertyKey Text)
provisionedProductProperties :: Maybe (HashMap PropertyKey Text)
$sel:provisionedProductProperties:UpdateProvisionedProductPropertiesResponse' :: UpdateProvisionedProductPropertiesResponse
-> Maybe (HashMap PropertyKey Text)
provisionedProductProperties} -> Maybe (HashMap PropertyKey Text)
provisionedProductProperties) (\s :: UpdateProvisionedProductPropertiesResponse
s@UpdateProvisionedProductPropertiesResponse' {} Maybe (HashMap PropertyKey Text)
a -> UpdateProvisionedProductPropertiesResponse
s {$sel:provisionedProductProperties:UpdateProvisionedProductPropertiesResponse' :: Maybe (HashMap PropertyKey Text)
provisionedProductProperties = Maybe (HashMap PropertyKey Text)
a} :: UpdateProvisionedProductPropertiesResponse) ((Maybe (HashMap PropertyKey Text)
  -> f (Maybe (HashMap PropertyKey Text)))
 -> UpdateProvisionedProductPropertiesResponse
 -> f UpdateProvisionedProductPropertiesResponse)
-> ((Maybe (HashMap PropertyKey Text)
     -> f (Maybe (HashMap PropertyKey Text)))
    -> Maybe (HashMap PropertyKey Text)
    -> f (Maybe (HashMap PropertyKey Text)))
-> (Maybe (HashMap PropertyKey Text)
    -> f (Maybe (HashMap PropertyKey Text)))
-> UpdateProvisionedProductPropertiesResponse
-> f UpdateProvisionedProductPropertiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap PropertyKey Text)
  (HashMap PropertyKey Text)
  (HashMap PropertyKey Text)
  (HashMap PropertyKey Text)
-> Iso
     (Maybe (HashMap PropertyKey Text))
     (Maybe (HashMap PropertyKey Text))
     (Maybe (HashMap PropertyKey Text))
     (Maybe (HashMap PropertyKey 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 PropertyKey Text)
  (HashMap PropertyKey Text)
  (HashMap PropertyKey Text)
  (HashMap PropertyKey Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the record.
updateProvisionedProductPropertiesResponse_recordId :: Lens.Lens' UpdateProvisionedProductPropertiesResponse (Prelude.Maybe Prelude.Text)
updateProvisionedProductPropertiesResponse_recordId :: (Maybe Text -> f (Maybe Text))
-> UpdateProvisionedProductPropertiesResponse
-> f UpdateProvisionedProductPropertiesResponse
updateProvisionedProductPropertiesResponse_recordId = (UpdateProvisionedProductPropertiesResponse -> Maybe Text)
-> (UpdateProvisionedProductPropertiesResponse
    -> Maybe Text -> UpdateProvisionedProductPropertiesResponse)
-> Lens
     UpdateProvisionedProductPropertiesResponse
     UpdateProvisionedProductPropertiesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisionedProductPropertiesResponse' {Maybe Text
recordId :: Maybe Text
$sel:recordId:UpdateProvisionedProductPropertiesResponse' :: UpdateProvisionedProductPropertiesResponse -> Maybe Text
recordId} -> Maybe Text
recordId) (\s :: UpdateProvisionedProductPropertiesResponse
s@UpdateProvisionedProductPropertiesResponse' {} Maybe Text
a -> UpdateProvisionedProductPropertiesResponse
s {$sel:recordId:UpdateProvisionedProductPropertiesResponse' :: Maybe Text
recordId = Maybe Text
a} :: UpdateProvisionedProductPropertiesResponse)

-- | The provisioned product identifier.
updateProvisionedProductPropertiesResponse_provisionedProductId :: Lens.Lens' UpdateProvisionedProductPropertiesResponse (Prelude.Maybe Prelude.Text)
updateProvisionedProductPropertiesResponse_provisionedProductId :: (Maybe Text -> f (Maybe Text))
-> UpdateProvisionedProductPropertiesResponse
-> f UpdateProvisionedProductPropertiesResponse
updateProvisionedProductPropertiesResponse_provisionedProductId = (UpdateProvisionedProductPropertiesResponse -> Maybe Text)
-> (UpdateProvisionedProductPropertiesResponse
    -> Maybe Text -> UpdateProvisionedProductPropertiesResponse)
-> Lens
     UpdateProvisionedProductPropertiesResponse
     UpdateProvisionedProductPropertiesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisionedProductPropertiesResponse' {Maybe Text
provisionedProductId :: Maybe Text
$sel:provisionedProductId:UpdateProvisionedProductPropertiesResponse' :: UpdateProvisionedProductPropertiesResponse -> Maybe Text
provisionedProductId} -> Maybe Text
provisionedProductId) (\s :: UpdateProvisionedProductPropertiesResponse
s@UpdateProvisionedProductPropertiesResponse' {} Maybe Text
a -> UpdateProvisionedProductPropertiesResponse
s {$sel:provisionedProductId:UpdateProvisionedProductPropertiesResponse' :: Maybe Text
provisionedProductId = Maybe Text
a} :: UpdateProvisionedProductPropertiesResponse)

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

instance
  Prelude.NFData
    UpdateProvisionedProductPropertiesResponse