{-# 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.BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-- 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.BatchDisassociateApprovalRuleTemplateFromRepositoriesError 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
-- BatchDisassociateApprovalRuleTemplateFromRepositories operation.
--
-- /See:/ 'newBatchDisassociateApprovalRuleTemplateFromRepositoriesError' smart constructor.
data BatchDisassociateApprovalRuleTemplateFromRepositoriesError = BatchDisassociateApprovalRuleTemplateFromRepositoriesError'
  { -- | An error code that specifies whether the repository name was not valid
    -- or not found.
    BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository where the association with the template was
    -- not able to be removed.
    BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
    -- | An error message that provides details about why the repository name was
    -- either not found or not valid.
    BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Bool
(BatchDisassociateApprovalRuleTemplateFromRepositoriesError
 -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
 -> Bool)
-> (BatchDisassociateApprovalRuleTemplateFromRepositoriesError
    -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
    -> Bool)
-> Eq BatchDisassociateApprovalRuleTemplateFromRepositoriesError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Bool
$c/= :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Bool
== :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Bool
$c== :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Bool
Prelude.Eq, ReadPrec
  [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
ReadPrec BatchDisassociateApprovalRuleTemplateFromRepositoriesError
Int
-> ReadS BatchDisassociateApprovalRuleTemplateFromRepositoriesError
ReadS [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
(Int
 -> ReadS
      BatchDisassociateApprovalRuleTemplateFromRepositoriesError)
-> ReadS
     [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
-> ReadPrec
     BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> ReadPrec
     [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
-> Read BatchDisassociateApprovalRuleTemplateFromRepositoriesError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
$creadListPrec :: ReadPrec
  [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
readPrec :: ReadPrec BatchDisassociateApprovalRuleTemplateFromRepositoriesError
$creadPrec :: ReadPrec BatchDisassociateApprovalRuleTemplateFromRepositoriesError
readList :: ReadS [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
$creadList :: ReadS [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
readsPrec :: Int
-> ReadS BatchDisassociateApprovalRuleTemplateFromRepositoriesError
$creadsPrec :: Int
-> ReadS BatchDisassociateApprovalRuleTemplateFromRepositoriesError
Prelude.Read, Int
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> ShowS
[BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
-> ShowS
BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> String
(Int
 -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
 -> ShowS)
-> (BatchDisassociateApprovalRuleTemplateFromRepositoriesError
    -> String)
-> ([BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
    -> ShowS)
-> Show BatchDisassociateApprovalRuleTemplateFromRepositoriesError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
-> ShowS
$cshowList :: [BatchDisassociateApprovalRuleTemplateFromRepositoriesError]
-> ShowS
show :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> String
$cshow :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> String
showsPrec :: Int
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> ShowS
$cshowsPrec :: Int
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> ShowS
Prelude.Show, (forall x.
 BatchDisassociateApprovalRuleTemplateFromRepositoriesError
 -> Rep
      BatchDisassociateApprovalRuleTemplateFromRepositoriesError x)
-> (forall x.
    Rep BatchDisassociateApprovalRuleTemplateFromRepositoriesError x
    -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError)
-> Generic
     BatchDisassociateApprovalRuleTemplateFromRepositoriesError
forall x.
Rep BatchDisassociateApprovalRuleTemplateFromRepositoriesError x
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
forall x.
BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Rep BatchDisassociateApprovalRuleTemplateFromRepositoriesError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDisassociateApprovalRuleTemplateFromRepositoriesError x
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
$cfrom :: forall x.
BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Rep BatchDisassociateApprovalRuleTemplateFromRepositoriesError x
Prelude.Generic)

-- |
-- Create a value of 'BatchDisassociateApprovalRuleTemplateFromRepositoriesError' 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', 'batchDisassociateApprovalRuleTemplateFromRepositoriesError_errorCode' - An error code that specifies whether the repository name was not valid
-- or not found.
--
-- 'repositoryName', 'batchDisassociateApprovalRuleTemplateFromRepositoriesError_repositoryName' - The name of the repository where the association with the template was
-- not able to be removed.
--
-- 'errorMessage', 'batchDisassociateApprovalRuleTemplateFromRepositoriesError_errorMessage' - An error message that provides details about why the repository name was
-- either not found or not valid.
newBatchDisassociateApprovalRuleTemplateFromRepositoriesError ::
  BatchDisassociateApprovalRuleTemplateFromRepositoriesError
newBatchDisassociateApprovalRuleTemplateFromRepositoriesError :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
newBatchDisassociateApprovalRuleTemplateFromRepositoriesError =
  BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
BatchDisassociateApprovalRuleTemplateFromRepositoriesError'
    { $sel:errorCode:BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: Maybe Text
errorCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: Maybe Text
repositoryName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: 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.
batchDisassociateApprovalRuleTemplateFromRepositoriesError_errorCode :: Lens.Lens' BatchDisassociateApprovalRuleTemplateFromRepositoriesError (Prelude.Maybe Prelude.Text)
batchDisassociateApprovalRuleTemplateFromRepositoriesError_errorCode :: (Maybe Text -> f (Maybe Text))
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> f BatchDisassociateApprovalRuleTemplateFromRepositoriesError
batchDisassociateApprovalRuleTemplateFromRepositoriesError_errorCode = (BatchDisassociateApprovalRuleTemplateFromRepositoriesError
 -> Maybe Text)
-> (BatchDisassociateApprovalRuleTemplateFromRepositoriesError
    -> Maybe Text
    -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError)
-> Lens
     BatchDisassociateApprovalRuleTemplateFromRepositoriesError
     BatchDisassociateApprovalRuleTemplateFromRepositoriesError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDisassociateApprovalRuleTemplateFromRepositoriesError' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
s@BatchDisassociateApprovalRuleTemplateFromRepositoriesError' {} Maybe Text
a -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
s {$sel:errorCode:BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: Maybe Text
errorCode = Maybe Text
a} :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError)

-- | The name of the repository where the association with the template was
-- not able to be removed.
batchDisassociateApprovalRuleTemplateFromRepositoriesError_repositoryName :: Lens.Lens' BatchDisassociateApprovalRuleTemplateFromRepositoriesError (Prelude.Maybe Prelude.Text)
batchDisassociateApprovalRuleTemplateFromRepositoriesError_repositoryName :: (Maybe Text -> f (Maybe Text))
-> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> f BatchDisassociateApprovalRuleTemplateFromRepositoriesError
batchDisassociateApprovalRuleTemplateFromRepositoriesError_repositoryName = (BatchDisassociateApprovalRuleTemplateFromRepositoriesError
 -> Maybe Text)
-> (BatchDisassociateApprovalRuleTemplateFromRepositoriesError
    -> Maybe Text
    -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError)
-> Lens
     BatchDisassociateApprovalRuleTemplateFromRepositoriesError
     BatchDisassociateApprovalRuleTemplateFromRepositoriesError
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDisassociateApprovalRuleTemplateFromRepositoriesError' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
-> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError
s@BatchDisassociateApprovalRuleTemplateFromRepositoriesError' {} Maybe Text
a -> BatchDisassociateApprovalRuleTemplateFromRepositoriesError
s {$sel:repositoryName:BatchDisassociateApprovalRuleTemplateFromRepositoriesError' :: Maybe Text
repositoryName = Maybe Text
a} :: BatchDisassociateApprovalRuleTemplateFromRepositoriesError)

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

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

instance
  Prelude.NFData
    BatchDisassociateApprovalRuleTemplateFromRepositoriesError