updateDataset method

Future<UpdateDatasetResponse> updateDataset({
  1. required String datasetId,
  2. String? clientToken,
  3. String? description,
})

Updates a dataset's metadata. Synchronous operation. Only provided fields are updated; omitted fields remain unchanged. To modify dataset content, use AddDatasetExamples, UpdateDatasetExamples, or DeleteDatasetExamples.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter datasetId : The unique identifier of the dataset to update.

Parameter clientToken : A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

Parameter description : The updated description for the dataset.

Implementation

Future<UpdateDatasetResponse> updateDataset({
  required String datasetId,
  String? clientToken,
  String? description,
}) async {
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/datasets/${Uri.encodeComponent(datasetId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDatasetResponse.fromJson(response);
}