Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PPS] Added a method to get a detailed meeting report #86

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pip-wheel-metadata/zoomus.dist-info/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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.
30 changes: 30 additions & 0 deletions pip-wheel-metadata/zoomus.dist-info/METADATA
Original file line number Diff line number Diff line change
@@ -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: [email protected]
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


1 change: 1 addition & 0 deletions pip-wheel-metadata/zoomus.dist-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zoomus
61 changes: 60 additions & 1 deletion zoomus/components/meeting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from zoomus import util
from zoomus.components import base
import json
import ast


class MeetingComponent(base.BaseComponent):
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
)
9 changes: 9 additions & 0 deletions zoomus/components/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this addition! Can you please add a test case for it so that we can ensure that we are maintaining test coverage?

Thank you for your time and effort!

"""
/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"])
Expand Down
9 changes: 5 additions & 4 deletions zoomus/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down