insert method

Creates a new policy in the specified organization using the data included in the request.

Use this API to add Cloud Armor policies. Previously, alpha and beta versions of this API were used to add firewall policies. This usage is now disabled for most organizations. Use firewallPolicies.insert instead.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<Operation> insert(
  InsertOrganizationSecurityPolicyRequest request,
) async {
  final url = _endPoint.replace(
    path: '/compute/v1/locations/global/securityPolicies',
    queryParameters: {
      'parentId': ?request.parentId,
      'requestId': ?request.requestId,
    },
  );
  final response = await _client.post(
    url,
    body: request.securityPolicyResource,
  );
  return Operation.fromJson(response);
}