{-# 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.CodeCommit.Types.BatchAssociateApprovalRuleTemplateWithRepositoriesError
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeCommit.Types.BatchAssociateApprovalRuleTemplateWithRepositoriesError where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Returns information about errors in a
-- BatchAssociateApprovalRuleTemplateWithRepositories operation.
--
-- /See:/ 'newBatchAssociateApprovalRuleTemplateWithRepositoriesError' smart constructor.
data BatchAssociateApprovalRuleTemplateWithRepositoriesError = BatchAssociateApprovalRuleTemplateWithRepositoriesError'
  { -- | An error code that specifies whether the repository name was not valid
    -- or not found.
    BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository where the association was not made.
    BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
    -- | An error message that provides details about why the repository name was
    -- not found or not valid.
    BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> Bool
(BatchAssociateApprovalRuleTemplateWithRepositoriesError
 -> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> Bool)
-> (BatchAssociateApprovalRuleTemplateWithRepositoriesError
    -> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> Bool)
-> Eq BatchAssociateApprovalRuleTemplateWithRepositoriesError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> Bool
$c/= :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> Bool
== :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> Bool
$c== :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> Bool
Prelude.Eq, ReadPrec [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
ReadPrec BatchAssociateApprovalRuleTemplateWithRepositoriesError
Int
-> ReadS BatchAssociateApprovalRuleTemplateWithRepositoriesError
ReadS [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
(Int
 -> ReadS BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> ReadS [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
-> ReadPrec BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> ReadPrec
     [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
-> Read BatchAssociateApprovalRuleTemplateWithRepositoriesError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
$creadListPrec :: ReadPrec [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
readPrec :: ReadPrec BatchAssociateApprovalRuleTemplateWithRepositoriesError
$creadPrec :: ReadPrec BatchAssociateApprovalRuleTemplateWithRepositoriesError
readList :: ReadS [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
$creadList :: ReadS [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
readsPrec :: Int
-> ReadS BatchAssociateApprovalRuleTemplateWithRepositoriesError
$creadsPrec :: Int
-> ReadS BatchAssociateApprovalRuleTemplateWithRepositoriesError
Prelude.Read, Int
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> ShowS
[BatchAssociateApprovalRuleTemplateWithRepositoriesError] -> ShowS
BatchAssociateApprovalRuleTemplateWithRepositoriesError -> String
(Int
 -> BatchAssociateApprovalRuleTemplateWithRepositoriesError
 -> ShowS)
-> (BatchAssociateApprovalRuleTemplateWithRepositoriesError
    -> String)
-> ([BatchAssociateApprovalRuleTemplateWithRepositoriesError]
    -> ShowS)
-> Show BatchAssociateApprovalRuleTemplateWithRepositoriesError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAssociateApprovalRuleTemplateWithRepositoriesError] -> ShowS
$cshowList :: [BatchAssociateApprovalRuleTemplateWithRepositoriesError] -> ShowS
show :: BatchAssociateApprovalRuleTemplateWithRepositoriesError -> String
$cshow :: BatchAssociateApprovalRuleTemplateWithRepositoriesError -> String
showsPrec :: Int
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> ShowS
$cshowsPrec :: Int
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError -> ShowS
Prelude.Show, (forall x.
 BatchAssociateApprovalRuleTemplateWithRepositoriesError
 -> Rep BatchAssociateApprovalRuleTemplateWithRepositoriesError x)
-> (forall x.
    Rep BatchAssociateApprovalRuleTemplateWithRepositoriesError x
    -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Generic BatchAssociateApprovalRuleTemplateWithRepositoriesError
forall x.
Rep BatchAssociateApprovalRuleTemplateWithRepositoriesError x
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError
forall x.
BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Rep BatchAssociateApprovalRuleTemplateWithRepositoriesError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchAssociateApprovalRuleTemplateWithRepositoriesError x
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError
$cfrom :: forall x.
BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Rep BatchAssociateApprovalRuleTemplateWithRepositoriesError x
Prelude.Generic)

-- |
-- Create a value of 'BatchAssociateApprovalRuleTemplateWithRepositoriesError' 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', 'batchAssociateApprovalRuleTemplateWithRepositoriesError_errorCode' - An error code that specifies whether the repository name was not valid
-- or not found.
--
-- 'repositoryName', 'batchAssociateApprovalRuleTemplateWithRepositoriesError_repositoryName' - The name of the repository where the association was not made.
--
-- 'errorMessage', 'batchAssociateApprovalRuleTemplateWithRepositoriesError_errorMessage' - An error message that provides details about why the repository name was
-- not found or not valid.
newBatchAssociateApprovalRuleTemplateWithRepositoriesError ::
  BatchAssociateApprovalRuleTemplateWithRepositoriesError
newBatchAssociateApprovalRuleTemplateWithRepositoriesError :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
newBatchAssociateApprovalRuleTemplateWithRepositoriesError =
  BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError
BatchAssociateApprovalRuleTemplateWithRepositoriesError'
    { $sel:errorCode:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: Maybe Text
errorCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: Maybe Text
repositoryName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: Maybe Text
errorMessage =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | An error code that specifies whether the repository name was not valid
-- or not found.
batchAssociateApprovalRuleTemplateWithRepositoriesError_errorCode :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositoriesError (Prelude.Maybe Prelude.Text)
batchAssociateApprovalRuleTemplateWithRepositoriesError_errorCode :: (Maybe Text -> f (Maybe Text))
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> f BatchAssociateApprovalRuleTemplateWithRepositoriesError
batchAssociateApprovalRuleTemplateWithRepositoriesError_errorCode = (BatchAssociateApprovalRuleTemplateWithRepositoriesError
 -> Maybe Text)
-> (BatchAssociateApprovalRuleTemplateWithRepositoriesError
    -> Maybe Text
    -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Lens
     BatchAssociateApprovalRuleTemplateWithRepositoriesError
     BatchAssociateApprovalRuleTemplateWithRepositoriesError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositoriesError' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
s@BatchAssociateApprovalRuleTemplateWithRepositoriesError' {} Maybe Text
a -> BatchAssociateApprovalRuleTemplateWithRepositoriesError
s {$sel:errorCode:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: Maybe Text
errorCode = Maybe Text
a} :: BatchAssociateApprovalRuleTemplateWithRepositoriesError)

-- | The name of the repository where the association was not made.
batchAssociateApprovalRuleTemplateWithRepositoriesError_repositoryName :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositoriesError (Prelude.Maybe Prelude.Text)
batchAssociateApprovalRuleTemplateWithRepositoriesError_repositoryName :: (Maybe Text -> f (Maybe Text))
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> f BatchAssociateApprovalRuleTemplateWithRepositoriesError
batchAssociateApprovalRuleTemplateWithRepositoriesError_repositoryName = (BatchAssociateApprovalRuleTemplateWithRepositoriesError
 -> Maybe Text)
-> (BatchAssociateApprovalRuleTemplateWithRepositoriesError
    -> Maybe Text
    -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Lens
     BatchAssociateApprovalRuleTemplateWithRepositoriesError
     BatchAssociateApprovalRuleTemplateWithRepositoriesError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositoriesError' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
s@BatchAssociateApprovalRuleTemplateWithRepositoriesError' {} Maybe Text
a -> BatchAssociateApprovalRuleTemplateWithRepositoriesError
s {$sel:repositoryName:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: Maybe Text
repositoryName = Maybe Text
a} :: BatchAssociateApprovalRuleTemplateWithRepositoriesError)

-- | An error message that provides details about why the repository name was
-- not found or not valid.
batchAssociateApprovalRuleTemplateWithRepositoriesError_errorMessage :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositoriesError (Prelude.Maybe Prelude.Text)
batchAssociateApprovalRuleTemplateWithRepositoriesError_errorMessage :: (Maybe Text -> f (Maybe Text))
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> f BatchAssociateApprovalRuleTemplateWithRepositoriesError
batchAssociateApprovalRuleTemplateWithRepositoriesError_errorMessage = (BatchAssociateApprovalRuleTemplateWithRepositoriesError
 -> Maybe Text)
-> (BatchAssociateApprovalRuleTemplateWithRepositoriesError
    -> Maybe Text
    -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Lens
     BatchAssociateApprovalRuleTemplateWithRepositoriesError
     BatchAssociateApprovalRuleTemplateWithRepositoriesError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositoriesError' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
-> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: BatchAssociateApprovalRuleTemplateWithRepositoriesError
s@BatchAssociateApprovalRuleTemplateWithRepositoriesError' {} Maybe Text
a -> BatchAssociateApprovalRuleTemplateWithRepositoriesError
s {$sel:errorMessage:BatchAssociateApprovalRuleTemplateWithRepositoriesError' :: Maybe Text
errorMessage = Maybe Text
a} :: BatchAssociateApprovalRuleTemplateWithRepositoriesError)

instance
  Core.FromJSON
    BatchAssociateApprovalRuleTemplateWithRepositoriesError
  where
  parseJSON :: Value
-> Parser BatchAssociateApprovalRuleTemplateWithRepositoriesError
parseJSON =
    String
-> (Object
    -> Parser BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Value
-> Parser BatchAssociateApprovalRuleTemplateWithRepositoriesError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchAssociateApprovalRuleTemplateWithRepositoriesError"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> BatchAssociateApprovalRuleTemplateWithRepositoriesError
BatchAssociateApprovalRuleTemplateWithRepositoriesError'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorCode")
              Parser
  (Maybe Text
   -> Maybe Text
   -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"repositoryName")
              Parser
  (Maybe Text
   -> BatchAssociateApprovalRuleTemplateWithRepositoriesError)
-> Parser (Maybe Text)
-> Parser BatchAssociateApprovalRuleTemplateWithRepositoriesError
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorMessage")
      )

instance
  Prelude.Hashable
    BatchAssociateApprovalRuleTemplateWithRepositoriesError

instance
  Prelude.NFData
    BatchAssociateApprovalRuleTemplateWithRepositoriesError