updateWorkGroup method

Future<void> updateWorkGroup({
  1. required String workGroup,
  2. WorkGroupConfigurationUpdates? configurationUpdates,
  3. String? description,
  4. WorkGroupState? state,
})

Updates the workgroup with the specified name. The workgroup's name cannot be changed.

May throw InternalServerException. May throw InvalidRequestException.

Parameter workGroup : The specified workgroup that will be updated.

Parameter configurationUpdates : The workgroup configuration that will be updated for the given workgroup.

Parameter description : The workgroup description.

Parameter state : The workgroup state that will be updated for the given workgroup.

Implementation

Future<void> updateWorkGroup({
  required String workGroup,
  WorkGroupConfigurationUpdates? configurationUpdates,
  String? description,
  WorkGroupState? state,
}) async {
  ArgumentError.checkNotNull(workGroup, 'workGroup');
  _s.validateStringLength(
    'description',
    description,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.UpdateWorkGroup'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'WorkGroup': workGroup,
      if (configurationUpdates != null)
        'ConfigurationUpdates': configurationUpdates,
      if (description != null) 'Description': description,
      if (state != null) 'State': state.toValue(),
    },
  );
}