create method

Future<GoogleCloudApigeeV1SecurityMonitoringCondition> create(
  1. GoogleCloudApigeeV1SecurityMonitoringCondition request,
  2. String parent, {
  3. String? securityMonitoringConditionId,
  4. String? $fields,
})

Create a security monitoring condition.

request - The metadata request object.

Request parameters:

parent - Required. The parent resource name. Format: organizations/{org} Value must have pattern ^organizations/\[^/\]+$.

securityMonitoringConditionId - Optional. Optional: The security monitoring condition id. If not specified, a monitoring condition uuid will be generated by the backend. This value should be 4-63 characters, and valid characters are /a-z-/.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleCloudApigeeV1SecurityMonitoringCondition.

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<GoogleCloudApigeeV1SecurityMonitoringCondition> create(
  GoogleCloudApigeeV1SecurityMonitoringCondition request,
  core.String parent, {
  core.String? securityMonitoringConditionId,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (securityMonitoringConditionId != null)
      'securityMonitoringConditionId': [securityMonitoringConditionId],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' +
      core.Uri.encodeFull('$parent') +
      '/securityMonitoringConditions';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return GoogleCloudApigeeV1SecurityMonitoringCondition.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}