{-# 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.MediaLive.Types.BatchFailedResultModel
-- 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.MediaLive.Types.BatchFailedResultModel 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

-- | Details from a failed operation
--
-- /See:/ 'newBatchFailedResultModel' smart constructor.
data BatchFailedResultModel = BatchFailedResultModel'
  { -- | ARN of the resource
    BatchFailedResultModel -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Error code for the failed operation
    BatchFailedResultModel -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
    -- | ID of the resource
    BatchFailedResultModel -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Error message for the failed operation
    BatchFailedResultModel -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchFailedResultModel -> BatchFailedResultModel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchFailedResultModel -> BatchFailedResultModel -> Bool
$c/= :: BatchFailedResultModel -> BatchFailedResultModel -> Bool
== :: BatchFailedResultModel -> BatchFailedResultModel -> Bool
$c== :: BatchFailedResultModel -> BatchFailedResultModel -> Bool
Prelude.Eq, ReadPrec [BatchFailedResultModel]
ReadPrec BatchFailedResultModel
Int -> ReadS BatchFailedResultModel
ReadS [BatchFailedResultModel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchFailedResultModel]
$creadListPrec :: ReadPrec [BatchFailedResultModel]
readPrec :: ReadPrec BatchFailedResultModel
$creadPrec :: ReadPrec BatchFailedResultModel
readList :: ReadS [BatchFailedResultModel]
$creadList :: ReadS [BatchFailedResultModel]
readsPrec :: Int -> ReadS BatchFailedResultModel
$creadsPrec :: Int -> ReadS BatchFailedResultModel
Prelude.Read, Int -> BatchFailedResultModel -> ShowS
[BatchFailedResultModel] -> ShowS
BatchFailedResultModel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchFailedResultModel] -> ShowS
$cshowList :: [BatchFailedResultModel] -> ShowS
show :: BatchFailedResultModel -> String
$cshow :: BatchFailedResultModel -> String
showsPrec :: Int -> BatchFailedResultModel -> ShowS
$cshowsPrec :: Int -> BatchFailedResultModel -> ShowS
Prelude.Show, forall x. Rep BatchFailedResultModel x -> BatchFailedResultModel
forall x. BatchFailedResultModel -> Rep BatchFailedResultModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchFailedResultModel x -> BatchFailedResultModel
$cfrom :: forall x. BatchFailedResultModel -> Rep BatchFailedResultModel x
Prelude.Generic)

-- |
-- Create a value of 'BatchFailedResultModel' 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:
--
-- 'arn', 'batchFailedResultModel_arn' - ARN of the resource
--
-- 'code', 'batchFailedResultModel_code' - Error code for the failed operation
--
-- 'id', 'batchFailedResultModel_id' - ID of the resource
--
-- 'message', 'batchFailedResultModel_message' - Error message for the failed operation
newBatchFailedResultModel ::
  BatchFailedResultModel
newBatchFailedResultModel :: BatchFailedResultModel
newBatchFailedResultModel =
  BatchFailedResultModel'
    { $sel:arn:BatchFailedResultModel' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:code:BatchFailedResultModel' :: Maybe Text
code = forall a. Maybe a
Prelude.Nothing,
      $sel:id:BatchFailedResultModel' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:message:BatchFailedResultModel' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

-- | ARN of the resource
batchFailedResultModel_arn :: Lens.Lens' BatchFailedResultModel (Prelude.Maybe Prelude.Text)
batchFailedResultModel_arn :: Lens' BatchFailedResultModel (Maybe Text)
batchFailedResultModel_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchFailedResultModel' {Maybe Text
arn :: Maybe Text
$sel:arn:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
arn} -> Maybe Text
arn) (\s :: BatchFailedResultModel
s@BatchFailedResultModel' {} Maybe Text
a -> BatchFailedResultModel
s {$sel:arn:BatchFailedResultModel' :: Maybe Text
arn = Maybe Text
a} :: BatchFailedResultModel)

-- | Error code for the failed operation
batchFailedResultModel_code :: Lens.Lens' BatchFailedResultModel (Prelude.Maybe Prelude.Text)
batchFailedResultModel_code :: Lens' BatchFailedResultModel (Maybe Text)
batchFailedResultModel_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchFailedResultModel' {Maybe Text
code :: Maybe Text
$sel:code:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
code} -> Maybe Text
code) (\s :: BatchFailedResultModel
s@BatchFailedResultModel' {} Maybe Text
a -> BatchFailedResultModel
s {$sel:code:BatchFailedResultModel' :: Maybe Text
code = Maybe Text
a} :: BatchFailedResultModel)

-- | ID of the resource
batchFailedResultModel_id :: Lens.Lens' BatchFailedResultModel (Prelude.Maybe Prelude.Text)
batchFailedResultModel_id :: Lens' BatchFailedResultModel (Maybe Text)
batchFailedResultModel_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchFailedResultModel' {Maybe Text
id :: Maybe Text
$sel:id:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
id} -> Maybe Text
id) (\s :: BatchFailedResultModel
s@BatchFailedResultModel' {} Maybe Text
a -> BatchFailedResultModel
s {$sel:id:BatchFailedResultModel' :: Maybe Text
id = Maybe Text
a} :: BatchFailedResultModel)

-- | Error message for the failed operation
batchFailedResultModel_message :: Lens.Lens' BatchFailedResultModel (Prelude.Maybe Prelude.Text)
batchFailedResultModel_message :: Lens' BatchFailedResultModel (Maybe Text)
batchFailedResultModel_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchFailedResultModel' {Maybe Text
message :: Maybe Text
$sel:message:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
message} -> Maybe Text
message) (\s :: BatchFailedResultModel
s@BatchFailedResultModel' {} Maybe Text
a -> BatchFailedResultModel
s {$sel:message:BatchFailedResultModel' :: Maybe Text
message = Maybe Text
a} :: BatchFailedResultModel)

instance Data.FromJSON BatchFailedResultModel where
  parseJSON :: Value -> Parser BatchFailedResultModel
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchFailedResultModel"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> BatchFailedResultModel
BatchFailedResultModel'
            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
"arn")
            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
"code")
            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
"id")
            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
"message")
      )

instance Prelude.Hashable BatchFailedResultModel where
  hashWithSalt :: Int -> BatchFailedResultModel -> Int
hashWithSalt Int
_salt BatchFailedResultModel' {Maybe Text
message :: Maybe Text
id :: Maybe Text
code :: Maybe Text
arn :: Maybe Text
$sel:message:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
$sel:id:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
$sel:code:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
$sel:arn:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
code
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message

instance Prelude.NFData BatchFailedResultModel where
  rnf :: BatchFailedResultModel -> ()
rnf BatchFailedResultModel' {Maybe Text
message :: Maybe Text
id :: Maybe Text
code :: Maybe Text
arn :: Maybe Text
$sel:message:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
$sel:id:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
$sel:code:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
$sel:arn:BatchFailedResultModel' :: BatchFailedResultModel -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
code
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message