testRepositoryTriggers method

Future<TestRepositoryTriggersOutput> testRepositoryTriggers({
  1. required String repositoryName,
  2. required List<RepositoryTrigger> triggers,
})

Tests the functionality of repository triggers by sending information to the trigger target. If real data is available in the repository, the test sends data from the last commit. If no data is available, sample data is generated.

May throw RepositoryDoesNotExistException. May throw RepositoryNameRequiredException. May throw InvalidRepositoryNameException. May throw RepositoryTriggersListRequiredException. May throw MaximumRepositoryTriggersExceededException. May throw InvalidRepositoryTriggerNameException. May throw InvalidRepositoryTriggerDestinationArnException. May throw InvalidRepositoryTriggerRegionException. May throw InvalidRepositoryTriggerCustomDataException. May throw MaximumBranchesExceededException. May throw InvalidRepositoryTriggerBranchNameException. May throw InvalidRepositoryTriggerEventsException. May throw RepositoryTriggerNameRequiredException. May throw RepositoryTriggerDestinationArnRequiredException. May throw RepositoryTriggerBranchNameListRequiredException. May throw RepositoryTriggerEventsListRequiredException. May throw EncryptionIntegrityChecksFailedException. May throw EncryptionKeyAccessDeniedException. May throw EncryptionKeyDisabledException. May throw EncryptionKeyNotFoundException. May throw EncryptionKeyUnavailableException.

Parameter repositoryName : The name of the repository in which to test the triggers.

Parameter triggers : The list of triggers to test.

Implementation

Future<TestRepositoryTriggersOutput> testRepositoryTriggers({
  required String repositoryName,
  required List<RepositoryTrigger> triggers,
}) async {
  ArgumentError.checkNotNull(repositoryName, 'repositoryName');
  _s.validateStringLength(
    'repositoryName',
    repositoryName,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(triggers, 'triggers');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.TestRepositoryTriggers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'repositoryName': repositoryName,
      'triggers': triggers,
    },
  );

  return TestRepositoryTriggersOutput.fromJson(jsonResponse.body);
}