DigitalTwinsClient.UpdateComponentAsync メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
デジタル ツイン上のコンポーネントのプロパティを非同期的に更新します。
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateComponentAsync(string digitalTwinId, string componentName, Azure.JsonPatchDocument jsonPatchDocument, Azure.ETag? ifMatch = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateComponentAsync : string * string * Azure.JsonPatchDocument * Nullable<Azure.ETag> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.UpdateComponentAsync : string * string * Azure.JsonPatchDocument * Nullable<Azure.ETag> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function UpdateComponentAsync (digitalTwinId As String, componentName As String, jsonPatchDocument As JsonPatchDocument, Optional ifMatch As Nullable(Of ETag) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)
パラメーター
- digitalTwinId
- String
デジタル ツインの ID。
- componentName
- String
変更されるコンポーネント。
- jsonPatchDocument
- JsonPatchDocument
指定したデジタル ツインのコンポーネントに対して実行される application/json-patch+json 操作。
- cancellationToken
- CancellationToken
キャンセル トークン。
戻り値
HTTP 応答 Response<T>。 この応答オブジェクトには、このリソースの更新された ETag を提供する HTTP ヘッダーが含まれています。
例外
例
// Update Component1 by replacing the property ComponentProp1 value,
// using an optional utility to build the payload.
var componentJsonPatchDocument = new JsonPatchDocument();
componentJsonPatchDocument.AppendReplace("/ComponentProp1", "Some new value");
await client.UpdateComponentAsync(basicDtId, "Component1", componentJsonPatchDocument);
Console.WriteLine($"Updated component for digital twin '{basicDtId}'.");
注釈
その他のサンプルについては、 リポジトリのサンプルを参照してください。
適用対象
こちらもご覧ください
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
Azure SDK for .NET