ms-python-client
Advanced tools
| from typing import Mapping, Optional | ||
| from ms_python_client.ms_client_interface import MSClientInterface | ||
| class UsersComponent: | ||
| def __init__(self, client: MSClientInterface) -> None: | ||
| self.client = client | ||
| def list_users( | ||
| self, | ||
| parameters: Optional[Mapping[str, str]] = None, | ||
| extra_headers: Optional[Mapping[str, str]] = None, | ||
| ) -> dict: | ||
| """List all users | ||
| Args: | ||
| parameters (Optional[Mapping[str, str]], optional): Parameters for the request. Defaults to None. | ||
| extra_headers (Optional[Mapping[str, str]], optional): Additional headers for the request. Defaults to None. | ||
| Returns: | ||
| dict: The response of the request | ||
| """ | ||
| api_path = "/users" | ||
| response = self.client.make_get_request(api_path, parameters, extra_headers) | ||
| return response.json() |
@@ -7,2 +7,3 @@ import logging | ||
| from ms_python_client.utils.event_generator import ( | ||
| ZOOM_ID_EXTENDED_PROPERTY_ID, | ||
| EventParameters, | ||
@@ -62,3 +63,9 @@ PartialEventParameters, | ||
| """ | ||
| parameters = {"$count": "true", "$filter": f"contains(subject,'{zoom_id}')"} | ||
| parameters = { | ||
| "$count": "true", | ||
| "$filter": f"singleValueExtendedProperties/Any(ep: ep/id eq \ | ||
| '{ZOOM_ID_EXTENDED_PROPERTY_ID}' and ep/value eq '{zoom_id}')", | ||
| "$expand": f"singleValueExtendedProperties($filter=id eq \ | ||
| '{ZOOM_ID_EXTENDED_PROPERTY_ID}')", | ||
| } | ||
| response = self.events_component.list_events(user_id, parameters, extra_headers) | ||
@@ -65,0 +72,0 @@ |
@@ -11,3 +11,3 @@ import atexit | ||
| from ms_python_client.components.events.events_component import EventsComponent | ||
| from ms_python_client.components.events.users_component import UsersComponent | ||
| from ms_python_client.components.users.users_component import UsersComponent | ||
| from ms_python_client.ms_client_interface import MSClientInterface | ||
@@ -14,0 +14,0 @@ from ms_python_client.utils import init_from_env |
@@ -57,2 +57,7 @@ import datetime | ||
| ZOOM_ID_EXTENDED_PROPERTY_ID = ( | ||
| "String {d3123b00-8eb5-4f10-ae88-1269fe4cbaf0} Name ZoomId" | ||
| ) | ||
| def create_event_body(event_parameters: EventParameters) -> dict: | ||
@@ -77,7 +82,3 @@ """Creates an event from the given parameters | ||
| return { | ||
| "subject": f"[{event_parameters['zoom_id']}] {event_parameters['subject']}", | ||
| "body": { | ||
| "contentType": "text", | ||
| "content": f"Zoom URL: {event_parameters['zoom_url']}", | ||
| }, | ||
| "subject": event_parameters["subject"], | ||
| "start": { | ||
@@ -106,2 +107,8 @@ "dateTime": datetime.datetime.fromisoformat( | ||
| "onlineMeetingUrl": event_parameters["zoom_url"], | ||
| "singleValueExtendedProperties": [ | ||
| { | ||
| "id": ZOOM_ID_EXTENDED_PROPERTY_ID, | ||
| "value": event_parameters["zoom_id"], | ||
| } | ||
| ], | ||
| } | ||
@@ -131,6 +138,2 @@ | ||
| { | ||
| "body": { | ||
| "contentType": "text", | ||
| "content": f"Zoom URL: {event_parameters['zoom_url']}", | ||
| }, | ||
| "location": { | ||
@@ -149,3 +152,3 @@ "displayName": event_parameters["zoom_url"], | ||
| { | ||
| "subject": f"[{event_parameters['zoom_id']}] {event_parameters['subject']}" | ||
| "subject": event_parameters["subject"], | ||
| } | ||
@@ -152,0 +155,0 @@ ) |
+6
-6
| Metadata-Version: 2.1 | ||
| Name: ms-python-client | ||
| Version: 1.0.2 | ||
| Version: 1.0.3 | ||
| Summary: This package is used to interact with the microsoft graph API | ||
@@ -17,3 +17,3 @@ License: MIT | ||
| Requires-Dist: requests (>=2.31.0,<3.0.0) | ||
| Project-URL: Bug Tracker, https://github.com/SamuelGuillemet/ms-python-client/issues | ||
| Project-URL: Bug Tracker, https://github.com/cern-vc/ms-python-client/issues | ||
| Description-Content-Type: text/markdown | ||
@@ -23,6 +23,6 @@ | ||
| [](https://github.com/SamuelGuillemet/ms-python-client/actions/workflows/python-tests.yml) | ||
| [](https://github.com/SamuelGuillemet/ms-python-client/actions/workflows/pre-commit.yaml) | ||
| [](https://github.com/SamuelGuillemet/ms-python-client/actions/workflows/codeql-analysis.yml) | ||
| [](https://codecov.io/gh/SamuelGuillemet/MS-python-client) | ||
| [](https://github.com/cern-vc/ms-python-client/actions/workflows/python-tests.yml) | ||
| [](https://github.com/cern-vc/ms-python-client/actions/workflows/pre-commit.yaml) | ||
| [](https://github.com/cern-vc/ms-python-client/actions/workflows/codeql-analysis.yml) | ||
| [](https://codecov.io/gh/cern-vc/MS-python-client) | ||
@@ -29,0 +29,0 @@ Microsoft graph API Python client with support for [Server to Server Oauth tokens](https://learn.microsoft.com/en-us/graph/auth/auth-concepts?view=graph-rest-1.0) with App Only access. |
+5
-5
| [tool.poetry] | ||
| name = "ms-python-client" | ||
| version = "1.0.2" | ||
| version = "1.0.3" | ||
| exclude = ["tests*", "example*", ".github*", ".git*", ".vscode*"] | ||
@@ -17,7 +17,7 @@ description = "This package is used to interact with the microsoft graph API" | ||
| [tool.poetry.dev-dependencies] | ||
| black = "23.3.0" | ||
| [tool.poetry.group.dev.dependencies] | ||
| black = "23.7.0" | ||
| flake8 = "6.0.0" | ||
| isort = "5.12.0" | ||
| pre-commit = "2.15.0" | ||
| pre-commit = "3.3.3" | ||
| mypy = "1.4.1" | ||
@@ -35,3 +35,3 @@ mypy-extensions = "1.0.0" | ||
| [tool.poetry.urls] | ||
| "Bug Tracker" = "https://github.com/SamuelGuillemet/ms-python-client/issues" | ||
| "Bug Tracker" = "https://github.com/cern-vc/ms-python-client/issues" | ||
@@ -38,0 +38,0 @@ [tool.isort] |
+4
-4
| # Microsoft Python client | ||
| [](https://github.com/SamuelGuillemet/ms-python-client/actions/workflows/python-tests.yml) | ||
| [](https://github.com/SamuelGuillemet/ms-python-client/actions/workflows/pre-commit.yaml) | ||
| [](https://github.com/SamuelGuillemet/ms-python-client/actions/workflows/codeql-analysis.yml) | ||
| [](https://codecov.io/gh/SamuelGuillemet/MS-python-client) | ||
| [](https://github.com/cern-vc/ms-python-client/actions/workflows/python-tests.yml) | ||
| [](https://github.com/cern-vc/ms-python-client/actions/workflows/pre-commit.yaml) | ||
| [](https://github.com/cern-vc/ms-python-client/actions/workflows/codeql-analysis.yml) | ||
| [](https://codecov.io/gh/cern-vc/MS-python-client) | ||
@@ -8,0 +8,0 @@ Microsoft graph API Python client with support for [Server to Server Oauth tokens](https://learn.microsoft.com/en-us/graph/auth/auth-concepts?view=graph-rest-1.0) with App Only access. |
| from typing import Mapping, Optional | ||
| from ms_python_client.ms_client_interface import MSClientInterface | ||
| class UsersComponent: | ||
| def __init__(self, client: MSClientInterface) -> None: | ||
| self.client = client | ||
| def list_users( | ||
| self, | ||
| parameters: Optional[Mapping[str, str]] = None, | ||
| extra_headers: Optional[Mapping[str, str]] = None, | ||
| ) -> dict: | ||
| """List all users | ||
| Args: | ||
| parameters (Optional[Mapping[str, str]], optional): Parameters for the request. Defaults to None. | ||
| extra_headers (Optional[Mapping[str, str]], optional): Additional headers for the request. Defaults to None. | ||
| Returns: | ||
| dict: The response of the request | ||
| """ | ||
| api_path = "/users" | ||
| response = self.client.make_get_request(api_path, parameters, extra_headers) | ||
| return response.json() |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
43539
0.16%21
5%803
1.01%