我正在使用Node.js Google客户端API创建一个Google日历事件,我要求使用以下对象使用该事件创建会议:
eval()
我从服务器返回一条错误消息:def main():
terminate = False
print("Welcome to the self-checkout system at Wake-Mart.")
count, total = scan_prices()
print('')
disc = discount(count, total)
print('')
promo = promotion(count, total)
balance = total
def scan_prices():
total = 0
count = 0
prices = float(input("Enter the price of the first item:"))
while prices > 0:
count +=1
total = total + prices
print("Number of items:", count, "Total:", total)
prices = float(input("Eneter the price of the next item [or 0 to stop]:"))
while prices < 0:
print("Price cannot be negative.")
prices = float(input("Eneter the price of the next item [or 0 to stop]:"))
if prices > 0:
count +=1
total = total + prices
print("Number of items:", count, "Total:", total)
prices = float(input("Eneter the price of the next item [or 0 to stop]:"))
continue
return count, total
def discount(count, total):
if count >= 10:
print("You've got a 10% discount for buying 10 items or more.")
total = total * .9
print("Number of items:", count, "Total:", total)
return total
def promotion(count, total):
if total >= 50:
card = input(print("Do you want to buy a $50 gift card for $40 [y/n]:"))
if card == 'Y' or 'y':
print("Thank you for buying a giftcard.")
count +=1
total = (total * .9) + 40
print("Number if items:", count, "Total:", total)
else:
print("Thank for your purchases.")
print("Number if items:", count, "Total:", (total * .9))
return count, total
main()
没有任何意义,因为根据this documentation var conferenceData =
{
createRequest:
{
requestId: uuid(),
conferenceSolutionKey:
{
type: "hangoutsMeet"
}
}
}
,这是一个可接受的值:
可能的值为:
- “ eventHangout ”(针对消费者的环聊(http://hangouts.google.com)
- “ eventNamedHangout ”,适用于G Suite用户(http://hangouts.google.com)的经典环聊
- “ hangoutsMeet ”进行环聊聚会(http://meet.google.com)
有人知道为什么它会返回该错误吗?
答案 0 :(得分:0)
您的uuid()返回字符串吗?
并尝试像这样的东西:
props.setProperty("ner.useSUTime", "0");
答案 1 :(得分:0)
我现在正面临着同样的问题。 我认为这实际上是由于您尝试插入事件的日历不接受“ hangoutsMeet”电话会议类型而造成的。
您可以通过使用API来获取日历设置详细信息,以在ConferenceProperties.allowedConferenceSolutionTypes中进行检查: -https://developers.google.com/calendar/v3/reference/calendars/get -https://developers.google.com/calendar/v3/reference/calendars#resource
对于我的特殊情况,我可以观察到日历仅支持“ eventNamedHangout”,而未列出“ hangoutsMeet”。
话虽这么说,但我不知道如何真正确保特定的日历资源支持“ hangoutsMeet”类型。
修改
似乎我的问题出在我使用GCP服务帐户这一事实上-在这种情况下,我观察到的是仅支持eventNamedHangout类型。 通过oauth舞蹈获得的具有access_token的API将完全相同的有效载荷发送给API时,hangoutsMeet可用。
答案 2 :(得分:0)
我已经开始工作了。根据您所指的events docs,如果提供conferenceSolution
,则还必须至少提供一个entryPoint
。否则,请使用createRequest
:
“ conferenceSolution和至少一个entryPoint或createRequest是必需的。”