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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A span in a policy. The span consists of a start position (inclusive) and end position (exclusive).</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Span {
    /// <p>The start position of the span (inclusive).</p>
    pub start: ::std::option::Option<crate::types::Position>,
    /// <p>The end position of the span (exclusive).</p>
    pub end: ::std::option::Option<crate::types::Position>,
}
impl Span {
    /// <p>The start position of the span (inclusive).</p>
    pub fn start(&self) -> ::std::option::Option<&crate::types::Position> {
        self.start.as_ref()
    }
    /// <p>The end position of the span (exclusive).</p>
    pub fn end(&self) -> ::std::option::Option<&crate::types::Position> {
        self.end.as_ref()
    }
}
impl Span {
    /// Creates a new builder-style object to manufacture [`Span`](crate::types::Span).
    pub fn builder() -> crate::types::builders::SpanBuilder {
        crate::types::builders::SpanBuilder::default()
    }
}

/// A builder for [`Span`](crate::types::Span).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SpanBuilder {
    pub(crate) start: ::std::option::Option<crate::types::Position>,
    pub(crate) end: ::std::option::Option<crate::types::Position>,
}
impl SpanBuilder {
    /// <p>The start position of the span (inclusive).</p>
    /// This field is required.
    pub fn start(mut self, input: crate::types::Position) -> Self {
        self.start = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start position of the span (inclusive).</p>
    pub fn set_start(mut self, input: ::std::option::Option<crate::types::Position>) -> Self {
        self.start = input;
        self
    }
    /// <p>The start position of the span (inclusive).</p>
    pub fn get_start(&self) -> &::std::option::Option<crate::types::Position> {
        &self.start
    }
    /// <p>The end position of the span (exclusive).</p>
    /// This field is required.
    pub fn end(mut self, input: crate::types::Position) -> Self {
        self.end = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end position of the span (exclusive).</p>
    pub fn set_end(mut self, input: ::std::option::Option<crate::types::Position>) -> Self {
        self.end = input;
        self
    }
    /// <p>The end position of the span (exclusive).</p>
    pub fn get_end(&self) -> &::std::option::Option<crate::types::Position> {
        &self.end
    }
    /// Consumes the builder and constructs a [`Span`](crate::types::Span).
    pub fn build(self) -> crate::types::Span {
        crate::types::Span {
            start: self.start,
            end: self.end,
        }
    }
}