smarly-net / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
1 stars 1 forks source link

UserOrganization.Type is not returned from Users.Get(id).Execute() in v1.6 #419

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new VS 2012 Project running .NET 4.0.
2. Install-Package Google.Apis.Admin.Directory.directory_v1 -Pre
3. Add the attached Program.cs
4. (a)  Populate SERVICE_ACCOUNT_USER, SERVICE_ACCOUNT_EMAIL and 
SERVICE_ACCOUNT_PKCS12_FILE_PATH if you want to use a service account, or
   (b) (i) Populate CLIENT_ID and CLIENT_SECRET, 
      (ii) comment out var authToken = GetServiceCredential(..., and 
     (iii) uncomment var authToken = GetUserCredential(...,
   if you want to use a user account.
5.  Change the variables givenName, familyName, domainName to be appropriate 
for your directory.
6.  Change the password (apologies for the in-comment warning about changing 
this - it wasn't aimed at you but anyone using this code as an example.  If we 
need warnings on coffee cups about contents being hot...!  :-)

What is the expected output? What do you see instead?
I'd expect each instance of UserOrganization to have a Type property.  They 
don't.

There are four allowed values of Type, according to this page: 
https://developers.google.com/admin-sdk/directory/v1/reference/users, work, 
school, domain_only and unknown.

ASIDE: This is inconsistent with other User... objects (e.g. UserAddress) which 
allow 'custom' and then allow you to define the custom type name in .CustomType.

CustomType exists on UserOrganization but the reason to use it is unclear, 
because 'custom' is not an acceptable value for Type.  Because of that
I create two instances of UserOrganization for each type: the first contains 
all properties except CustomType and the second contains all including a 
CustomType.

CustomType is returned (populated or empty) on all eight instances.  Type is 
not.  For example:

CustomType:  unknownOffice
Name:        MyOrganization 5
CostCenter:  41234
Department:  MyDepartment
Description: My description
Domain:      my.domain
Location:    MyLocation
Primary:
Title:       MyTitle
Symbol:      SYMBOL
Title:       MyTitle

Results.txt contains the full output.

What version of the product are you using? v1.6 
(Google.Apis.Admin.Directory.directory_v1.1.6.0.20-beta)
What is your operating system? Windows 7 SP1 (recently patched)
What is your IDE? Visual Studio Express 2012 for Windows Desktop 
What is the .NET framework version? 4.0

Please provide any additional information below.
Code won't run with 4.5 with user credentials because 
Microsoft.Bcl.Async.1.0.165 doesn't contain  
Microsoft.Threading.Tasks.Extensions.Desktop.dll for 4.5.

Original issue reported on code.google.com by simon.ga...@gmail.com on 17 Nov 2013 at 11:55

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 18 Nov 2013 at 3:21