Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_can_convert_date_to_str(self):
d = datetime.date(year=2015, month=12, day=8)
self.assertEqual(util.date_to_str(d), "2015-12-08T00:00:00Z")
def test_can_convert_datetime_to_str(self):
d = datetime.datetime(year=2015, month=12, day=8, hour=23, minute=21, second=37)
self.assertEqual(util.date_to_str(d), "2015-12-08T23:21:37Z")
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("/webinar/list", 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"])
del kwargs["start_time"]
kwargs["to"] = util.date_to_str(kwargs["end_time"])
del kwargs["end_time"]
return self.get_request("/report/users", 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 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 update(self, **kwargs):
util.require_keys(kwargs, ["id", "host_id"])
if kwargs.get("start_time"):
kwargs["start_time"] = util.date_to_str(kwargs["start_time"])
return self.post_request("/webinar/update", params=kwargs)
def upcoming(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("/webinar/list/registration", 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)