diff --git a/pip-wheel-metadata/zoomus.dist-info/LICENSE.txt b/pip-wheel-metadata/zoomus.dist-info/LICENSE.txt new file mode 100644 index 0000000..f313380 --- /dev/null +++ b/pip-wheel-metadata/zoomus.dist-info/LICENSE.txt @@ -0,0 +1,13 @@ +Copyright [2015] [Accountable Care Transactions, Inc] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/pip-wheel-metadata/zoomus.dist-info/METADATA b/pip-wheel-metadata/zoomus.dist-info/METADATA new file mode 100644 index 0000000..eec9111 --- /dev/null +++ b/pip-wheel-metadata/zoomus.dist-info/METADATA @@ -0,0 +1,30 @@ +Metadata-Version: 2.1 +Name: zoomus +Version: 1.1.3 +Summary: Python client library for Zoom.us REST API v1 and v2 +Home-page: https://github.com/prschmid/zoomus +Author: Zoomus Contributors +Author-email: zoomus@googlegroups.com +License: Apache Software License +Platform: any +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Development Status :: 5 - Production/Stable +Classifier: Natural Language :: English +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: OS Independent +Classifier: Topic :: Internet +Classifier: Topic :: Office/Business +Classifier: Topic :: Software Development :: Libraries +Description-Content-Type: text/markdown +Requires-Dist: requests +Requires-Dist: PyJWT + +Python client library for Zoom.us REST API v1 and v2 + + diff --git a/pip-wheel-metadata/zoomus.dist-info/top_level.txt b/pip-wheel-metadata/zoomus.dist-info/top_level.txt new file mode 100644 index 0000000..70ecf6d --- /dev/null +++ b/pip-wheel-metadata/zoomus.dist-info/top_level.txt @@ -0,0 +1 @@ +zoomus diff --git a/zoomus/components/meeting.py b/zoomus/components/meeting.py index c6f9e81..8902b13 100644 --- a/zoomus/components/meeting.py +++ b/zoomus/components/meeting.py @@ -4,6 +4,8 @@ from zoomus import util from zoomus.components import base +import json +import ast class MeetingComponent(base.BaseComponent): @@ -39,7 +41,6 @@ def get(self, **kwargs): util.require_keys(kwargs, ["id", "host_id"]) return self.post_request("/meeting/get", params=kwargs) - class MeetingComponentV2(base.BaseComponent): def list(self, **kwargs): util.require_keys(kwargs, "user_id") @@ -70,3 +71,61 @@ def delete(self, **kwargs): return self.delete_request( "/meetings/{}".format(kwargs.get("id")), params=kwargs ) + + def register(self, **kwargs): + util.require_keys(kwargs, ["id", "email", "first_name", "last_name", "phone"]) + + params={ + "email": kwargs["email"], + "first_name": kwargs["first_name"], + "last_name": kwargs["last_name"], + "custom_questions": [ + { + "title": "Phone Number", + "value": kwargs["phone"] + } + ] + } + + if "city" in kwargs: + params["city"] = kwargs["city"] + + return self.post_request( + "/meetings/{}/registrants".format(kwargs.get("id")), data=params + ) + + def approve(self, **kwargs): + util.require_keys(kwargs, ["id", "email", "userid"]) + params = { + "action": "approve", + "registrants": [ + { + "id": kwargs["userid"], + "email": kwargs["email"] + } + ] + } + return self.put_request( + "/meetings/{}/registrants/status".format(kwargs.get("id")), data=params + ) + + def get_registration_questions(self, **kwargs): + util.require_keys(kwargs, ["id"]) + return self.get_request( + "/meetings/{}/registrants/questions".format(kwargs.get("id")) + ) + + def deny(self, **kwargs): + util.require_keys(kwargs, ["id", "email", "userid"]) + params = { + "action": "deny", + "registrants": [ + { + "id": kwargs["userid"], + "email": kwargs["email"] + } + ] + } + return self.put_request( + "/meetings/{}/registrants/status".format(kwargs.get("id")), data=params + ) \ No newline at end of file diff --git a/zoomus/components/report.py b/zoomus/components/report.py index 3da70c7..e4d5701 100644 --- a/zoomus/components/report.py +++ b/zoomus/components/report.py @@ -41,6 +41,15 @@ def get_user_report(self, **kwargs): "/report/users/{}/meetings".format(kwargs.get("user_id")), params=kwargs ) + def get_meeting_detail_report(self, **kwargs): + """ + /report/meetings/{meetingId}/participants + """ + util.require_keys(kwargs, ["meeting_id"]) + return self.get_request( + "/report/meetings/{}/participants".format(kwargs.get("meeting_id")), params=kwargs + ) + def get_account_report(self, **kwargs): util.require_keys(kwargs, ["start_time", "end_time"]) kwargs["from"] = util.date_to_str(kwargs["start_time"]) diff --git a/zoomus/util.py b/zoomus/util.py index 6cf791b..42bcb85 100644 --- a/zoomus/util.py +++ b/zoomus/util.py @@ -179,18 +179,19 @@ def put_request(self, endpoint, params=None, data=None, headers=None, cookies=No :param cookies: request cookies :return: The :class:``requests.Response`` object for this request """ - if data and not is_str_type(data): - data = json.dumps(data) + # if data and not is_str_type(data): + # data = json.dumps(data) if headers is None and self.config.get("version") == API_VERSION_2: headers = {"Authorization": "Bearer {}".format(self.config.get("token"))} - return requests.put( + resp = requests.put( self.url_for(endpoint), params=params, - data=data, + json=data, headers=headers, cookies=cookies, timeout=self.timeout, ) + return resp @contextlib.contextmanager