Skip to content

Missing Enumeration Members #2735

@jbh999

Description

@jbh999

Describe the bug

Deserializing the JSON response from the getManagedDevice API endpoint (no issue here) and then casting it into a ManagedDevice object throws an exception.


The JSON response returned from the API includes:

"managementAgent": "intuneAosp"
"deviceEnrollmentType": "androidAOSPUserOwnedDeviceEnrollment"

Neither of these values have a member in the associated enumerations contained in the ManagedDevice class:
ManagementAgentType enumeration does not have an intuneAosp member
DeviceEnrollmentType enumeration does not have an androidAOSPUserOwnedDeviceEnrollment member

Casting the deserialized response from the getManagedDevice API results in the following exception:

Newtonsoft.Json.JsonSerializationException: Error converting value "intuneAosp" to type 'System.Nullable`1[Microsoft.Graph.ManagementAgentType]'. Path '[1].managementAgent'.
---> System.ArgumentException: Requested value 'intuneAosp' was not found.

Expected behavior

Ability to deserialize the JSON response from getManagedDevice API endpoint and cast it into a ManagedDevice object

How to reproduce

  1. Enroll a DigiLens (Set up Intune enrollment for Android (AOSP) corporate-owned user-associated devices)

  2. Call the getManagedDevice API

  3. Review the JSON (API returns success and a valid JSON response)
    "managementAgent": "intuneAosp"
    "deviceEnrollmentType": "androidAOSPUserOwnedDeviceEnrollment"

  4. Deserializing the JSON response and casting it into a ManagedDevice object results in the exception

SDK Version

No response

Latest version known to work for scenario above?

Never worked

Known Workarounds

None that I know of

Debug output

Click to expand log ```
</details>


### Configuration

Windows 11 x64

Not related to any specific configuration

### Other information

• [ManagementAgentType enumeration](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/c75439214c6752d0dff406ab4b0905a4369a7b5d/src/Microsoft.Graph/Generated/Models/ManagementAgentType.cs) requires an `intuneAosp` member
• [DeviceEnrollmentType enumeration](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/c75439214c6752d0dff406ab4b0905a4369a7b5d/src/Microsoft.Graph/Generated/Models/DeviceEnrollmentType.cs) requires an `androidAOSPUserOwnedDeviceEnrollment` member

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions