{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ServiceCatalog.Types.FailedServiceActionAssociation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServiceCatalog.Types.FailedServiceActionAssociation where

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

-- | An object containing information about the error, along with identifying
-- information about the self-service action and its associations.
--
-- /See:/ 'newFailedServiceActionAssociation' smart constructor.
data FailedServiceActionAssociation = FailedServiceActionAssociation'
  { -- | The identifier of the provisioning artifact. For example,
    -- @pa-4abcdjnxjj6ne@.
    FailedServiceActionAssociation -> Maybe Text
provisioningArtifactId :: Prelude.Maybe Prelude.Text,
    -- | The error code. Valid values are listed below.
    FailedServiceActionAssociation
-> Maybe ServiceActionAssociationErrorCode
errorCode :: Prelude.Maybe ServiceActionAssociationErrorCode,
    -- | A text description of the error.
    FailedServiceActionAssociation -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The self-service action identifier. For example, @act-fs7abcd89wxyz@.
    FailedServiceActionAssociation -> Maybe Text
serviceActionId :: Prelude.Maybe Prelude.Text,
    -- | The product identifier. For example, @prod-abcdzk7xy33qa@.
    FailedServiceActionAssociation -> Maybe Text
productId :: Prelude.Maybe Prelude.Text
  }
  deriving (FailedServiceActionAssociation
-> FailedServiceActionAssociation -> Bool
(FailedServiceActionAssociation
 -> FailedServiceActionAssociation -> Bool)
-> (FailedServiceActionAssociation
    -> FailedServiceActionAssociation -> Bool)
-> Eq FailedServiceActionAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedServiceActionAssociation
-> FailedServiceActionAssociation -> Bool
$c/= :: FailedServiceActionAssociation
-> FailedServiceActionAssociation -> Bool
== :: FailedServiceActionAssociation
-> FailedServiceActionAssociation -> Bool
$c== :: FailedServiceActionAssociation
-> FailedServiceActionAssociation -> Bool
Prelude.Eq, ReadPrec [FailedServiceActionAssociation]
ReadPrec FailedServiceActionAssociation
Int -> ReadS FailedServiceActionAssociation
ReadS [FailedServiceActionAssociation]
(Int -> ReadS FailedServiceActionAssociation)
-> ReadS [FailedServiceActionAssociation]
-> ReadPrec FailedServiceActionAssociation
-> ReadPrec [FailedServiceActionAssociation]
-> Read FailedServiceActionAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedServiceActionAssociation]
$creadListPrec :: ReadPrec [FailedServiceActionAssociation]
readPrec :: ReadPrec FailedServiceActionAssociation
$creadPrec :: ReadPrec FailedServiceActionAssociation
readList :: ReadS [FailedServiceActionAssociation]
$creadList :: ReadS [FailedServiceActionAssociation]
readsPrec :: Int -> ReadS FailedServiceActionAssociation
$creadsPrec :: Int -> ReadS FailedServiceActionAssociation
Prelude.Read, Int -> FailedServiceActionAssociation -> ShowS
[FailedServiceActionAssociation] -> ShowS
FailedServiceActionAssociation -> String
(Int -> FailedServiceActionAssociation -> ShowS)
-> (FailedServiceActionAssociation -> String)
-> ([FailedServiceActionAssociation] -> ShowS)
-> Show FailedServiceActionAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedServiceActionAssociation] -> ShowS
$cshowList :: [FailedServiceActionAssociation] -> ShowS
show :: FailedServiceActionAssociation -> String
$cshow :: FailedServiceActionAssociation -> String
showsPrec :: Int -> FailedServiceActionAssociation -> ShowS
$cshowsPrec :: Int -> FailedServiceActionAssociation -> ShowS
Prelude.Show, (forall x.
 FailedServiceActionAssociation
 -> Rep FailedServiceActionAssociation x)
-> (forall x.
    Rep FailedServiceActionAssociation x
    -> FailedServiceActionAssociation)
