(self, obj)
| 11402 | return raw |
| 11403 | |
| 11404 | def _drive_person_from_obj(self, obj): |
| 11405 | if not isinstance(obj, dict): |
| 11406 | return None |
| 11407 | name = obj.get("name") or obj.get("displayName") or obj.get("display_name") or obj.get("fullName") or "" |
| 11408 | if not name and isinstance(obj.get("user"), dict): |
| 11409 | nested = obj.get("user") or {} |
| 11410 | name = nested.get("name") or nested.get("displayName") or "" |
| 11411 | email = obj.get("emailAddress") or obj.get("email") or "" |
| 11412 | if not email and isinstance(obj.get("user"), dict): |
| 11413 | nested = obj.get("user") or {} |
| 11414 | email = nested.get("emailAddress") or nested.get("email") or "" |
| 11415 | google_id = obj.get("id") or obj.get("permissionId") or "" |
| 11416 | if not google_id and isinstance(obj.get("user"), dict): |
| 11417 | google_id = (obj.get("user") or {}).get("id") or "" |
| 11418 | if not (name or email or google_id): |
| 11419 | return None |
| 11420 | |
| 11421 | domain = obj.get("domain") or "" |
| 11422 | if not domain and "@" in str(email): |
| 11423 | domain = str(email).split("@", 1)[1] |
| 11424 | return { |
| 11425 | "name": str(name).strip(), |
| 11426 | "email": str(email).strip(), |
| 11427 | "id": str(google_id).strip(), |
| 11428 | "domain": str(domain).strip(), |
| 11429 | } |
| 11430 | |
| 11431 | def _drive_people_from_list(self, people): |
| 11432 | out = [] |
no outgoing calls
no test coverage detected