Skip to main content

aws_sdk_devopsagent/operation/associate_service/
_associate_service_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Input for creating a new service association within an AgentSpace.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AssociateServiceInput {
7    /// The unique identifier of the AgentSpace
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// The unique identifier of the service.
10    pub service_id: ::std::option::Option<::std::string::String>,
11    /// The configuration that directs how AgentSpace interacts with the given service.
12    pub configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
13}
14impl AssociateServiceInput {
15    /// The unique identifier of the AgentSpace
16    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
17        self.agent_space_id.as_deref()
18    }
19    /// The unique identifier of the service.
20    pub fn service_id(&self) -> ::std::option::Option<&str> {
21        self.service_id.as_deref()
22    }
23    /// The configuration that directs how AgentSpace interacts with the given service.
24    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ServiceConfiguration> {
25        self.configuration.as_ref()
26    }
27}
28impl AssociateServiceInput {
29    /// Creates a new builder-style object to manufacture [`AssociateServiceInput`](crate::operation::associate_service::AssociateServiceInput).
30    pub fn builder() -> crate::operation::associate_service::builders::AssociateServiceInputBuilder {
31        crate::operation::associate_service::builders::AssociateServiceInputBuilder::default()
32    }
33}
34
35/// A builder for [`AssociateServiceInput`](crate::operation::associate_service::AssociateServiceInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct AssociateServiceInputBuilder {
39    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
40    pub(crate) service_id: ::std::option::Option<::std::string::String>,
41    pub(crate) configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
42}
43impl AssociateServiceInputBuilder {
44    /// The unique identifier of the AgentSpace
45    /// This field is required.
46    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.agent_space_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// The unique identifier of the AgentSpace
51    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.agent_space_id = input;
53        self
54    }
55    /// The unique identifier of the AgentSpace
56    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.agent_space_id
58    }
59    /// The unique identifier of the service.
60    /// This field is required.
61    pub fn service_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.service_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// The unique identifier of the service.
66    pub fn set_service_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.service_id = input;
68        self
69    }
70    /// The unique identifier of the service.
71    pub fn get_service_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.service_id
73    }
74    /// The configuration that directs how AgentSpace interacts with the given service.
75    /// This field is required.
76    pub fn configuration(mut self, input: crate::types::ServiceConfiguration) -> Self {
77        self.configuration = ::std::option::Option::Some(input);
78        self
79    }
80    /// The configuration that directs how AgentSpace interacts with the given service.
81    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ServiceConfiguration>) -> Self {
82        self.configuration = input;
83        self
84    }
85    /// The configuration that directs how AgentSpace interacts with the given service.
86    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ServiceConfiguration> {
87        &self.configuration
88    }
89    /// Consumes the builder and constructs a [`AssociateServiceInput`](crate::operation::associate_service::AssociateServiceInput).
90    pub fn build(
91        self,
92    ) -> ::std::result::Result<crate::operation::associate_service::AssociateServiceInput, ::aws_smithy_types::error::operation::BuildError> {
93        ::std::result::Result::Ok(crate::operation::associate_service::AssociateServiceInput {
94            agent_space_id: self.agent_space_id,
95            service_id: self.service_id,
96            configuration: self.configuration,
97        })
98    }
99}