aws-sdk-deadline 1.20.0

AWS SDK for AWSDeadlineCloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_job::_create_job_output::CreateJobOutputBuilder;

pub use crate::operation::create_job::_create_job_input::CreateJobInputBuilder;

impl crate::operation::create_job::builders::CreateJobInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_job::CreateJobOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_job::CreateJobError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_job();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateJob`.
///
/// <p>Creates a job. A job is a render submission submitted by a user. It contains specific job properties outlined as steps and tasks.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateJobFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_job::builders::CreateJobInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl crate::client::customize::internal::CustomizableSend<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>
    for CreateJobFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateJobFluentBuilder {
    /// Creates a new `CreateJobFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateJob as a reference.
    pub fn as_input(&self) -> &crate::operation::create_job::builders::CreateJobInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_job::CreateJobOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_job::CreateJobError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_job::CreateJob::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_job::CreateJob::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_job::CreateJobOutput,
        crate::operation::create_job::CreateJobError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The farm ID of the farm to connect to the job.</p>
    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.farm_id(input.into());
        self
    }
    /// <p>The farm ID of the farm to connect to the job.</p>
    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_farm_id(input);
        self
    }
    /// <p>The farm ID of the farm to connect to the job.</p>
    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_farm_id()
    }
    /// <p>The ID of the queue that the job is submitted to.</p>
    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.queue_id(input.into());
        self
    }
    /// <p>The ID of the queue that the job is submitted to.</p>
    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_queue_id(input);
        self
    }
    /// <p>The ID of the queue that the job is submitted to.</p>
    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_queue_id()
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <p>The unique token which the server uses to recognize retries of the same request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// <p>The job template to use for this job.</p>
    pub fn template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.template(input.into());
        self
    }
    /// <p>The job template to use for this job.</p>
    pub fn set_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_template(input);
        self
    }
    /// <p>The job template to use for this job.</p>
    pub fn get_template(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_template()
    }
    /// <p>The file type for the job template.</p>
    pub fn template_type(mut self, input: crate::types::JobTemplateType) -> Self {
        self.inner = self.inner.template_type(input);
        self
    }
    /// <p>The file type for the job template.</p>
    pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::JobTemplateType>) -> Self {
        self.inner = self.inner.set_template_type(input);
        self
    }
    /// <p>The file type for the job template.</p>
    pub fn get_template_type(&self) -> &::std::option::Option<crate::types::JobTemplateType> {
        self.inner.get_template_type()
    }
    /// <p>The priority of the job on a scale of 1 to 100. The highest priority is 1.</p>
    pub fn priority(mut self, input: i32) -> Self {
        self.inner = self.inner.priority(input);
        self
    }
    /// <p>The priority of the job on a scale of 1 to 100. The highest priority is 1.</p>
    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_priority(input);
        self
    }
    /// <p>The priority of the job on a scale of 1 to 100. The highest priority is 1.</p>
    pub fn get_priority(&self) -> &::std::option::Option<i32> {
        self.inner.get_priority()
    }
    ///
    /// Adds a key-value pair to `parameters`.
    ///
    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
    ///
    /// <p>The parameters for the job.</p>
    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::JobParameter) -> Self {
        self.inner = self.inner.parameters(k.into(), v);
        self
    }
    /// <p>The parameters for the job.</p>
    pub fn set_parameters(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>>,
    ) -> Self {
        self.inner = self.inner.set_parameters(input);
        self
    }
    /// <p>The parameters for the job.</p>
    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::JobParameter>> {
        self.inner.get_parameters()
    }
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub fn attachments(mut self, input: crate::types::Attachments) -> Self {
        self.inner = self.inner.attachments(input);
        self
    }
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub fn set_attachments(mut self, input: ::std::option::Option<crate::types::Attachments>) -> Self {
        self.inner = self.inner.set_attachments(input);
        self
    }
    /// <p>The attachments for the job. Attach files required for the job to run to a render job.</p>
    pub fn get_attachments(&self) -> &::std::option::Option<crate::types::Attachments> {
        self.inner.get_attachments()
    }
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub fn storage_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.storage_profile_id(input.into());
        self
    }
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub fn set_storage_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_storage_profile_id(input);
        self
    }
    /// <p>The storage profile ID for the storage profile to connect to the job.</p>
    pub fn get_storage_profile_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_storage_profile_id()
    }
    /// <p>The initial status of the job's tasks when they are created. Tasks that are created with a <code>SUSPENDED</code> status will not run until you update their status.</p>
    pub fn target_task_run_status(mut self, input: crate::types::CreateJobTargetTaskRunStatus) -> Self {
        self.inner = self.inner.target_task_run_status(input);
        self
    }
    /// <p>The initial status of the job's tasks when they are created. Tasks that are created with a <code>SUSPENDED</code> status will not run until you update their status.</p>
    pub fn set_target_task_run_status(mut self, input: ::std::option::Option<crate::types::CreateJobTargetTaskRunStatus>) -> Self {
        self.inner = self.inner.set_target_task_run_status(input);
        self
    }
    /// <p>The initial status of the job's tasks when they are created. Tasks that are created with a <code>SUSPENDED</code> status will not run until you update their status.</p>
    pub fn get_target_task_run_status(&self) -> &::std::option::Option<crate::types::CreateJobTargetTaskRunStatus> {
        self.inner.get_target_task_run_status()
    }
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub fn max_failed_tasks_count(mut self, input: i32) -> Self {
        self.inner = self.inner.max_failed_tasks_count(input);
        self
    }
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub fn set_max_failed_tasks_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_failed_tasks_count(input);
        self
    }
    /// <p>The number of task failures before the job stops running and is marked as <code>FAILED</code>.</p>
    pub fn get_max_failed_tasks_count(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_failed_tasks_count()
    }
    /// <p>The maximum number of retries for a job.</p>
    pub fn max_retries_per_task(mut self, input: i32) -> Self {
        self.inner = self.inner.max_retries_per_task(input);
        self
    }
    /// <p>The maximum number of retries for a job.</p>
    pub fn set_max_retries_per_task(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_retries_per_task(input);
        self
    }
    /// <p>The maximum number of retries for a job.</p>
    pub fn get_max_retries_per_task(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_retries_per_task()
    }
}