{-# 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.Omics.Types.ReadSetBatchError
-- 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.Omics.Types.ReadSetBatchError 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

-- | An error from a batch read set operation.
--
-- /See:/ 'newReadSetBatchError' smart constructor.
data ReadSetBatchError = ReadSetBatchError'
  { -- | The error\'s code.
    ReadSetBatchError -> Text
code :: Prelude.Text,
    -- | The error\'s ID.
    ReadSetBatchError -> Text
id :: Prelude.Text,
    -- | The error\'s message.
    ReadSetBatchError -> Text
message :: Prelude.Text
  }
  deriving (ReadSetBatchError -> ReadSetBatchError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReadSetBatchError -> ReadSetBatchError -> Bool
$c/= :: ReadSetBatchError -> ReadSetBatchError -> Bool
== :: ReadSetBatchError -> ReadSetBatchError -> Bool
$c== :: ReadSetBatchError -> ReadSetBatchError -> Bool
Prelude.Eq, ReadPrec [ReadSetBatchError]
ReadPrec ReadSetBatchError
Int -> ReadS ReadSetBatchError
ReadS [ReadSetBatchError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReadSetBatchError]
$creadListPrec :: ReadPrec [ReadSetBatchError]
readPrec :: ReadPrec ReadSetBatchError
$creadPrec :: ReadPrec ReadSetBatchError
readList :: ReadS [ReadSetBatchError]
$creadList :: ReadS [ReadSetBatchError]
readsPrec :: Int -> ReadS ReadSetBatchError
$creadsPrec :: Int -> ReadS ReadSetBatchError
Prelude.Read, Int -> ReadSetBatchError -> ShowS
[ReadSetBatchError] -> ShowS
ReadSetBatchError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReadSetBatchError] -> ShowS
$cshowList :: [ReadSetBatchError] -> ShowS
show :: ReadSetBatchError -> String
$cshow :: ReadSetBatchError -> String
showsPrec :: Int -> ReadSetBatchError -> ShowS
$cshowsPrec :: Int -> ReadSetBatchError -> ShowS
Prelude.Show, forall x. Rep ReadSetBatchError x -> ReadSetBatchError
forall x. ReadSetBatchError -> Rep ReadSetBatchError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReadSetBatchError x -> ReadSetBatchError
$cfrom :: forall x. ReadSetBatchError -> Rep ReadSetBatchError x
Prelude.Generic)

-- |
-- Create a value of 'ReadSetBatchError' 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:
--
-- 'code', 'readSetBatchError_code' - The error\'s code.
--
-- 'id', 'readSetBatchError_id' - The error\'s ID.
--
-- 'message', 'readSetBatchError_message' - The error\'s message.
newReadSetBatchError ::
  -- | 'code'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  -- | 'message'
  Prelude.Text ->
  ReadSetBatchError
newReadSetBatchError :: Text -> Text -> Text -> ReadSetBatchError
newReadSetBatchError Text
pCode_ Text
pId_ Text
pMessage_ =
  ReadSetBatchError'
    { $sel:code:ReadSetBatchError' :: Text
code = Text
pCode_,
      $sel:id:ReadSetBatchError' :: Text
id = Text
pId_,
      $sel:message:ReadSetBatchError' :: Text
message = Text
pMessage_
    }

-- | The error\'s code.
readSetBatchError_code :: Lens.Lens' ReadSetBatchError Prelude.Text
readSetBatchError_code :: Lens' ReadSetBatchError Text
readSetBatchError_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadSetBatchError' {Text
code :: Text
$sel:code:ReadSetBatchError' :: ReadSetBatchError -> Text
code} -> Text
code) (\s :: ReadSetBatchError
s@ReadSetBatchError' {} Text
a -> ReadSetBatchError
s {$sel:code:ReadSetBatchError' :: Text
code = Text
a} :: ReadSetBatchError)

-- | The error\'s ID.
readSetBatchError_id :: Lens.Lens' ReadSetBatchError Prelude.Text
readSetBatchError_id :: Lens' ReadSetBatchError Text
readSetBatchError_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadSetBatchError' {Text
id :: Text
$sel:id:ReadSetBatchError' :: ReadSetBatchError -> Text
id} -> Text
id) (\s :: ReadSetBatchError
s@ReadSetBatchError' {} Text
a -> ReadSetBatchError
s {$sel:id:ReadSetBatchError' :: Text
id = Text
a} :: ReadSetBatchError)

-- | The error\'s message.
readSetBatchError_message :: Lens.Lens' ReadSetBatchError Prelude.Text
readSetBatchError_message :: Lens' ReadSetBatchError Text
readSetBatchError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReadSetBatchError' {Text
message :: Text
$sel:message:ReadSetBatchError' :: ReadSetBatchError -> Text
message} -> Text
message) (\s :: ReadSetBatchError
s@ReadSetBatchError' {} Text
a -> ReadSetBatchError
s {$sel:message:ReadSetBatchError' :: Text
message = Text
a} :: ReadSetBatchError)

instance Data.FromJSON ReadSetBatchError where
  parseJSON :: Value -> Parser ReadSetBatchError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReadSetBatchError"
      ( \Object
x ->
          Text -> Text -> Text -> ReadSetBatchError
ReadSetBatchError'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 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 a
Data..: Key
"message")
      )

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

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