setValue method
Future<DynamiteResponse<DeclarativeSettingsSetValueResponseApplicationJson, void> >
setValue({
- required String app,
- required String formId,
- required String fieldId,
- required ContentString<
JsonObject> value, - bool? oCSAPIRequest,
Sets a declarative settings value.
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:
appID of the app.formIdID of the form.fieldIdID of the field.valueValue to be saved.oCSAPIRequestRequired to be true for the API request to pass. Defaults totrue.
Status codes:
- 200: Value set successfully
- 500: Not logged in or not an admin user
- 400: Invalid arguments to save value
See:
- $setValue_Request for the request send by this method.
- $setValue_Serializer for a converter to parse the
Responsefrom an executed request.
Implementation
Future<_i1.DynamiteResponse<DeclarativeSettingsSetValueResponseApplicationJson, void>> setValue({
required String app,
required String formId,
required String fieldId,
required ContentString<JsonObject> value,
bool? oCSAPIRequest,
}) async {
final _request = $setValue_Request(
app: app,
formId: formId,
fieldId: fieldId,
value: value,
oCSAPIRequest: oCSAPIRequest,
);
final _response = await _rootClient.httpClient.send(_request);
final _serializer = $setValue_Serializer();
final _rawResponse =
await _i1.ResponseConverter<DeclarativeSettingsSetValueResponseApplicationJson, void>(_serializer)
.convert(_response);
return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}