def remove_member(self, **kwargs): util.require_keys(kwargs, "channel_id") util.require_keys(kwargs, "member_id") return self.delete_request( "/chat/channels/{}/members/{}".format(kwargs.get("channel_id"), kwargs.get("member_id")), params=kwargs, )
def get_user_report(self, **kwargs): util.require_keys(kwargs, ["user_id", "start_time", "end_time"]) kwargs["from"] = util.date_to_str(kwargs["start_time"]) del kwargs["start_time"] kwargs["to"] = util.date_to_str(kwargs["end_time"]) del kwargs["end_time"] return self.get_request("/report/users/{}/meetings".format( kwargs.get("user_id")), params=kwargs)
def list(self, **kwargs): util.require_keys(kwargs, "host_id") start = kwargs.pop("start", None) if start: kwargs["from"] = util.date_to_str(start) end = kwargs.pop("end", None) if end: kwargs["to"] = util.date_to_str(end) return self.post_request("/recording/list", params=kwargs)
def list(self, **kwargs): util.require_keys(kwargs, "user_id") start = kwargs.pop("start", None) if start: kwargs["from"] = util.date_to_str(start) end = kwargs.pop("end", None) if end: kwargs["to"] = util.date_to_str(end) return self.get_request("/users/{}/recordings".format( kwargs.get("user_id")), params=kwargs)
def delete(self, **kwargs) -> requests.Response: """ https://marketplace.zoom.us/docs/api-reference/zoom-api/chat-messages/deletechatmessage#request-parameters Use params=kwargs Examples: https://api.zoom.us/v2/chat/users/me/messages/{message_id}?to_channel={some_channel_id} https://api.zoom.us/v2/chat/users/me/messages/{message_id}?to_contact={some_contact_id} """ require_keys(kwargs, "message_id") return self.delete_request("/chat/users/me/messages/{}".format( kwargs.get("message_id")), params=kwargs)
def list(self, **kwargs) -> requests.Response: """ https://marketplace.zoom.us/docs/api-reference/zoom-api/chat-messages/getchatmessages#request-parameters Use params=kwargs Examples: https://api.zoom.us/v2/chat/users/{user_id}/messages?to_channel={some_channel_id} https://api.zoom.us/v2/chat/users/{user_id}/messages?to_contact={some_contact_id} """ require_keys(kwargs, "user_id") return self.get_request( "/chat/users/{}/messages?page_size=50".format( kwargs.get("user_id")), params=kwargs, )
def post(self, **kwargs) -> requests.Response: """ https://marketplace.zoom.us/docs/api-reference/zoom-api/chat-messages/sendachatmessage#request-body Use data=kwargs Examples: https://api.zoom.us/v2/chat/users/me/messages body: { "message": {some_message}, "to_channel": {some_channel_id} } body: { "message": {some_message}, "to_contact": {some_contact_id} } """ require_keys(kwargs, "message") return self.post_request("/chat/users/me/messages", data=kwargs)
def update(self, **kwargs) -> requests.Response: """ https://marketplace.zoom.us/docs/api-reference/zoom-api/chat-messages/editmessage#request-body Use data=kwargs Examples: https://api.zoom.us/v2/chat/users/me/messages/{messageId} body: { "message": {some_message}, "to_channel": {some_channel_id} } body: { "message": {some_message}, "to_contact": {some_contact_id} } """ require_keys(kwargs, "message_id") return self.put_request("/chat/users/me/messages/{}".format( kwargs.get("message_id")), data=kwargs)
def list_members(self, **kwargs): util.require_keys(kwargs, "channel_id") return self.get_request("/chat/channels/{}/members".format( kwargs.get("channel_id")), params=kwargs)
def update(self, **kwargs): util.require_keys(kwargs, ["channel_id", "name"]) return self.patch_request("/chat/channels/{}".format( kwargs.get("channel_id")), data=kwargs)
def delete(self, **kwargs): util.require_keys(kwargs, "channel_id") return self.delete_request("/chat/channels/{}".format( kwargs.get("channel_id")), params=kwargs)
def list(self, **kwargs): util.require_keys(kwargs, "user_id") return self.get_request("/chat/users/{}/messages".format( kwargs.get("user_id")), params=kwargs)
def create(self, **kwargs): util.require_keys(kwargs, ["name", "type", "members"]) return self.post_request("/chat/users/me/channels", data=kwargs)
def delete(self, **kwargs): util.require_keys(kwargs, "meeting_id") return self.delete_request("/meetings/{}/recordings".format( kwargs.get("meeting_id")), params=kwargs)
def join(self, **kwargs): require_keys(kwargs, "channelId") return self.post_request("/chat/channels/{}/members/me".format( kwargs.get("channelId")), params=kwargs)
def join(self, **kwargs): util.require_keys(kwargs, "channel_id") return self.post_request("/chat/channels/{}/members/me".format( kwargs.get("channel_id")), data=kwargs)
def get(self, **kwargs): util.require_keys(kwargs, ["meeting_id"]) return self.post_request("/recording/get", params=kwargs)
def get(self, **kwargs): util.require_keys(kwargs, "id") return self.get_request("/meetings/{}".format(kwargs.get("id")), params=kwargs)
def update(self, **kwargs): util.require_keys(kwargs, "id") if kwargs.get("start_time"): kwargs["start_time"] = util.date_to_str(kwargs["start_time"]) return self.patch_request("/meetings/{}".format(kwargs.get("id")), params=kwargs)
def end(self, **kwargs): util.require_keys(kwargs, ["id", "host_id"]) return self.post_request("/meeting/end", params=kwargs)
def create(self, **kwargs): util.require_keys(kwargs, ["host_id", "topic", "type"]) if kwargs.get("start_time"): kwargs["start_time"] = util.date_to_str(kwargs["start_time"]) return self.post_request("/meeting/create", params=kwargs)
def update(self, **kwargs): require_keys(kwargs, "channelId") return self.patch_request("/chat/channels/{}".format( kwargs.get("channelId")), data=kwargs)
def remove(self, **kwargs): require_keys(kwargs, ["channelId", "memberId"]) return self.delete_request("/chat/channels/{}/members/{}".format( kwargs.get("channelId"), kwargs.get("memberId")), params=kwargs)
def leave(self, **kwargs): require_keys(kwargs, "channelId") return self.delete_request("/chat/channels/{}/members/me".format( kwargs.get("channelId")), params=kwargs)
def leave(self, **kwargs): util.require_keys(kwargs, "channel_id") return self.delete_request("/chat/channels/{}/members/me".format( kwargs.get("channel_id")))
def post(self, **kwargs): util.require_keys(kwargs, "message") return self.post_request("/chat/users/me/messages", data=kwargs)
def put(self, **kwargs): util.require_keys(kwargs, ["message_id", "message"]) return self.put_request("/chat/users/me/messages/{}".format( kwargs.get("message_id")), data=kwargs)
def delete(self, **kwargs): util.require_keys(kwargs, "message_id") return self.delete_request("/chat/users/me/messages/{}".format( kwargs.get("message_id")), params=kwargs)
def list(self, **kwargs): util.require_keys(kwargs, "host_id") if kwargs.get("start_time"): kwargs["start_time"] = util.date_to_str(kwargs["start_time"]) return self.post_request("/meeting/list", params=kwargs)
def invite(self, **kwargs): require_keys(kwargs, ["channelId", "members"]) return self.post_request("/chat/channels/{}/members".format( kwargs.get("channelId")), data=kwargs)