ReferenceError: ConferenceDataService не определен для надстройки конференц-связи G Suite Calendar - PullRequest
0 голосов
/ 05 марта 2020

Я пытаюсь поиграть с примером на https://developers.google.com/gsuite/add-ons/calendar/calendar-actions#setting_conference_data_with_a_callback_function, и я получаю сообщение об ошибке при доступе к некоторым API. В частности, когда я пытаюсь получить доступ к ConferenceDataService, я получаю сообщение об ошибке ниже.

ReferenceError: ConferenceDataService is not defined

Я подозреваю, что в документации отсутствует компонент для конференций G Suite Calendar.

В документации также отсутствует информация о свойстве "conferenceSolution" в манифесте, которое, по-видимому, необходимо для отображения в раскрывающемся списке "Добавить конференцию" для события Календаря Google.

Вот манифест

{
  "timeZone": "America/Mexico_City",
  "dependencies": {
    "enabledAdvancedServices": [{
      "userSymbol": "Calendar",
      "serviceId": "calendar",
      "version": "v3"
    }]
  },
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
   "oauthScopes": [
    "https://www.googleapis.com/auth/calendar.addons.execute", 
    "https://www.googleapis.com/auth/calendar.addons.current.event.read", 
    "https://www.googleapis.com/auth/calendar.addons.current.event.write", 
    "https://www.googleapis.com/auth/calendar.readonly", 
    "https://www.googleapis.com/auth/calendar.events.readonly", 
    "https://www.googleapis.com/auth/calendar.settings.readonly", 
    "https://www.googleapis.com/auth/gmail.addons.execute", 
    "https://www.googleapis.com/auth/script.external_request", 
    "https://www.googleapis.com/auth/script.scriptapp", 
    "https://www.googleapis.com/auth/script.locale", 
    "https://www.googleapis.com/auth/userinfo.email"],
  "urlFetchWhitelist": ["https://companyxyz.com/"],
  "addOns": {
    "common": {
      "name": "companyxyz Test",
      "logoUrl": "https://companyxyz.com/logo32.png",
      "layoutProperties": {
        "primaryColor": "#6963ff",
        "secondaryColor": "#1f2933"
      },
      "useLocaleFromApp": true,
      "homepageTrigger": {
        "runFunction": "onHomepage",
        "enabled": true
      },
      "universalActions": [{
        "label": "Learn more about company xyz",
        "openLink": "https://companyxyz.com"
      }]
    },
    "calendar": {
      "conferenceSolution": [{
        "onCreateFunction": "createConference",
        "id": "1",
        "name": "Company XYZ",
        "logoUrl": "https://companyxyz.com/images/logo192.png"
      }],
      "eventOpenTrigger": {
        "runFunction": "buildSimpleCard"
      },
      "currentEventAccess": "READ_WRITE"
    }
  }
}

А вот code.gs

function createConference(e) {
  Logger.log(e);
  var dataBuilder = ConferenceDataService.newConferenceDataBuilder();
  return dataBuilder.build();  
}

function onHomepage(e) {
}

function buildSimpleCard(e) {
}

Вызов ConferenceDataService.newConferenceDataBuilder() немедленно прерывается с ошибкой, указанной выше.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...