{-# 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.ExecuteProvisionedProductServiceAction
-- 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)
--
-- Executes a self-service action against a provisioned product.
module Amazonka.ServiceCatalog.ExecuteProvisionedProductServiceAction
  ( -- * Creating a Request
    ExecuteProvisionedProductServiceAction (..),
    newExecuteProvisionedProductServiceAction,

    -- * Request Lenses
    executeProvisionedProductServiceAction_acceptLanguage,
    executeProvisionedProductServiceAction_parameters,
    executeProvisionedProductServiceAction_provisionedProductId,
    executeProvisionedProductServiceAction_serviceActionId,
    executeProvisionedProductServiceAction_executeToken,

    -- * Destructuring the Response
    ExecuteProvisionedProductServiceActionResponse (..),
    newExecuteProvisionedProductServiceActionResponse,

    -- * Response Lenses
    executeProvisionedProductServiceActionResponse_recordDetail,
    executeProvisionedProductServiceActionResponse_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:/ 'newExecuteProvisionedProductServiceAction' smart constructor.
data ExecuteProvisionedProductServiceAction = ExecuteProvisionedProductServiceAction'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ExecuteProvisionedProductServiceAction -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | A map of all self-service action parameters and their values. If a
    -- provided parameter is of a special type, such as @TARGET@, the provided
    -- value will override the default value generated by AWS Service Catalog.
    -- If the parameters field is not provided, no additional parameters are
    -- passed and default values will be used for any special parameters such
    -- as @TARGET@.
    ExecuteProvisionedProductServiceAction
-> Maybe (HashMap Text [Text])
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The identifier of the provisioned product.
    ExecuteProvisionedProductServiceAction -> Text
provisionedProductId :: Prelude.Text,
    -- | The self-service action identifier. For example, @act-fs7abcd89wxyz@.
    ExecuteProvisionedProductServiceAction -> Text
serviceActionId :: Prelude.Text,
    -- | An idempotency token that uniquely identifies the execute request.
    ExecuteProvisionedProductServiceAction -> Text
executeToken :: Prelude.Text
  }
  deriving (ExecuteProvisionedProductServiceAction
-> ExecuteProvisionedProductServiceAction -> Bool
(ExecuteProvisionedProductServiceAction
 -> ExecuteProvisionedProductServiceAction -> Bool)
-> (ExecuteProvisionedProductServiceAction
    -> ExecuteProvisionedProductServiceAction -> Bool)
-> Eq ExecuteProvisionedProductServiceAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecuteProvisionedProductServiceAction
-> ExecuteProvisionedProductServiceAction -> Bool
$c/= :: ExecuteProvisionedProductServiceAction
-> ExecuteProvisionedProductServiceAction -> Bool
== :: ExecuteProvisionedProductServiceAction
-> ExecuteProvisionedProductServiceAction -> Bool
$c== :: ExecuteProvisionedProductServiceAction
-> ExecuteProvisionedProductServiceAction -> Bool
Prelude.Eq, ReadPrec [ExecuteProvisionedProductServiceAction]
ReadPrec ExecuteProvisionedProductServiceAction
Int -> ReadS ExecuteProvisionedProductServiceAction
ReadS [ExecuteProvisionedProductServiceAction]
(Int -> ReadS ExecuteProvisionedProductServiceAction)
-> ReadS [ExecuteProvisionedProductServiceAction]
-> ReadPrec ExecuteProvisionedProductServiceAction
-> ReadPrec [ExecuteProvisionedProductServiceAction]
-> Read ExecuteProvisionedProductServiceAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExecuteProvisionedProductServiceAction]
$creadListPrec :: ReadPrec [ExecuteProvisionedProductServiceAction]
readPrec :: ReadPrec ExecuteProvisionedProductServiceAction
$creadPrec :: ReadPrec ExecuteProvisionedProductServiceAction
readList :: ReadS [ExecuteProvisionedProductServiceAction]
$creadList :: ReadS [ExecuteProvisionedProductServiceAction]
readsPrec :: Int -> ReadS ExecuteProvisionedProductServiceAction
$creadsPrec :: Int -> ReadS ExecuteProvisionedProductServiceAction
Prelude.Read, Int -> ExecuteProvisionedProductServiceAction -> ShowS
[ExecuteProvisionedProductServiceAction] -> ShowS
ExecuteProvisionedProductServiceAction -> String
(Int -> ExecuteProvisionedProductServiceAction -> ShowS)
-> (ExecuteProvisionedProductServiceAction -> String)
-> ([ExecuteProvisionedProductServiceAction] -> ShowS)
-> Show ExecuteProvisionedProductServiceAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecuteProvisionedProductServiceAction] -> ShowS
$cshowList :: [ExecuteProvisionedProductServiceAction] -> ShowS
show :: ExecuteProvisionedProductServiceAction -> String
$cshow :: ExecuteProvisionedProductServiceAction -> String
showsPrec :: Int -> ExecuteProvisionedProductServiceAction -> ShowS
$cshowsPrec :: Int -> ExecuteProvisionedProductServiceAction -> ShowS
Prelude.Show, (forall x.
 ExecuteProvisionedProductServiceAction
 -> Rep ExecuteProvisionedProductServiceAction x)
