updateDraftPoll method
Future<DynamiteResponse<PollUpdateDraftPollResponseApplicationJson, void> >
updateDraftPoll({
- required String token,
- required int pollId,
- required PollUpdateDraftPollRequestApplicationJson $body,
- PollUpdateDraftPollApiVersion? apiVersion,
- bool? oCSAPIRequest,
Modify a draft poll.
Required capability: edit-draft-poll.
Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers.
Throws a DynamiteApiException if the API call does not return an expected status code.
Parameters:
apiVersionDefaults to"v1".tokenpollIdThe poll id.oCSAPIRequestRequired to be true for the API request to pass. Defaults totrue.
Status codes:
- 200: Draft modified successfully
- 400: Modifying poll is not possible
- 403: No permission to modify this poll
- 404: No draft poll exists
See:
- $updateDraftPoll_Request for the request send by this method.
- $updateDraftPoll_Serializer for a converter to parse the
Responsefrom an executed request.
Implementation
Future<_i1.DynamiteResponse<PollUpdateDraftPollResponseApplicationJson, void>> updateDraftPoll({
required String token,
required int pollId,
required PollUpdateDraftPollRequestApplicationJson $body,
PollUpdateDraftPollApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final _request = $updateDraftPoll_Request(
token: token,
pollId: pollId,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
$body: $body,
);
final _streamedResponse = await _rootClient.httpClient.send(_request);
final _response = await _i3.Response.fromStream(_streamedResponse);
final _serializer = $updateDraftPoll_Serializer();
return _i1.ResponseConverter<PollUpdateDraftPollResponseApplicationJson, void>(_serializer).convert(_response);
}