aws-sdk-securityhub 1.110.0

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

/// <p>Provides details about one of the following actions that affects or that was taken on a resource:</p>
/// <ul>
/// <li>
/// <p>A remote IP address issued an Amazon Web Services API call</p></li>
/// <li>
/// <p>A DNS request was received</p></li>
/// <li>
/// <p>A remote IP address attempted to connect to an EC2 instance</p></li>
/// <li>
/// <p>A remote IP address attempted a port probe on an EC2 instance</p></li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Action {
    /// <p>The type of action that was detected. The possible action types are:</p>
    /// <ul>
    /// <li>
    /// <p><code>NETWORK_CONNECTION</code></p></li>
    /// <li>
    /// <p><code>AWS_API_CALL</code></p></li>
    /// <li>
    /// <p><code>DNS_REQUEST</code></p></li>
    /// <li>
    /// <p><code>PORT_PROBE</code></p></li>
    /// </ul>
    pub action_type: ::std::option::Option<::std::string::String>,
    /// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
    pub network_connection_action: ::std::option::Option<crate::types::NetworkConnectionAction>,
    /// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
    pub aws_api_call_action: ::std::option::Option<crate::types::AwsApiCallAction>,
    /// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
    pub dns_request_action: ::std::option::Option<crate::types::DnsRequestAction>,
    /// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
    pub port_probe_action: ::std::option::Option<crate::types::PortProbeAction>,
}
impl Action {
    /// <p>The type of action that was detected. The possible action types are:</p>
    /// <ul>
    /// <li>
    /// <p><code>NETWORK_CONNECTION</code></p></li>
    /// <li>
    /// <p><code>AWS_API_CALL</code></p></li>
    /// <li>
    /// <p><code>DNS_REQUEST</code></p></li>
    /// <li>
    /// <p><code>PORT_PROBE</code></p></li>
    /// </ul>
    pub fn action_type(&self) -> ::std::option::Option<&str> {
        self.action_type.as_deref()
    }
    /// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
    pub fn network_connection_action(&self) -> ::std::option::Option<&crate::types::NetworkConnectionAction> {
        self.network_connection_action.as_ref()
    }
    /// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
    pub fn aws_api_call_action(&self) -> ::std::option::Option<&crate::types::AwsApiCallAction> {
        self.aws_api_call_action.as_ref()
    }
    /// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
    pub fn dns_request_action(&self) -> ::std::option::Option<&crate::types::DnsRequestAction> {
        self.dns_request_action.as_ref()
    }
    /// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
    pub fn port_probe_action(&self) -> ::std::option::Option<&crate::types::PortProbeAction> {
        self.port_probe_action.as_ref()
    }
}
impl Action {
    /// Creates a new builder-style object to manufacture [`Action`](crate::types::Action).
    pub fn builder() -> crate::types::builders::ActionBuilder {
        crate::types::builders::ActionBuilder::default()
    }
}

/// A builder for [`Action`](crate::types::Action).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ActionBuilder {
    pub(crate) action_type: ::std::option::Option<::std::string::String>,
    pub(crate) network_connection_action: ::std::option::Option<crate::types::NetworkConnectionAction>,
    pub(crate) aws_api_call_action: ::std::option::Option<crate::types::AwsApiCallAction>,
    pub(crate) dns_request_action: ::std::option::Option<crate::types::DnsRequestAction>,
    pub(crate) port_probe_action: ::std::option::Option<crate::types::PortProbeAction>,
}
impl ActionBuilder {
    /// <p>The type of action that was detected. The possible action types are:</p>
    /// <ul>
    /// <li>
    /// <p><code>NETWORK_CONNECTION</code></p></li>
    /// <li>
    /// <p><code>AWS_API_CALL</code></p></li>
    /// <li>
    /// <p><code>DNS_REQUEST</code></p></li>
    /// <li>
    /// <p><code>PORT_PROBE</code></p></li>
    /// </ul>
    pub fn action_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of action that was detected. The possible action types are:</p>
    /// <ul>
    /// <li>
    /// <p><code>NETWORK_CONNECTION</code></p></li>
    /// <li>
    /// <p><code>AWS_API_CALL</code></p></li>
    /// <li>
    /// <p><code>DNS_REQUEST</code></p></li>
    /// <li>
    /// <p><code>PORT_PROBE</code></p></li>
    /// </ul>
    pub fn set_action_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action_type = input;
        self
    }
    /// <p>The type of action that was detected. The possible action types are:</p>
    /// <ul>
    /// <li>
    /// <p><code>NETWORK_CONNECTION</code></p></li>
    /// <li>
    /// <p><code>AWS_API_CALL</code></p></li>
    /// <li>
    /// <p><code>DNS_REQUEST</code></p></li>
    /// <li>
    /// <p><code>PORT_PROBE</code></p></li>
    /// </ul>
    pub fn get_action_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.action_type
    }
    /// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
    pub fn network_connection_action(mut self, input: crate::types::NetworkConnectionAction) -> Self {
        self.network_connection_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
    pub fn set_network_connection_action(mut self, input: ::std::option::Option<crate::types::NetworkConnectionAction>) -> Self {
        self.network_connection_action = input;
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
    pub fn get_network_connection_action(&self) -> &::std::option::Option<crate::types::NetworkConnectionAction> {
        &self.network_connection_action
    }
    /// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
    pub fn aws_api_call_action(mut self, input: crate::types::AwsApiCallAction) -> Self {
        self.aws_api_call_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
    pub fn set_aws_api_call_action(mut self, input: ::std::option::Option<crate::types::AwsApiCallAction>) -> Self {
        self.aws_api_call_action = input;
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
    pub fn get_aws_api_call_action(&self) -> &::std::option::Option<crate::types::AwsApiCallAction> {
        &self.aws_api_call_action
    }
    /// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
    pub fn dns_request_action(mut self, input: crate::types::DnsRequestAction) -> Self {
        self.dns_request_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
    pub fn set_dns_request_action(mut self, input: ::std::option::Option<crate::types::DnsRequestAction>) -> Self {
        self.dns_request_action = input;
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
    pub fn get_dns_request_action(&self) -> &::std::option::Option<crate::types::DnsRequestAction> {
        &self.dns_request_action
    }
    /// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
    pub fn port_probe_action(mut self, input: crate::types::PortProbeAction) -> Self {
        self.port_probe_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
    pub fn set_port_probe_action(mut self, input: ::std::option::Option<crate::types::PortProbeAction>) -> Self {
        self.port_probe_action = input;
        self
    }
    /// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
    pub fn get_port_probe_action(&self) -> &::std::option::Option<crate::types::PortProbeAction> {
        &self.port_probe_action
    }
    /// Consumes the builder and constructs a [`Action`](crate::types::Action).
    pub fn build(self) -> crate::types::Action {
        crate::types::Action {
            action_type: self.action_type,
            network_connection_action: self.network_connection_action,
            aws_api_call_action: self.aws_api_call_action,
            dns_request_action: self.dns_request_action,
            port_probe_action: self.port_probe_action,
        }
    }
}