Class CommunityConnector

CommunityConnector

CommunityConnector 可讓指令碼存取建構工具和公用程式,協助開發數據分析的社群連接器。使用此類別取得 Fields 物件以及 FieldTypeAggregationType 列舉的參照,以便可用於 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);

屬性

屬性類型說明
AggregationTypeAggregationTypeAggregationType 列舉。
AuthTypeAuthTypeAuthType 列舉。
BigQueryParameterTypeBigQueryParameterTypeBigQueryParameterType 列舉。
FieldTypeFieldTypeFieldType 列舉。

方法

方法傳回類型簡短說明
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 物件。

內容詳盡的說明文件

getConfig()

傳回 Config 物件。使用這個物件新增設定項目。

回攻員

ConfigConfig 物件。


getFields()

傳回 Fields 物件。使用這個物件即可新增指標和維度 Field

回攻員

FieldsFields 物件。


newAuthTypeResponse()

傳回新的 GetAuthTypeResponse 物件。請使用這個物件,為您在指令碼專案中實作的 getAuthType() 函式建立回應。

回攻員

GetAuthTypeResponse:新的 GetAuthTypeResponse 物件。


newBigQueryConfig()

傳回新的 BigQueryConfig 物件。請使用這個物件,為您在指令碼專案中實作的 getData() 函式建立回應。

回攻員

BigQueryConfig:新的 BigQueryConfig 物件。


newDebugError()

傳回新的 DebugError 物件。請使用這個物件建立偵錯錯誤。

回攻員

DebugError:新的 DebugError 物件。


newGetDataResponse()

傳回新的 GetDataResponse 物件。請使用這個物件,為您在指令碼專案中實作的 getData() 函式建立回應。

回攻員

GetDataResponse:新的 GetDataResponse 物件。


newGetSchemaResponse()

傳回新的 GetSchemaResponse 物件。請使用這個物件,為您在指令碼專案中實作的 getSchema() 函式建立回應。

回攻員

GetSchemaResponse:新的 GetSchemaResponse 物件。


newSetCredentialsResponse()

傳回新的 SetCredentialsResponse 物件。請使用這個物件,為您在指令碼專案中實作的 setCredentials() 函式建立回應。

回攻員

SetCredentialsResponse:新的 SetCredentialsResponse 物件。


newUserError()

傳回新的 UserError 物件。請使用這個物件來建立使用者錯誤。

回攻員

UserError:新的 UserError 物件。