Discard multiple audit objects - Metasys - LIT-12013522 - Software Application - Basic Services client library for .NET (and COM) - Metasys API - 4.2

Metasys REST Client for .NET and COM Developer Guide

Brand
Metasys
Product name
Basic Services client library for .NET (and COM)
Metasys API
Document type
API Reference Guide
Document number
LIT-12013522
Version
4.2
Revision date
2021-04-07
Language
English (United States)

To discard multiple audits, use the DiscardMultiple method. DiscardMultiple takes a list of BatchRequestParam objects and returns a list of Result objects. The BatchRequestParam objects specify the list of audit GUIDS and annotations.

Note: DiscardMultiple is only available with API v3.
Table 1. Discard multiple audit objects .NET signature
Library method name DiscardMultiple
Description Discard multiple audit objects
Method signature Result DiscardMultiple(IEnumerable<BatchRequestParam> requests);
Method input parameters requests: list of objects that specify the GUIDs of the audit objects that you want to discard including the text attached to the audits.
Return value A list of Result objects.
The following .NET C# code is an example of a discard multiple audits call:
var requests = new List<BatchRequestParam>();
BatchRequestParam request1 = new BatchRequestParam { ObjectId = new Guid("e0fb025a-d8a2-4258-91ea-c4026c1620d1"), Resource = "THIS IS THE FIRST DISCARD ANNOTATION" };
requests.Add(request1);
BatchRequestParam request2 = new BatchRequestParam { ObjectId = new Guid("5ff1341e-dbf1-4eaf-b9a1-987f51dabefa"), Resource = "THIS IS THE SECOND DISCARD ANNOTATION" };
requests.Add(request2);

IEnumerable<Result> results = client.Audits.DiscardMultiple(requests);
Result resultItem = results.ElementAt(0);
Console.WriteLine(resultItem);
/*
  {
    "Id": "e0fb025a-d8a2-4258-91ea-c4026c1620d1",
    "Status": 204,
    "Annotation": "THIS IS THE FIRST DISCARD ANNOTATION"
  }  
*/