Detection rule response action identifiers always return an empty list

Offen
#706 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
api

Rechercherichtung

Beginne mit dem Einstiegspunkt graph_client.security.rules.detection_rules.get() und der im Issue gezeigten Implementierung von ResponseAction get_field_deserializers. Verfolge, wie identifier generiert und deserialisiert wird, einschließlich des Quellschemas oder Generators, falls zutreffend. Als abgeschlossen gilt, wenn detection-rule response actions den passenden enum identifier statt einer leeren Liste zurückgeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

status:waiting-for-triage type:bug
Describe the bug

When calling a List or Get for detection rules, e.g. await self.graph_client.security.rules.detection_rules.get(), you get a DetectionRuleCollectionResponse.

This response contains a field detection_action.response_actions which is a list of type ResponseAction.

For a specific response action, e.g. IsolateDeviceResponseAction, the identifier field is always [] instead of the Enum it should be, e.g. identifier=<DeviceIdEntityIdentifier.DeviceId: 'deviceId'>.

I believe this is due to this code in the get_field_deserializers:

fields: Dict[str, Callable[[Any], None]] = {
    "identifier": lambda n : setattr(self, 'identifier', n.get_collection_of_enum_values(DeviceIdEntityIdentifier)),
    "isolationType": lambda n : setattr(self, 'isolation_type', n.get_enum_value(IsolationType)),
}

I suspect the get_collection_of_enum_values should be replaced with get_enum_value. Since I presume that this code is all generated, the root cause of this problem is probably somewhere else.

Expected behavior

Return the correct enum for all ResponseAction identifiers.

How to reproduce

Call await self.graph_client.security.rules.detection_rules.get() on a detection rule with a response action.

SDK Version

1.16.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

No response

Configuration
  • OS: MacOS 14.5
  • Architecture: Apple ARM
Other information

No response

Vorherrschende Sprache
Python
Sterne
44
Forks
16
Ø Merge
20 Std. 39 Min.
Gemergte PRs (30 T.)
3

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoftgraph/msgraph-beta-sdk-python

Alle Issues in microsoftgraph/msgraph-beta-sdk-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.