Skip to main content

aws_sdk_devopsagent/operation/update_goal/
_update_goal_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Request structure for updating a goal
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateGoalInput {
7    /// The unique identifier for the agent space containing the goal
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// The unique identifier of the goal to update
10    pub goal_id: ::std::option::Option<::std::string::String>,
11    /// Update goal schedule state
12    pub evaluation_schedule: ::std::option::Option<crate::types::GoalScheduleInput>,
13    /// Client-provided token for idempotent operations
14    pub client_token: ::std::option::Option<::std::string::String>,
15}
16impl UpdateGoalInput {
17    /// The unique identifier for the agent space containing the goal
18    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
19        self.agent_space_id.as_deref()
20    }
21    /// The unique identifier of the goal to update
22    pub fn goal_id(&self) -> ::std::option::Option<&str> {
23        self.goal_id.as_deref()
24    }
25    /// Update goal schedule state
26    pub fn evaluation_schedule(&self) -> ::std::option::Option<&crate::types::GoalScheduleInput> {
27        self.evaluation_schedule.as_ref()
28    }
29    /// Client-provided token for idempotent operations
30    pub fn client_token(&self) -> ::std::option::Option<&str> {
31        self.client_token.as_deref()
32    }
33}
34impl UpdateGoalInput {
35    /// Creates a new builder-style object to manufacture [`UpdateGoalInput`](crate::operation::update_goal::UpdateGoalInput).
36    pub fn builder() -> crate::operation::update_goal::builders::UpdateGoalInputBuilder {
37        crate::operation::update_goal::builders::UpdateGoalInputBuilder::default()
38    }
39}
40
41/// A builder for [`UpdateGoalInput`](crate::operation::update_goal::UpdateGoalInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UpdateGoalInputBuilder {
45    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
46    pub(crate) goal_id: ::std::option::Option<::std::string::String>,
47    pub(crate) evaluation_schedule: ::std::option::Option<crate::types::GoalScheduleInput>,
48    pub(crate) client_token: ::std::option::Option<::std::string::String>,
49}
50impl UpdateGoalInputBuilder {
51    /// The unique identifier for the agent space containing the goal
52    /// This field is required.
53    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.agent_space_id = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// The unique identifier for the agent space containing the goal
58    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.agent_space_id = input;
60        self
61    }
62    /// The unique identifier for the agent space containing the goal
63    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
64        &self.agent_space_id
65    }
66    /// The unique identifier of the goal to update
67    /// This field is required.
68    pub fn goal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.goal_id = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// The unique identifier of the goal to update
73    pub fn set_goal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.goal_id = input;
75        self
76    }
77    /// The unique identifier of the goal to update
78    pub fn get_goal_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.goal_id
80    }
81    /// Update goal schedule state
82    pub fn evaluation_schedule(mut self, input: crate::types::GoalScheduleInput) -> Self {
83        self.evaluation_schedule = ::std::option::Option::Some(input);
84        self
85    }
86    /// Update goal schedule state
87    pub fn set_evaluation_schedule(mut self, input: ::std::option::Option<crate::types::GoalScheduleInput>) -> Self {
88        self.evaluation_schedule = input;
89        self
90    }
91    /// Update goal schedule state
92    pub fn get_evaluation_schedule(&self) -> &::std::option::Option<crate::types::GoalScheduleInput> {
93        &self.evaluation_schedule
94    }
95    /// Client-provided token for idempotent operations
96    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.client_token = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// Client-provided token for idempotent operations
101    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.client_token = input;
103        self
104    }
105    /// Client-provided token for idempotent operations
106    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
107        &self.client_token
108    }
109    /// Consumes the builder and constructs a [`UpdateGoalInput`](crate::operation::update_goal::UpdateGoalInput).
110    pub fn build(self) -> ::std::result::Result<crate::operation::update_goal::UpdateGoalInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::update_goal::UpdateGoalInput {
112            agent_space_id: self.agent_space_id,
113            goal_id: self.goal_id,
114            evaluation_schedule: self.evaluation_schedule,
115            client_token: self.client_token,
116        })
117    }
118}