스크립트 프로젝트의 setCredentials() 응답을 만드는 빌더입니다.
const communityConnector = DataStudioApp.createCommunityConnector(); function setCredentials(request) { const isValid = validateCredentials(request); if (isValid) { // store the credentials somewhere. } return communityConnector.newSetCredentialsResponse().setIsValid(isValid).build(); } function validateCredentials(request) { // ... }
메서드
| 메서드 | 반환 유형 | 간략한 설명 |
|---|---|---|
build() | Object | 이 객체의 유효성을 검사하고 Data Studio에 필요한 형식으로 반환합니다. |
print | String | 이 객체의 JSON 표현을 출력합니다. |
set | Set | 이 Set의 유효한 상태를 설정합니다. |
자세한 문서
build()
printJson()
이 객체의 JSON 표현을 출력합니다. 디버깅 전용입니다.
리턴
String
setIsValid(isValid)
이 SetCredentialsResponse의 유효한 상태를 설정합니다. 요청에 제공된 사용자 인증 정보가 유효한 경우 true로 설정하고, 그렇지 않은 경우 false로 설정합니다.
매개변수
| 이름 | 유형 | 설명 |
|---|---|---|
is | Boolean | 설정할 유효한 상태입니다. |
리턴
SetCredentialsResponse — 체이닝을 위한 이 빌더입니다.