Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS
翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
AWS SDK updateModelManifestで を使用する
次のサンプルコードは、updateModelManifest を使用する方法を説明しています。
アクション例は、より大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。次のコード例で、このアクションのコンテキストを確認できます。
- Java
-
- SDK for Java 2.x
-
GitHub には、その他のリソースもあります。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。
/**
* Updates the model manifest.
*
* @param name the name of the model manifest to update
*/
public void updateModelManifestAsync(String name) {
UpdateModelManifestRequest request = UpdateModelManifestRequest.builder()
.name(name)
.status(ManifestStatus.ACTIVE)
.build();
getAsyncClient().updateModelManifest(request)
.whenComplete((response, exception) -> {
if (exception != null) {
throw new CompletionException("Failed to update model manifest: " + exception.getMessage(), exception);
}
})
.thenApply(response -> null);
}
- Kotlin
-
- SDK for Kotlin
-
GitHub には、その他のリソースもあります。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。
/**
* Updates the model manifest.
*
* @param nameVal the name of the model manifest to update
*/
suspend fun updateModelManifest(nameVal: String) {
val request = UpdateModelManifestRequest {
name = nameVal
status = ManifestStatus.Active
}
IotFleetWiseClient.fromEnvironment { region = "us-east-1" }.use { fleetwiseClient ->
fleetwiseClient.updateModelManifest(request)
println("$nameVal was successfully updated")
}
}