{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.BatchAssociateApprovalRuleTemplateWithRepositories
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an association between an approval rule template and one or more
-- specified repositories.
module Amazonka.CodeCommit.BatchAssociateApprovalRuleTemplateWithRepositories
  ( -- * Creating a Request
    BatchAssociateApprovalRuleTemplateWithRepositories (..),
    newBatchAssociateApprovalRuleTemplateWithRepositories,

    -- * Request Lenses
    batchAssociateApprovalRuleTemplateWithRepositories_approvalRuleTemplateName,
    batchAssociateApprovalRuleTemplateWithRepositories_repositoryNames,

    -- * Destructuring the Response
    BatchAssociateApprovalRuleTemplateWithRepositoriesResponse (..),
    newBatchAssociateApprovalRuleTemplateWithRepositoriesResponse,

    -- * Response Lenses
    batchAssociateApprovalRuleTemplateWithRepositoriesResponse_httpStatus,
    batchAssociateApprovalRuleTemplateWithRepositoriesResponse_associatedRepositoryNames,
    batchAssociateApprovalRuleTemplateWithRepositoriesResponse_errors,
  )
where

import Amazonka.CodeCommit.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newBatchAssociateApprovalRuleTemplateWithRepositories' smart constructor.
data BatchAssociateApprovalRuleTemplateWithRepositories = BatchAssociateApprovalRuleTemplateWithRepositories'
  { -- | The name of the template you want to associate with one or more
    -- repositories.
    BatchAssociateApprovalRuleTemplateWithRepositories -> Text
approvalRuleTemplateName :: Prelude.Text,
    -- | The names of the repositories you want to associate with the template.
    --
    -- The length constraint limit is for each string in the array. The array
    -- itself can be empty.
    BatchAssociateApprovalRuleTemplateWithRepositories -> [Text]
repositoryNames :: [Prelude.Text]
  }
  deriving (BatchAssociateApprovalRuleTemplateWithRepositories
-> BatchAssociateApprovalRuleTemplateWithRepositories -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAssociateApprovalRuleTemplateWithRepositories
-> BatchAssociateApprovalRuleTemplateWithRepositories -> Bool
$c/= :: BatchAssociateApprovalRuleTemplateWithRepositories
-> BatchAssociateApprovalRuleTemplateWithRepositories -> Bool
== :: BatchAssociateApprovalRuleTemplateWithRepositories
-> BatchAssociateApprovalRuleTemplateWithRepositories -> Bool
$c== :: BatchAssociateApprovalRuleTemplateWithRepositories
-> BatchAssociateApprovalRuleTemplateWithRepositories -> Bool
Prelude.Eq, ReadPrec [BatchAssociateApprovalRuleTemplateWithRepositories]
ReadPrec BatchAssociateApprovalRuleTemplateWithRepositories
Int -> ReadS BatchAssociateApprovalRuleTemplateWithRepositories
ReadS [BatchAssociateApprovalRuleTemplateWithRepositories]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAssociateApprovalRuleTemplateWithRepositories]
$creadListPrec :: ReadPrec [BatchAssociateApprovalRuleTemplateWithRepositories]
readPrec :: ReadPrec BatchAssociateApprovalRuleTemplateWithRepositories
$creadPrec :: ReadPrec BatchAssociateApprovalRuleTemplateWithRepositories
readList :: ReadS [BatchAssociateApprovalRuleTemplateWithRepositories]
$creadList :: ReadS [BatchAssociateApprovalRuleTemplateWithRepositories]
readsPrec :: Int -> ReadS BatchAssociateApprovalRuleTemplateWithRepositories
$creadsPrec :: Int -> ReadS BatchAssociateApprovalRuleTemplateWithRepositories
Prelude.Read, Int -> BatchAssociateApprovalRuleTemplateWithRepositories -> ShowS
[BatchAssociateApprovalRuleTemplateWithRepositories] -> ShowS
BatchAssociateApprovalRuleTemplateWithRepositories -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAssociateApprovalRuleTemplateWithRepositories] -> ShowS
$cshowList :: [BatchAssociateApprovalRuleTemplateWithRepositories] -> ShowS
show :: BatchAssociateApprovalRuleTemplateWithRepositories -> String
$cshow :: BatchAssociateApprovalRuleTemplateWithRepositories -> String
showsPrec :: Int -> BatchAssociateApprovalRuleTemplateWithRepositories -> ShowS
$cshowsPrec :: Int -> BatchAssociateApprovalRuleTemplateWithRepositories -> ShowS
Prelude.Show, forall x.
Rep BatchAssociateApprovalRuleTemplateWithRepositories x
-> BatchAssociateApprovalRuleTemplateWithRepositories
forall x.
BatchAssociateApprovalRuleTemplateWithRepositories
-> Rep BatchAssociateApprovalRuleTemplateWithRepositories x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchAssociateApprovalRuleTemplateWithRepositories x
-> BatchAssociateApprovalRuleTemplateWithRepositories
$cfrom :: forall x.
BatchAssociateApprovalRuleTemplateWithRepositories
-> Rep BatchAssociateApprovalRuleTemplateWithRepositories x
Prelude.Generic)

-- |
-- Create a value of 'BatchAssociateApprovalRuleTemplateWithRepositories' 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:
--
-- 'approvalRuleTemplateName', 'batchAssociateApprovalRuleTemplateWithRepositories_approvalRuleTemplateName' - The name of the template you want to associate with one or more
-- repositories.
--
-- 'repositoryNames', 'batchAssociateApprovalRuleTemplateWithRepositories_repositoryNames' - The names of the repositories you want to associate with the template.
--
-- The length constraint limit is for each string in the array. The array
-- itself can be empty.
newBatchAssociateApprovalRuleTemplateWithRepositories ::
  -- | 'approvalRuleTemplateName'
  Prelude.Text ->
  BatchAssociateApprovalRuleTemplateWithRepositories
newBatchAssociateApprovalRuleTemplateWithRepositories :: Text -> BatchAssociateApprovalRuleTemplateWithRepositories
newBatchAssociateApprovalRuleTemplateWithRepositories
  Text
pApprovalRuleTemplateName_ =
    BatchAssociateApprovalRuleTemplateWithRepositories'
      { $sel:approvalRuleTemplateName:BatchAssociateApprovalRuleTemplateWithRepositories' :: Text
approvalRuleTemplateName =
          Text
pApprovalRuleTemplateName_,
        $sel:repositoryNames:BatchAssociateApprovalRuleTemplateWithRepositories' :: [Text]
repositoryNames =
          forall a. Monoid a => a
Prelude.mempty
      }

-- | The name of the template you want to associate with one or more
-- repositories.
batchAssociateApprovalRuleTemplateWithRepositories_approvalRuleTemplateName :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositories Prelude.Text
batchAssociateApprovalRuleTemplateWithRepositories_approvalRuleTemplateName :: Lens' BatchAssociateApprovalRuleTemplateWithRepositories Text
batchAssociateApprovalRuleTemplateWithRepositories_approvalRuleTemplateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositories' {Text
approvalRuleTemplateName :: Text
$sel:approvalRuleTemplateName:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> Text
approvalRuleTemplateName} -> Text
approvalRuleTemplateName) (\s :: BatchAssociateApprovalRuleTemplateWithRepositories
s@BatchAssociateApprovalRuleTemplateWithRepositories' {} Text
a -> BatchAssociateApprovalRuleTemplateWithRepositories
s {$sel:approvalRuleTemplateName:BatchAssociateApprovalRuleTemplateWithRepositories' :: Text
approvalRuleTemplateName = Text
a} :: BatchAssociateApprovalRuleTemplateWithRepositories)

-- | The names of the repositories you want to associate with the template.
--
-- The length constraint limit is for each string in the array. The array
-- itself can be empty.
batchAssociateApprovalRuleTemplateWithRepositories_repositoryNames :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositories [Prelude.Text]
batchAssociateApprovalRuleTemplateWithRepositories_repositoryNames :: Lens' BatchAssociateApprovalRuleTemplateWithRepositories [Text]
batchAssociateApprovalRuleTemplateWithRepositories_repositoryNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositories' {[Text]
repositoryNames :: [Text]
$sel:repositoryNames:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> [Text]
repositoryNames} -> [Text]
repositoryNames) (\s :: BatchAssociateApprovalRuleTemplateWithRepositories
s@BatchAssociateApprovalRuleTemplateWithRepositories' {} [Text]
a -> BatchAssociateApprovalRuleTemplateWithRepositories
s {$sel:repositoryNames:BatchAssociateApprovalRuleTemplateWithRepositories' :: [Text]
repositoryNames = [Text]
a} :: BatchAssociateApprovalRuleTemplateWithRepositories) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    BatchAssociateApprovalRuleTemplateWithRepositories
  where
  type
    AWSResponse
      BatchAssociateApprovalRuleTemplateWithRepositories =
      BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
  request :: (Service -> Service)
