Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Device attributes #996

Open
cnotin opened this issue Jun 28, 2024 · 5 comments
Open

Missing Device attributes #996

cnotin opened this issue Jun 28, 2024 · 5 comments
Labels
dependency:metadata Awaiting fix from core dependency project module type:bug A broken experience

Comments

@cnotin
Copy link

cnotin commented Jun 28, 2024

Describe the bug

The Device class https://github.com/microsoftgraph/msgraph-beta-sdk-java/blob/main/src/main/java/com/microsoft/graph/beta/generated/models/Device.java has several attributes missing in this SDK (and certainly others) compared to what's returned by the API:

  • createdDateTime
  • deletedDateTime (available, actually)
  • externalSourceName
  • sourceType

Here's the proof that they are returned by the API:

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#devices",
  "value": [
    {
      "id": "15b8b2c6-5056-412c-ad0f-4f06e0f140c2",
      "deletedDateTime": null,
[...}
      "createdDateTime": "2023-12-12T07:50:41Z",
[...]
      "externalSourceName": null,
[...]
      "sourceType": null,
[...]
    },

When using the PowerShell Graph SDK, they are available via AdditionalProperties
These are also not documented.

I suppose this is because the metadata of the Graph API doesn't return those. So the issue is similar to #838 and #499

Device in metadata
<EntityType Name="device" BaseType="graph.directoryObject" OpenType="true">
<Property Name="accountEnabled" Type="Edm.Boolean"/>
<Property Name="alternativeSecurityIds" Type="Collection(graph.alternativeSecurityId)" Nullable="false"/>
<Property Name="approximateLastSignInDateTime" Type="Edm.DateTimeOffset"/>
<Property Name="complianceExpirationDateTime" Type="Edm.DateTimeOffset"/>
<Property Name="deviceCategory" Type="Edm.String"/>
<Property Name="deviceId" Type="Edm.String"/>
<Property Name="deviceMetadata" Type="Edm.String"/>
<Property Name="deviceOwnership" Type="Edm.String"/>
<Property Name="deviceVersion" Type="Edm.Int32"/>
<Property Name="displayName" Type="Edm.String"/>
<Property Name="domainName" Type="Edm.String"/>
<Property Name="enrollmentProfileName" Type="Edm.String"/>
<Property Name="enrollmentType" Type="Edm.String"/>
<Property Name="extensionAttributes" Type="graph.onPremisesExtensionAttributes"/>
<Property Name="hostnames" Type="Collection(Edm.String)"/>
<Property Name="isCompliant" Type="Edm.Boolean"/>
<Property Name="isManaged" Type="Edm.Boolean"/>
<Property Name="isManagementRestricted" Type="Edm.Boolean"/>
<Property Name="isRooted" Type="Edm.Boolean"/>
<Property Name="managementType" Type="Edm.String"/>
<Property Name="manufacturer" Type="Edm.String"/>
<Property Name="mdmAppId" Type="Edm.String"/>
<Property Name="model" Type="Edm.String"/>
<Property Name="onPremisesLastSyncDateTime" Type="Edm.DateTimeOffset"/>
<Property Name="onPremisesSecurityIdentifier" Type="Edm.String"/>
<Property Name="onPremisesSyncEnabled" Type="Edm.Boolean"/>
<Property Name="operatingSystem" Type="Edm.String"/>
<Property Name="operatingSystemVersion" Type="Edm.String"/>
<Property Name="physicalIds" Type="Collection(Edm.String)" Nullable="false"/>
<Property Name="profileType" Type="Edm.String"/>
<Property Name="registrationDateTime" Type="Edm.DateTimeOffset"/>
<Property Name="systemLabels" Type="Collection(Edm.String)" Nullable="false"/>
<Property Name="trustType" Type="Edm.String"/>
<Property Name="kind" Type="Edm.String"/>
<Property Name="name" Type="Edm.String"/>
<Property Name="platform" Type="Edm.String"/>
<Property Name="status" Type="Edm.String"/>
<NavigationProperty Name="usageRights" Type="Collection(graph.usageRight)" ContainsTarget="true"/>
<NavigationProperty Name="memberOf" Type="Collection(graph.directoryObject)"/>
<NavigationProperty Name="registeredOwners" Type="Collection(graph.directoryObject)"/>
<NavigationProperty Name="registeredUsers" Type="Collection(graph.directoryObject)"/>
<NavigationProperty Name="transitiveMemberOf" Type="Collection(graph.directoryObject)"/>
<NavigationProperty Name="extensions" Type="Collection(graph.extension)" ContainsTarget="true"/>
<NavigationProperty Name="commands" Type="Collection(graph.command)" ContainsTarget="true"/>
<Annotation Term="Org.OData.Core.V1.AlternateKeys">
<Collection>
<Record Type="Org.OData.Core.V1.AlternateKey">
<PropertyValue Property="Key">
<Collection>
<Record Type="Org.OData.Core.V1.PropertyRef">
<PropertyValue Property="Alias" String="deviceId"/>
<PropertyValue Property="Name" PropertyPath="deviceId"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Collection>
</Annotation>
</EntityType>

Expected behavior

Be able to get these Device attributes

How to reproduce

Use the Java (or other) Graph SDK and try accessing these properties of a Device

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

Call the API directly

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@Ndiritu
Copy link
Contributor

Ndiritu commented Jul 15, 2024

Thanks for raising this issue @cnotin.

While we resolve the issue with the API service team. You can also use getAdditionalData() to get key-value pairs for the missing properties.

Minor sidenote: getDeletedDateTime is available on the Device model via inheritance.

@Ndiritu Ndiritu added the type:bug A broken experience label Jul 15, 2024
@cnotin
Copy link
Author

cnotin commented Jul 17, 2024

Thank you! We'll monitor this then ;)
And we noted the workaround.

@Ndiritu Ndiritu added the dependency:metadata Awaiting fix from core dependency project module label Sep 23, 2024
@cnotin
Copy link
Author

cnotin commented Oct 25, 2024

I wanted to share that the workaround works 👌thx!
but of course, we're looking forward to have it as a normal attribute 😉
If that helps: in similar cases, @baywet created an ICM for the graph team #499 (comment)

@baywet
Copy link
Member

baywet commented Oct 25, 2024

Thanks for the nudge: deletedDateTime is already available as a property on directoryObject (parent type)

I have created an ICM on the relevant team about this. https://portal.microsofticm.com/imp/v5/incidents/details/558471350/summary

@Ndiritu can you go subscribe to it please as I'll be out of office soon, I'd like you to follow up on it.

@cnotin
Copy link
Author

cnotin commented Oct 25, 2024

deletedDateTime is indeed available (updated my original report)

Merci Vincent :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency:metadata Awaiting fix from core dependency project module type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

3 participants