-> (forall x.
    Rep ExecuteProvisionedProductServiceAction x
    -> ExecuteProvisionedProductServiceAction)
-> Generic ExecuteProvisionedProductServiceAction
forall x.
Rep ExecuteProvisionedProductServiceAction x
-> ExecuteProvisionedProductServiceAction
forall x.
ExecuteProvisionedProductServiceAction
-> Rep ExecuteProvisionedProductServiceAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExecuteProvisionedProductServiceAction x
-> ExecuteProvisionedProductServiceAction
$cfrom :: forall x.
ExecuteProvisionedProductServiceAction
-> Rep ExecuteProvisionedProductServiceAction x
Prelude.Generic)

-- |
-- Create a value of 'ExecuteProvisionedProductServiceAction' 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', 'executeProvisionedProductServiceAction_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'parameters', 'executeProvisionedProductServiceAction_parameters' - A map of all self-service action parameters and their values. If a
-- provided parameter is of a special type, such as @TARGET@, the provided
-- value will override the default value generated by AWS Service Catalog.
-- If the parameters field is not provided, no additional parameters are
-- passed and default values will be used for any special parameters such
-- as @TARGET@.
--
-- 'provisionedProductId', 'executeProvisionedProductServiceAction_provisionedProductId' - The identifier of the provisioned product.
--
-- 'serviceActionId', 'executeProvisionedProductServiceAction_serviceActionId' - The self-service action identifier. For example, @act-fs7abcd89wxyz@.
--
-- 'executeToken', 'executeProvisionedProductServiceAction_executeToken' - An idempotency token that uniquely identifies the execute request.
newExecuteProvisionedProductServiceAction ::
  -- | 'provisionedProductId'
  Prelude.Text ->
  -- | 'serviceActionId'
  Prelude.Text ->
  -- | 'executeToken'
  Prelude.Text ->
  ExecuteProvisionedProductServiceAction
newExecuteProvisionedProductServiceAction :: Text -> Text -> Text -> ExecuteProvisionedProductServiceAction
newExecuteProvisionedProductServiceAction
  Text
pProvisionedProductId_
  Text
pServiceActionId_
  Text
pExecuteToken_ =
    ExecuteProvisionedProductServiceAction' :: Maybe Text