-> BatchAssociateApprovalRuleTemplateWithRepositories
-> Request BatchAssociateApprovalRuleTemplateWithRepositories
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy BatchAssociateApprovalRuleTemplateWithRepositories
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse BatchAssociateApprovalRuleTemplateWithRepositories)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> [Text]
-> [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
BatchAssociateApprovalRuleTemplateWithRepositoriesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"associatedRepositoryNames"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"errors" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    BatchAssociateApprovalRuleTemplateWithRepositories
  where
  hashWithSalt :: Int -> BatchAssociateApprovalRuleTemplateWithRepositories -> Int
hashWithSalt
    Int
_salt
    BatchAssociateApprovalRuleTemplateWithRepositories' {[Text]
Text
repositoryNames :: [Text]
approvalRuleTemplateName :: Text
$sel:repositoryNames:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> [Text]
$sel:approvalRuleTemplateName:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
approvalRuleTemplateName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
repositoryNames

instance
  Prelude.NFData
    BatchAssociateApprovalRuleTemplateWithRepositories
  where
  rnf :: BatchAssociateApprovalRuleTemplateWithRepositories -> ()
rnf
    BatchAssociateApprovalRuleTemplateWithRepositories' {[Text]
Text
repositoryNames :: [Text]
approvalRuleTemplateName :: Text
$sel:repositoryNames:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> [Text]
$sel:approvalRuleTemplateName:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Text
approvalRuleTemplateName
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
repositoryNames

instance
  Data.ToHeaders
    BatchAssociateApprovalRuleTemplateWithRepositories
  where
  toHeaders :: BatchAssociateApprovalRuleTemplateWithRepositories
-> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeCommit_20150413.BatchAssociateApprovalRuleTemplateWithRepositories" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    BatchAssociateApprovalRuleTemplateWithRepositories
  where
  toJSON :: BatchAssociateApprovalRuleTemplateWithRepositories -> Value
toJSON
    BatchAssociateApprovalRuleTemplateWithRepositories' {[Text]
Text
repositoryNames :: [Text]
approvalRuleTemplateName :: Text
$sel:repositoryNames:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> [Text]
$sel:approvalRuleTemplateName:BatchAssociateApprovalRuleTemplateWithRepositories' :: BatchAssociateApprovalRuleTemplateWithRepositories -> Text
..} =
      [Pair] -> Value
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ forall a. a -> Maybe a
Prelude.Just
                ( Key
"approvalRuleTemplateName"
                    forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
approvalRuleTemplateName
                ),
              forall a. a -> Maybe a
Prelude.Just
                (Key
"repositoryNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
repositoryNames)
            ]
        )

instance
  Data.ToPath
    BatchAssociateApprovalRuleTemplateWithRepositories
  where
  toPath :: BatchAssociateApprovalRuleTemplateWithRepositories -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    BatchAssociateApprovalRuleTemplateWithRepositories
  where
  toQuery :: BatchAssociateApprovalRuleTemplateWithRepositories -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchAssociateApprovalRuleTemplateWithRepositoriesResponse' smart constructor.
