Skip to main content

aws_sdk_devopsagent/operation/update_association/
_update_association_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Input for updating an existing service association. Present fields are fully replaced; absent fields are left unchanged.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateAssociationInput {
7    /// <p>The unique identifier of the AgentSpace</p>
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// <p>The unique identifier of the given association.</p>
10    pub association_id: ::std::option::Option<::std::string::String>,
11    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
12    pub configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
13    /// <p>Enabled capabilities for this association.</p>
14    pub capabilities: ::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>>,
15}
16impl UpdateAssociationInput {
17    /// <p>The unique identifier of the AgentSpace</p>
18    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
19        self.agent_space_id.as_deref()
20    }
21    /// <p>The unique identifier of the given association.</p>
22    pub fn association_id(&self) -> ::std::option::Option<&str> {
23        self.association_id.as_deref()
24    }
25    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
26    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ServiceConfiguration> {
27        self.configuration.as_ref()
28    }
29    /// <p>Enabled capabilities for this association.</p>
30    pub fn capabilities(
31        &self,
32    ) -> ::std::option::Option<&::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>> {
33        self.capabilities.as_ref()
34    }
35}
36impl UpdateAssociationInput {
37    /// Creates a new builder-style object to manufacture [`UpdateAssociationInput`](crate::operation::update_association::UpdateAssociationInput).
38    pub fn builder() -> crate::operation::update_association::builders::UpdateAssociationInputBuilder {
39        crate::operation::update_association::builders::UpdateAssociationInputBuilder::default()
40    }
41}
42
43/// A builder for [`UpdateAssociationInput`](crate::operation::update_association::UpdateAssociationInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct UpdateAssociationInputBuilder {
47    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
48    pub(crate) association_id: ::std::option::Option<::std::string::String>,
49    pub(crate) configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
50    pub(crate) capabilities: ::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>>,
51}
52impl UpdateAssociationInputBuilder {
53    /// <p>The unique identifier of the AgentSpace</p>
54    /// This field is required.
55    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.agent_space_id = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>The unique identifier of the AgentSpace</p>
60    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.agent_space_id = input;
62        self
63    }
64    /// <p>The unique identifier of the AgentSpace</p>
65    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
66        &self.agent_space_id
67    }
68    /// <p>The unique identifier of the given association.</p>
69    /// This field is required.
70    pub fn association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.association_id = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The unique identifier of the given association.</p>
75    pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.association_id = input;
77        self
78    }
79    /// <p>The unique identifier of the given association.</p>
80    pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
81        &self.association_id
82    }
83    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
84    /// This field is required.
85    pub fn configuration(mut self, input: crate::types::ServiceConfiguration) -> Self {
86        self.configuration = ::std::option::Option::Some(input);
87        self
88    }
89    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
90    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ServiceConfiguration>) -> Self {
91        self.configuration = input;
92        self
93    }
94    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
95    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ServiceConfiguration> {
96        &self.configuration
97    }
98    /// Adds a key-value pair to `capabilities`.
99    ///
100    /// To override the contents of this collection use [`set_capabilities`](Self::set_capabilities).
101    ///
102    /// <p>Enabled capabilities for this association.</p>
103    pub fn capabilities(mut self, k: crate::types::CapabilityType, v: crate::types::CapabilityConfiguration) -> Self {
104        let mut hash_map = self.capabilities.unwrap_or_default();
105        hash_map.insert(k, v);
106        self.capabilities = ::std::option::Option::Some(hash_map);
107        self
108    }
109    /// <p>Enabled capabilities for this association.</p>
110    pub fn set_capabilities(
111        mut self,
112        input: ::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>>,
113    ) -> Self {
114        self.capabilities = input;
115        self
116    }
117    /// <p>Enabled capabilities for this association.</p>
118    pub fn get_capabilities(
119        &self,
120    ) -> &::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>> {
121        &self.capabilities
122    }
123    /// Consumes the builder and constructs a [`UpdateAssociationInput`](crate::operation::update_association::UpdateAssociationInput).
124    pub fn build(
125        self,
126    ) -> ::std::result::Result<crate::operation::update_association::UpdateAssociationInput, ::aws_smithy_types::error::operation::BuildError> {
127        ::std::result::Result::Ok(crate::operation::update_association::UpdateAssociationInput {
128            agent_space_id: self.agent_space_id,
129            association_id: self.association_id,
130            configuration: self.configuration,
131            capabilities: self.capabilities,
132        })
133    }
134}