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>GetEvidenceContent</code>: the content of one evidence version.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetEvidenceContentOutput {
    /// <p>The evidence file content.</p>
    pub content: ::aws_smithy_types::Blob,
    /// <p>The MIME type of the content.</p>
    pub content_type: ::std::string::String,
    /// <p>The title of the evidence.</p>
    pub title: ::std::string::String,
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub checksum: ::std::option::Option<::std::string::String>,
    /// <p>The version number of the evidence that the content belongs to.</p>
    pub version: i32,
    _request_id: Option<String>,
}
impl GetEvidenceContentOutput {
    /// <p>The evidence file content.</p>
    pub fn content(&self) -> &::aws_smithy_types::Blob {
        &self.content
    }
    /// <p>The MIME type of the content.</p>
    pub fn content_type(&self) -> &str {
        use std::ops::Deref;
        self.content_type.deref()
    }
    /// <p>The title of the evidence.</p>
    pub fn title(&self) -> &str {
        use std::ops::Deref;
        self.title.deref()
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn checksum(&self) -> ::std::option::Option<&str> {
        self.checksum.as_deref()
    }
    /// <p>The version number of the evidence that the content belongs to.</p>
    pub fn version(&self) -> i32 {
        self.version
    }
}
impl ::std::fmt::Debug for GetEvidenceContentOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetEvidenceContentOutput");
        formatter.field("content", &"*** Sensitive Data Redacted ***");
        formatter.field("content_type", &self.content_type);
        formatter.field("title", &"*** Sensitive Data Redacted ***");
        formatter.field("checksum", &self.checksum);
        formatter.field("version", &self.version);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetEvidenceContentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetEvidenceContentOutput {
    /// Creates a new builder-style object to manufacture [`GetEvidenceContentOutput`](crate::operation::get_evidence_content::GetEvidenceContentOutput).
    pub fn builder() -> crate::operation::get_evidence_content::builders::GetEvidenceContentOutputBuilder {
        crate::operation::get_evidence_content::builders::GetEvidenceContentOutputBuilder::default()
    }
}

/// A builder for [`GetEvidenceContentOutput`](crate::operation::get_evidence_content::GetEvidenceContentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetEvidenceContentOutputBuilder {
    pub(crate) content: ::std::option::Option<::aws_smithy_types::Blob>,
    pub(crate) content_type: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) checksum: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<i32>,
    _request_id: Option<String>,
}
impl GetEvidenceContentOutputBuilder {
    /// <p>The evidence file content.</p>
    /// This field is required.
    pub fn content(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.content = ::std::option::Option::Some(input);
        self
    }
    /// <p>The evidence file content.</p>
    pub fn set_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.content = input;
        self
    }
    /// <p>The evidence file content.</p>
    pub fn get_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.content
    }
    /// <p>The MIME type of the content.</p>
    /// This field is required.
    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.content_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The MIME type of the content.</p>
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.content_type = input;
        self
    }
    /// <p>The MIME type of the content.</p>
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.content_type
    }
    /// <p>The title of the evidence.</p>
    /// This field is required.
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The title of the evidence.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// <p>The title of the evidence.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.checksum = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.checksum = input;
        self
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
        &self.checksum
    }
    /// <p>The version number of the evidence that the content belongs to.</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 that the content belongs to.</p>
    pub fn set_version(mut self, input: ::std::option::Option<i32>) -> Self {
        self.version = input;
        self
    }
    /// <p>The version number of the evidence that the content belongs to.</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 [`GetEvidenceContentOutput`](crate::operation::get_evidence_content::GetEvidenceContentOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`content`](crate::operation::get_evidence_content::builders::GetEvidenceContentOutputBuilder::content)
    /// - [`content_type`](crate::operation::get_evidence_content::builders::GetEvidenceContentOutputBuilder::content_type)
    /// - [`title`](crate::operation::get_evidence_content::builders::GetEvidenceContentOutputBuilder::title)
    /// - [`version`](crate::operation::get_evidence_content::builders::GetEvidenceContentOutputBuilder::version)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_evidence_content::GetEvidenceContentOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_evidence_content::GetEvidenceContentOutput {
            content: self.content.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "content",
                    "content was not specified but it is required when building GetEvidenceContentOutput",
                )
            })?,
            content_type: self.content_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "content_type",
                    "content_type was not specified but it is required when building GetEvidenceContentOutput",
                )
            })?,
            title: self.title.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "title",
                    "title was not specified but it is required when building GetEvidenceContentOutput",
                )
            })?,
            checksum: self.checksum,
            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 GetEvidenceContentOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetEvidenceContentOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetEvidenceContentOutputBuilder");
        formatter.field("content", &"*** Sensitive Data Redacted ***");
        formatter.field("content_type", &self.content_type);
        formatter.field("title", &"*** Sensitive Data Redacted ***");
        formatter.field("checksum", &self.checksum);
        formatter.field("version", &self.version);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}