1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Returns information about the location of a change or comment in the comparison between two commits or a pull request.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Location {
/// <p>The name of the file being compared, including its extension and subdirectory, if any.</p>
pub file_path: ::std::option::Option<::std::string::String>,
/// <p>The position of a change in a compared file, in line number format.</p>
pub file_position: ::std::option::Option<i64>,
/// <p>In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.</p>
pub relative_file_version: ::std::option::Option<crate::types::RelativeFileVersionEnum>,
}
impl Location {
/// <p>The name of the file being compared, including its extension and subdirectory, if any.</p>
pub fn file_path(&self) -> ::std::option::Option<&str> {
self.file_path.as_deref()
}
/// <p>The position of a change in a compared file, in line number format.</p>
pub fn file_position(&self) -> ::std::option::Option<i64> {
self.file_position
}
/// <p>In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.</p>
pub fn relative_file_version(&self) -> ::std::option::Option<&crate::types::RelativeFileVersionEnum> {
self.relative_file_version.as_ref()
}
}
impl Location {
/// Creates a new builder-style object to manufacture [`Location`](crate::types::Location).
pub fn builder() -> crate::types::builders::LocationBuilder {
crate::types::builders::LocationBuilder::default()
}
}
/// A builder for [`Location`](crate::types::Location).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LocationBuilder {
pub(crate) file_path: ::std::option::Option<::std::string::String>,
pub(crate) file_position: ::std::option::Option<i64>,
pub(crate) relative_file_version: ::std::option::Option<crate::types::RelativeFileVersionEnum>,
}
impl LocationBuilder {
/// <p>The name of the file being compared, including its extension and subdirectory, if any.</p>
pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.file_path = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the file being compared, including its extension and subdirectory, if any.</p>
pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.file_path = input;
self
}
/// <p>The name of the file being compared, including its extension and subdirectory, if any.</p>
pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
&self.file_path
}
/// <p>The position of a change in a compared file, in line number format.</p>
pub fn file_position(mut self, input: i64) -> Self {
self.file_position = ::std::option::Option::Some(input);
self
}
/// <p>The position of a change in a compared file, in line number format.</p>
pub fn set_file_position(mut self, input: ::std::option::Option<i64>) -> Self {
self.file_position = input;
self
}
/// <p>The position of a change in a compared file, in line number format.</p>
pub fn get_file_position(&self) -> &::std::option::Option<i64> {
&self.file_position
}
/// <p>In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.</p>
pub fn relative_file_version(mut self, input: crate::types::RelativeFileVersionEnum) -> Self {
self.relative_file_version = ::std::option::Option::Some(input);
self
}
/// <p>In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.</p>
pub fn set_relative_file_version(mut self, input: ::std::option::Option<crate::types::RelativeFileVersionEnum>) -> Self {
self.relative_file_version = input;
self
}
/// <p>In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.</p>
pub fn get_relative_file_version(&self) -> &::std::option::Option<crate::types::RelativeFileVersionEnum> {
&self.relative_file_version
}
/// Consumes the builder and constructs a [`Location`](crate::types::Location).
pub fn build(self) -> crate::types::Location {
crate::types::Location {
file_path: self.file_path,
file_position: self.file_position,
relative_file_version: self.relative_file_version,
}
}
}