updateSourceControlFromJob method

Future<UpdateSourceControlFromJobResponse> updateSourceControlFromJob({
  1. SourceControlAuthStrategy? authStrategy,
  2. String? authToken,
  3. String? branchName,
  4. String? commitId,
  5. String? folder,
  6. String? jobName,
  7. SourceControlProvider? provider,
  8. String? repositoryName,
  9. String? repositoryOwner,
})

Synchronizes a job to the source control repository. This operation takes the job artifacts from the Glue internal stores and makes a commit to the remote repository that is configured on the job.

This API supports optional parameters which take in the repository information.

May throw AccessDeniedException. May throw AlreadyExistsException. May throw EntityNotFoundException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException. May throw ValidationException.

Parameter authStrategy : The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets Manager, or a personal access token.

Parameter authToken : The value of the authorization token.

Parameter branchName : An optional branch in the remote repository.

Parameter commitId : A commit ID for a commit in the remote repository.

Parameter folder : An optional folder in the remote repository.

Parameter jobName : The name of the Glue job to be synchronized to or from the remote repository.

Parameter provider : The provider for the remote repository. Possible values: GITHUB, AWS_CODE_COMMIT, GITLAB, BITBUCKET.

Parameter repositoryName : The name of the remote repository that contains the job artifacts. For BitBucket providers, RepositoryName should include WorkspaceName. Use the format .

Parameter repositoryOwner : The owner of the remote repository that contains the job artifacts.

Implementation

Future<UpdateSourceControlFromJobResponse> updateSourceControlFromJob({
  SourceControlAuthStrategy? authStrategy,
  String? authToken,
  String? branchName,
  String? commitId,
  String? folder,
  String? jobName,
  SourceControlProvider? provider,
  String? repositoryName,
  String? repositoryOwner,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.UpdateSourceControlFromJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (authStrategy != null) 'AuthStrategy': authStrategy.value,
      if (authToken != null) 'AuthToken': authToken,
      if (branchName != null) 'BranchName': branchName,
      if (commitId != null) 'CommitId': commitId,
      if (folder != null) 'Folder': folder,
      if (jobName != null) 'JobName': jobName,
      if (provider != null) 'Provider': provider.value,
      if (repositoryName != null) 'RepositoryName': repositoryName,
      if (repositoryOwner != null) 'RepositoryOwner': repositoryOwner,
    },
  );

  return UpdateSourceControlFromJobResponse.fromJson(jsonResponse.body);
}