post https://app.diffgram.com/api/v1/project//job/file/attach
Attach (or remove) files to a job. This uses the Diffgram file_id.
Update from the SDK
The SDK creates file objects. Since these act like normal python objects we can use normal list comprehension to group them together. Then when we go to create the job we pass the file_list
We may optionally declare add_or_remove
to be within ["add", "remove"]
job.file_update(file_list = file_list)
# optional
job.file_update(
file_list = file_list,
add_or_remove = "remove"
)
Full example:
file_list = []
for path in path_list:
file = project.file.from_local(path)
file_list.append(file)
job.file_update(file_list = file_list)
Integrated example using the job.new() from SDK
job.new() uses file_update(), and has a pass through for file_list for convenience.
file_list = []
for path in path_list:
file = project.file.from_local(path)
file_list.append(file)
job = project.job.new(
...
file_list = file_list
)
Permissions
Roles = ["admin", "Editor"],
apis_user_list = ['api_enabled_builder'])