AWSDocAWS SDKGitHub サンプルリポジトリには、さらに多くの SDK サンプルがあります
翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
既存の Amazon Pinpoint エンドポイントに関する情報を表示する
次のコード例は、エンドポイントを取得する方法を示しています。
- Java
-
- SDK for Java 2.x
-
注記
他にもありますGitHub。用例一覧を検索し、AWS コード例リポジトリ
での設定と実行の方法を確認してください。 public static void lookupPinpointEndpoint(PinpointClient pinpoint, String appId, String endpoint ) { try { GetEndpointRequest appRequest = GetEndpointRequest.builder() .applicationId(appId) .endpointId(endpoint) .build(); GetEndpointResponse result = pinpoint.getEndpoint(appRequest); EndpointResponse endResponse = result.endpointResponse(); // Uses the Google Gson library to pretty print the endpoint JSON. Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE) .setPrettyPrinting() .create(); String endpointJson = gson.toJson(endResponse); System.out.println(endpointJson); } catch (PinpointException e) { System.err.println(e.awsErrorDetails().errorMessage()); System.exit(1); } System.out.println("Done"); }
-
API の詳細については、AWS SDK for Java 2.xAPI GetEndpointリファレンスのを参照してください。
-
- Kotlin
-
- SDK for Kotlin
-
注記
これはプレビューリリースの機能に関するプレリリースドキュメントです。このドキュメントは変更される可能性があります。
注記
他にもありますGitHub。用例一覧を検索し、AWS コード例リポジトリ
での設定と実行の方法を確認してください。 suspend fun lookupPinpointEndpoint(appId: String?, endpoint: String?) { PinpointClient { region = "us-west-2" }.use { pinpoint -> val result = pinpoint.getEndpoint( GetEndpointRequest { applicationId = appId endpointId = endpoint } ) val endResponse = result.endpointResponse // Uses the Google Gson library to pretty print the endpoint JSON. val gson: com.google.gson.Gson = GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE) .setPrettyPrinting() .create() val endpointJson: String = gson.toJson(endResponse) println(endpointJson) } }
-
API の詳細については、「AWSSDK for Kotlin API リファレンス」を参照してくださいGetEndpoint
。
-
エンドポイントをエクスポートする
セグメントのインポート