aws-sdk-accessanalyzer 1.106.0

AWS SDK for Access Analyzer
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 GetFindingV2Output {
    /// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
    pub analyzed_at: ::aws_smithy_types::DateTime,
    /// <p>The time at which the finding was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>An error.</p>
    pub error: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the finding to retrieve.</p>
    pub id: ::std::string::String,
    /// <p>A token used for pagination of results returned.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The resource that generated the finding.</p>
    pub resource: ::std::option::Option<::std::string::String>,
    /// <p>The type of the resource identified in the finding.</p>
    pub resource_type: crate::types::ResourceType,
    /// <p>Tye Amazon Web Services account ID that owns the resource.</p>
    pub resource_owner_account: ::std::string::String,
    /// <p>The status of the finding.</p>
    pub status: crate::types::FindingStatus,
    /// <p>The time at which the finding was updated.</p>
    pub updated_at: ::aws_smithy_types::DateTime,
    /// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
    pub finding_details: ::std::vec::Vec<crate::types::FindingDetails>,
    /// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
    pub finding_type: ::std::option::Option<crate::types::FindingType>,
    _request_id: Option<String>,
}
impl GetFindingV2Output {
    /// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
    pub fn analyzed_at(&self) -> &::aws_smithy_types::DateTime {
        &self.analyzed_at
    }
    /// <p>The time at which the finding was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>An error.</p>
    pub fn error(&self) -> ::std::option::Option<&str> {
        self.error.as_deref()
    }
    /// <p>The ID of the finding to retrieve.</p>
    pub fn id(&self) -> &str {
        use std::ops::Deref;
        self.id.deref()
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The resource that generated the finding.</p>
    pub fn resource(&self) -> ::std::option::Option<&str> {
        self.resource.as_deref()
    }
    /// <p>The type of the resource identified in the finding.</p>
    pub fn resource_type(&self) -> &crate::types::ResourceType {
        &self.resource_type
    }
    /// <p>Tye Amazon Web Services account ID that owns the resource.</p>
    pub fn resource_owner_account(&self) -> &str {
        use std::ops::Deref;
        self.resource_owner_account.deref()
    }
    /// <p>The status of the finding.</p>
    pub fn status(&self) -> &crate::types::FindingStatus {
        &self.status
    }
    /// <p>The time at which the finding was updated.</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
    pub fn finding_details(&self) -> &[crate::types::FindingDetails] {
        use std::ops::Deref;
        self.finding_details.deref()
    }
    /// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
    pub fn finding_type(&self) -> ::std::option::Option<&crate::types::FindingType> {
        self.finding_type.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetFindingV2Output {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetFindingV2Output {
    /// Creates a new builder-style object to manufacture [`GetFindingV2Output`](crate::operation::get_finding_v2::GetFindingV2Output).
    pub fn builder() -> crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder {
        crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::default()
    }
}

/// A builder for [`GetFindingV2Output`](crate::operation::get_finding_v2::GetFindingV2Output).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetFindingV2OutputBuilder {
    pub(crate) analyzed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) error: ::std::option::Option<::std::string::String>,
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) resource: ::std::option::Option<::std::string::String>,
    pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
    pub(crate) resource_owner_account: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::FindingStatus>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) finding_details: ::std::option::Option<::std::vec::Vec<crate::types::FindingDetails>>,
    pub(crate) finding_type: ::std::option::Option<crate::types::FindingType>,
    _request_id: Option<String>,
}
impl GetFindingV2OutputBuilder {
    /// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
    /// This field is required.
    pub fn analyzed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.analyzed_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
    pub fn set_analyzed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.analyzed_at = input;
        self
    }
    /// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
    pub fn get_analyzed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.analyzed_at
    }
    /// <p>The time at which the finding was created.</p>
    /// 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
    }
    /// <p>The time at which the finding was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The time at which the finding was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>An error.</p>
    pub fn error(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An error.</p>
    pub fn set_error(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error = input;
        self
    }
    /// <p>An error.</p>
    pub fn get_error(&self) -> &::std::option::Option<::std::string::String> {
        &self.error
    }
    /// <p>The ID of the finding to retrieve.</p>
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the finding to retrieve.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The ID of the finding to retrieve.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>The resource that generated the finding.</p>
    pub fn resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The resource that generated the finding.</p>
    pub fn set_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource = input;
        self
    }
    /// <p>The resource that generated the finding.</p>
    pub fn get_resource(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource
    }
    /// <p>The type of the resource identified in the finding.</p>
    /// This field is required.
    pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
        self.resource_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the resource identified in the finding.</p>
    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>The type of the resource identified in the finding.</p>
    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
        &self.resource_type
    }
    /// <p>Tye Amazon Web Services account ID that owns the resource.</p>
    /// This field is required.
    pub fn resource_owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_owner_account = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Tye Amazon Web Services account ID that owns the resource.</p>
    pub fn set_resource_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_owner_account = input;
        self
    }
    /// <p>Tye Amazon Web Services account ID that owns the resource.</p>
    pub fn get_resource_owner_account(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_owner_account
    }
    /// <p>The status of the finding.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::FindingStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the finding.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the finding.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatus> {
        &self.status
    }
    /// <p>The time at which the finding was updated.</p>
    /// 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
    }
    /// <p>The time at which the finding was updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The time at which the finding was updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Appends an item to `finding_details`.
    ///
    /// To override the contents of this collection use [`set_finding_details`](Self::set_finding_details).
    ///
    /// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
    pub fn finding_details(mut self, input: crate::types::FindingDetails) -> Self {
        let mut v = self.finding_details.unwrap_or_default();
        v.push(input);
        self.finding_details = ::std::option::Option::Some(v);
        self
    }
    /// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
    pub fn set_finding_details(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FindingDetails>>) -> Self {
        self.finding_details = input;
        self
    }
    /// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
    pub fn get_finding_details(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FindingDetails>> {
        &self.finding_details
    }
    /// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
    pub fn finding_type(mut self, input: crate::types::FindingType) -> Self {
        self.finding_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
    pub fn set_finding_type(mut self, input: ::std::option::Option<crate::types::FindingType>) -> Self {
        self.finding_type = input;
        self
    }
    /// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
    pub fn get_finding_type(&self) -> &::std::option::Option<crate::types::FindingType> {
        &self.finding_type
    }
    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 [`GetFindingV2Output`](crate::operation::get_finding_v2::GetFindingV2Output).
    /// This method will fail if any of the following fields are not set:
    /// - [`analyzed_at`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::analyzed_at)
    /// - [`created_at`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::created_at)
    /// - [`id`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::id)
    /// - [`resource_type`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::resource_type)
    /// - [`resource_owner_account`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::resource_owner_account)
    /// - [`status`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::status)
    /// - [`updated_at`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::updated_at)
    /// - [`finding_details`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::finding_details)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_finding_v2::GetFindingV2Output, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_finding_v2::GetFindingV2Output {
            analyzed_at: self.analyzed_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "analyzed_at",
                    "analyzed_at was not specified but it is required when building GetFindingV2Output",
                )
            })?,
            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 GetFindingV2Output",
                )
            })?,
            error: self.error,
            id: self.id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "id",
                    "id was not specified but it is required when building GetFindingV2Output",
                )
            })?,
            next_token: self.next_token,
            resource: self.resource,
            resource_type: self.resource_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "resource_type",
                    "resource_type was not specified but it is required when building GetFindingV2Output",
                )
            })?,
            resource_owner_account: self.resource_owner_account.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "resource_owner_account",
                    "resource_owner_account was not specified but it is required when building GetFindingV2Output",
                )
            })?,
            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 GetFindingV2Output",
                )
            })?,
            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 GetFindingV2Output",
                )
            })?,
            finding_details: self.finding_details.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "finding_details",
                    "finding_details was not specified but it is required when building GetFindingV2Output",
                )
            })?,
            finding_type: self.finding_type,
            _request_id: self._request_id,
        })
    }
}