aws-sdk-devopsagent 1.10.0

AWS SDK for AWS DevOps Agent Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Input for updating an existing service association. Present fields are fully replaced; absent fields are left unchanged.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateAssociationInput {
    /// <p>The unique identifier of the AgentSpace</p>
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the given association.</p>
    pub association_id: ::std::option::Option<::std::string::String>,
    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
    pub configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
    /// <p>Enabled capabilities for this association.</p>
    pub capabilities: ::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>>,
}
impl UpdateAssociationInput {
    /// <p>The unique identifier of the AgentSpace</p>
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// <p>The unique identifier of the given association.</p>
    pub fn association_id(&self) -> ::std::option::Option<&str> {
        self.association_id.as_deref()
    }
    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ServiceConfiguration> {
        self.configuration.as_ref()
    }
    /// <p>Enabled capabilities for this association.</p>
    pub fn capabilities(
        &self,
    ) -> ::std::option::Option<&::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>> {
        self.capabilities.as_ref()
    }
}
impl UpdateAssociationInput {
    /// Creates a new builder-style object to manufacture [`UpdateAssociationInput`](crate::operation::update_association::UpdateAssociationInput).
    pub fn builder() -> crate::operation::update_association::builders::UpdateAssociationInputBuilder {
        crate::operation::update_association::builders::UpdateAssociationInputBuilder::default()
    }
}

/// A builder for [`UpdateAssociationInput`](crate::operation::update_association::UpdateAssociationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateAssociationInputBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) association_id: ::std::option::Option<::std::string::String>,
    pub(crate) configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
    pub(crate) capabilities: ::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>>,
}
impl UpdateAssociationInputBuilder {
    /// <p>The unique identifier of the AgentSpace</p>
    /// This field is required.
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the AgentSpace</p>
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// <p>The unique identifier of the AgentSpace</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>The unique identifier of the given association.</p>
    /// This field is required.
    pub fn association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.association_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the given association.</p>
    pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.association_id = input;
        self
    }
    /// <p>The unique identifier of the given association.</p>
    pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.association_id
    }
    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
    /// This field is required.
    pub fn configuration(mut self, input: crate::types::ServiceConfiguration) -> Self {
        self.configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ServiceConfiguration>) -> Self {
        self.configuration = input;
        self
    }
    /// <p>The configuration that directs how AgentSpace interacts with the given service. The entire configuration is replaced on update.</p>
    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ServiceConfiguration> {
        &self.configuration
    }
    /// Adds a key-value pair to `capabilities`.
    ///
    /// To override the contents of this collection use [`set_capabilities`](Self::set_capabilities).
    ///
    /// <p>Enabled capabilities for this association.</p>
    pub fn capabilities(mut self, k: crate::types::CapabilityType, v: crate::types::CapabilityConfiguration) -> Self {
        let mut hash_map = self.capabilities.unwrap_or_default();
        hash_map.insert(k, v);
        self.capabilities = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Enabled capabilities for this association.</p>
    pub fn set_capabilities(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>>,
    ) -> Self {
        self.capabilities = input;
        self
    }
    /// <p>Enabled capabilities for this association.</p>
    pub fn get_capabilities(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<crate::types::CapabilityType, crate::types::CapabilityConfiguration>> {
        &self.capabilities
    }
    /// Consumes the builder and constructs a [`UpdateAssociationInput`](crate::operation::update_association::UpdateAssociationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_association::UpdateAssociationInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_association::UpdateAssociationInput {
            agent_space_id: self.agent_space_id,
            association_id: self.association_id,
            configuration: self.configuration,
            capabilities: self.capabilities,
        })
    }
}