-> Generic FailedServiceActionAssociation
forall x.
Rep FailedServiceActionAssociation x
-> FailedServiceActionAssociation
forall x.
FailedServiceActionAssociation
-> Rep FailedServiceActionAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FailedServiceActionAssociation x
-> FailedServiceActionAssociation
$cfrom :: forall x.
FailedServiceActionAssociation
-> Rep FailedServiceActionAssociation x
Prelude.Generic)

-- |
-- Create a value of 'FailedServiceActionAssociation' 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:
--
-- 'provisioningArtifactId', 'failedServiceActionAssociation_provisioningArtifactId' - The identifier of the provisioning artifact. For example,
-- @pa-4abcdjnxjj6ne@.
--
-- 'errorCode', 'failedServiceActionAssociation_errorCode' - The error code. Valid values are listed below.
--
-- 'errorMessage', 'failedServiceActionAssociation_errorMessage' - A text description of the error.
--
-- 'serviceActionId', 'failedServiceActionAssociation_serviceActionId' - The self-service action identifier. For example, @act-fs7abcd89wxyz@.
--
-- 'productId', 'failedServiceActionAssociation_productId' - The product identifier. For example, @prod-abcdzk7xy33qa@.
newFailedServiceActionAssociation ::
  FailedServiceActionAssociation
newFailedServiceActionAssociation :: FailedServiceActionAssociation
newFailedServiceActionAssociation =
  FailedServiceActionAssociation' :: Maybe Text
-> Maybe ServiceActionAssociationErrorCode
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> FailedServiceActionAssociation
FailedServiceActionAssociation'
    { $sel:provisioningArtifactId:FailedServiceActionAssociation' :: Maybe Text
provisioningArtifactId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:FailedServiceActionAssociation' :: Maybe ServiceActionAssociationErrorCode
errorCode = Maybe ServiceActionAssociationErrorCode
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:FailedServiceActionAssociation' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceActionId:FailedServiceActionAssociation' :: Maybe Text
serviceActionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:productId:FailedServiceActionAssociation' :: Maybe Text
productId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the provisioning artifact. For example,
-- @pa-4abcdjnxjj6ne@.
failedServiceActionAssociation_provisioningArtifactId :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe Prelude.Text)
failedServiceActionAssociation_provisioningArtifactId :: (Maybe Text -> f (Maybe Text))
-> FailedServiceActionAssociation
-> f FailedServiceActionAssociation
failedServiceActionAssociation_provisioningArtifactId = (FailedServiceActionAssociation -> Maybe Text)
-> (FailedServiceActionAssociation
    -> Maybe Text -> FailedServiceActionAssociation)
-> Lens
     FailedServiceActionAssociation
     FailedServiceActionAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedServiceActionAssociation' {Maybe Text
provisioningArtifactId :: Maybe Text
$sel:provisioningArtifactId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
provisioningArtifactId} -> Maybe Text
provisioningArtifactId) (\s :: FailedServiceActionAssociation
s@FailedServiceActionAssociation' {} Maybe Text
a -> FailedServiceActionAssociation
s {$sel:provisioningArtifactId:FailedServiceActionAssociation' :: Maybe Text
provisioningArtifactId = Maybe Text
a} :: FailedServiceActionAssociation)

-- | The error code. Valid values are listed below.
failedServiceActionAssociation_errorCode :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe ServiceActionAssociationErrorCode)
failedServiceActionAssociation_errorCode :: (Maybe ServiceActionAssociationErrorCode
 -> f (Maybe ServiceActionAssociationErrorCode))
-> FailedServiceActionAssociation
-> f FailedServiceActionAssociation
failedServiceActionAssociation_errorCode = (FailedServiceActionAssociation
 -> Maybe ServiceActionAssociationErrorCode)
-> (FailedServiceActionAssociation
    -> Maybe ServiceActionAssociationErrorCode
    -> FailedServiceActionAssociation)
