aws-sdk-continuum 1.0.0

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

/// Contains the identifier, ARN, title, and initial status of the newly ingested finding.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCodeFindingOutput {
    /// The unique identifier assigned to the finding.
    pub finding_id: ::std::string::String,
    /// The ARN of the ingested finding.
    pub finding_arn: ::std::string::String,
    /// The title extracted from the submitted document. Always populated at ingestion.
    pub title: ::std::string::String,
    /// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
    pub status: crate::types::FindingStatus,
    /// The timestamp when the finding was ingested.
    pub created_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl CreateCodeFindingOutput {
    /// The unique identifier assigned to the finding.
    pub fn finding_id(&self) -> &str {
        use std::ops::Deref;
        self.finding_id.deref()
    }
    /// The ARN of the ingested finding.
    pub fn finding_arn(&self) -> &str {
        use std::ops::Deref;
        self.finding_arn.deref()
    }
    /// The title extracted from the submitted document. Always populated at ingestion.
    pub fn title(&self) -> &str {
        use std::ops::Deref;
        self.title.deref()
    }
    /// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
    pub fn status(&self) -> &crate::types::FindingStatus {
        &self.status
    }
    /// The timestamp when the finding was ingested.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
}
impl ::aws_types::request_id::RequestId for CreateCodeFindingOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateCodeFindingOutput {
    /// Creates a new builder-style object to manufacture [`CreateCodeFindingOutput`](crate::operation::create_code_finding::CreateCodeFindingOutput).
    pub fn builder() -> crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder {
        crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::default()
    }
}

/// A builder for [`CreateCodeFindingOutput`](crate::operation::create_code_finding::CreateCodeFindingOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCodeFindingOutputBuilder {
    pub(crate) finding_id: ::std::option::Option<::std::string::String>,
    pub(crate) finding_arn: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::FindingStatus>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateCodeFindingOutputBuilder {
    /// The unique identifier assigned to the finding.
    /// This field is required.
    pub fn finding_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.finding_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier assigned to the finding.
    pub fn set_finding_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.finding_id = input;
        self
    }
    /// The unique identifier assigned to the finding.
    pub fn get_finding_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.finding_id
    }
    /// The ARN of the ingested finding.
    /// This field is required.
    pub fn finding_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.finding_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the ingested finding.
    pub fn set_finding_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.finding_arn = input;
        self
    }
    /// The ARN of the ingested finding.
    pub fn get_finding_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.finding_arn
    }
    /// The title extracted from the submitted document. Always populated at ingestion.
    /// 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
    }
    /// The title extracted from the submitted document. Always populated at ingestion.
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// The title extracted from the submitted document. Always populated at ingestion.
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
    /// This field is required.
    pub fn status(mut self, input: crate::types::FindingStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatus>) -> Self {
        self.status = input;
        self
    }
    /// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
    pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatus> {
        &self.status
    }
    /// The timestamp when the finding was ingested.
    /// 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 finding was ingested.
    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 finding was ingested.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_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 [`CreateCodeFindingOutput`](crate::operation::create_code_finding::CreateCodeFindingOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`finding_id`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::finding_id)
    /// - [`finding_arn`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::finding_arn)
    /// - [`title`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::title)
    /// - [`status`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::status)
    /// - [`created_at`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_code_finding::CreateCodeFindingOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_code_finding::CreateCodeFindingOutput {
            finding_id: self.finding_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "finding_id",
                    "finding_id was not specified but it is required when building CreateCodeFindingOutput",
                )
            })?,
            finding_arn: self.finding_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "finding_arn",
                    "finding_arn was not specified but it is required when building CreateCodeFindingOutput",
                )
            })?,
            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 CreateCodeFindingOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building CreateCodeFindingOutput",
                )
            })?,
            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 CreateCodeFindingOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}