aws-sdk-textract 1.101.0

AWS SDK for Amazon Textract
Documentation
// 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(),
        }
    }
}