Class GetSchemaResponse

  • GetSchemaResponse is a builder used to create agetSchema() response for your script project.

  • Thebuild() method validates and returns the object in the format Data Studio needs.

  • TheprintJson() method prints the JSON representation of the object for debugging.

  • ThesetFields(fields) method sets the fields for the builder.

GetSchemaResponse

Builder to create agetSchema() response for your script project.

functiongetSchema(){constcc=DataStudioApp.createCommunityConnector();constfields=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);returncc.newGetSchemaResponse().setFields(fields).build();}

Methods

MethodReturn typeBrief description
build()ObjectValidates this object and returns it in the format needed by Data Studio.
printJson()StringPrints the JSON representation of this object.
setFields(fields)GetSchemaResponseSets theFields of the builder.

Detailed documentation

build()

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

Return

Object — The validatedGetSchemaResponse object.


printJson()

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

Return

String


setFields(fields)

Sets theFields of the builder.

Parameters

NameTypeDescription
fieldsFieldsThe fields to set.

Return

GetSchemaResponse — This builder, for chaining.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.