-> Maybe (HashMap Text [Text])
-> Text
-> Text
-> Text
-> ExecuteProvisionedProductServiceAction
ExecuteProvisionedProductServiceAction'
      { $sel:acceptLanguage:ExecuteProvisionedProductServiceAction' :: Maybe Text
acceptLanguage =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:parameters:ExecuteProvisionedProductServiceAction' :: Maybe (HashMap Text [Text])
parameters = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
        $sel:provisionedProductId:ExecuteProvisionedProductServiceAction' :: Text
provisionedProductId =
          Text
pProvisionedProductId_,
        $sel:serviceActionId:ExecuteProvisionedProductServiceAction' :: Text
serviceActionId = Text
pServiceActionId_,
        $sel:executeToken:ExecuteProvisionedProductServiceAction' :: Text
executeToken = Text
pExecuteToken_
      }

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

-- | A map of all self-service action parameters and their values. If a
-- provided parameter is of a special type, such as @TARGET@, the provided
-- value will override the default value generated by AWS Service Catalog.
-- If the parameters field is not provided, no additional parameters are
-- passed and default values will be used for any special parameters such
-- as @TARGET@.
executeProvisionedProductServiceAction_parameters :: Lens.Lens' ExecuteProvisionedProductServiceAction (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
executeProvisionedProductServiceAction_parameters :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> ExecuteProvisionedProductServiceAction
-> f ExecuteProvisionedProductServiceAction
executeProvisionedProductServiceAction_parameters = (ExecuteProvisionedProductServiceAction
 -> Maybe (HashMap Text [Text]))
-> (ExecuteProvisionedProductServiceAction
    -> Maybe (HashMap Text [Text])
    -> ExecuteProvisionedProductServiceAction)
-> Lens
     ExecuteProvisionedProductServiceAction
     ExecuteProvisionedProductServiceAction
     (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 (\ExecuteProvisionedProductServiceAction' {Maybe (HashMap Text [Text])
parameters :: Maybe (HashMap Text [Text])
$sel:parameters:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction
-> Maybe (HashMap Text [Text])
parameters} -> Maybe (HashMap Text [Text])
parameters) (\s :: ExecuteProvisionedProductServiceAction
s@ExecuteProvisionedProductServiceAction' {} Maybe (HashMap Text [Text])
a -> ExecuteProvisionedProductServiceAction
s {$sel:parameters:ExecuteProvisionedProductServiceAction' :: Maybe (HashMap Text [Text])
parameters = Maybe (HashMap Text [Text])
a} :: ExecuteProvisionedProductServiceAction) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> ExecuteProvisionedProductServiceAction
 -> f ExecuteProvisionedProductServiceAction)
-> ((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])))
-> ExecuteProvisionedProductServiceAction
-> f ExecuteProvisionedProductServiceAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
-> Iso
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The self-service action identifier. For example, @act-fs7abcd89wxyz@.
executeProvisionedProductServiceAction_serviceActionId :: Lens.Lens' ExecuteProvisionedProductServiceAction Prelude.Text
executeProvisionedProductServiceAction_serviceActionId :: (Text -> f Text)
-> ExecuteProvisionedProductServiceAction
-> f ExecuteProvisionedProductServiceAction
executeProvisionedProductServiceAction_serviceActionId = (ExecuteProvisionedProductServiceAction -> Text)
-> (ExecuteProvisionedProductServiceAction
    -> Text -> ExecuteProvisionedProductServiceAction)
-> Lens
     ExecuteProvisionedProductServiceAction
     ExecuteProvisionedProductServiceAction
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteProvisionedProductServiceAction' {Text
serviceActionId :: Text
$sel:serviceActionId:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction -> Text
serviceActionId} -> Text
serviceActionId) (\s :: ExecuteProvisionedProductServiceAction
s@ExecuteProvisionedProductServiceAction' {} Text
a -> ExecuteProvisionedProductServiceAction
s {$sel:serviceActionId:ExecuteProvisionedProductServiceAction' :: Text
serviceActionId = Text
a} :: ExecuteProvisionedProductServiceAction)

