pub struct JobBuilder { /* private fields */ }Expand description
Builder for serial JobCreateRequest pipelines.
For linear jobs, use the fluent task shorthands and let the SDK wire each task to the previous task.
use cloudconvert_sdk::{FileExtension, JobCreateRequest};
let request = JobCreateRequest::linear()
.import_url("https://example.test/input.docx")
.convert(FileExtension::Pdf)
.export_url()
.build();
let payload = serde_json::to_value(request).unwrap();
assert_eq!(payload["tasks"]["export-url"]["input"], "convert");Use *_with(...) methods when a task needs options. Use
JobCreateRequest::graph when a later task needs a handle to a specific
earlier task.
Implementations§
Source§impl JobBuilder
impl JobBuilder
Sourcepub fn webhook_url(self, webhook_url: impl Into<String>) -> Self
pub fn webhook_url(self, webhook_url: impl Into<String>) -> Self
Sets the webhook URL CloudConvert should call for this job.
Sourcepub fn redirect(self, redirect: bool) -> Self
pub fn redirect(self, redirect: bool) -> Self
Sets whether CloudConvert should redirect on synchronous job completion.
Sourcepub fn option(self, key: impl Into<String>, value: impl Into<Value>) -> Self
pub fn option(self, key: impl Into<String>, value: impl Into<Value>) -> Self
Adds a custom top-level job field.
Sourcepub fn task(self, name: impl Into<String>, task: impl Into<TaskRequest>) -> Self
pub fn task(self, name: impl Into<String>, task: impl Into<TaskRequest>) -> Self
Adds a task with an explicit CloudConvert task name.
This keeps compatibility with CloudConvert’s keyed task object and with existing code that already depends on task names.
Sourcepub fn add_task(&mut self, task: impl Into<TaskRequest>) -> TaskName
pub fn add_task(&mut self, task: impl Into<TaskRequest>) -> TaskName
Adds a task with a generated name and returns that name as a handle.
Generated names are derived from the task operation, such as
import-url, convert, or export-url. Duplicate operation names get
numeric suffixes.
use cloudconvert_sdk::{ConvertTask, FileExtension, JobCreateRequest, TaskRequest};
let mut builder = JobCreateRequest::builder();
let import = builder.add_task(TaskRequest::import_url("https://example.test/input.docx"));
let convert = builder.add_task(ConvertTask::new(&import, FileExtension::Pdf));
assert_eq!(import.as_str(), "import-url");
assert_eq!(convert.as_str(), "convert");Sourcepub fn add_named_task(
&mut self,
name: impl Into<String>,
task: impl Into<TaskRequest>,
) -> TaskName
pub fn add_named_task( &mut self, name: impl Into<String>, task: impl Into<TaskRequest>, ) -> TaskName
Adds a task with an explicit name and returns that name as a handle.
Sourcepub fn import_url(self, url: impl Into<String>) -> Self
pub fn import_url(self, url: impl Into<String>) -> Self
Appends an import/url task.
Sourcepub fn import_upload(self) -> Self
pub fn import_upload(self) -> Self
Appends an import/upload task.
Sourcepub fn import_base64(
self,
file: impl Into<String>,
filename: impl Into<String>,
) -> Self
pub fn import_base64( self, file: impl Into<String>, filename: impl Into<String>, ) -> Self
Appends an import/base64 task.
Sourcepub fn import_raw(
self,
file: impl Into<String>,
filename: impl Into<String>,
) -> Self
pub fn import_raw( self, file: impl Into<String>, filename: impl Into<String>, ) -> Self
Appends an import/raw task.
Sourcepub fn import_s3(
self,
bucket: impl Into<String>,
region: impl Into<String>,
access_key_id: impl Into<String>,
secret_access_key: impl Into<String>,
) -> Self
pub fn import_s3( self, bucket: impl Into<String>, region: impl Into<String>, access_key_id: impl Into<String>, secret_access_key: impl Into<String>, ) -> Self
Appends an import/s3 task.
Sourcepub fn import_azure_blob(
self,
storage_account: impl Into<String>,
container: impl Into<String>,
) -> Self
pub fn import_azure_blob( self, storage_account: impl Into<String>, container: impl Into<String>, ) -> Self
Appends an import/azure/blob task.
Sourcepub fn import_google_cloud_storage(
self,
project_id: impl Into<String>,
bucket: impl Into<String>,
client_email: impl Into<String>,
private_key: impl Into<String>,
) -> Self
pub fn import_google_cloud_storage( self, project_id: impl Into<String>, bucket: impl Into<String>, client_email: impl Into<String>, private_key: impl Into<String>, ) -> Self
Appends an import/google-cloud-storage task.
Sourcepub fn import_openstack(
self,
auth_url: impl Into<String>,
username: impl Into<String>,
password: impl Into<String>,
region: impl Into<String>,
container: impl Into<String>,
) -> Self
pub fn import_openstack( self, auth_url: impl Into<String>, username: impl Into<String>, password: impl Into<String>, region: impl Into<String>, container: impl Into<String>, ) -> Self
Appends an import/openstack task.
Sourcepub fn import_sftp(
self,
host: impl Into<String>,
username: impl Into<String>,
) -> Self
pub fn import_sftp( self, host: impl Into<String>, username: impl Into<String>, ) -> Self
Appends an import/sftp task.
Sourcepub fn convert(self, output_format: impl Into<String>) -> Self
pub fn convert(self, output_format: impl Into<String>) -> Self
Appends a convert task using the previous task as input.
Sourcepub fn convert_with_input_format(
self,
input_format: impl Into<String>,
output_format: impl Into<String>,
) -> Self
pub fn convert_with_input_format( self, input_format: impl Into<String>, output_format: impl Into<String>, ) -> Self
Appends a convert task with an explicit input format.
Sourcepub fn watermark_text(self, text: impl Into<String>) -> Self
pub fn watermark_text(self, text: impl Into<String>) -> Self
Appends a text watermark task using the previous task as input.
Sourcepub fn watermark_image(self, image_task_name: impl Into<String>) -> Self
pub fn watermark_image(self, image_task_name: impl Into<String>) -> Self
Appends an image watermark task using the previous task as input.
Sourcepub fn capture_website(
self,
url: impl Into<String>,
output_format: impl Into<String>,
) -> Self
pub fn capture_website( self, url: impl Into<String>, output_format: impl Into<String>, ) -> Self
Appends a capture-website task.
Sourcepub fn thumbnail(self, output_format: impl Into<String>) -> Self
pub fn thumbnail(self, output_format: impl Into<String>) -> Self
Appends a thumbnail task using the previous task as input.
Sourcepub fn metadata_write(self) -> Self
pub fn metadata_write(self) -> Self
Appends a metadata/write task using the previous task as input.
Sourcepub fn merge(self, output_format: impl Into<String>) -> Self
pub fn merge(self, output_format: impl Into<String>) -> Self
Appends a merge task using the previous task as input.
Sourcepub fn archive(self, output_format: impl Into<String>) -> Self
pub fn archive(self, output_format: impl Into<String>) -> Self
Appends an archive task using the previous task as input.
Sourcepub fn command(
self,
engine: impl Into<String>,
command: impl Into<String>,
arguments: impl Into<String>,
) -> Self
pub fn command( self, engine: impl Into<String>, command: impl Into<String>, arguments: impl Into<String>, ) -> Self
Appends a command task using the previous task as input.
Sourcepub fn pdf_a_with<F>(self, configure: F) -> Self
pub fn pdf_a_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn pdf_x_with<F>(self, configure: F) -> Self
pub fn pdf_x_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn pdf_ocr_with<F>(self, configure: F) -> Self
pub fn pdf_ocr_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn pdf_encrypt(self) -> Self
pub fn pdf_encrypt(self) -> Self
Appends a PDF operation task using the previous task as input.
Sourcepub fn pdf_encrypt_with<F>(self, configure: F) -> Self
pub fn pdf_encrypt_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn pdf_decrypt(self) -> Self
pub fn pdf_decrypt(self) -> Self
Appends a PDF operation task using the previous task as input.
Sourcepub fn pdf_decrypt_with<F>(self, configure: F) -> Self
pub fn pdf_decrypt_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn pdf_split_pages(self) -> Self
pub fn pdf_split_pages(self) -> Self
Appends a PDF operation task using the previous task as input.
Sourcepub fn pdf_split_pages_with<F>(self, configure: F) -> Self
pub fn pdf_split_pages_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn pdf_extract_pages(self) -> Self
pub fn pdf_extract_pages(self) -> Self
Appends a PDF operation task using the previous task as input.
Sourcepub fn pdf_extract_pages_with<F>(self, configure: F) -> Self
pub fn pdf_extract_pages_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn pdf_rotate_pages(self) -> Self
pub fn pdf_rotate_pages(self) -> Self
Appends a PDF operation task using the previous task as input.
Sourcepub fn pdf_rotate_pages_with<F>(self, configure: F) -> Self
pub fn pdf_rotate_pages_with<F>(self, configure: F) -> Self
Appends and configures a PDF operation task using the previous task as input.
Sourcepub fn export_url(self) -> Self
pub fn export_url(self) -> Self
Appends an export/url task using the previous task as input.
Sourcepub fn export_s3(
self,
bucket: impl Into<String>,
region: impl Into<String>,
access_key_id: impl Into<String>,
secret_access_key: impl Into<String>,
) -> Self
pub fn export_s3( self, bucket: impl Into<String>, region: impl Into<String>, access_key_id: impl Into<String>, secret_access_key: impl Into<String>, ) -> Self
Appends an export/s3 task using the previous task as input.
Sourcepub fn export_azure_blob(
self,
storage_account: impl Into<String>,
container: impl Into<String>,
) -> Self
pub fn export_azure_blob( self, storage_account: impl Into<String>, container: impl Into<String>, ) -> Self
Appends an export/azure/blob task using the previous task as input.
Sourcepub fn export_google_cloud_storage(
self,
project_id: impl Into<String>,
bucket: impl Into<String>,
client_email: impl Into<String>,
private_key: impl Into<String>,
) -> Self
pub fn export_google_cloud_storage( self, project_id: impl Into<String>, bucket: impl Into<String>, client_email: impl Into<String>, private_key: impl Into<String>, ) -> Self
Appends an export/google-cloud-storage task using the previous task as input.
Sourcepub fn export_openstack(
self,
auth_url: impl Into<String>,
username: impl Into<String>,
password: impl Into<String>,
region: impl Into<String>,
container: impl Into<String>,
) -> Self
pub fn export_openstack( self, auth_url: impl Into<String>, username: impl Into<String>, password: impl Into<String>, region: impl Into<String>, container: impl Into<String>, ) -> Self
Appends an export/openstack task using the previous task as input.
Sourcepub fn export_sftp(
self,
host: impl Into<String>,
username: impl Into<String>,
) -> Self
pub fn export_sftp( self, host: impl Into<String>, username: impl Into<String>, ) -> Self
Appends an export/sftp task using the previous task as input.
Sourcepub fn export_upload(self, url: impl Into<String>) -> Self
pub fn export_upload(self, url: impl Into<String>) -> Self
Appends an export/upload task using the previous task as input.
Sourcepub fn import_url_with<F>(self, url: impl Into<String>, configure: F) -> Self
pub fn import_url_with<F>(self, url: impl Into<String>, configure: F) -> Self
Appends and configures an import/url task.
Sourcepub fn import_upload_with<F>(self, configure: F) -> Self
pub fn import_upload_with<F>(self, configure: F) -> Self
Appends and configures an import/upload task.
Sourcepub fn import_s3_with<F>(
self,
bucket: impl Into<String>,
region: impl Into<String>,
access_key_id: impl Into<String>,
secret_access_key: impl Into<String>,
configure: F,
) -> Self
pub fn import_s3_with<F>( self, bucket: impl Into<String>, region: impl Into<String>, access_key_id: impl Into<String>, secret_access_key: impl Into<String>, configure: F, ) -> Self
Appends and configures an import/s3 task.
Sourcepub fn import_azure_blob_with<F>(
self,
storage_account: impl Into<String>,
container: impl Into<String>,
configure: F,
) -> Self
pub fn import_azure_blob_with<F>( self, storage_account: impl Into<String>, container: impl Into<String>, configure: F, ) -> Self
Appends and configures an import/azure/blob task.
Sourcepub fn import_google_cloud_storage_with<F>(
self,
project_id: impl Into<String>,
bucket: impl Into<String>,
client_email: impl Into<String>,
private_key: impl Into<String>,
configure: F,
) -> Self
pub fn import_google_cloud_storage_with<F>( self, project_id: impl Into<String>, bucket: impl Into<String>, client_email: impl Into<String>, private_key: impl Into<String>, configure: F, ) -> Self
Appends and configures an import/google-cloud-storage task.
Sourcepub fn import_openstack_with<F>(
self,
auth_url: impl Into<String>,
username: impl Into<String>,
password: impl Into<String>,
region: impl Into<String>,
container: impl Into<String>,
configure: F,
) -> Self
pub fn import_openstack_with<F>( self, auth_url: impl Into<String>, username: impl Into<String>, password: impl Into<String>, region: impl Into<String>, container: impl Into<String>, configure: F, ) -> Self
Appends and configures an import/openstack task.
Sourcepub fn import_sftp_with<F>(
self,
host: impl Into<String>,
username: impl Into<String>,
configure: F,
) -> Self
pub fn import_sftp_with<F>( self, host: impl Into<String>, username: impl Into<String>, configure: F, ) -> Self
Appends and configures an import/sftp task.
Sourcepub fn convert_with<F>(
self,
output_format: impl Into<String>,
configure: F,
) -> Self
pub fn convert_with<F>( self, output_format: impl Into<String>, configure: F, ) -> Self
Appends and configures a convert task using the previous task as input.
Sourcepub fn optimize_with<F>(self, configure: F) -> Self
pub fn optimize_with<F>(self, configure: F) -> Self
Appends and configures an optimize task using the previous task as input.
Sourcepub fn watermark_text_with<F>(
self,
text: impl Into<String>,
configure: F,
) -> Self
pub fn watermark_text_with<F>( self, text: impl Into<String>, configure: F, ) -> Self
Appends and configures a text watermark task using the previous task as input.
Sourcepub fn watermark_image_with<F>(
self,
image_task_name: impl Into<String>,
configure: F,
) -> Self
pub fn watermark_image_with<F>( self, image_task_name: impl Into<String>, configure: F, ) -> Self
Appends and configures an image watermark task using the previous task as input.
Sourcepub fn capture_website_with<F>(
self,
url: impl Into<String>,
output_format: impl Into<String>,
configure: F,
) -> Self
pub fn capture_website_with<F>( self, url: impl Into<String>, output_format: impl Into<String>, configure: F, ) -> Self
Appends and configures a capture-website task.
Sourcepub fn thumbnail_with<F>(
self,
output_format: impl Into<String>,
configure: F,
) -> Self
pub fn thumbnail_with<F>( self, output_format: impl Into<String>, configure: F, ) -> Self
Appends and configures a thumbnail task using the previous task as input.
Sourcepub fn metadata_with<F>(self, configure: F) -> Self
pub fn metadata_with<F>(self, configure: F) -> Self
Appends and configures a metadata task using the previous task as input.
Sourcepub fn metadata_write_with<F>(self, configure: F) -> Self
pub fn metadata_write_with<F>(self, configure: F) -> Self
Appends and configures a metadata/write task using the previous task as input.
Sourcepub fn merge_with<F>(
self,
output_format: impl Into<String>,
configure: F,
) -> Self
pub fn merge_with<F>( self, output_format: impl Into<String>, configure: F, ) -> Self
Appends and configures a merge task using the previous task as input.
Sourcepub fn archive_with<F>(
self,
output_format: impl Into<String>,
configure: F,
) -> Self
pub fn archive_with<F>( self, output_format: impl Into<String>, configure: F, ) -> Self
Appends and configures an archive task using the previous task as input.
Sourcepub fn command_with<F>(
self,
engine: impl Into<String>,
command: impl Into<String>,
arguments: impl Into<String>,
configure: F,
) -> Self
pub fn command_with<F>( self, engine: impl Into<String>, command: impl Into<String>, arguments: impl Into<String>, configure: F, ) -> Self
Appends and configures a command task using the previous task as input.
Sourcepub fn export_url_with<F>(self, configure: F) -> Self
pub fn export_url_with<F>(self, configure: F) -> Self
Appends and configures an export/url task using the previous task as input.
Sourcepub fn export_s3_with<F>(
self,
bucket: impl Into<String>,
region: impl Into<String>,
access_key_id: impl Into<String>,
secret_access_key: impl Into<String>,
configure: F,
) -> Self
pub fn export_s3_with<F>( self, bucket: impl Into<String>, region: impl Into<String>, access_key_id: impl Into<String>, secret_access_key: impl Into<String>, configure: F, ) -> Self
Appends and configures an export/s3 task using the previous task as input.
Sourcepub fn export_azure_blob_with<F>(
self,
storage_account: impl Into<String>,
container: impl Into<String>,
configure: F,
) -> Self
pub fn export_azure_blob_with<F>( self, storage_account: impl Into<String>, container: impl Into<String>, configure: F, ) -> Self
Appends and configures an export/azure/blob task using the previous task as input.
Sourcepub fn export_google_cloud_storage_with<F>(
self,
project_id: impl Into<String>,
bucket: impl Into<String>,
client_email: impl Into<String>,
private_key: impl Into<String>,
configure: F,
) -> Self
pub fn export_google_cloud_storage_with<F>( self, project_id: impl Into<String>, bucket: impl Into<String>, client_email: impl Into<String>, private_key: impl Into<String>, configure: F, ) -> Self
Appends and configures an export/google-cloud-storage task using the previous task as input.
Sourcepub fn export_openstack_with<F>(
self,
auth_url: impl Into<String>,
username: impl Into<String>,
password: impl Into<String>,
region: impl Into<String>,
container: impl Into<String>,
configure: F,
) -> Self
pub fn export_openstack_with<F>( self, auth_url: impl Into<String>, username: impl Into<String>, password: impl Into<String>, region: impl Into<String>, container: impl Into<String>, configure: F, ) -> Self
Appends and configures an export/openstack task using the previous task as input.
Sourcepub fn export_sftp_with<F>(
self,
host: impl Into<String>,
username: impl Into<String>,
configure: F,
) -> Self
pub fn export_sftp_with<F>( self, host: impl Into<String>, username: impl Into<String>, configure: F, ) -> Self
Appends and configures an export/sftp task using the previous task as input.
Sourcepub fn export_upload_with<F>(self, url: impl Into<String>, configure: F) -> Self
pub fn export_upload_with<F>(self, url: impl Into<String>, configure: F) -> Self
Appends and configures an export/upload task using the previous task as input.
Sourcepub fn build(self) -> JobCreateRequest
pub fn build(self) -> JobCreateRequest
Finishes the builder and returns the job creation request.
Trait Implementations§
Source§impl Clone for JobBuilder
impl Clone for JobBuilder
Source§fn clone(&self) -> JobBuilder
fn clone(&self) -> JobBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more