msgraph-beta-sdk-python icon indicating copy to clipboard operation
msgraph-beta-sdk-python copied to clipboard

Exception: Invalid key: Google for enum <enum 'ManagementAgentType'>.

Open fa-tech-net opened this issue 1 year ago • 0 comments
trafficstars

While fetching managed devices with the following call :

GraphServiceClient -> device_management.managed_devices.get()

  File "[...]\msgraph_beta\generated\models\managed_device.py", line 400, in <lambda>
    "managementAgent": lambda n : setattr(self, 'management_agent', n.get_enum_value(ManagementAgentType)),
  File "[...]\kiota_serialization_json\json_parse_node.py", line 201, in get_enum_value
    raise Exception(f'Invalid key: {camel_case_key} for enum {enum_class}.')
Exception: Invalid key: Google for enum <enum 'ManagementAgentType'>.

File generated is missing a management agent type google, in class ManagementAgentType from generated\models\management_agent_type.py

Manually adding the Google enum in the file fix the issue

fa-tech-net avatar Jan 24 '24 14:01 fa-tech-net