microsoft / Partner-Center-Java

Partner Center SDK for Java
https://docs.microsoft.com/java/partnercenter/
31 stars 12 forks source link

UserLocation empty for Users #28

Closed victor-ochoa-td closed 5 years ago

victor-ochoa-td commented 5 years ago

For version 1.10 it seems the UsageLocation within CustomerUser is broken and it's always returned by as null.

Steps to reproduce

  1. Get the list of Users for an ICustomer.
  2. Show UsageLocation value for all the Users
  3. All Users will have UsageLocation as null.
ICustomer customer = ...
for(CustomerUser user:customer.getUsers().get().getItems()) {
      System.out.println("User: " + user.getDisplayName());
      System.out.println("Location: " + user.getUsageLocation());                
}

Expected behavior

This is the Json from version 1.8:

{
    "__UsageLocation": "NL",
    "__Id": "f8b3f59a-7fff-4fe2-b491-b90fd33e114c",
    "__UserPrincipalName": "testUser@testvictor.onmicrosoft.com",
    "__FirstName": "Test",
    "__LastName": "User",
    "__DisplayName": "testUser",
    "__UserDomainType": "NONE",
    "__State": "ACTIVE",
    "__Links": {
        "__Self": {
            "__Uri": "/customers/ab1dd3c6-d8f0-4b05-9e5a-97a28453d960/users/f8b3f59a-7fff-4fe2-b491-b90fd33e114c",
            "__Method": "GET",
            "__Headers": []
        }
    },
    "attributes": {
        "__ObjectType": "CustomerUser"
    }
}

Actual behavior

This is the result from 1.10:

{
    "__Id": "f8b3f59a-7fff-4fe2-b491-b90fd33e114c",
    "__UserPrincipalName": "testUser@testvictor.onmicrosoft.com",
    "__FirstName": "Test",
    "__LastName": "User",
    "__DisplayName": "testUser",
    "__UserDomainType": "NONE",
    "__State": "ACTIVE",
    "__Links": {
        "__Self": {
            "__Uri": "/customers/ab1dd3c6-d8f0-4b05-9e5a-97a28453d960/users/f8b3f59a-7fff-4fe2-b491-b90fd33e114c",
            "__Method": "GET",
            "__Headers": []
        }
    },
    "attributes": {
        "__ObjectType": "CustomerUser"
    }
}

Environment

I've tested from Linux mint with Eclipse Oxygen. Partner center SDK: 1.8.1: for the correct response 1.10.0: for the incorrect version

ghost commented 5 years ago

Hi @victor-ochoa-td,

We just merged a change that includes a fix for this issue. Our hope is to release this updated version this week. Thank you for bring this issue to our attention. Please let us know if you have encountered any other issues.

victor-ochoa-td commented 5 years ago

Thanks for the quick fix!