create method
- GoogleCloudContactcenterinsightsV1AutoLabelingRule request,
- String parent, {
- String? autoLabelingRuleId,
- String? $fields,
Creates an auto labeling rule.
request - The metadata request object.
Request parameters:
parent - Required. The project and location to create the auto labeling
rule in. Format: projects/{project}/locations/{location}
Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.
autoLabelingRuleId - Required. The ID to use for the auto labeling rule,
which will become the final component of the auto labeling rule's resource
name.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudContactcenterinsightsV1AutoLabelingRule.
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<GoogleCloudContactcenterinsightsV1AutoLabelingRule> create(
GoogleCloudContactcenterinsightsV1AutoLabelingRule request,
core.String parent, {
core.String? autoLabelingRuleId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'autoLabelingRuleId': ?autoLabelingRuleId == null
? null
: [autoLabelingRuleId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/autoLabelingRules';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudContactcenterinsightsV1AutoLabelingRule.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}