microsoftgraph / microsoftgraph/msgraph-beta-sdk-java

Missing Device attributes

Đang mở
#996 8 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

dependency:metadata type:bug
Ngôn ngữ chính
Java
Star
32
Fork
14
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
6

Mô tả

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 https://github.com/microsoftgraph/msgraph-beta-sdk-java/issues/838 and https://github.com/microsoftgraph/msgraph-beta-sdk-java/issues/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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với src/main/java/com/microsoft/graph/beta/generated/models/Device.java và so sánh các thuộc tính của nó với phản hồi API và metadata beta được liên kết trong issue. Kiểm tra các issue liên quan #838 và #499 để biết cách tiếp cận đã được thiết lập. Hoàn tất nghĩa là Java SDK cung cấp các thuộc tính Device được liệt kê và có thể truy cập chúng khi chúng được API trả về.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.