aws_sdk_datasync/types/
_task_list_entry.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a single entry in a list of tasks. <code>TaskListEntry</code> returns an array that contains a list of tasks when the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_ListTasks.html">ListTasks</a> operation is called. A task includes the source and destination file systems to sync and the options to use for the tasks.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TaskListEntry {
7    /// <p>The Amazon Resource Name (ARN) of the task.</p>
8    pub task_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The status of the task.</p>
10    pub status: ::std::option::Option<crate::types::TaskStatus>,
11    /// <p>The name of the task.</p>
12    pub name: ::std::option::Option<::std::string::String>,
13    /// <p>The task mode that you're using. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html">Choosing a task mode for your data transfer</a>.</p>
14    pub task_mode: ::std::option::Option<crate::types::TaskMode>,
15}
16impl TaskListEntry {
17    /// <p>The Amazon Resource Name (ARN) of the task.</p>
18    pub fn task_arn(&self) -> ::std::option::Option<&str> {
19        self.task_arn.as_deref()
20    }
21    /// <p>The status of the task.</p>
22    pub fn status(&self) -> ::std::option::Option<&crate::types::TaskStatus> {
23        self.status.as_ref()
24    }
25    /// <p>The name of the task.</p>
26    pub fn name(&self) -> ::std::option::Option<&str> {
27        self.name.as_deref()
28    }
29    /// <p>The task mode that you're using. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html">Choosing a task mode for your data transfer</a>.</p>
30    pub fn task_mode(&self) -> ::std::option::Option<&crate::types::TaskMode> {
31        self.task_mode.as_ref()
32    }
33}
34impl TaskListEntry {
35    /// Creates a new builder-style object to manufacture [`TaskListEntry`](crate::types::TaskListEntry).
36    pub fn builder() -> crate::types::builders::TaskListEntryBuilder {
37        crate::types::builders::TaskListEntryBuilder::default()
38    }
39}
40
41/// A builder for [`TaskListEntry`](crate::types::TaskListEntry).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct TaskListEntryBuilder {
45    pub(crate) task_arn: ::std::option::Option<::std::string::String>,
46    pub(crate) status: ::std::option::Option<crate::types::TaskStatus>,
47    pub(crate) name: ::std::option::Option<::std::string::String>,
48    pub(crate) task_mode: ::std::option::Option<crate::types::TaskMode>,
49}
50impl TaskListEntryBuilder {
51    /// <p>The Amazon Resource Name (ARN) of the task.</p>
52    pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.task_arn = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The Amazon Resource Name (ARN) of the task.</p>
57    pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.task_arn = input;
59        self
60    }
61    /// <p>The Amazon Resource Name (ARN) of the task.</p>
62    pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
63        &self.task_arn
64    }
65    /// <p>The status of the task.</p>
66    pub fn status(mut self, input: crate::types::TaskStatus) -> Self {
67        self.status = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The status of the task.</p>
71    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TaskStatus>) -> Self {
72        self.status = input;
73        self
74    }
75    /// <p>The status of the task.</p>
76    pub fn get_status(&self) -> &::std::option::Option<crate::types::TaskStatus> {
77        &self.status
78    }
79    /// <p>The name of the task.</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 task.</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 task.</p>
90    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.name
92    }
93    /// <p>The task mode that you're using. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html">Choosing a task mode for your data transfer</a>.</p>
94    pub fn task_mode(mut self, input: crate::types::TaskMode) -> Self {
95        self.task_mode = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>The task mode that you're using. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html">Choosing a task mode for your data transfer</a>.</p>
99    pub fn set_task_mode(mut self, input: ::std::option::Option<crate::types::TaskMode>) -> Self {
100        self.task_mode = input;
101        self
102    }
103    /// <p>The task mode that you're using. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html">Choosing a task mode for your data transfer</a>.</p>
104    pub fn get_task_mode(&self) -> &::std::option::Option<crate::types::TaskMode> {
105        &self.task_mode
106    }
107    /// Consumes the builder and constructs a [`TaskListEntry`](crate::types::TaskListEntry).
108    pub fn build(self) -> crate::types::TaskListEntry {
109        crate::types::TaskListEntry {
110            task_arn: self.task_arn,
111            status: self.status,
112            name: self.name,
113            task_mode: self.task_mode,
114        }
115    }
116}