patchCaptableClassesById method

Future<CaptableUpdated?> patchCaptableClassesById(
  1. String id,
  2. CaptableShareClassAmend captableShareClassAmend
)

Replaces one share class's terms.

Replaces one share class's terms. It is a full REPLACE and not a merge, despite the PATCH: every field is written as sent, so a field omitted is written empty rather than left alone. Send the whole class. The method is PATCH because the resource is addressed by id, not because the body is partial — and getting that backwards silently blanks terms every later issuance prices against.

Parameters:

  • String id (required): ID addresses the resource. The URL is the addressing authority — a path segment binds after the body and after the query — so the address decides which row is written whatever a body claims.

  • CaptableShareClassAmend captableShareClassAmend (required):

Implementation

Future<CaptableUpdated?> patchCaptableClassesById(String id, CaptableShareClassAmend captableShareClassAmend,) async {
  final response = await patchCaptableClassesByIdWithHttpInfo(id, captableShareClassAmend,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CaptableUpdated',) as CaptableUpdated;

  }
  return null;
}