Skip to main content

aws_sdk_securityhub/types/
_code_vulnerabilities_file_path.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides details about where a code vulnerability is located in your Lambda function.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CodeVulnerabilitiesFilePath {
7    /// <p>The line number of the last line of code in which the vulnerability is located.</p>
8    pub end_line: ::std::option::Option<i32>,
9    /// <p>The name of the file in which the code vulnerability is located.</p>
10    pub file_name: ::std::option::Option<::std::string::String>,
11    /// <p>The file path to the code in which the vulnerability is located.</p>
12    pub file_path: ::std::option::Option<::std::string::String>,
13    /// <p>The line number of the first line of code in which the vulnerability is located.</p>
14    pub start_line: ::std::option::Option<i32>,
15}
16impl CodeVulnerabilitiesFilePath {
17    /// <p>The line number of the last line of code in which the vulnerability is located.</p>
18    pub fn end_line(&self) -> ::std::option::Option<i32> {
19        self.end_line
20    }
21    /// <p>The name of the file in which the code vulnerability is located.</p>
22    pub fn file_name(&self) -> ::std::option::Option<&str> {
23        self.file_name.as_deref()
24    }
25    /// <p>The file path to the code in which the vulnerability is located.</p>
26    pub fn file_path(&self) -> ::std::option::Option<&str> {
27        self.file_path.as_deref()
28    }
29    /// <p>The line number of the first line of code in which the vulnerability is located.</p>
30    pub fn start_line(&self) -> ::std::option::Option<i32> {
31        self.start_line
32    }
33}
34impl CodeVulnerabilitiesFilePath {
35    /// Creates a new builder-style object to manufacture [`CodeVulnerabilitiesFilePath`](crate::types::CodeVulnerabilitiesFilePath).
36    pub fn builder() -> crate::types::builders::CodeVulnerabilitiesFilePathBuilder {
37        crate::types::builders::CodeVulnerabilitiesFilePathBuilder::default()
38    }
39}
40
41/// A builder for [`CodeVulnerabilitiesFilePath`](crate::types::CodeVulnerabilitiesFilePath).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct CodeVulnerabilitiesFilePathBuilder {
45    pub(crate) end_line: ::std::option::Option<i32>,
46    pub(crate) file_name: ::std::option::Option<::std::string::String>,
47    pub(crate) file_path: ::std::option::Option<::std::string::String>,
48    pub(crate) start_line: ::std::option::Option<i32>,
49}
50impl CodeVulnerabilitiesFilePathBuilder {
51    /// <p>The line number of the last line of code in which the vulnerability is located.</p>
52    pub fn end_line(mut self, input: i32) -> Self {
53        self.end_line = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The line number of the last line of code in which the vulnerability is located.</p>
57    pub fn set_end_line(mut self, input: ::std::option::Option<i32>) -> Self {
58        self.end_line = input;
59        self
60    }
61    /// <p>The line number of the last line of code in which the vulnerability is located.</p>
62    pub fn get_end_line(&self) -> &::std::option::Option<i32> {
63        &self.end_line
64    }
65    /// <p>The name of the file in which the code vulnerability is located.</p>
66    pub fn file_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.file_name = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The name of the file in which the code vulnerability is located.</p>
71    pub fn set_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.file_name = input;
73        self
74    }
75    /// <p>The name of the file in which the code vulnerability is located.</p>
76    pub fn get_file_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.file_name
78    }
79    /// <p>The file path to the code in which the vulnerability is located.</p>
80    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.file_path = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The file path to the code in which the vulnerability is located.</p>
85    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.file_path = input;
87        self
88    }
89    /// <p>The file path to the code in which the vulnerability is located.</p>
90    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
91        &self.file_path
92    }
93    /// <p>The line number of the first line of code in which the vulnerability is located.</p>
94    pub fn start_line(mut self, input: i32) -> Self {
95        self.start_line = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>The line number of the first line of code in which the vulnerability is located.</p>
99    pub fn set_start_line(mut self, input: ::std::option::Option<i32>) -> Self {
100        self.start_line = input;
101        self
102    }
103    /// <p>The line number of the first line of code in which the vulnerability is located.</p>
104    pub fn get_start_line(&self) -> &::std::option::Option<i32> {
105        &self.start_line
106    }
107    /// Consumes the builder and constructs a [`CodeVulnerabilitiesFilePath`](crate::types::CodeVulnerabilitiesFilePath).
108    pub fn build(self) -> crate::types::CodeVulnerabilitiesFilePath {
109        crate::types::CodeVulnerabilitiesFilePath {
110            end_line: self.end_line,
111            file_name: self.file_name,
112            file_path: self.file_path,
113            start_line: self.start_line,
114        }
115    }
116}