借助 CommunityConnector,脚本可以访问构建器和实用程序,从而开发适用于数据洞察的社区连接器。使用此类可获取对 Fields
对象以及 FieldType
和 AggregationType
枚举的引用,以便它们可用于构建 Field
。
var cc = DataStudioApp.createCommunityConnector(); var fieldType = cc.FieldType; var aggregationType = cc.AggregationType; var fields = cc.getFields(); fields.newMetric() .setAggregation(aggregationType.AVG) .setType(fieldType.CURRENCY_USD);
属性
媒体资源 | 类型 | 说明 |
---|---|---|
AggregationType | AggregationType | AggregationType 枚举。 |
AuthType | AuthType | AuthType 枚举。 |
BigQueryParameterType | BigQueryParameterType | BigQueryParameterType 枚举。 |
FieldType | FieldType | FieldType 枚举。 |
方法
方法 | 返回类型 | 简介 |
---|---|---|
getConfig() | Config | 返回一个 Config 对象。 |
getFields() | Fields | 返回一个 Fields 对象。 |
newAuthTypeResponse() | GetAuthTypeResponse | 返回一个新的 GetAuthTypeResponse 对象。 |
newBigQueryConfig() | BigQueryConfig | 返回一个新的 BigQueryConfig 对象。 |
newDebugError() | DebugError | 返回一个新的 DebugError 对象。 |
newGetDataResponse() | GetDataResponse | 返回一个新的 GetDataResponse 对象。 |
newGetSchemaResponse() | GetSchemaResponse | 返回一个新的 GetSchemaResponse 对象。 |
newSetCredentialsResponse() | SetCredentialsResponse | 返回一个新的 SetCredentialsResponse 对象。 |
newUserError() | UserError | 返回一个新的 UserError 对象。 |
详细文档
newAuthTypeResponse()
返回一个新的 GetAuthTypeResponse
对象。使用此对象可为您在脚本项目中实现的 getAuthType()
函数创建响应。
弃踢回攻
GetAuthTypeResponse
- 新的 GetAuthTypeResponse
对象。
newBigQueryConfig()
返回一个新的 BigQueryConfig
对象。使用此对象可为您在脚本项目中实现的 getData()
函数创建响应。
弃踢回攻
BigQueryConfig
- 新的 BigQueryConfig
对象。
newDebugError()
newGetDataResponse()
返回一个新的 GetDataResponse
对象。使用此对象可为您在脚本项目中实现的 getData()
函数创建响应。
弃踢回攻
GetDataResponse
- 新的 GetDataResponse
对象。
newGetSchemaResponse()
返回一个新的 GetSchemaResponse
对象。使用此对象可为您在脚本项目中实现的 getSchema()
函数创建响应。
弃踢回攻
GetSchemaResponse
- 新的 GetSchemaResponse
对象。
newSetCredentialsResponse()
返回一个新的 SetCredentialsResponse
对象。使用此对象可为您在脚本项目中实现的 setCredentials()
函数创建响应。