-- | An idempotency token that uniquely identifies the execute request.
executeProvisionedProductServiceAction_executeToken :: Lens.Lens' ExecuteProvisionedProductServiceAction Prelude.Text
executeProvisionedProductServiceAction_executeToken :: (Text -> f Text)
-> ExecuteProvisionedProductServiceAction
-> f ExecuteProvisionedProductServiceAction
executeProvisionedProductServiceAction_executeToken = (ExecuteProvisionedProductServiceAction -> Text)
-> (ExecuteProvisionedProductServiceAction
    -> Text -> ExecuteProvisionedProductServiceAction)
-> Lens
     ExecuteProvisionedProductServiceAction
     ExecuteProvisionedProductServiceAction
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteProvisionedProductServiceAction' {Text
executeToken :: Text
$sel:executeToken:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction -> Text
executeToken} -> Text
executeToken) (\s :: ExecuteProvisionedProductServiceAction
s@ExecuteProvisionedProductServiceAction' {} Text
a -> ExecuteProvisionedProductServiceAction
s {$sel:executeToken:ExecuteProvisionedProductServiceAction' :: Text
executeToken = Text
a} :: ExecuteProvisionedProductServiceAction)

instance
  Core.AWSRequest
    ExecuteProvisionedProductServiceAction
  where
  type
    AWSResponse
      ExecuteProvisionedProductServiceAction =
      ExecuteProvisionedProductServiceActionResponse
  request :: ExecuteProvisionedProductServiceAction
-> Request ExecuteProvisionedProductServiceAction
request = Service
-> ExecuteProvisionedProductServiceAction
-> Request ExecuteProvisionedProductServiceAction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ExecuteProvisionedProductServiceAction
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse ExecuteProvisionedProductServiceAction)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse ExecuteProvisionedProductServiceAction))
-> Logger
-> Service
-> Proxy ExecuteProvisionedProductServiceAction
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse ExecuteProvisionedProductServiceAction)))
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 RecordDetail
-> Int -> ExecuteProvisionedProductServiceActionResponse
ExecuteProvisionedProductServiceActionResponse'
            (Maybe RecordDetail
 -> Int -> ExecuteProvisionedProductServiceActionResponse)
