aws-sdk-devopsagent 1.4.0

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

/// Represents a service association within an AgentSpace, defining how the agent interacts with external services.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Association {
    /// The unique identifier of the AgentSpace
    pub agent_space_id: ::std::string::String,
    /// The timestamp when the resource was created.
    pub created_at: ::aws_smithy_types::DateTime,
    /// The timestamp when the resource was last updated.
    pub updated_at: ::aws_smithy_types::DateTime,
    /// Validation status
    pub status: ::std::option::Option<crate::types::ValidationStatus>,
    /// The unique identifier of the given association.
    pub association_id: ::std::string::String,
    /// The identifier for associated service
    pub service_id: ::std::string::String,
    /// The configuration that directs how AgentSpace interacts with the given service.
    pub configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
}
impl Association {
    /// The unique identifier of the AgentSpace
    pub fn agent_space_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_id.deref()
    }
    /// The timestamp when the resource was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// The timestamp when the resource was last updated.
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// Validation status
    pub fn status(&self) -> ::std::option::Option<&crate::types::ValidationStatus> {
        self.status.as_ref()
    }
    /// The unique identifier of the given association.
    pub fn association_id(&self) -> &str {
        use std::ops::Deref;
        self.association_id.deref()
    }
    /// The identifier for associated service
    pub fn service_id(&self) -> &str {
        use std::ops::Deref;
        self.service_id.deref()
    }
    /// The configuration that directs how AgentSpace interacts with the given service.
    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ServiceConfiguration> {
        self.configuration.as_ref()
    }
}
impl Association {
    /// Creates a new builder-style object to manufacture [`Association`](crate::types::Association).
    pub fn builder() -> crate::types::builders::AssociationBuilder {
        crate::types::builders::AssociationBuilder::default()
    }
}

/// A builder for [`Association`](crate::types::Association).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssociationBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) status: ::std::option::Option<crate::types::ValidationStatus>,
    pub(crate) association_id: ::std::option::Option<::std::string::String>,
    pub(crate) service_id: ::std::option::Option<::std::string::String>,
    pub(crate) configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
}
impl AssociationBuilder {
    /// The unique identifier of the AgentSpace
    /// 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
    }
    /// The unique identifier of the AgentSpace
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// The unique identifier of the AgentSpace
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// The timestamp when the resource was created.
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// The timestamp when the resource was created.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// The timestamp when the resource was created.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// The timestamp when the resource was last updated.
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// The timestamp when the resource was last updated.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// The timestamp when the resource was last updated.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Validation status
    pub fn status(mut self, input: crate::types::ValidationStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// Validation status
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ValidationStatus>) -> Self {
        self.status = input;
        self
    }
    /// Validation status
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ValidationStatus> {
        &self.status
    }
    /// The unique identifier of the given association.
    /// 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
    }
    /// The unique identifier of the given association.
    pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.association_id = input;
        self
    }
    /// The unique identifier of the given association.
    pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.association_id
    }
    /// The identifier for associated service
    /// This field is required.
    pub fn service_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The identifier for associated service
    pub fn set_service_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_id = input;
        self
    }
    /// The identifier for associated service
    pub fn get_service_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_id
    }
    /// The configuration that directs how AgentSpace interacts with the given service.
    /// This field is required.
    pub fn configuration(mut self, input: crate::types::ServiceConfiguration) -> Self {
        self.configuration = ::std::option::Option::Some(input);
        self
    }
    /// The configuration that directs how AgentSpace interacts with the given service.
    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ServiceConfiguration>) -> Self {
        self.configuration = input;
        self
    }
    /// The configuration that directs how AgentSpace interacts with the given service.
    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ServiceConfiguration> {
        &self.configuration
    }
    /// Consumes the builder and constructs a [`Association`](crate::types::Association).
    /// This method will fail if any of the following fields are not set:
    /// - [`agent_space_id`](crate::types::builders::AssociationBuilder::agent_space_id)
    /// - [`created_at`](crate::types::builders::AssociationBuilder::created_at)
    /// - [`updated_at`](crate::types::builders::AssociationBuilder::updated_at)
    /// - [`association_id`](crate::types::builders::AssociationBuilder::association_id)
    /// - [`service_id`](crate::types::builders::AssociationBuilder::service_id)
    pub fn build(self) -> ::std::result::Result<crate::types::Association, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Association {
            agent_space_id: self.agent_space_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_space_id",
                    "agent_space_id was not specified but it is required when building Association",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building Association",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building Association",
                )
            })?,
            status: self.status,
            association_id: self.association_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "association_id",
                    "association_id was not specified but it is required when building Association",
                )
            })?,
            service_id: self.service_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "service_id",
                    "service_id was not specified but it is required when building Association",
                )
            })?,
            configuration: self.configuration,
        })
    }
}