aws_sdk_devicefarm/operation/update_project/_update_project_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a request to the update project operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateProjectInput {
7 /// <p>The Amazon Resource Name (ARN) of the project whose name to update.</p>
8 pub arn: ::std::option::Option<::std::string::String>,
9 /// <p>A string that represents the new name of the project that you are updating.</p>
10 pub name: ::std::option::Option<::std::string::String>,
11 /// <p>The number of minutes a test run in the project executes before it times out.</p>
12 pub default_job_timeout_minutes: ::std::option::Option<i32>,
13 /// <p>The VPC security groups and subnets that are attached to a project.</p>
14 pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
15 /// <p>A set of environment variables which are used by default for all runs in the project. These environment variables are applied to the test run during the execution of a test spec file.</p>
16 /// <p>For more information about using test spec files, please see <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html">Custom test environments </a> in <i>AWS Device Farm.</i></p>
17 pub environment_variables: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>>,
18 /// <p>An IAM role to be assumed by the test host for all runs in the project.</p>
19 pub execution_role_arn: ::std::option::Option<::std::string::String>,
20}
21impl UpdateProjectInput {
22 /// <p>The Amazon Resource Name (ARN) of the project whose name to update.</p>
23 pub fn arn(&self) -> ::std::option::Option<&str> {
24 self.arn.as_deref()
25 }
26 /// <p>A string that represents the new name of the project that you are updating.</p>
27 pub fn name(&self) -> ::std::option::Option<&str> {
28 self.name.as_deref()
29 }
30 /// <p>The number of minutes a test run in the project executes before it times out.</p>
31 pub fn default_job_timeout_minutes(&self) -> ::std::option::Option<i32> {
32 self.default_job_timeout_minutes
33 }
34 /// <p>The VPC security groups and subnets that are attached to a project.</p>
35 pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
36 self.vpc_config.as_ref()
37 }
38 /// <p>A set of environment variables which are used by default for all runs in the project. These environment variables are applied to the test run during the execution of a test spec file.</p>
39 /// <p>For more information about using test spec files, please see <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html">Custom test environments </a> in <i>AWS Device Farm.</i></p>
40 ///
41 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.environment_variables.is_none()`.
42 pub fn environment_variables(&self) -> &[crate::types::EnvironmentVariable] {
43 self.environment_variables.as_deref().unwrap_or_default()
44 }
45 /// <p>An IAM role to be assumed by the test host for all runs in the project.</p>
46 pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
47 self.execution_role_arn.as_deref()
48 }
49}
50impl UpdateProjectInput {
51 /// Creates a new builder-style object to manufacture [`UpdateProjectInput`](crate::operation::update_project::UpdateProjectInput).
52 pub fn builder() -> crate::operation::update_project::builders::UpdateProjectInputBuilder {
53 crate::operation::update_project::builders::UpdateProjectInputBuilder::default()
54 }
55}
56
57/// A builder for [`UpdateProjectInput`](crate::operation::update_project::UpdateProjectInput).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct UpdateProjectInputBuilder {
61 pub(crate) arn: ::std::option::Option<::std::string::String>,
62 pub(crate) name: ::std::option::Option<::std::string::String>,
63 pub(crate) default_job_timeout_minutes: ::std::option::Option<i32>,
64 pub(crate) vpc_config: ::std::option::Option<crate::types::VpcConfig>,
65 pub(crate) environment_variables: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>>,
66 pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
67}
68impl UpdateProjectInputBuilder {
69 /// <p>The Amazon Resource Name (ARN) of the project whose name to update.</p>
70 /// This field is required.
71 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72 self.arn = ::std::option::Option::Some(input.into());
73 self
74 }
75 /// <p>The Amazon Resource Name (ARN) of the project whose name to update.</p>
76 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77 self.arn = input;
78 self
79 }
80 /// <p>The Amazon Resource Name (ARN) of the project whose name to update.</p>
81 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
82 &self.arn
83 }
84 /// <p>A string that represents the new name of the project that you are updating.</p>
85 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.name = ::std::option::Option::Some(input.into());
87 self
88 }
89 /// <p>A string that represents the new name of the project that you are updating.</p>
90 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.name = input;
92 self
93 }
94 /// <p>A string that represents the new name of the project that you are updating.</p>
95 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
96 &self.name
97 }
98 /// <p>The number of minutes a test run in the project executes before it times out.</p>
99 pub fn default_job_timeout_minutes(mut self, input: i32) -> Self {
100 self.default_job_timeout_minutes = ::std::option::Option::Some(input);
101 self
102 }
103 /// <p>The number of minutes a test run in the project executes before it times out.</p>
104 pub fn set_default_job_timeout_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
105 self.default_job_timeout_minutes = input;
106 self
107 }
108 /// <p>The number of minutes a test run in the project executes before it times out.</p>
109 pub fn get_default_job_timeout_minutes(&self) -> &::std::option::Option<i32> {
110 &self.default_job_timeout_minutes
111 }
112 /// <p>The VPC security groups and subnets that are attached to a project.</p>
113 pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
114 self.vpc_config = ::std::option::Option::Some(input);
115 self
116 }
117 /// <p>The VPC security groups and subnets that are attached to a project.</p>
118 pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
119 self.vpc_config = input;
120 self
121 }
122 /// <p>The VPC security groups and subnets that are attached to a project.</p>
123 pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
124 &self.vpc_config
125 }
126 /// Appends an item to `environment_variables`.
127 ///
128 /// To override the contents of this collection use [`set_environment_variables`](Self::set_environment_variables).
129 ///
130 /// <p>A set of environment variables which are used by default for all runs in the project. These environment variables are applied to the test run during the execution of a test spec file.</p>
131 /// <p>For more information about using test spec files, please see <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html">Custom test environments </a> in <i>AWS Device Farm.</i></p>
132 pub fn environment_variables(mut self, input: crate::types::EnvironmentVariable) -> Self {
133 let mut v = self.environment_variables.unwrap_or_default();
134 v.push(input);
135 self.environment_variables = ::std::option::Option::Some(v);
136 self
137 }
138 /// <p>A set of environment variables which are used by default for all runs in the project. These environment variables are applied to the test run during the execution of a test spec file.</p>
139 /// <p>For more information about using test spec files, please see <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html">Custom test environments </a> in <i>AWS Device Farm.</i></p>
140 pub fn set_environment_variables(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>>) -> Self {
141 self.environment_variables = input;
142 self
143 }
144 /// <p>A set of environment variables which are used by default for all runs in the project. These environment variables are applied to the test run during the execution of a test spec file.</p>
145 /// <p>For more information about using test spec files, please see <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html">Custom test environments </a> in <i>AWS Device Farm.</i></p>
146 pub fn get_environment_variables(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>> {
147 &self.environment_variables
148 }
149 /// <p>An IAM role to be assumed by the test host for all runs in the project.</p>
150 pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.execution_role_arn = ::std::option::Option::Some(input.into());
152 self
153 }
154 /// <p>An IAM role to be assumed by the test host for all runs in the project.</p>
155 pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.execution_role_arn = input;
157 self
158 }
159 /// <p>An IAM role to be assumed by the test host for all runs in the project.</p>
160 pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
161 &self.execution_role_arn
162 }
163 /// Consumes the builder and constructs a [`UpdateProjectInput`](crate::operation::update_project::UpdateProjectInput).
164 pub fn build(
165 self,
166 ) -> ::std::result::Result<crate::operation::update_project::UpdateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
167 ::std::result::Result::Ok(crate::operation::update_project::UpdateProjectInput {
168 arn: self.arn,
169 name: self.name,
170 default_job_timeout_minutes: self.default_job_timeout_minutes,
171 vpc_config: self.vpc_config,
172 environment_variables: self.environment_variables,
173 execution_role_arn: self.execution_role_arn,
174 })
175 }
176}