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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A position in a policy.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Position {
/// <p>The line of the position, starting from 1.</p>
pub line: i32,
/// <p>The column of the position, starting from 0.</p>
pub column: i32,
/// <p>The offset within the policy that corresponds to the position, starting from 0.</p>
pub offset: i32,
}
impl Position {
/// <p>The line of the position, starting from 1.</p>
pub fn line(&self) -> i32 {
self.line
}
/// <p>The column of the position, starting from 0.</p>
pub fn column(&self) -> i32 {
self.column
}
/// <p>The offset within the policy that corresponds to the position, starting from 0.</p>
pub fn offset(&self) -> i32 {
self.offset
}
}
impl Position {
/// Creates a new builder-style object to manufacture [`Position`](crate::types::Position).
pub fn builder() -> crate::types::builders::PositionBuilder {
crate::types::builders::PositionBuilder::default()
}
}
/// A builder for [`Position`](crate::types::Position).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PositionBuilder {
pub(crate) line: ::std::option::Option<i32>,
pub(crate) column: ::std::option::Option<i32>,
pub(crate) offset: ::std::option::Option<i32>,
}
impl PositionBuilder {
/// <p>The line of the position, starting from 1.</p>
/// This field is required.
pub fn line(mut self, input: i32) -> Self {
self.line = ::std::option::Option::Some(input);
self
}
/// <p>The line of the position, starting from 1.</p>
pub fn set_line(mut self, input: ::std::option::Option<i32>) -> Self {
self.line = input;
self
}
/// <p>The line of the position, starting from 1.</p>
pub fn get_line(&self) -> &::std::option::Option<i32> {
&self.line
}
/// <p>The column of the position, starting from 0.</p>
/// This field is required.
pub fn column(mut self, input: i32) -> Self {
self.column = ::std::option::Option::Some(input);
self
}
/// <p>The column of the position, starting from 0.</p>
pub fn set_column(mut self, input: ::std::option::Option<i32>) -> Self {
self.column = input;
self
}
/// <p>The column of the position, starting from 0.</p>
pub fn get_column(&self) -> &::std::option::Option<i32> {
&self.column
}
/// <p>The offset within the policy that corresponds to the position, starting from 0.</p>
/// This field is required.
pub fn offset(mut self, input: i32) -> Self {
self.offset = ::std::option::Option::Some(input);
self
}
/// <p>The offset within the policy that corresponds to the position, starting from 0.</p>
pub fn set_offset(mut self, input: ::std::option::Option<i32>) -> Self {
self.offset = input;
self
}
/// <p>The offset within the policy that corresponds to the position, starting from 0.</p>
pub fn get_offset(&self) -> &::std::option::Option<i32> {
&self.offset
}
/// Consumes the builder and constructs a [`Position`](crate::types::Position).
/// This method will fail if any of the following fields are not set:
/// - [`line`](crate::types::builders::PositionBuilder::line)
/// - [`column`](crate::types::builders::PositionBuilder::column)
/// - [`offset`](crate::types::builders::PositionBuilder::offset)
pub fn build(self) -> ::std::result::Result<crate::types::Position, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Position {
line: self.line.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"line",
"line was not specified but it is required when building Position",
)
})?,
column: self.column.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"column",
"column was not specified but it is required when building Position",
)
})?,
offset: self.offset.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"offset",
"offset was not specified but it is required when building Position",
)
})?,
})
}
}