Class GetSchemaResponse
GetSchemaResponse
スクリプト プロジェクトの getSchema()
レスポンスを作成するためのビルダー。
function getSchema() {
const cc = DataStudioApp.createCommunityConnector();
const fields = cc.getFields();
fields.newDimension()
.setId('Created')
.setName('Date Created')
.setDescription('The date that this was created')
.setType(cc.FieldType.YEAR_MONTH_DAY);
fields.newMetric()
.setId('Amount')
.setName('Amount (USD)')
.setDescription('The cost in US dollars')
.setType(cc.FieldType.CURRENCY_USD);
return cc.newGetSchemaResponse().setFields(fields).build();
}
詳細なドキュメント
printJson()
このオブジェクトの JSON 表現を出力します。これはデバッグ専用です。
戻る
String
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-12-22 UTC。
[null,null,["最終更新日 2024-12-22 UTC。"],[[["`getSchemaResponse` facilitates the creation of a schema for your Data Studio Community Connector, defining the structure of data your connector provides."],["It allows you to specify dimensions and metrics, including their data types, descriptions, and IDs, using the `fields` object."],["The `build()` method finalizes the schema definition and returns a validated object in the format required by Data Studio."],["Additional methods like `printJson()` and `setFields()` are available for debugging and further schema customization."]]],["The `getSchema()` function defines data fields for a script project using the `DataStudioApp` service. It creates a dimension field named \"Date Created\" of `YEAR_MONTH_DAY` type and a metric field \"Amount (USD)\" of `CURRENCY_USD` type. The `newGetSchemaResponse()` builder then compiles and validates these fields using `setFields()` before the final format for Data Studio is produced using `build()`. `printJson()` outputs a JSON representation for debugging.\n"]]