aws-sdk-deadline 1.2.0

AWS SDK for AWSDeadlineCloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CopyJobTemplateOutput {
    /// <p>The format of the job template, either <code>JSON</code> or <code>YAML</code>.</p>
    pub template_type: crate::types::JobTemplateType,
    _request_id: Option<String>,
}
impl CopyJobTemplateOutput {
    /// <p>The format of the job template, either <code>JSON</code> or <code>YAML</code>.</p>
    pub fn template_type(&self) -> &crate::types::JobTemplateType {
        &self.template_type
    }
}
impl ::aws_types::request_id::RequestId for CopyJobTemplateOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CopyJobTemplateOutput {
    /// Creates a new builder-style object to manufacture [`CopyJobTemplateOutput`](crate::operation::copy_job_template::CopyJobTemplateOutput).
    pub fn builder() -> crate::operation::copy_job_template::builders::CopyJobTemplateOutputBuilder {
        crate::operation::copy_job_template::builders::CopyJobTemplateOutputBuilder::default()
    }
}

/// A builder for [`CopyJobTemplateOutput`](crate::operation::copy_job_template::CopyJobTemplateOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CopyJobTemplateOutputBuilder {
    pub(crate) template_type: ::std::option::Option<crate::types::JobTemplateType>,
    _request_id: Option<String>,
}
impl CopyJobTemplateOutputBuilder {
    /// <p>The format of the job template, either <code>JSON</code> or <code>YAML</code>.</p>
    /// This field is required.
    pub fn template_type(mut self, input: crate::types::JobTemplateType) -> Self {
        self.template_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The format of the job template, either <code>JSON</code> or <code>YAML</code>.</p>
    pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::JobTemplateType>) -> Self {
        self.template_type = input;
        self
    }
    /// <p>The format of the job template, either <code>JSON</code> or <code>YAML</code>.</p>
    pub fn get_template_type(&self) -> &::std::option::Option<crate::types::JobTemplateType> {
        &self.template_type
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CopyJobTemplateOutput`](crate::operation::copy_job_template::CopyJobTemplateOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`template_type`](crate::operation::copy_job_template::builders::CopyJobTemplateOutputBuilder::template_type)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::copy_job_template::CopyJobTemplateOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::copy_job_template::CopyJobTemplateOutput {
            template_type: self.template_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "template_type",
                    "template_type was not specified but it is required when building CopyJobTemplateOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}