aws_sdk_rekognition/types/
_compare_faces_match.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides information about a face in a target image that matches the source image face analyzed by <code>CompareFaces</code>. The <code>Face</code> property contains the bounding box of the face in the target image. The <code>Similarity</code> property is the confidence that the source image face matches the face in the bounding box.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CompareFacesMatch {
7    /// <p>Level of confidence that the faces match.</p>
8    pub similarity: ::std::option::Option<f32>,
9    /// <p>Provides face metadata (bounding box and confidence that the bounding box actually contains a face).</p>
10    pub face: ::std::option::Option<crate::types::ComparedFace>,
11}
12impl CompareFacesMatch {
13    /// <p>Level of confidence that the faces match.</p>
14    pub fn similarity(&self) -> ::std::option::Option<f32> {
15        self.similarity
16    }
17    /// <p>Provides face metadata (bounding box and confidence that the bounding box actually contains a face).</p>
18    pub fn face(&self) -> ::std::option::Option<&crate::types::ComparedFace> {
19        self.face.as_ref()
20    }
21}
22impl CompareFacesMatch {
23    /// Creates a new builder-style object to manufacture [`CompareFacesMatch`](crate::types::CompareFacesMatch).
24    pub fn builder() -> crate::types::builders::CompareFacesMatchBuilder {
25        crate::types::builders::CompareFacesMatchBuilder::default()
26    }
27}
28
29/// A builder for [`CompareFacesMatch`](crate::types::CompareFacesMatch).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CompareFacesMatchBuilder {
33    pub(crate) similarity: ::std::option::Option<f32>,
34    pub(crate) face: ::std::option::Option<crate::types::ComparedFace>,
35}
36impl CompareFacesMatchBuilder {
37    /// <p>Level of confidence that the faces match.</p>
38    pub fn similarity(mut self, input: f32) -> Self {
39        self.similarity = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>Level of confidence that the faces match.</p>
43    pub fn set_similarity(mut self, input: ::std::option::Option<f32>) -> Self {
44        self.similarity = input;
45        self
46    }
47    /// <p>Level of confidence that the faces match.</p>
48    pub fn get_similarity(&self) -> &::std::option::Option<f32> {
49        &self.similarity
50    }
51    /// <p>Provides face metadata (bounding box and confidence that the bounding box actually contains a face).</p>
52    pub fn face(mut self, input: crate::types::ComparedFace) -> Self {
53        self.face = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>Provides face metadata (bounding box and confidence that the bounding box actually contains a face).</p>
57    pub fn set_face(mut self, input: ::std::option::Option<crate::types::ComparedFace>) -> Self {
58        self.face = input;
59        self
60    }
61    /// <p>Provides face metadata (bounding box and confidence that the bounding box actually contains a face).</p>
62    pub fn get_face(&self) -> &::std::option::Option<crate::types::ComparedFace> {
63        &self.face
64    }
65    /// Consumes the builder and constructs a [`CompareFacesMatch`](crate::types::CompareFacesMatch).
66    pub fn build(self) -> crate::types::CompareFacesMatch {
67        crate::types::CompareFacesMatch {
68            similarity: self.similarity,
69            face: self.face,
70        }
71    }
72}