Search code examples
google-admin-sdkgoogle-api-dotnet-clientgoogle-directory-api

Why is type of these User properties object: Addresses, Emails, Organizations, etc?


I am referring to the Google.Apis.Admin.Directory.directory_v1.Data.User type.

The property type of Addresses, for example, in beta versions (i.e. 1.7 and older) was

public virtual System.Collections.Generic.IList<UserAddress> Addresses { get; set; }

In later versions (currently 1.9.1), they are all of type object.

public virtual object Addresses { get; set; }

What are the reasons behind the change and usage scenarios?

I trawled the release notes, the web, google group, SO, etc. and found no explanation on this.


Solution

  • A change to the backend had the unintended consequence of changing the discovery document for the service, making the addresses field (and others) being marked as type=any. This causes problems for strongly types languages like .NET, as you've found. The team is aware of the issue but it's unclear when a fix will be available.