{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServiceCatalog.Types.FailedServiceActionAssociation where

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

-- | The error code. Valid values are listed below.
failedServiceActionAssociation_errorCode :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe ServiceActionAssociationErrorCode)
failedServiceActionAssociation_errorCode :: Lens'
  FailedServiceActionAssociation
  (Maybe ServiceActionAssociationErrorCode)
failedServiceActionAssociation_errorCode = 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 :: Lens' FailedServiceActionAssociation (Maybe Text)
failedServiceActionAssociation_errorMessage = 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 product identifier. For example, @prod-abcdzk7xy33qa@.
failedServiceActionAssociation_productId :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe Prelude.Text)
failedServiceActionAssociation_productId :: Lens' FailedServiceActionAssociation (Maybe Text)
failedServiceActionAssociation_productId = 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)

-- | The identifier of the provisioning artifact. For example,
-- @pa-4abcdjnxjj6ne@.
failedServiceActionAssociation_provisioningArtifactId :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe Prelude.Text)
failedServiceActionAssociation_provisioningArtifactId :: Lens' FailedServiceActionAssociation (Maybe Text)
failedServiceActionAssociation_provisioningArtifactId = 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 self-service action identifier. For example, @act-fs7abcd89wxyz@.
failedServiceActionAssociation_serviceActionId :: Lens.Lens' FailedServiceActionAssociation (Prelude.Maybe Prelude.Text)
failedServiceActionAssociation_serviceActionId :: Lens' FailedServiceActionAssociation (Maybe Text)
failedServiceActionAssociation_serviceActionId = 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)

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

instance
  Prelude.Hashable
    FailedServiceActionAssociation
  where
  hashWithSalt :: Int -> FailedServiceActionAssociation -> Int
hashWithSalt
    Int
_salt
    FailedServiceActionAssociation' {Maybe Text
Maybe ServiceActionAssociationErrorCode
serviceActionId :: Maybe Text
provisioningArtifactId :: Maybe Text
productId :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe ServiceActionAssociationErrorCode
$sel:serviceActionId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:provisioningArtifactId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:productId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:errorMessage:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:errorCode:FailedServiceActionAssociation' :: FailedServiceActionAssociation
-> Maybe ServiceActionAssociationErrorCode
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceActionAssociationErrorCode
errorCode
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
provisioningArtifactId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceActionId

instance
  Prelude.NFData
    FailedServiceActionAssociation
  where
  rnf :: FailedServiceActionAssociation -> ()
rnf FailedServiceActionAssociation' {Maybe Text
Maybe ServiceActionAssociationErrorCode
serviceActionId :: Maybe Text
provisioningArtifactId :: Maybe Text
productId :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe ServiceActionAssociationErrorCode
$sel:serviceActionId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:provisioningArtifactId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:productId:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:errorMessage:FailedServiceActionAssociation' :: FailedServiceActionAssociation -> Maybe Text
$sel:errorCode:FailedServiceActionAssociation' :: FailedServiceActionAssociation
-> Maybe ServiceActionAssociationErrorCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceActionAssociationErrorCode
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
productId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
provisioningArtifactId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceActionId