迁移Google API实用程序,截止日期为2019年3月25日

时间:2018-03-27 08:09:07

标签: google-api

我昨天收到了来自 Google开发团队的电子邮件,其中包含此声明:

  

谨以此邮件通知您,JSON-RPCGlobal HTTP batch端点将于2018年3月26日弃用,并且自2019年3月25日起不再有效。

他们的指示是:<​​/ p>

  

请在2019年3月25日之前迁移下面列出的受影响项目的应用程序。我们知道这些更改会对客户产生影响,并且已尽力使转换步骤尽可能明确。有关如何迁移现有API客户端库的详细信息,请参阅Google Developers Blog post

我浏览了那篇文章,并说:

  

Google API Client Libraries已重新生成,不再向全局HTTP批处理终结点发出请求。使用这些库的客户端必须升级到最新版本。不使用Google API客户端库和/或对JSON-RPC端点或HTTP批量端点进行自定义调用的客户端需要进行下面列出的更改。

在给我的电子邮件中,他们明确表示我的项目会受到影响。它是一个与V3 Calendar API一起使用的Visual Basic .Net应用程序。我已经使用批次设施。

目前我正在使用Google API版本 1.29.2 ,但我发现有更新的版本:

Nuget Package Updates

为了符合这种调整,我真的不清楚我需要做什么?如果我们需要帮助,上述博客文章鼓励我们使用google-api标记问题。

帮助!谢谢!

以下是我如何使用批量请求的示例:

Dim oBatchRequest = New Google.Apis.Requests.BatchRequest(m_Service)
...
...
Dim oTaskDelete = oBatchRequest.ExecuteAsync()
oTaskDelete.Wait()

现在我很清楚哪个版本的API库使用这种新的方法,他们通过电子邮件发送给我。如果有帮助,我使用的范围是:

m_Scopes.Add("https://www.googleapis.com/auth/calendar "
             "https://www.google.com/m8/feeds/ "
             "https://mail.google.com/")

我刚刚将包从v1.29.2更新为v1.32.2并进行了完整编译并且没有错误。我做了一个测试同步,看起来它正在工作。

My Inno Setup脚本目前在用户计算机上安装这些文件:

; Google Calendar Interface v3
Source: "Google.Apis.Auth.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.Apis.Auth.PlatformServices.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.Apis.Calendar.v3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.Apis.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.Apis.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.Apis.PlatformServices.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.GData.Client.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.GData.Contacts.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Google.GData.Extensions.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "GoogleAuthandSync.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "GoogleAuthandSync.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "Microsoft.Threading.Tasks.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Microsoft.Threading.Tasks.Extensions.Desktop.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Microsoft.Threading.Tasks.Extensions.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "System.Net.Http.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "System.Net.Http.Extensions.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "System.Net.Http.Primitives.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Zlib.Portable.dll"; DestDir: "{app}"; Flags: ignoreversion

我的文件夹实际上有这些文件:

D:\My Programs\2017\GoogleAuthandSync\GoogleAuthandSync\bin\Release>dir *.dll
 Volume in drive D is DATA
 Volume Serial Number is A8B0-A5C6

 Directory of D:\My Programs\2017\GoogleAuthandSync\GoogleAuthandSync\bin\Release

26/04/2016  12:16         2,236,416 BouncyCastle.Crypto.dll
08/02/2018  11:32           105,472 Google.Apis.Auth.dll
08/02/2018  11:32             5,120 Google.Apis.Auth.PlatformServices.dll
26/03/2018  08:38            89,600 Google.Apis.Calendar.v3.dll
08/02/2018  11:32            67,072 Google.Apis.Core.dll
08/02/2018  11:32            71,680 Google.Apis.dll
08/02/2018  11:32             4,096 Google.Apis.PlatformServices.dll
25/06/2013  11:24           212,992 Google.GData.Client.dll
25/06/2013  11:33            29,184 Google.GData.Contacts.dll
25/06/2013  11:27            90,112 Google.GData.Extensions.dll
08/03/2017  20:26           276,480 log4net.dll
18/06/2017  13:57           653,824 Newtonsoft.Json.dll
13/08/2013  01:19            27,296 System.Data.DataSetExtensions.dll
13/08/2013  01:19         1,172,568 System.Data.dll
13/08/2013  01:19            63,064 System.Net.dll
05/09/2017  14:54           197,984 System.Net.Http.dll
19/02/2015  21:10            22,232 System.Net.Http.Extensions.dll
19/02/2015  21:10            21,720 System.Net.Http.Primitives.dll
05/11/2016  05:57            39,872 System.Security.Cryptography.Algorithms.dll
05/11/2016  05:57            23,480 System.Security.Cryptography.Encoding.dll
05/11/2016  05:57            22,816 System.Security.Cryptography.Primitives.dll
05/09/2017  14:54            38,872 System.Security.Cryptography.X509Certificates.dll
13/08/2013  01:19           921,688 System.XML.dll
13/08/2013  01:19            43,112 System.Xml.Linq.dll
22/06/2015  09:00            81,920 Zlib.Portable.dll
              25 File(s)      6,518,672 bytes
               0 Dir(s)  717,216,362,496 bytes free

所以这些看起来更多:

26/04/2016  12:16         2,236,416 BouncyCastle.Crypto.dll
08/03/2017  20:26           276,480 log4net.dll
13/08/2013  01:19            27,296 System.Data.DataSetExtensions.dll
13/08/2013  01:19         1,172,568 System.Data.dll
13/08/2013  01:19            63,064 System.Net.dll
05/11/2016  05:57            39,872 System.Security.Cryptography.Algorithms.dll
05/11/2016  05:57            23,480 System.Security.Cryptography.Encoding.dll
05/11/2016  05:57            22,816 System.Security.Cryptography.Primitives.dll
05/09/2017  14:54            38,872 System.Security.Cryptography.X509Certificates.dll

我必须取消它们吗?

2 个答案:

答案 0 :(得分:3)

如果您只调用单个API(日历v3),则批量请求将是同质的,除了升级客户端库之外,您不需要更改代码。

答案 1 :(得分:0)

如果您直接在PHP中创建\ Google_Http_Batch对象,则应遵循以下comment

$service = new \Google_Service_Calendar();
$batch = $service->createBatch();