data BatchAssociateApprovalRuleTemplateWithRepositoriesResponse = BatchAssociateApprovalRuleTemplateWithRepositoriesResponse'
  { -- | The response's http status code.
    BatchAssociateApprovalRuleTemplateWithRepositoriesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of names of the repositories that have been associated with the
    -- template.
    BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> [Text]
associatedRepositoryNames :: [Prelude.Text],
    -- | A list of any errors that might have occurred while attempting to create
    -- the association between the template and the repositories.
    BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors :: [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
  }
  deriving (BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> Bool
$c/= :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> Bool
== :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> Bool
$c== :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> Bool
Prelude.Eq, ReadPrec
  [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
ReadPrec BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
Int
-> ReadS BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
ReadS [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
$creadListPrec :: ReadPrec
  [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
readPrec :: ReadPrec BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
$creadPrec :: ReadPrec BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
readList :: ReadS [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
$creadList :: ReadS [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
readsPrec :: Int
-> ReadS BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
$creadsPrec :: Int
-> ReadS BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
Prelude.Read, Int
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> ShowS
[BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
-> ShowS
BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
-> ShowS
$cshowList :: [BatchAssociateApprovalRuleTemplateWithRepositoriesResponse]
-> ShowS
show :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> String
$cshow :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> String
showsPrec :: Int
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> ShowS
$cshowsPrec :: Int
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> ShowS
Prelude.Show, forall x.
Rep BatchAssociateApprovalRuleTemplateWithRepositoriesResponse x
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
forall x.
BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> Rep BatchAssociateApprovalRuleTemplateWithRepositoriesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchAssociateApprovalRuleTemplateWithRepositoriesResponse x
-> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
$cfrom :: forall x.
BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> Rep BatchAssociateApprovalRuleTemplateWithRepositoriesResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' 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:
--
-- 'httpStatus', 'batchAssociateApprovalRuleTemplateWithRepositoriesResponse_httpStatus' - The response's http status code.
--
-- 'associatedRepositoryNames', 'batchAssociateApprovalRuleTemplateWithRepositoriesResponse_associatedRepositoryNames' - A list of names of the repositories that have been associated with the
-- template.
--
-- 'errors', 'batchAssociateApprovalRuleTemplateWithRepositoriesResponse_errors' - A list of any errors that might have occurred while attempting to create
-- the association between the template and the repositories.
newBatchAssociateApprovalRuleTemplateWithRepositoriesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
newBatchAssociateApprovalRuleTemplateWithRepositoriesResponse :: Int -> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
newBatchAssociateApprovalRuleTemplateWithRepositoriesResponse
  Int
pHttpStatus_ =
    BatchAssociateApprovalRuleTemplateWithRepositoriesResponse'
      { $sel:httpStatus:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:associatedRepositoryNames:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: [Text]
associatedRepositoryNames =
          forall a. Monoid a => a
Prelude.mempty,
        $sel:errors:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors =
          forall a. Monoid a => a
Prelude.mempty
      }

-- | The response's http status code.
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_httpStatus :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositoriesResponse Prelude.Int
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_httpStatus :: Lens'
  BatchAssociateApprovalRuleTemplateWithRepositoriesResponse Int
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
s@BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' {} Int
a -> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
s {$sel:httpStatus:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: Int
httpStatus = Int
a} :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse)

-- | A list of names of the repositories that have been associated with the
-- template.
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_associatedRepositoryNames :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositoriesResponse [Prelude.Text]
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_associatedRepositoryNames :: Lens'
  BatchAssociateApprovalRuleTemplateWithRepositoriesResponse [Text]
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_associatedRepositoryNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' {[Text]
associatedRepositoryNames :: [Text]
$sel:associatedRepositoryNames:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> [Text]
associatedRepositoryNames} -> [Text]
associatedRepositoryNames) (\s :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
s@BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' {} [Text]
a -> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
s {$sel:associatedRepositoryNames:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: [Text]
associatedRepositoryNames = [Text]
a} :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of any errors that might have occurred while attempting to create
-- the association between the template and the repositories.
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_errors :: Lens.Lens' BatchAssociateApprovalRuleTemplateWithRepositoriesResponse [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_errors :: Lens'
  BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
  [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
batchAssociateApprovalRuleTemplateWithRepositoriesResponse_errors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' {[BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors :: [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
$sel:errors:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors} -> [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors) (\s :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
s@BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' {} [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
a -> BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
s {$sel:errors:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors = [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
a} :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
  where
  rnf :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse -> ()
rnf
    BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' {Int
[Text]
[BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors :: [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
associatedRepositoryNames :: [Text]
httpStatus :: Int
$sel:errors:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
$sel:associatedRepositoryNames:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse
-> [Text]
$sel:httpStatus:BatchAssociateApprovalRuleTemplateWithRepositoriesResponse' :: BatchAssociateApprovalRuleTemplateWithRepositoriesResponse -> Int
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
associatedRepositoryNames
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchAssociateApprovalRuleTemplateWithRepositoriesError]
errors