aws_sdk_glue/types/
_node.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A node represents an Glue component (trigger, crawler, or job) on a workflow graph.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Node {
7    /// <p>The type of Glue component represented by the node.</p>
8    pub r#type: ::std::option::Option<crate::types::NodeType>,
9    /// <p>The name of the Glue component represented by the node.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The unique Id assigned to the node within the workflow.</p>
12    pub unique_id: ::std::option::Option<::std::string::String>,
13    /// <p>Details of the Trigger when the node represents a Trigger.</p>
14    pub trigger_details: ::std::option::Option<crate::types::TriggerNodeDetails>,
15    /// <p>Details of the Job when the node represents a Job.</p>
16    pub job_details: ::std::option::Option<crate::types::JobNodeDetails>,
17    /// <p>Details of the crawler when the node represents a crawler.</p>
18    pub crawler_details: ::std::option::Option<crate::types::CrawlerNodeDetails>,
19}
20impl Node {
21    /// <p>The type of Glue component represented by the node.</p>
22    pub fn r#type(&self) -> ::std::option::Option<&crate::types::NodeType> {
23        self.r#type.as_ref()
24    }
25    /// <p>The name of the Glue component represented by the node.</p>
26    pub fn name(&self) -> ::std::option::Option<&str> {
27        self.name.as_deref()
28    }
29    /// <p>The unique Id assigned to the node within the workflow.</p>
30    pub fn unique_id(&self) -> ::std::option::Option<&str> {
31        self.unique_id.as_deref()
32    }
33    /// <p>Details of the Trigger when the node represents a Trigger.</p>
34    pub fn trigger_details(&self) -> ::std::option::Option<&crate::types::TriggerNodeDetails> {
35        self.trigger_details.as_ref()
36    }
37    /// <p>Details of the Job when the node represents a Job.</p>
38    pub fn job_details(&self) -> ::std::option::Option<&crate::types::JobNodeDetails> {
39        self.job_details.as_ref()
40    }
41    /// <p>Details of the crawler when the node represents a crawler.</p>
42    pub fn crawler_details(&self) -> ::std::option::Option<&crate::types::CrawlerNodeDetails> {
43        self.crawler_details.as_ref()
44    }
45}
46impl Node {
47    /// Creates a new builder-style object to manufacture [`Node`](crate::types::Node).
48    pub fn builder() -> crate::types::builders::NodeBuilder {
49        crate::types::builders::NodeBuilder::default()
50    }
51}
52
53/// A builder for [`Node`](crate::types::Node).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct NodeBuilder {
57    pub(crate) r#type: ::std::option::Option<crate::types::NodeType>,
58    pub(crate) name: ::std::option::Option<::std::string::String>,
59    pub(crate) unique_id: ::std::option::Option<::std::string::String>,
60    pub(crate) trigger_details: ::std::option::Option<crate::types::TriggerNodeDetails>,
61    pub(crate) job_details: ::std::option::Option<crate::types::JobNodeDetails>,
62    pub(crate) crawler_details: ::std::option::Option<crate::types::CrawlerNodeDetails>,
63}
64impl NodeBuilder {
65    /// <p>The type of Glue component represented by the node.</p>
66    pub fn r#type(mut self, input: crate::types::NodeType) -> Self {
67        self.r#type = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The type of Glue component represented by the node.</p>
71    pub fn set_type(mut self, input: ::std::option::Option<crate::types::NodeType>) -> Self {
72        self.r#type = input;
73        self
74    }
75    /// <p>The type of Glue component represented by the node.</p>
76    pub fn get_type(&self) -> &::std::option::Option<crate::types::NodeType> {
77        &self.r#type
78    }
79    /// <p>The name of the Glue component represented by the node.</p>
80    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the Glue component represented by the node.</p>
85    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.name = input;
87        self
88    }
89    /// <p>The name of the Glue component represented by the node.</p>
90    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.name
92    }
93    /// <p>The unique Id assigned to the node within the workflow.</p>
94    pub fn unique_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.unique_id = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The unique Id assigned to the node within the workflow.</p>
99    pub fn set_unique_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.unique_id = input;
101        self
102    }
103    /// <p>The unique Id assigned to the node within the workflow.</p>
104    pub fn get_unique_id(&self) -> &::std::option::Option<::std::string::String> {
105        &self.unique_id
106    }
107    /// <p>Details of the Trigger when the node represents a Trigger.</p>
108    pub fn trigger_details(mut self, input: crate::types::TriggerNodeDetails) -> Self {
109        self.trigger_details = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>Details of the Trigger when the node represents a Trigger.</p>
113    pub fn set_trigger_details(mut self, input: ::std::option::Option<crate::types::TriggerNodeDetails>) -> Self {
114        self.trigger_details = input;
115        self
116    }
117    /// <p>Details of the Trigger when the node represents a Trigger.</p>
118    pub fn get_trigger_details(&self) -> &::std::option::Option<crate::types::TriggerNodeDetails> {
119        &self.trigger_details
120    }
121    /// <p>Details of the Job when the node represents a Job.</p>
122    pub fn job_details(mut self, input: crate::types::JobNodeDetails) -> Self {
123        self.job_details = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>Details of the Job when the node represents a Job.</p>
127    pub fn set_job_details(mut self, input: ::std::option::Option<crate::types::JobNodeDetails>) -> Self {
128        self.job_details = input;
129        self
130    }
131    /// <p>Details of the Job when the node represents a Job.</p>
132    pub fn get_job_details(&self) -> &::std::option::Option<crate::types::JobNodeDetails> {
133        &self.job_details
134    }
135    /// <p>Details of the crawler when the node represents a crawler.</p>
136    pub fn crawler_details(mut self, input: crate::types::CrawlerNodeDetails) -> Self {
137        self.crawler_details = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>Details of the crawler when the node represents a crawler.</p>
141    pub fn set_crawler_details(mut self, input: ::std::option::Option<crate::types::CrawlerNodeDetails>) -> Self {
142        self.crawler_details = input;
143        self
144    }
145    /// <p>Details of the crawler when the node represents a crawler.</p>
146    pub fn get_crawler_details(&self) -> &::std::option::Option<crate::types::CrawlerNodeDetails> {
147        &self.crawler_details
148    }
149    /// Consumes the builder and constructs a [`Node`](crate::types::Node).
150    pub fn build(self) -> crate::types::Node {
151        crate::types::Node {
152            r#type: self.r#type,
153            name: self.name,
154            unique_id: self.unique_id,
155            trigger_details: self.trigger_details,
156            job_details: self.job_details,
157            crawler_details: self.crawler_details,
158        }
159    }
160}