Graph API错误将重复发生次数从“ noEnd”更改为“ numbered”

问题描述

我在Outlook中有一个与使用Google日历的与会者进行的活动。当我使用图形API将事件重复范围类型从“ noEnd”更改为“ numbered”时,Google参加者的事件不会得到更新。

这是我用于将重复设置为“ noEnd”的代码:

public async System.Threading.Tasks.Task SetDailyRecurrenceForever(string ExternalID,string CalendarRefreshToken)
    {
        var tmpEvent = new Microsoft.Graph.Event
        {
            Recurrence = new PatternedRecurrence
            {
                Pattern = new RecurrencePattern
                {
                    Type = RecurrencePatternType.Daily,Interval = 1,FirstDayOfWeek = Microsoft.Graph.DayOfWeek.Sunday,Index = WeekIndex.First
                },Range = new RecurrenceRange
                {
                    Type = RecurrenceRangeType.NoEnd,StartDate = new Microsoft.Graph.Date(2020,10,6),RecurrenceTimeZone = "Central Standard Time",NumberOfOccurrences = 0
                }
            }
        };

        var graphClient = await MicrosoftAuthenticationProvider.GetGraphClient(CALENDAR_CLIENT_ID,CALENDAR_CLIENT_SECRET,CALENDAR_REDIRECT_URI,CALENDAR_ACCESS_SCOPES,CalendarRefreshToken)
                .ConfigureAwait(false);

        
            await graphClient.Me.Events[ExternalID]
            .Request()
            .UpdateAsync(tmpEvent)
            .ConfigureAwait(false);           
    }

这是我用来将重复次数设置为“编号”的代码:

public async System.Threading.Tasks.Task SetDailyRecurrenceForFiveDays(string ExternalID,Range = new RecurrenceRange
                {
                    Type = RecurrenceRangeType.Numbered,NumberOfOccurrences = 5
                }
            }
        };

        var graphClient = await MicrosoftAuthenticationProvider.GetGraphClient(CALENDAR_CLIENT_ID,CalendarRefreshToken)
                .ConfigureAwait(false);


        await graphClient.Me.Events[ExternalID]
        .Request()
        .UpdateAsync(tmpEvent)
        .ConfigureAwait(false);
    }

通过使用图形浏览器发送PATCH,该错误也可以重复: https://graph.microsoft.com/v1.0/me/events/{ID}

将事件更新为“ noEnd”:

{"recurrence":{"pattern":{"type":"daily","interval":1,"month":0,"dayOfMonth":0,"firstDayOfWeek":"sunday","index":"first"},"range":{"type":"noEnd","startDate":"2020-10-06","endDate":"0001-01-01","recurrenceTimeZone":"Central Standard Time","numberOfOccurrences":0}}}

将事件更新为“已编号”:

{"recurrence":{"pattern":{"type":"daily","range":{"type":"numbered","numberOfOccurrences":5}}}

以下视频显示了Google与会者遇到的行为: https://www.screencast.com/t/uhwovvZf

注意:在视频的结尾,我表明将时间间隔切换为2会导致google事件正确更新,因此,当时间间隔为1时,这尤其是个问题。

这是一个已知的错误吗?有人有解决方法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...