updateNotebook method

Future<void> updateNotebook({
  1. required String notebookId,
  2. required String payload,
  3. required NotebookType type,
  4. String? clientRequestToken,
  5. String? sessionId,
})

Updates the contents of a Spark notebook.

May throw InternalServerException. May throw InvalidRequestException. May throw TooManyRequestsException.

Parameter notebookId : The ID of the notebook to update.

Parameter payload : The updated content for the notebook.

Parameter type : The notebook content type. Currently, the only valid type is IPYNB.

Parameter clientRequestToken : A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).

Parameter sessionId : The active notebook session ID. Required if the notebook has an active session.

Implementation

Future<void> updateNotebook({
  required String notebookId,
  required String payload,
  required NotebookType type,
  String? clientRequestToken,
  String? sessionId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.UpdateNotebook'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'NotebookId': notebookId,
      'Payload': payload,
      'Type': type.value,
      if (clientRequestToken != null)
        'ClientRequestToken': clientRequestToken,
      if (sessionId != null) 'SessionId': sessionId,
    },
  );
}