1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A batch job identifier in which the batch job to run is identified by the script name.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ScriptBatchJobIdentifier {
    /// <p>The name of the script containing the batch job definition.</p>
    pub script_name: ::std::string::String,
}
impl ScriptBatchJobIdentifier {
    /// <p>The name of the script containing the batch job definition.</p>
    pub fn script_name(&self) -> &str {
        use std::ops::Deref;
        self.script_name.deref()
    }
}
impl ScriptBatchJobIdentifier {
    /// Creates a new builder-style object to manufacture [`ScriptBatchJobIdentifier`](crate::types::ScriptBatchJobIdentifier).
    pub fn builder() -> crate::types::builders::ScriptBatchJobIdentifierBuilder {
        crate::types::builders::ScriptBatchJobIdentifierBuilder::default()
    }
}

/// A builder for [`ScriptBatchJobIdentifier`](crate::types::ScriptBatchJobIdentifier).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ScriptBatchJobIdentifierBuilder {
    pub(crate) script_name: ::std::option::Option<::std::string::String>,
}
impl ScriptBatchJobIdentifierBuilder {
    /// <p>The name of the script containing the batch job definition.</p>
    /// This field is required.
    pub fn script_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.script_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the script containing the batch job definition.</p>
    pub fn set_script_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.script_name = input;
        self
    }
    /// <p>The name of the script containing the batch job definition.</p>
    pub fn get_script_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.script_name
    }
    /// Consumes the builder and constructs a [`ScriptBatchJobIdentifier`](crate::types::ScriptBatchJobIdentifier).
    /// This method will fail if any of the following fields are not set:
    /// - [`script_name`](crate::types::builders::ScriptBatchJobIdentifierBuilder::script_name)
    pub fn build(self) -> ::std::result::Result<crate::types::ScriptBatchJobIdentifier, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ScriptBatchJobIdentifier {
            script_name: self.script_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "script_name",
                    "script_name was not specified but it is required when building ScriptBatchJobIdentifier",
                )
            })?,
        })
    }
}