updateSyncConfiguration method

Future<UpdateSyncConfigurationOutput> updateSyncConfiguration({
  1. required String resourceName,
  2. required SyncConfigurationType syncType,
  3. String? branch,
  4. String? configFile,
  5. PublishDeploymentStatus? publishDeploymentStatus,
  6. String? repositoryLinkId,
  7. String? roleArn,
  8. TriggerResourceUpdateOn? triggerResourceUpdateOn,
})

Updates the sync configuration for your connection and a specified external Git repository.

May throw AccessDeniedException. May throw ConcurrentModificationException. May throw InternalServerException. May throw InvalidInputException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UpdateOutOfSyncException.

Parameter resourceName : The name of the Amazon Web Services resource for the sync configuration to be updated.

Parameter syncType : The sync type for the sync configuration to be updated.

Parameter branch : The branch for the sync configuration to be updated.

Parameter configFile : The configuration file for the sync configuration to be updated.

Parameter publishDeploymentStatus : Whether to enable or disable publishing of deployment status to source providers.

Parameter repositoryLinkId : The ID of the repository link for the sync configuration to be updated.

Parameter roleArn : The ARN of the IAM role for the sync configuration to be updated.

Parameter triggerResourceUpdateOn : When to trigger Git sync to begin the stack update.

Implementation

Future<UpdateSyncConfigurationOutput> updateSyncConfiguration({
  required String resourceName,
  required SyncConfigurationType syncType,
  String? branch,
  String? configFile,
  PublishDeploymentStatus? publishDeploymentStatus,
  String? repositoryLinkId,
  String? roleArn,
  TriggerResourceUpdateOn? triggerResourceUpdateOn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'CodeStar_connections_20191201.UpdateSyncConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceName': resourceName,
      'SyncType': syncType.value,
      if (branch != null) 'Branch': branch,
      if (configFile != null) 'ConfigFile': configFile,
      if (publishDeploymentStatus != null)
        'PublishDeploymentStatus': publishDeploymentStatus.value,
      if (repositoryLinkId != null) 'RepositoryLinkId': repositoryLinkId,
      if (roleArn != null) 'RoleArn': roleArn,
      if (triggerResourceUpdateOn != null)
        'TriggerResourceUpdateOn': triggerResourceUpdateOn.value,
    },
  );

  return UpdateSyncConfigurationOutput.fromJson(jsonResponse.body);
}