名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
フォーカスのある受信トレイの [分類] フィールドを、指定したとおりに変更します。
InferenceClassicationOverride インスタンスのその他のフィールドの変更には、PATCH を使用できません。
送信者にオーバーライドがあり、その送信者が表示名を変更すると、既存のオーバーライドで POST を使用して [名前] フィールドの更新を実施できます。
送信者にオーバーライドがあり、その送信者が SMTP アドレスを変更すると、既存のオーバーライドを削除して、新しい SMTP アドレスで新しくオーバーライドを作成することが、この送信者のオーバーライドを「更新」する唯一の方法になります。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
Mail.ReadWrite |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
Mail.ReadWrite |
注意事項なし。 |
| アプリケーション |
Mail.ReadWrite |
注意事項なし。 |
HTTP 要求
PATCH /me/inferenceClassification/overrides/{id}
PATCH /users/{id}/inferenceClassification/overrides/{id}
| 名前 |
型 |
説明 |
| Authorization |
string |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
string |
エンティティ本文内のデータの性質です。 必須です。 |
要求本文
要求の本文内に、classifyAs の新しい値を指定します。 最適なパフォーマンスを得るためには、変更されない既存の値を含めないでください。
| プロパティ |
型 |
説明 |
| classifyAs |
string |
特定の差出人からの着信メッセージを常時分類する方法を指定します。 使用可能な値は、 focused、 otherです。 |
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文で、更新された inferenceClassificationOverride オブジェクトを返します。
例
要求
次の例では、SMTP アドレス randiw@contoso.com のオーバーライドを other から focused に変更します。
PATCH https://graph.microsoft.com/beta/me/inferenceClassification/overrides/{id}
Content-type: application/json
{
"classifyAs": "focused"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new InferenceClassificationOverride
{
ClassifyAs = InferenceClassificationType.Focused,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.InferenceClassification.Overrides["{inferenceClassificationOverride-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewInferenceClassificationOverride()
classifyAs := graphmodels.FOCUSED_INFERENCECLASSIFICATIONTYPE
requestBody.SetClassifyAs(&classifyAs)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
overrides, err := graphClient.Me().InferenceClassification().Overrides().ByInferenceClassificationOverrideId("inferenceClassificationOverride-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
InferenceClassificationOverride inferenceClassificationOverride = new InferenceClassificationOverride();
inferenceClassificationOverride.setClassifyAs(InferenceClassificationType.Focused);
InferenceClassificationOverride result = graphClient.me().inferenceClassification().overrides().byInferenceClassificationOverrideId("{inferenceClassificationOverride-id}").patch(inferenceClassificationOverride);
const options = {
authProvider,
};
const client = Client.init(options);
const inferenceClassificationOverride = {
classifyAs: 'focused'
};
await client.api('/me/inferenceClassification/overrides/{id}')
.version('beta')
.update(inferenceClassificationOverride);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\InferenceClassificationOverride;
use Microsoft\Graph\Beta\Generated\Models\InferenceClassificationType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InferenceClassificationOverride();
$requestBody->setClassifyAs(new InferenceClassificationType('focused'));
$result = $graphServiceClient->me()->inferenceClassification()->overrides()->byInferenceClassificationOverrideId('inferenceClassificationOverride-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Mail
$params = @{
classifyAs = "focused"
}
# A UPN can also be used as -UserId.
Update-MgBetaUserInferenceClassificationOverride -UserId $userId -InferenceClassificationOverrideId $inferenceClassificationOverrideId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.inference_classification_override import InferenceClassificationOverride
from msgraph_beta.generated.models.inference_classification_type import InferenceClassificationType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = InferenceClassificationOverride(
classify_as = InferenceClassificationType.Focused,
)
result = await graph_client.me.inference_classification.overrides.by_inference_classification_override_id('inferenceClassificationOverride-id').patch(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"classifyAs": "focused",
"senderEmailAddress": {
"name": "Randi Welch",
"address": "randiw@contoso.com"
},
"id": "98f5bdef-576a-404d-a2ea-07a3cf34af4r"
}