Class SetCredentialsResponse

SetCredentialsResponse

‫Builder כדי ליצור תשובה 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) {
  // ...
}

Methods

שיטהסוג הערך שמוחזרתיאור קצר
build()Objectמאמת את האובייקט הזה ומחזיר אותו בפורמט שנדרש על ידי Data Studio.
printJson()Stringמדפיס את הייצוג של האובייקט הזה ב-JSON.
setIsValid(isValid)SetCredentialsResponseהמאפיין הזה מגדיר את הסטטוס התקין של SetCredentialsResponse.

תיעוד מפורט

build()

מאמת את האובייקט הזה ומחזיר אותו בפורמט שנדרש על ידי Data Studio.

חזרה

Object – אובייקט SetCredentialsResponse שעבר אימות.


printJson()

מדפיס את הייצוג של האובייקט הזה ב-JSON. הפעולה הזו מיועדת לניפוי באגים בלבד.

חזרה

String


setIsValid(isValid)

המאפיין הזה מגדיר את הסטטוס התקין של SetCredentialsResponse. הערך שמוגדר הוא true אם פרטי הכניסה שסופקו בבקשה היו תקינים, אחרת הערך הוא false.

פרמטרים

שםסוגתיאור
isValidBooleanהסטטוס התקין שצריך להגדיר.

חזרה

SetCredentialsResponse – ה-builder הזה, לשרשור.