-> Lens
     FailedServiceActionAssociation
     FailedServiceActionAssociation
     (Maybe ServiceActionAssociationErrorCode)
     (Maybe ServiceActionAssociationErrorCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedServiceActionAssociation' {Maybe ServiceActionAssociationErrorCode
errorCode :: Maybe ServiceActionAssociationErrorCode
$sel:errorCode:FailedServiceActionAssociation' :: FailedServiceActionAssociation
-> Maybe ServiceActionAssociationErrorCode
errorCode} -> Maybe ServiceActionAssociationErrorCode
errorCode) (\s :: FailedServiceActionAssociation
s@FailedServiceActionAssociation' {} Maybe ServiceActionAssociationErrorCode
a -> FailedServiceActionAssociation
s {$sel:errorCode:FailedServiceActionAssociation' :: Maybe ServiceActionAssociationErrorCode
errorCode = Maybe ServiceActionAssociationErrorCode
a} :: FailedServiceActionAssociation)

-- | A text description of the error.
failedServiceActionAssociation_errorMessage :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe Prelude.Text)
failedServiceActionAssociation_errorMessage :: (Maybe Text -> f (Maybe Text))
-> FailedServiceActionAssociation
-> f FailedServiceActionAssociation
failedServiceActionAssociation_errorMessage = (FailedServiceActionAssociation -> Maybe Text)
-> (FailedServiceActionAssociation
    -> Maybe Text -> FailedServiceActionAssociation)
-> Lens
     FailedServiceActionAssociation
     FailedServiceActionAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedServiceActionAssociation' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: FailedServiceActionAssociation
s@FailedServiceActionAssociation' {} Maybe Text
a -> FailedServiceActionAssociation
s {$sel:errorMessage:FailedServiceActionAssociation' :: Maybe Text
errorMessage = Maybe Text
a} :: FailedServiceActionAssociation)

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

-- | The product identifier. For example, @prod-abcdzk7xy33qa@.
failedServiceActionAssociation_productId :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe Prelude.Text)
failedServiceActionAssociation_productId :: (Maybe Text -> f (Maybe Text))
-> FailedServiceActionAssociation
-> f FailedServiceActionAssociation
failedServiceActionAssociation_productId = (FailedServiceActionAssociation -> Maybe Text)
-> (FailedServiceActionAssociation
    -> Maybe Text -> FailedServiceActionAssociation)
-> Lens
     FailedServiceActionAssociation
     FailedServiceActionAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedServiceActionAssociation' {Maybe Text
productId :: Maybe Text
$sel:productId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
productId} -> Maybe Text
productId) (\s :: FailedServiceActionAssociation
s@FailedServiceActionAssociation' {} Maybe Text
a -> FailedServiceActionAssociation
s {$sel:productId:FailedServiceActionAssociation' :: Maybe Text
productId = Maybe Text
a} :: FailedServiceActionAssociation)

instance Core.FromJSON FailedServiceActionAssociation where
  parseJSON :: Value -> Parser FailedServiceActionAssociation
parseJSON =
    String
-> (Object -> Parser FailedServiceActionAssociation)
-> Value
-> Parser FailedServiceActionAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FailedServiceActionAssociation"
      ( \Object
x ->
          Maybe Text
-> Maybe ServiceActionAssociationErrorCode
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> FailedServiceActionAssociation
FailedServiceActionAssociation'
            (Maybe Text
 -> Maybe ServiceActionAssociationErrorCode
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> FailedServiceActionAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe ServiceActionAssociationErrorCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> FailedServiceActionAssociation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisioningArtifactId")
            Parser
  (Maybe ServiceActionAssociationErrorCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> FailedServiceActionAssociation)
-> Parser (Maybe ServiceActionAssociationErrorCode)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> FailedServiceActionAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServiceActionAssociationErrorCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorCode")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> FailedServiceActionAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> FailedServiceActionAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorMessage")
            Parser (Maybe Text -> Maybe Text -> FailedServiceActionAssociation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> FailedServiceActionAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceActionId")
            Parser (Maybe Text -> FailedServiceActionAssociation)
-> Parser (Maybe Text) -> Parser FailedServiceActionAssociation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProductId")
      )

instance
  Prelude.Hashable
    FailedServiceActionAssociation

instance
  Prelude.NFData
    FailedServiceActionAssociation