Class GetSchemaResponse

Get Schema Response

Builder to create a get Schema() response for your script project.

 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 
 (); 
 } 

Methods

Method Return type Brief description
Object Validates this object and returns it in the format needed by Data Studio.
String Prints the JSON representation of this object.
Get Schema Response Sets the Fields of the builder.

Detailed documentation

build()

Validates this object and returns it in the format needed by Data Studio.

Return

Object — The validated Get Schema Response object.


print Json()

Prints the JSON representation of this object. This is for debugging only.

Return

String


set Fields(fields)

Sets the Fields of the builder.

Parameters

Name Type Description
fields
Fields The fields to set.

Return

Get Schema Response — This builder, for chaining.

Design a Mobile Site
View Site in Mobile | Classic
Share by: