triggeraction method
- TriggerActionPayload request,
- String name, {
- String? languageCode,
- String? $fields,
Start an action.
The action can be requested by a business in third-party application.
Before the business can request the action, the third-party application
needs to show them action specific content and display a user input form.
The action can be successfully started only once all required
inputs are
provided. If any required
input is missing, or invalid value was
provided, the service will return 400 error. Validation errors will
contain Ids for all problematic field together with translated, human
readable error messages that can be shown to the user.
request
- The metadata request object.
Request parameters:
name
- Required. The business's account that is triggering the action.
Format: accounts/{account}
Value must have pattern ^accounts/\[^/\]+$
.
languageCode
- Optional. Language code
IETF BCP 47 syntax used to localize
the response. If not set, the result will be in default language en-US
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a TriggerActionResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<TriggerActionResponse> triggeraction(
TriggerActionPayload request,
core.String name, {
core.String? languageCode,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (languageCode != null) 'languageCode': [languageCode],
if ($fields != null) 'fields': [$fields],
};
final url_ =
'issueresolution/v1/' + core.Uri.encodeFull('$name') + ':triggeraction';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TriggerActionResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}