aws_sdk_glue/operation/create_script/
_create_script_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateScriptInput {
6    /// <p>A list of the nodes in the DAG.</p>
7    pub dag_nodes: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNode>>,
8    /// <p>A list of the edges in the DAG.</p>
9    pub dag_edges: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenEdge>>,
10    /// <p>The programming language of the resulting code from the DAG.</p>
11    pub language: ::std::option::Option<crate::types::Language>,
12}
13impl CreateScriptInput {
14    /// <p>A list of the nodes in the DAG.</p>
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.dag_nodes.is_none()`.
17    pub fn dag_nodes(&self) -> &[crate::types::CodeGenNode] {
18        self.dag_nodes.as_deref().unwrap_or_default()
19    }
20    /// <p>A list of the edges in the DAG.</p>
21    ///
22    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.dag_edges.is_none()`.
23    pub fn dag_edges(&self) -> &[crate::types::CodeGenEdge] {
24        self.dag_edges.as_deref().unwrap_or_default()
25    }
26    /// <p>The programming language of the resulting code from the DAG.</p>
27    pub fn language(&self) -> ::std::option::Option<&crate::types::Language> {
28        self.language.as_ref()
29    }
30}
31impl CreateScriptInput {
32    /// Creates a new builder-style object to manufacture [`CreateScriptInput`](crate::operation::create_script::CreateScriptInput).
33    pub fn builder() -> crate::operation::create_script::builders::CreateScriptInputBuilder {
34        crate::operation::create_script::builders::CreateScriptInputBuilder::default()
35    }
36}
37
38/// A builder for [`CreateScriptInput`](crate::operation::create_script::CreateScriptInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct CreateScriptInputBuilder {
42    pub(crate) dag_nodes: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNode>>,
43    pub(crate) dag_edges: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenEdge>>,
44    pub(crate) language: ::std::option::Option<crate::types::Language>,
45}
46impl CreateScriptInputBuilder {
47    /// Appends an item to `dag_nodes`.
48    ///
49    /// To override the contents of this collection use [`set_dag_nodes`](Self::set_dag_nodes).
50    ///
51    /// <p>A list of the nodes in the DAG.</p>
52    pub fn dag_nodes(mut self, input: crate::types::CodeGenNode) -> Self {
53        let mut v = self.dag_nodes.unwrap_or_default();
54        v.push(input);
55        self.dag_nodes = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>A list of the nodes in the DAG.</p>
59    pub fn set_dag_nodes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNode>>) -> Self {
60        self.dag_nodes = input;
61        self
62    }
63    /// <p>A list of the nodes in the DAG.</p>
64    pub fn get_dag_nodes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CodeGenNode>> {
65        &self.dag_nodes
66    }
67    /// Appends an item to `dag_edges`.
68    ///
69    /// To override the contents of this collection use [`set_dag_edges`](Self::set_dag_edges).
70    ///
71    /// <p>A list of the edges in the DAG.</p>
72    pub fn dag_edges(mut self, input: crate::types::CodeGenEdge) -> Self {
73        let mut v = self.dag_edges.unwrap_or_default();
74        v.push(input);
75        self.dag_edges = ::std::option::Option::Some(v);
76        self
77    }
78    /// <p>A list of the edges in the DAG.</p>
79    pub fn set_dag_edges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenEdge>>) -> Self {
80        self.dag_edges = input;
81        self
82    }
83    /// <p>A list of the edges in the DAG.</p>
84    pub fn get_dag_edges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CodeGenEdge>> {
85        &self.dag_edges
86    }
87    /// <p>The programming language of the resulting code from the DAG.</p>
88    pub fn language(mut self, input: crate::types::Language) -> Self {
89        self.language = ::std::option::Option::Some(input);
90        self
91    }
92    /// <p>The programming language of the resulting code from the DAG.</p>
93    pub fn set_language(mut self, input: ::std::option::Option<crate::types::Language>) -> Self {
94        self.language = input;
95        self
96    }
97    /// <p>The programming language of the resulting code from the DAG.</p>
98    pub fn get_language(&self) -> &::std::option::Option<crate::types::Language> {
99        &self.language
100    }
101    /// Consumes the builder and constructs a [`CreateScriptInput`](crate::operation::create_script::CreateScriptInput).
102    pub fn build(
103        self,
104    ) -> ::std::result::Result<crate::operation::create_script::CreateScriptInput, ::aws_smithy_types::error::operation::BuildError> {
105        ::std::result::Result::Ok(crate::operation::create_script::CreateScriptInput {
106            dag_nodes: self.dag_nodes,
107            dag_edges: self.dag_edges,
108            language: self.language,
109        })
110    }
111}