msgraph-sdk-php icon indicating copy to clipboard operation
msgraph-sdk-php copied to clipboard

Invalid enum value appleACMEDEPUDAModernAuth

Open a0z0 opened this issue 11 months ago • 6 comments

Describe the bug

Unable to retrieve managed device list.

Expected behavior

ManagedDevice object can be obtained.

How to reproduce

$requestConfiguration = new ManagedDevicesRequestBuilderGetRequestConfiguration(); $queryParameters = ManagedDevicesRequestBuilderGetRequestConfiguration::createQueryParameters(); $requestConfiguration->queryParameters = $queryParameters;

$result = $graphServiceClient->deviceManagement()->managedDevices()->get($requestConfiguration)->wait();

SDK Version

v2.23.0

Latest version known to work for scenario above?

No response

Known Workarounds

Add the following to Models/DeviceEnrollmentType.php public const APPLE_ACME_DEP_UDA_MODERN_AUTH = "appleACMEDEPUDAModernAuth";

Debug output

Click to expand log ``` InvalidArgumentException: Invalid enum value appleACMEDEPUDAModernAuth in /var/www/exment/vendor/microsoft/kiota-abstractions/src/Enum.php:57 Stack trace: #0 /var/www/exment/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(170): Microsoft\Kiota\Abstractions\Enum->__construct() #1 /var/www/exment/vendor/microsoft/microsoft-graph/src/Generated/Models/ManagedDevice.php(369): Microsoft\Kiota\Serialization\Json\JsonParseNode->getEnumValue() #2 /var/www/exment/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(147): Microsoft\Graph\Generated\Models\ManagedDevice->Microsoft\Graph\Generated\Models\{closure}() #3 /var/www/exment/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(120): Microsoft\Kiota\Serialization\Json\JsonParseNode->assignFieldValues() #4 /var/www/exment/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(95): Microsoft\Kiota\Serialization\Json\JsonParseNode->getObjectValue() #5 [internal function]: Microsoft\Kiota\Serialization\Json\JsonParseNode::Microsoft\Kiota\Serialization\Json\{closure}() #6 /var/www/exment/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(94): array_map() #7 /var/www/exment/vendor/microsoft/microsoft-graph/src/Generated/Models/ManagedDeviceCollectionResponse.php(35): Microsoft\Kiota\Serialization\Json\JsonParseNode->getCollectionOfObjectValues() #8 /var/www/exment/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(147): Microsoft\Graph\Generated\Models\ManagedDeviceCollectionResponse->Microsoft\Graph\Generated\Models\{closure}() #9 /var/www/exment/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(120): Microsoft\Kiota\Serialization\Json\JsonParseNode->assignFieldValues() #10 /var/www/exment/vendor/microsoft/kiota-http-guzzle/src/GuzzleRequestAdapter.php(170): Microsoft\Kiota\Serialization\Json\JsonParseNode->getObjectValue() #11 /var/www/exment/vendor/php-http/promise/src/FulfilledPromise.php(39): Microsoft\Kiota\Http\GuzzleRequestAdapter->Microsoft\Kiota\Http\{closure}() #12 /var/www/exment/vendor/microsoft/kiota-http-guzzle/src/GuzzleRequestAdapter.php(145): Http\Promise\FulfilledPromise->then() #13 /var/www/exment/vendor/microsoft/microsoft-graph/src/Generated/DeviceManagement/ManagedDevices/ManagedDevicesRequestBuilder.php(65): Microsoft\Kiota\Http\GuzzleRequestAdapter->sendAsync() #14 /var/www/exment/storage/app/plugins/MsDeviceSync/Graph.php(149): Microsoft\Graph\Generated\DeviceManagement\ManagedDevices\ManagedDevicesRequestBuilder->get() ```

Configuration

No response

Other information

No response

a0z0 avatar Jan 10 '25 06:01 a0z0

https://github.com/microsoftgraph/msgraph-sdk-php/issues/1605

a0z0 avatar Jan 10 '25 07:01 a0z0

@a0z0 Thank you for reporting this and sharing a workaround. I have escalated this to the API team to update their API schema since the SDK's models are generated based on it.

Ndiritu avatar Jan 13 '25 09:01 Ndiritu

Internal IcM

Ndiritu avatar Jan 13 '25 09:01 Ndiritu

Please be sure to reference the msgraph-sdk-dotnet issue (Missing Enumeration Members #2735) I opened up on November 7

jbh999 avatar Jan 13 '25 16:01 jbh999

@jbh999 the .NET issue has been referenced as well. The fix should cascade across all languages.

Ndiritu avatar Jan 14 '25 05:01 Ndiritu

@Ndiritu I appreciate that! ... Do you have an estimate as to when the SDK will be updated with these changes?

jbh999 avatar Jan 14 '25 13:01 jbh999