-> Either String (Maybe RecordDetail)
-> Either
     String (Int -> ExecuteProvisionedProductServiceActionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RecordDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RecordDetail")
              Either
  String (Int -> ExecuteProvisionedProductServiceActionResponse)
-> Either String Int
-> Either String ExecuteProvisionedProductServiceActionResponse
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
    ExecuteProvisionedProductServiceAction

instance
  Prelude.NFData
    ExecuteProvisionedProductServiceAction

instance
  Core.ToHeaders
    ExecuteProvisionedProductServiceAction
  where
  toHeaders :: ExecuteProvisionedProductServiceAction -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ExecuteProvisionedProductServiceAction -> 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.ExecuteProvisionedProductServiceAction" ::
                          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
    ExecuteProvisionedProductServiceAction
  where
  toJSON :: ExecuteProvisionedProductServiceAction -> Value
toJSON ExecuteProvisionedProductServiceAction' {Maybe Text
Maybe (HashMap Text [Text])
Text
executeToken :: Text
serviceActionId :: Text
provisionedProductId :: Text
parameters :: Maybe (HashMap Text [Text])
acceptLanguage :: Maybe Text
$sel:executeToken:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction -> Text
$sel:serviceActionId:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction -> Text
$sel:provisionedProductId:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction -> Text
$sel:parameters:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction
-> Maybe (HashMap Text [Text])
$sel:acceptLanguage:ExecuteProvisionedProductServiceAction' :: ExecuteProvisionedProductServiceAction -> 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,
            (Text
"Parameters" Text -> HashMap Text [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text [Text] -> Pair)
-> Maybe (HashMap Text [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
parameters,
            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
"ServiceActionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceActionId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ExecuteToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
executeToken)
          ]
      )

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

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

-- | /See:/ 'newExecuteProvisionedProductServiceActionResponse' smart constructor.
data ExecuteProvisionedProductServiceActionResponse = ExecuteProvisionedProductServiceActionResponse'
  { -- | An object containing detailed information about the result of
    -- provisioning the product.
    ExecuteProvisionedProductServiceActionResponse
-> Maybe RecordDetail
recordDetail :: Prelude.Maybe RecordDetail,
    -- | The response's http status code.
    ExecuteProvisionedProductServiceActionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ExecuteProvisionedProductServiceActionResponse
-> ExecuteProvisionedProductServiceActionResponse -> Bool
(ExecuteProvisionedProductServiceActionResponse
 -> ExecuteProvisionedProductServiceActionResponse -> Bool)
-> (ExecuteProvisionedProductServiceActionResponse
    -> ExecuteProvisionedProductServiceActionResponse -> Bool)
-> Eq ExecuteProvisionedProductServiceActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecuteProvisionedProductServiceActionResponse
-> ExecuteProvisionedProductServiceActionResponse -> Bool
$c/= :: ExecuteProvisionedProductServiceActionResponse
-> ExecuteProvisionedProductServiceActionResponse -> Bool
== :: ExecuteProvisionedProductServiceActionResponse
-> ExecuteProvisionedProductServiceActionResponse -> Bool
$c== :: ExecuteProvisionedProductServiceActionResponse
-> ExecuteProvisionedProductServiceActionResponse -> Bool
Prelude.Eq, ReadPrec [ExecuteProvisionedProductServiceActionResponse]
ReadPrec ExecuteProvisionedProductServiceActionResponse
Int -> ReadS ExecuteProvisionedProductServiceActionResponse
ReadS [ExecuteProvisionedProductServiceActionResponse]
(Int -> ReadS ExecuteProvisionedProductServiceActionResponse)
-> ReadS [ExecuteProvisionedProductServiceActionResponse]
-> ReadPrec ExecuteProvisionedProductServiceActionResponse
-> ReadPrec [ExecuteProvisionedProductServiceActionResponse]
-> Read ExecuteProvisionedProductServiceActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExecuteProvisionedProductServiceActionResponse]
$creadListPrec :: ReadPrec [ExecuteProvisionedProductServiceActionResponse]
readPrec :: ReadPrec ExecuteProvisionedProductServiceActionResponse
$creadPrec :: ReadPrec ExecuteProvisionedProductServiceActionResponse
readList :: ReadS [ExecuteProvisionedProductServiceActionResponse]
$creadList :: ReadS [ExecuteProvisionedProductServiceActionResponse]
readsPrec :: Int -> ReadS ExecuteProvisionedProductServiceActionResponse
$creadsPrec :: Int -> ReadS ExecuteProvisionedProductServiceActionResponse
Prelude.Read, Int -> ExecuteProvisionedProductServiceActionResponse -> ShowS
[ExecuteProvisionedProductServiceActionResponse] -> ShowS
ExecuteProvisionedProductServiceActionResponse -> String
(Int -> ExecuteProvisionedProductServiceActionResponse -> ShowS)
-> (ExecuteProvisionedProductServiceActionResponse -> String)
-> ([ExecuteProvisionedProductServiceActionResponse] -> ShowS)
-> Show ExecuteProvisionedProductServiceActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecuteProvisionedProductServiceActionResponse] -> ShowS
$cshowList :: [ExecuteProvisionedProductServiceActionResponse] -> ShowS
show :: ExecuteProvisionedProductServiceActionResponse -> String
$cshow :: ExecuteProvisionedProductServiceActionResponse -> String
showsPrec :: Int -> ExecuteProvisionedProductServiceActionResponse -> ShowS
$cshowsPrec :: Int -> ExecuteProvisionedProductServiceActionResponse -> ShowS
Prelude.Show, (forall x.
 ExecuteProvisionedProductServiceActionResponse
 -> Rep ExecuteProvisionedProductServiceActionResponse x)
-> (forall x.
    Rep ExecuteProvisionedProductServiceActionResponse x
    -> ExecuteProvisionedProductServiceActionResponse)
-> Generic ExecuteProvisionedProductServiceActionResponse
forall x.
Rep ExecuteProvisionedProductServiceActionResponse x
-> ExecuteProvisionedProductServiceActionResponse
forall x.
ExecuteProvisionedProductServiceActionResponse
-> Rep ExecuteProvisionedProductServiceActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExecuteProvisionedProductServiceActionResponse x
-> ExecuteProvisionedProductServiceActionResponse
$cfrom :: forall x.
ExecuteProvisionedProductServiceActionResponse
-> Rep ExecuteProvisionedProductServiceActionResponse x
Prelude.Generic)

-- |
-- Create a value of 'ExecuteProvisionedProductServiceActionResponse' 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:
--
-- 'recordDetail', 'executeProvisionedProductServiceActionResponse_recordDetail' - An object containing detailed information about the result of
-- provisioning the product.
--
-- 'httpStatus', 'executeProvisionedProductServiceActionResponse_httpStatus' - The response's http status code.
newExecuteProvisionedProductServiceActionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ExecuteProvisionedProductServiceActionResponse
newExecuteProvisionedProductServiceActionResponse :: Int -> ExecuteProvisionedProductServiceActionResponse
newExecuteProvisionedProductServiceActionResponse
  Int
pHttpStatus_ =
    ExecuteProvisionedProductServiceActionResponse' :: Maybe RecordDetail
-> Int -> ExecuteProvisionedProductServiceActionResponse
ExecuteProvisionedProductServiceActionResponse'
      { $sel:recordDetail:ExecuteProvisionedProductServiceActionResponse' :: Maybe RecordDetail
recordDetail =
          Maybe RecordDetail
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ExecuteProvisionedProductServiceActionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | An object containing detailed information about the result of
-- provisioning the product.
executeProvisionedProductServiceActionResponse_recordDetail :: Lens.Lens' ExecuteProvisionedProductServiceActionResponse (Prelude.Maybe RecordDetail)
executeProvisionedProductServiceActionResponse_recordDetail :: (Maybe RecordDetail -> f (Maybe RecordDetail))
-> ExecuteProvisionedProductServiceActionResponse
-> f ExecuteProvisionedProductServiceActionResponse
executeProvisionedProductServiceActionResponse_recordDetail = (ExecuteProvisionedProductServiceActionResponse
 -> Maybe RecordDetail)
-> (ExecuteProvisionedProductServiceActionResponse
    -> Maybe RecordDetail
    -> ExecuteProvisionedProductServiceActionResponse)
-> Lens
     ExecuteProvisionedProductServiceActionResponse
     ExecuteProvisionedProductServiceActionResponse
     (Maybe RecordDetail)
     (Maybe RecordDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteProvisionedProductServiceActionResponse' {Maybe RecordDetail
recordDetail :: Maybe RecordDetail
$sel:recordDetail:ExecuteProvisionedProductServiceActionResponse' :: ExecuteProvisionedProductServiceActionResponse
-> Maybe RecordDetail
recordDetail} -> Maybe RecordDetail
recordDetail) (\s :: ExecuteProvisionedProductServiceActionResponse
s@ExecuteProvisionedProductServiceActionResponse' {} Maybe RecordDetail
a -> ExecuteProvisionedProductServiceActionResponse
s {$sel:recordDetail:ExecuteProvisionedProductServiceActionResponse' :: Maybe RecordDetail
recordDetail = Maybe RecordDetail
a} :: ExecuteProvisionedProductServiceActionResponse)

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

instance
  Prelude.NFData
    ExecuteProvisionedProductServiceActionResponse