Struct aws_sdk_textract::model::geometry::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for Geometry
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn bounding_box(self, input: BoundingBox) -> Self
pub fn bounding_box(self, input: BoundingBox) -> Self
An axis-aligned coarse representation of the location of the recognized item on the document page.
sourcepub fn set_bounding_box(self, input: Option<BoundingBox>) -> Self
pub fn set_bounding_box(self, input: Option<BoundingBox>) -> Self
An axis-aligned coarse representation of the location of the recognized item on the document page.
Examples found in repository?
src/json_deser.rs (lines 2273-2277)
2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307
pub(crate) fn deser_structure_crate_model_geometry<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Geometry>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::geometry::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"BoundingBox" => {
builder = builder.set_bounding_box(
crate::json_deser::deser_structure_crate_model_bounding_box(
tokens,
)?,
);
}
"Polygon" => {
builder = builder.set_polygon(
crate::json_deser::deser_list_com_amazonaws_textract_polygon(
tokens,
)?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn polygon(self, input: Point) -> Self
pub fn polygon(self, input: Point) -> Self
Appends an item to polygon
.
To override the contents of this collection use set_polygon
.
Within the bounding box, a fine-grained polygon around the recognized item.
sourcepub fn set_polygon(self, input: Option<Vec<Point>>) -> Self
pub fn set_polygon(self, input: Option<Vec<Point>>) -> Self
Within the bounding box, a fine-grained polygon around the recognized item.
Examples found in repository?
src/json_deser.rs (lines 2280-2284)
2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307
pub(crate) fn deser_structure_crate_model_geometry<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Geometry>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::geometry::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"BoundingBox" => {
builder = builder.set_bounding_box(
crate::json_deser::deser_structure_crate_model_bounding_box(
tokens,
)?,
);
}
"Polygon" => {
builder = builder.set_polygon(
crate::json_deser::deser_list_com_amazonaws_textract_polygon(
tokens,
)?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> Geometry
pub fn build(self) -> Geometry
Consumes the builder and constructs a Geometry
.
Examples found in repository?
src/json_deser.rs (line 2299)
2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307
pub(crate) fn deser_structure_crate_model_geometry<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Geometry>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::geometry::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"BoundingBox" => {
builder = builder.set_bounding_box(
crate::json_deser::deser_structure_crate_model_bounding_box(
tokens,
)?,
);
}
"Polygon" => {
builder = builder.set_polygon(
crate::json_deser::deser_list_com_amazonaws_textract_polygon(
tokens,
)?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}