更新案例
命名空间:microsoft.graph.ediscovery
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
更新 case 对象的属性。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
eDiscovery.Read.All、eDiscovery.ReadWrite.All |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| 应用程序 |
不支持。 |
HTTP 请求
PATCH /compliance/ediscovery/cases/{id}
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
请求正文
在请求正文中,提供应更新的相关字段的值。 请求正文中不包括的现有属性将保留其以前的值,或根据对其他属性值的更改重新计算。 为了获得最佳性能,请勿加入尚未更改的现有值。
| 属性 |
类型 |
说明 |
| 说明 |
String |
案例描述。 |
| displayName |
String |
大小写名称。 |
| externalId |
String |
客户参考的外部案例编号。 |
响应
如果成功,此方法在响应正文中返回 响应代码和更新的 200 OK microsoft.graph.ediscovery.case 对象。
示例
请求
下面展示了示例请求。
PATCH https://graph.microsoft.com/beta/compliance/ediscovery/cases/061b9a92-8926-4bd9-b41d-abf35edc7583
Content-type: application/json
{
"displayName": "My Case 1 - Renamed",
"description": "Updated description",
"externalId": "Updated externalId"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var @case = new Microsoft.Graph.Ediscovery.Case
{
DisplayName = "My Case 1 - Renamed",
Description = "Updated description",
ExternalId = "Updated externalId"
};
await graphClient.Compliance.Ediscovery.Cases["{ediscovery.case-id}"]
.Request()
.UpdateAsync(@case);
const options = {
authProvider,
};
const client = Client.init(options);
const _case = {
displayName: 'My Case 1 - Renamed',
description: 'Updated description',
externalId: 'Updated externalId'
};
await client.api('/compliance/ediscovery/cases/061b9a92-8926-4bd9-b41d-abf35edc7583')
.version('beta')
.update(_case);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/compliance/ediscovery/cases/061b9a92-8926-4bd9-b41d-abf35edc7583"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphEdiscoveryCase *case = [[MSGraphEdiscoveryCase alloc] init];
[case setDisplayName:@"My Case 1 - Renamed"];
[case setDescription:@"Updated description"];
[case setExternalId:@"Updated externalId"];
NSError *error;
NSData *caseData = [case getSerializedDataWithError:&error];
[urlRequest setHTTPBody:caseData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Case _case = new Case();
_case.displayName = "My Case 1 - Renamed";
_case.description = "Updated description";
_case.externalId = "Updated externalId";
graphClient.compliance().ediscovery().cases("061b9a92-8926-4bd9-b41d-abf35edc7583")
.buildRequest()
.patch(_case);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewCase()
displayName := "My Case 1 - Renamed"
requestBody.SetDisplayName(&displayName)
description := "Updated description"
requestBody.SetDescription(&description)
externalId := "Updated externalId"
requestBody.SetExternalId(&externalId)
caseId := "case-id"
graphClient.Compliance().Ediscovery().CasesById(&caseId).Patch(requestBody)
Import-Module Microsoft.Graph.Compliance
$params = @{
DisplayName = "My Case 1 - Renamed"
Description = "Updated description"
ExternalId = "Updated externalId"
}
Update-MgComplianceEdiscoveryCase -CaseId $caseId -BodyParameter $params
响应
下面展示了示例响应。
HTTP/1.1 204 No Content