aws_sdk_rekognition/operation/start_person_tracking/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_person_tracking::_start_person_tracking_output::StartPersonTrackingOutputBuilder;
3
4pub use crate::operation::start_person_tracking::_start_person_tracking_input::StartPersonTrackingInputBuilder;
5
6impl crate::operation::start_person_tracking::builders::StartPersonTrackingInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::start_person_tracking::StartPersonTrackingOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_person_tracking::StartPersonTrackingError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_person_tracking();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartPersonTracking`.
24///
25/// <note>
26/// <p><i>End of support notice:</i> On October 31, 2025, AWS will discontinue support for Amazon Rekognition People Pathing. After October 31, 2025, you will no longer be able to use the Rekognition People Pathing capability. For more information, visit this <a href="https://aws.amazon.com/blogs/machine-learning/transitioning-from-amazon-rekognition-people-pathing-exploring-other-alternatives/">blog post</a>.</p>
27/// </note>
28/// <p>Starts the asynchronous tracking of a person's path in a stored video.</p>
29/// <p>Amazon Rekognition Video can track the path of people in a video stored in an Amazon S3 bucket. Use <code>Video</code> to specify the bucket name and the filename of the video. <code>StartPersonTracking</code> returns a job identifier (<code>JobId</code>) which you use to get the results of the operation. When label detection is finished, Amazon Rekognition publishes a completion status to the Amazon Simple Notification Service topic that you specify in <code>NotificationChannel</code>.</p>
30/// <p>To get the results of the person detection operation, first check that the status value published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so, call <code>GetPersonTracking</code> and pass the job identifier (<code>JobId</code>) from the initial call to <code>StartPersonTracking</code>.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct StartPersonTrackingFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::start_person_tracking::builders::StartPersonTrackingInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::start_person_tracking::StartPersonTrackingOutput,
40        crate::operation::start_person_tracking::StartPersonTrackingError,
41    > for StartPersonTrackingFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::start_person_tracking::StartPersonTrackingOutput,
49            crate::operation::start_person_tracking::StartPersonTrackingError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl StartPersonTrackingFluentBuilder {
56    /// Creates a new `StartPersonTrackingFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the StartPersonTracking as a reference.
65    pub fn as_input(&self) -> &crate::operation::start_person_tracking::builders::StartPersonTrackingInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::start_person_tracking::StartPersonTrackingOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::start_person_tracking::StartPersonTrackingError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::start_person_tracking::StartPersonTracking::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::start_person_tracking::StartPersonTracking::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::start_person_tracking::StartPersonTrackingOutput,
102        crate::operation::start_person_tracking::StartPersonTrackingError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The video in which you want to detect people. The video must be stored in an Amazon S3 bucket.</p>
117    pub fn video(mut self, input: crate::types::Video) -> Self {
118        self.inner = self.inner.video(input);
119        self
120    }
121    /// <p>The video in which you want to detect people. The video must be stored in an Amazon S3 bucket.</p>
122    pub fn set_video(mut self, input: ::std::option::Option<crate::types::Video>) -> Self {
123        self.inner = self.inner.set_video(input);
124        self
125    }
126    /// <p>The video in which you want to detect people. The video must be stored in an Amazon S3 bucket.</p>
127    pub fn get_video(&self) -> &::std::option::Option<crate::types::Video> {
128        self.inner.get_video()
129    }
130    /// <p>Idempotent token used to identify the start request. If you use the same token with multiple <code>StartPersonTracking</code> requests, the same <code>JobId</code> is returned. Use <code>ClientRequestToken</code> to prevent the same job from being accidently started more than once.</p>
131    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.client_request_token(input.into());
133        self
134    }
135    /// <p>Idempotent token used to identify the start request. If you use the same token with multiple <code>StartPersonTracking</code> requests, the same <code>JobId</code> is returned. Use <code>ClientRequestToken</code> to prevent the same job from being accidently started more than once.</p>
136    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_client_request_token(input);
138        self
139    }
140    /// <p>Idempotent token used to identify the start request. If you use the same token with multiple <code>StartPersonTracking</code> requests, the same <code>JobId</code> is returned. Use <code>ClientRequestToken</code> to prevent the same job from being accidently started more than once.</p>
141    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_client_request_token()
143    }
144    /// <p>The Amazon SNS topic ARN you want Amazon Rekognition Video to publish the completion status of the people detection operation to. The Amazon SNS topic must have a topic name that begins with <i>AmazonRekognition</i> if you are using the AmazonRekognitionServiceRole permissions policy.</p>
145    pub fn notification_channel(mut self, input: crate::types::NotificationChannel) -> Self {
146        self.inner = self.inner.notification_channel(input);
147        self
148    }
149    /// <p>The Amazon SNS topic ARN you want Amazon Rekognition Video to publish the completion status of the people detection operation to. The Amazon SNS topic must have a topic name that begins with <i>AmazonRekognition</i> if you are using the AmazonRekognitionServiceRole permissions policy.</p>
150    pub fn set_notification_channel(mut self, input: ::std::option::Option<crate::types::NotificationChannel>) -> Self {
151        self.inner = self.inner.set_notification_channel(input);
152        self
153    }
154    /// <p>The Amazon SNS topic ARN you want Amazon Rekognition Video to publish the completion status of the people detection operation to. The Amazon SNS topic must have a topic name that begins with <i>AmazonRekognition</i> if you are using the AmazonRekognitionServiceRole permissions policy.</p>
155    pub fn get_notification_channel(&self) -> &::std::option::Option<crate::types::NotificationChannel> {
156        self.inner.get_notification_channel()
157    }
158    /// <p>An identifier you specify that's returned in the completion notification that's published to your Amazon Simple Notification Service topic. For example, you can use <code>JobTag</code> to group related jobs and identify them in the completion notification.</p>
159    pub fn job_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.job_tag(input.into());
161        self
162    }
163    /// <p>An identifier you specify that's returned in the completion notification that's published to your Amazon Simple Notification Service topic. For example, you can use <code>JobTag</code> to group related jobs and identify them in the completion notification.</p>
164    pub fn set_job_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_job_tag(input);
166        self
167    }
168    /// <p>An identifier you specify that's returned in the completion notification that's published to your Amazon Simple Notification Service topic. For example, you can use <code>JobTag</code> to group related jobs and identify them in the completion notification.</p>
169    pub fn get_job_tag(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_job_tag()
171    }
172}