{-# 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.ResourceExplorer2.Types.BatchGetViewError
-- 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.ResourceExplorer2.Types.BatchGetViewError 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

-- | A collection of error messages for any views that Amazon Web Services
-- Resource Explorer couldn\'t retrieve details.
--
-- /See:/ 'newBatchGetViewError' smart constructor.
data BatchGetViewError = BatchGetViewError'
  { -- | The description of the error for the specified view.
    BatchGetViewError -> Text
errorMessage :: Prelude.Text,
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon resource name (ARN)>
    -- of the view for which Resource Explorer failed to retrieve details.
    BatchGetViewError -> Text
viewArn :: Prelude.Text
  }
  deriving (BatchGetViewError -> BatchGetViewError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetViewError -> BatchGetViewError -> Bool
$c/= :: BatchGetViewError -> BatchGetViewError -> Bool
== :: BatchGetViewError -> BatchGetViewError -> Bool
$c== :: BatchGetViewError -> BatchGetViewError -> Bool
Prelude.Eq, ReadPrec [BatchGetViewError]
ReadPrec BatchGetViewError
Int -> ReadS BatchGetViewError
ReadS [BatchGetViewError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetViewError]
$creadListPrec :: ReadPrec [BatchGetViewError]
readPrec :: ReadPrec BatchGetViewError
$creadPrec :: ReadPrec BatchGetViewError
readList :: ReadS [BatchGetViewError]
$creadList :: ReadS [BatchGetViewError]
readsPrec :: Int -> ReadS BatchGetViewError
$creadsPrec :: Int -> ReadS BatchGetViewError
Prelude.Read, Int -> BatchGetViewError -> ShowS
[BatchGetViewError] -> ShowS
BatchGetViewError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetViewError] -> ShowS
$cshowList :: [BatchGetViewError] -> ShowS
show :: BatchGetViewError -> String
$cshow :: BatchGetViewError -> String
showsPrec :: Int -> BatchGetViewError -> ShowS
$cshowsPrec :: Int -> BatchGetViewError -> ShowS
Prelude.Show, forall x. Rep BatchGetViewError x -> BatchGetViewError
forall x. BatchGetViewError -> Rep BatchGetViewError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetViewError x -> BatchGetViewError
$cfrom :: forall x. BatchGetViewError -> Rep BatchGetViewError x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetViewError' 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:
--
-- 'errorMessage', 'batchGetViewError_errorMessage' - The description of the error for the specified view.
--
-- 'viewArn', 'batchGetViewError_viewArn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon resource name (ARN)>
-- of the view for which Resource Explorer failed to retrieve details.
newBatchGetViewError ::
  -- | 'errorMessage'
  Prelude.Text ->
  -- | 'viewArn'
  Prelude.Text ->
  BatchGetViewError
newBatchGetViewError :: Text -> Text -> BatchGetViewError
newBatchGetViewError Text
pErrorMessage_ Text
pViewArn_ =
  BatchGetViewError'
    { $sel:errorMessage:BatchGetViewError' :: Text
errorMessage = Text
pErrorMessage_,
      $sel:viewArn:BatchGetViewError' :: Text
viewArn = Text
pViewArn_
    }

-- | The description of the error for the specified view.
batchGetViewError_errorMessage :: Lens.Lens' BatchGetViewError Prelude.Text
batchGetViewError_errorMessage :: Lens' BatchGetViewError Text
batchGetViewError_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetViewError' {Text
errorMessage :: Text
$sel:errorMessage:BatchGetViewError' :: BatchGetViewError -> Text
errorMessage} -> Text
errorMessage) (\s :: BatchGetViewError
s@BatchGetViewError' {} Text
a -> BatchGetViewError
s {$sel:errorMessage:BatchGetViewError' :: Text
errorMessage = Text
a} :: BatchGetViewError)

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon resource name (ARN)>
-- of the view for which Resource Explorer failed to retrieve details.
batchGetViewError_viewArn :: Lens.Lens' BatchGetViewError Prelude.Text
batchGetViewError_viewArn :: Lens' BatchGetViewError Text
batchGetViewError_viewArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetViewError' {Text
viewArn :: Text
$sel:viewArn:BatchGetViewError' :: BatchGetViewError -> Text
viewArn} -> Text
viewArn) (\s :: BatchGetViewError
s@BatchGetViewError' {} Text
a -> BatchGetViewError
s {$sel:viewArn:BatchGetViewError' :: Text
viewArn = Text
a} :: BatchGetViewError)

instance Data.FromJSON BatchGetViewError where
  parseJSON :: Value -> Parser BatchGetViewError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchGetViewError"
      ( \Object
x ->
          Text -> Text -> BatchGetViewError
BatchGetViewError'
            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
"ErrorMessage")
            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
"ViewArn")
      )

instance Prelude.Hashable BatchGetViewError where
  hashWithSalt :: Int -> BatchGetViewError -> Int
hashWithSalt Int
_salt BatchGetViewError' {Text
viewArn :: Text
errorMessage :: Text
$sel:viewArn:BatchGetViewError' :: BatchGetViewError -> Text
$sel:errorMessage:BatchGetViewError' :: BatchGetViewError -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
errorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
viewArn

instance Prelude.NFData BatchGetViewError where
  rnf :: BatchGetViewError -> ()
rnf BatchGetViewError' {Text
viewArn :: Text
errorMessage :: Text
$sel:viewArn:BatchGetViewError' :: BatchGetViewError -> Text
$sel:errorMessage:BatchGetViewError' :: BatchGetViewError -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
viewArn