This commit is contained in:
Kenneth Kehl
2023-12-14 13:24:34 -08:00
parent 931a48b3c6
commit 32b4e6918f
4 changed files with 268 additions and 34 deletions

View File

@@ -103,7 +103,16 @@ class JobApiClient(NotifyAdminAPIClient):
return scheduled_for
def create_job(self, job_id, service_id, scheduled_for=None):
def create_job(
self,
job_id,
service_id,
scheduled_for=None,
template_id=None,
original_file_name=None,
notification_count=None,
valid=None,
):
data = {"id": job_id}
# make a datetime object in the user's preferred timezone
@@ -112,6 +121,15 @@ class JobApiClient(NotifyAdminAPIClient):
scheduled_for = JobApiClient.convert_user_time_to_utc(scheduled_for)
data.update({"scheduled_for": scheduled_for})
if template_id:
data.update({"template_id": template_id})
if original_file_name:
data.update({"original_file_name": original_file_name})
if notification_count:
data.update({"notification_count": notification_count})
if valid:
data.update({"valid": valid})
data = _attach_current_user(data)
job = self.post(url="/service/{}/job".format(service_id), data=data)