createWaitlistEntry method
Future<WaitlistEntry?>
createWaitlistEntry({
- CreateWaitlistEntryRequest? createWaitlistEntryRequest,
Create a waitlist entry
Creates a new waitlist entry for the given email address. If the email address is already on the waitlist, no new entry will be created and the existing waitlist entry will be returned.
Parameters:
- CreateWaitlistEntryRequest createWaitlistEntryRequest:
Implementation
Future<WaitlistEntry?> createWaitlistEntry({
CreateWaitlistEntryRequest? createWaitlistEntryRequest,
}) async {
final response = await createWaitlistEntryWithHttpInfo(
createWaitlistEntryRequest: createWaitlistEntryRequest,
);
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),
'WaitlistEntry',
) as WaitlistEntry;
}
return null;
}