{-# 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.ConnectCampaigns.Types.FailedCampaignStateResponse
-- 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.ConnectCampaigns.Types.FailedCampaignStateResponse where

import Amazonka.ConnectCampaigns.Types.GetCampaignStateBatchFailureCode
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

-- | Failed response of campaign state
--
-- /See:/ 'newFailedCampaignStateResponse' smart constructor.
data FailedCampaignStateResponse = FailedCampaignStateResponse'
  { FailedCampaignStateResponse -> Maybe Text
campaignId :: Prelude.Maybe Prelude.Text,
    FailedCampaignStateResponse
-> Maybe GetCampaignStateBatchFailureCode
failureCode :: Prelude.Maybe GetCampaignStateBatchFailureCode
  }
  deriving (FailedCampaignStateResponse -> FailedCampaignStateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedCampaignStateResponse -> FailedCampaignStateResponse -> Bool
$c/= :: FailedCampaignStateResponse -> FailedCampaignStateResponse -> Bool
== :: FailedCampaignStateResponse -> FailedCampaignStateResponse -> Bool
$c== :: FailedCampaignStateResponse -> FailedCampaignStateResponse -> Bool
Prelude.Eq, ReadPrec [FailedCampaignStateResponse]
ReadPrec FailedCampaignStateResponse
Int -> ReadS FailedCampaignStateResponse
ReadS [FailedCampaignStateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedCampaignStateResponse]
$creadListPrec :: ReadPrec [FailedCampaignStateResponse]
readPrec :: ReadPrec FailedCampaignStateResponse
$creadPrec :: ReadPrec FailedCampaignStateResponse
readList :: ReadS [FailedCampaignStateResponse]
$creadList :: ReadS [FailedCampaignStateResponse]
readsPrec :: Int -> ReadS FailedCampaignStateResponse
$creadsPrec :: Int -> ReadS FailedCampaignStateResponse
Prelude.Read, Int -> FailedCampaignStateResponse -> ShowS
[FailedCampaignStateResponse] -> ShowS
FailedCampaignStateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedCampaignStateResponse] -> ShowS
$cshowList :: [FailedCampaignStateResponse] -> ShowS
show :: FailedCampaignStateResponse -> String
$cshow :: FailedCampaignStateResponse -> String
showsPrec :: Int -> FailedCampaignStateResponse -> ShowS
$cshowsPrec :: Int -> FailedCampaignStateResponse -> ShowS
Prelude.Show, forall x.
Rep FailedCampaignStateResponse x -> FailedCampaignStateResponse
forall x.
FailedCampaignStateResponse -> Rep FailedCampaignStateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FailedCampaignStateResponse x -> FailedCampaignStateResponse
$cfrom :: forall x.
FailedCampaignStateResponse -> Rep FailedCampaignStateResponse x
Prelude.Generic)

-- |
-- Create a value of 'FailedCampaignStateResponse' 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:
--
-- 'campaignId', 'failedCampaignStateResponse_campaignId' - Undocumented member.
--
-- 'failureCode', 'failedCampaignStateResponse_failureCode' - Undocumented member.
newFailedCampaignStateResponse ::
  FailedCampaignStateResponse
newFailedCampaignStateResponse :: FailedCampaignStateResponse
newFailedCampaignStateResponse =
  FailedCampaignStateResponse'
    { $sel:campaignId:FailedCampaignStateResponse' :: Maybe Text
campaignId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:failureCode:FailedCampaignStateResponse' :: Maybe GetCampaignStateBatchFailureCode
failureCode = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
failedCampaignStateResponse_campaignId :: Lens.Lens' FailedCampaignStateResponse (Prelude.Maybe Prelude.Text)
failedCampaignStateResponse_campaignId :: Lens' FailedCampaignStateResponse (Maybe Text)
failedCampaignStateResponse_campaignId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCampaignStateResponse' {Maybe Text
campaignId :: Maybe Text
$sel:campaignId:FailedCampaignStateResponse' :: FailedCampaignStateResponse -> Maybe Text
campaignId} -> Maybe Text
campaignId) (\s :: FailedCampaignStateResponse
s@FailedCampaignStateResponse' {} Maybe Text
a -> FailedCampaignStateResponse
s {$sel:campaignId:FailedCampaignStateResponse' :: Maybe Text
campaignId = Maybe Text
a} :: FailedCampaignStateResponse)

-- | Undocumented member.
failedCampaignStateResponse_failureCode :: Lens.Lens' FailedCampaignStateResponse (Prelude.Maybe GetCampaignStateBatchFailureCode)
failedCampaignStateResponse_failureCode :: Lens'
  FailedCampaignStateResponse
  (Maybe GetCampaignStateBatchFailureCode)
failedCampaignStateResponse_failureCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCampaignStateResponse' {Maybe GetCampaignStateBatchFailureCode
failureCode :: Maybe GetCampaignStateBatchFailureCode
$sel:failureCode:FailedCampaignStateResponse' :: FailedCampaignStateResponse
-> Maybe GetCampaignStateBatchFailureCode
failureCode} -> Maybe GetCampaignStateBatchFailureCode
failureCode) (\s :: FailedCampaignStateResponse
s@FailedCampaignStateResponse' {} Maybe GetCampaignStateBatchFailureCode
a -> FailedCampaignStateResponse
s {$sel:failureCode:FailedCampaignStateResponse' :: Maybe GetCampaignStateBatchFailureCode
failureCode = Maybe GetCampaignStateBatchFailureCode
a} :: FailedCampaignStateResponse)

instance Data.FromJSON FailedCampaignStateResponse where
  parseJSON :: Value -> Parser FailedCampaignStateResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FailedCampaignStateResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe GetCampaignStateBatchFailureCode
-> FailedCampaignStateResponse
FailedCampaignStateResponse'
            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
"campaignId")
            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
"failureCode")
      )

instance Prelude.Hashable FailedCampaignStateResponse where
  hashWithSalt :: Int -> FailedCampaignStateResponse -> Int
hashWithSalt Int
_salt FailedCampaignStateResponse' {Maybe Text
Maybe GetCampaignStateBatchFailureCode
failureCode :: Maybe GetCampaignStateBatchFailureCode
campaignId :: Maybe Text
$sel:failureCode:FailedCampaignStateResponse' :: FailedCampaignStateResponse
-> Maybe GetCampaignStateBatchFailureCode
$sel:campaignId:FailedCampaignStateResponse' :: FailedCampaignStateResponse -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
campaignId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GetCampaignStateBatchFailureCode
failureCode

instance Prelude.NFData FailedCampaignStateResponse where
  rnf :: FailedCampaignStateResponse -> ()
rnf FailedCampaignStateResponse' {Maybe Text
Maybe GetCampaignStateBatchFailureCode
failureCode :: Maybe GetCampaignStateBatchFailureCode
campaignId :: Maybe Text
$sel:failureCode:FailedCampaignStateResponse' :: FailedCampaignStateResponse
-> Maybe GetCampaignStateBatchFailureCode
$sel:campaignId:FailedCampaignStateResponse' :: FailedCampaignStateResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
campaignId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GetCampaignStateBatchFailureCode
failureCode