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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The X and Y coordinates of a point on a document page. The X and Y values that are returned are ratios of the overall document page size. For example, if the input document is 700 x 200 and the operation returns X=0.5 and Y=0.25, then the point is at the (350,50) pixel coordinate on the document page.</p>
/// <p>An array of <code>Point</code> objects, <code>Polygon</code>, is returned by <code>DetectDocumentText</code>. <code>Polygon</code> represents a fine-grained polygon around detected text. For more information, see Geometry in the Amazon Textract Developer Guide.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Point {
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub x: f32,
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub y: f32,
}
impl Point {
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub fn x(&self) -> f32 {
self.x
}
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub fn y(&self) -> f32 {
self.y
}
}
impl Point {
/// Creates a new builder-style object to manufacture [`Point`](crate::types::Point).
pub fn builder() -> crate::types::builders::PointBuilder {
crate::types::builders::PointBuilder::default()
}
}
/// A builder for [`Point`](crate::types::Point).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PointBuilder {
pub(crate) x: ::std::option::Option<f32>,
pub(crate) y: ::std::option::Option<f32>,
}
impl PointBuilder {
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub fn x(mut self, input: f32) -> Self {
self.x = ::std::option::Option::Some(input);
self
}
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub fn set_x(mut self, input: ::std::option::Option<f32>) -> Self {
self.x = input;
self
}
/// <p>The value of the X coordinate for a point on a <code>Polygon</code>.</p>
pub fn get_x(&self) -> &::std::option::Option<f32> {
&self.x
}
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub fn y(mut self, input: f32) -> Self {
self.y = ::std::option::Option::Some(input);
self
}
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub fn set_y(mut self, input: ::std::option::Option<f32>) -> Self {
self.y = input;
self
}
/// <p>The value of the Y coordinate for a point on a <code>Polygon</code>.</p>
pub fn get_y(&self) -> &::std::option::Option<f32> {
&self.y
}
/// Consumes the builder and constructs a [`Point`](crate::types::Point).
pub fn build(self) -> crate::types::Point {
crate::types::Point {
x: self.x.unwrap_or_default(),
y: self.y.unwrap_or_default(),
}
}
}