aws-sdk-assurance 1.0.0

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

/// <p>Output of <code>PutEvidence</code>: the evidence item and its version.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutEvidenceOutput {
    /// <p>The unique identifier of the evidence item.</p>
    pub evidence_id: ::std::string::String,
    /// <p>The version number of the evidence.</p>
    pub version: i32,
    _request_id: Option<String>,
}
impl PutEvidenceOutput {
    /// <p>The unique identifier of the evidence item.</p>
    pub fn evidence_id(&self) -> &str {
        use std::ops::Deref;
        self.evidence_id.deref()
    }
    /// <p>The version number of the evidence.</p>
    pub fn version(&self) -> i32 {
        self.version
    }
}
impl ::aws_types::request_id::RequestId for PutEvidenceOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl PutEvidenceOutput {
    /// Creates a new builder-style object to manufacture [`PutEvidenceOutput`](crate::operation::put_evidence::PutEvidenceOutput).
    pub fn builder() -> crate::operation::put_evidence::builders::PutEvidenceOutputBuilder {
        crate::operation::put_evidence::builders::PutEvidenceOutputBuilder::default()
    }
}

/// A builder for [`PutEvidenceOutput`](crate::operation::put_evidence::PutEvidenceOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutEvidenceOutputBuilder {
    pub(crate) evidence_id: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<i32>,
    _request_id: Option<String>,
}
impl PutEvidenceOutputBuilder {
    /// <p>The unique identifier of the evidence item.</p>
    /// This field is required.
    pub fn evidence_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.evidence_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the evidence item.</p>
    pub fn set_evidence_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.evidence_id = input;
        self
    }
    /// <p>The unique identifier of the evidence item.</p>
    pub fn get_evidence_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.evidence_id
    }
    /// <p>The version number of the evidence.</p>
    /// This field is required.
    pub fn version(mut self, input: i32) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The version number of the evidence.</p>
    pub fn set_version(mut self, input: ::std::option::Option<i32>) -> Self {
        self.version = input;
        self
    }
    /// <p>The version number of the evidence.</p>
    pub fn get_version(&self) -> &::std::option::Option<i32> {
        &self.version
    }
    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 [`PutEvidenceOutput`](crate::operation::put_evidence::PutEvidenceOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`evidence_id`](crate::operation::put_evidence::builders::PutEvidenceOutputBuilder::evidence_id)
    /// - [`version`](crate::operation::put_evidence::builders::PutEvidenceOutputBuilder::version)
    pub fn build(self) -> ::std::result::Result<crate::operation::put_evidence::PutEvidenceOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_evidence::PutEvidenceOutput {
            evidence_id: self.evidence_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "evidence_id",
                    "evidence_id was not specified but it is required when building PutEvidenceOutput",
                )
            })?,
            version: self.version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "version",
                    "version was not specified but it is required when building PutEvidenceOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}