aws-sdk-securityagent 1.1.0

AWS SDK for AWS Security Agent
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetArtifactOutput {
    /// Unique identifier of the agent space
    pub agent_space_id: ::std::string::String,
    /// Unique identifier of the artifact
    pub artifact_id: ::std::string::String,
    /// Artifact details
    pub artifact: ::std::option::Option<crate::types::Artifact>,
    /// Name of the artifact file
    pub file_name: ::std::string::String,
    /// Timestamp when the artifact was last updated
    pub updated_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl GetArtifactOutput {
    /// Unique identifier of the agent space
    pub fn agent_space_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_id.deref()
    }
    /// Unique identifier of the artifact
    pub fn artifact_id(&self) -> &str {
        use std::ops::Deref;
        self.artifact_id.deref()
    }
    /// Artifact details
    pub fn artifact(&self) -> ::std::option::Option<&crate::types::Artifact> {
        self.artifact.as_ref()
    }
    /// Name of the artifact file
    pub fn file_name(&self) -> &str {
        use std::ops::Deref;
        self.file_name.deref()
    }
    /// Timestamp when the artifact was last updated
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
}
impl ::aws_types::request_id::RequestId for GetArtifactOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetArtifactOutput {
    /// Creates a new builder-style object to manufacture [`GetArtifactOutput`](crate::operation::get_artifact::GetArtifactOutput).
    pub fn builder() -> crate::operation::get_artifact::builders::GetArtifactOutputBuilder {
        crate::operation::get_artifact::builders::GetArtifactOutputBuilder::default()
    }
}

/// A builder for [`GetArtifactOutput`](crate::operation::get_artifact::GetArtifactOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetArtifactOutputBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) artifact_id: ::std::option::Option<::std::string::String>,
    pub(crate) artifact: ::std::option::Option<crate::types::Artifact>,
    pub(crate) file_name: ::std::option::Option<::std::string::String>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetArtifactOutputBuilder {
    /// Unique identifier of the agent space
    /// 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
    }
    /// Unique identifier of the agent space
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// Unique identifier of the agent space
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// Unique identifier of the artifact
    /// This field is required.
    pub fn artifact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.artifact_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Unique identifier of the artifact
    pub fn set_artifact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.artifact_id = input;
        self
    }
    /// Unique identifier of the artifact
    pub fn get_artifact_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.artifact_id
    }
    /// Artifact details
    /// This field is required.
    pub fn artifact(mut self, input: crate::types::Artifact) -> Self {
        self.artifact = ::std::option::Option::Some(input);
        self
    }
    /// Artifact details
    pub fn set_artifact(mut self, input: ::std::option::Option<crate::types::Artifact>) -> Self {
        self.artifact = input;
        self
    }
    /// Artifact details
    pub fn get_artifact(&self) -> &::std::option::Option<crate::types::Artifact> {
        &self.artifact
    }
    /// Name of the artifact file
    /// This field is required.
    pub fn file_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_name = ::std::option::Option::Some(input.into());
        self
    }
    /// Name of the artifact file
    pub fn set_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_name = input;
        self
    }
    /// Name of the artifact file
    pub fn get_file_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_name
    }
    /// Timestamp when the artifact 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
    }
    /// Timestamp when the artifact was last updated
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// Timestamp when the artifact was last updated
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetArtifactOutput`](crate::operation::get_artifact::GetArtifactOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`agent_space_id`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::agent_space_id)
    /// - [`artifact_id`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::artifact_id)
    /// - [`file_name`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::file_name)
    /// - [`updated_at`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::updated_at)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_artifact::GetArtifactOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_artifact::GetArtifactOutput {
            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 GetArtifactOutput",
                )
            })?,
            artifact_id: self.artifact_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "artifact_id",
                    "artifact_id was not specified but it is required when building GetArtifactOutput",
                )
            })?,
            artifact: self.artifact,
            file_name: self.file_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_name",
                    "file_name was not specified but it is required when building GetArtifactOutput",
                )
            })?,
            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 GetArtifactOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}