updateCodeRepository method

Future<UpdateCodeRepositoryOutput> updateCodeRepository({
  1. required String codeRepositoryName,
  2. GitConfigForUpdate? gitConfig,
})

Updates the specified Git repository with the specified values.

Parameter codeRepositoryName : The name of the Git repository to update.

Parameter gitConfig : The configuration of the git repository, including the URL and the Amazon Resource Name (ARN) of the AWS Secrets Manager secret that contains the credentials used to access the repository. The secret must have a staging label of AWSCURRENT and must be in the following format:

{"username": UserName, "password": Password}

Implementation

Future<UpdateCodeRepositoryOutput> updateCodeRepository({
  required String codeRepositoryName,
  GitConfigForUpdate? gitConfig,
}) async {
  ArgumentError.checkNotNull(codeRepositoryName, 'codeRepositoryName');
  _s.validateStringLength(
    'codeRepositoryName',
    codeRepositoryName,
    1,
    63,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateCodeRepository'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CodeRepositoryName': codeRepositoryName,
      if (gitConfig != null) 'GitConfig': gitConfig,
    },
  );

  return UpdateCodeRepositoryOutput.fromJson(jsonResponse.body);
}