msgraph-sdk-php
msgraph-sdk-php copied to clipboard
Improve support for Enum Flags
Dear MS team,
We have a few win32LobApps (Beta model) in our Intune environment, where we can not access the applicableArchitectures property, due that it does not recognize the enumeration value "x86,x64"
Involved classes : Beta\Microsoft\Graph\Model\Beta\Microsoft\Win32LobApp Beta\Microsoft\Graph\Model\Beta\Microsoft\Graph\Model
In the attachments you can find a returned managed app data : ManagedApp_#microsoft.graph.win32LobApp.json.txt
Kind Regards
Tom Werkhoven
Hello @tomw-ucb,
Thank you for reporting the issue and sorry for the inconveniences. To support you better, could you please provide the version of the SDK you are using. You could also try using uppercase names for the Enum values, for example use X86
instead of x86
.
Hi Kenneth
We use the SDK microsoft/microsoft-graph v1.34.0 Graph endpoint https://graph.microsoft.com/beta/deviceAppManagement/mobileApps
We want to read the value of applicableArchitectures returned by Graph via the method of Beta\Microsoft\Graph\Model\Win32LobApp::getApplicableArchitectures(), but the class Beta\Microsoft\Graph\Model\WindowsArchitecture does not contain the Enum value for "x86,x64" (concatenated with a comma).
I guess the best way forward is to modify Win32LobApp::getApplicableArchitectures() to handle multiple values as already provided by Graph.
Regards, Tom
@SilasKenneth This is a missing feature. We need to support enums with flag values.
@tomw-ucb In the meantime, you'll need to use getProperties() to access the property dictionary to access those values.
@Ndiritu Regarding the conversation around supporting enums in PHP 8.1, I don't think enum flags are supported. We should consider this case.
(Update) v2 Preview allows setting Enum flags by comma separating values e.g. new WindowsArchitecture(WindowsArchitecture::X86.",".WindowsArchitecture::X86);
. Not the ideal solution. Can be improved.
Resolved in v2.0 of this SDK