aws_sdk_personalize/operation/create_event_tracker/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_event_tracker::_create_event_tracker_output::CreateEventTrackerOutputBuilder;
3
4pub use crate::operation::create_event_tracker::_create_event_tracker_input::CreateEventTrackerInputBuilder;
5
6impl crate::operation::create_event_tracker::builders::CreateEventTrackerInputBuilder {
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::create_event_tracker::CreateEventTrackerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_event_tracker::CreateEventTrackerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_event_tracker();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateEventTracker`.
24///
25/// <p>Creates an event tracker that you use when adding event data to a specified dataset group using the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_UBS_PutEvents.html">PutEvents</a> API.</p><note>
26/// <p>Only one event tracker can be associated with a dataset group. You will get an error if you call <code>CreateEventTracker</code> using the same dataset group as an existing event tracker.</p>
27/// </note>
28/// <p>When you create an event tracker, the response includes a tracking ID, which you pass as a parameter when you use the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_UBS_PutEvents.html">PutEvents</a> operation. Amazon Personalize then appends the event data to the Item interactions dataset of the dataset group you specify in your event tracker.</p>
29/// <p>The event tracker can be in one of the following states:</p>
30/// <ul>
31/// <li>
32/// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
33/// <li>
34/// <p>DELETE PENDING &gt; DELETE IN_PROGRESS</p></li>
35/// </ul>
36/// <p>To get the status of the event tracker, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeEventTracker.html">DescribeEventTracker</a>.</p><note>
37/// <p>The event tracker must be in the ACTIVE state before using the tracking ID.</p>
38/// </note>
39/// <p class="title"><b>Related APIs</b></p>
40/// <ul>
41/// <li>
42/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListEventTrackers.html">ListEventTrackers</a></p></li>
43/// <li>
44/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeEventTracker.html">DescribeEventTracker</a></p></li>
45/// <li>
46/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DeleteEventTracker.html">DeleteEventTracker</a></p></li>
47/// </ul>
48#[derive(::std::clone::Clone, ::std::fmt::Debug)]
49pub struct CreateEventTrackerFluentBuilder {
50    handle: ::std::sync::Arc<crate::client::Handle>,
51    inner: crate::operation::create_event_tracker::builders::CreateEventTrackerInputBuilder,
52    config_override: ::std::option::Option<crate::config::Builder>,
53}
54impl
55    crate::client::customize::internal::CustomizableSend<
56        crate::operation::create_event_tracker::CreateEventTrackerOutput,
57        crate::operation::create_event_tracker::CreateEventTrackerError,
58    > for CreateEventTrackerFluentBuilder
59{
60    fn send(
61        self,
62        config_override: crate::config::Builder,
63    ) -> crate::client::customize::internal::BoxFuture<
64        crate::client::customize::internal::SendResult<
65            crate::operation::create_event_tracker::CreateEventTrackerOutput,
66            crate::operation::create_event_tracker::CreateEventTrackerError,
67        >,
68    > {
69        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
70    }
71}
72impl CreateEventTrackerFluentBuilder {
73    /// Creates a new `CreateEventTrackerFluentBuilder`.
74    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
75        Self {
76            handle,
77            inner: ::std::default::Default::default(),
78            config_override: ::std::option::Option::None,
79        }
80    }
81    /// Access the CreateEventTracker as a reference.
82    pub fn as_input(&self) -> &crate::operation::create_event_tracker::builders::CreateEventTrackerInputBuilder {
83        &self.inner
84    }
85    /// Sends the request and returns the response.
86    ///
87    /// If an error occurs, an `SdkError` will be returned with additional details that
88    /// can be matched against.
89    ///
90    /// By default, any retryable failures will be retried twice. Retry behavior
91    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
92    /// set when configuring the client.
93    pub async fn send(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::create_event_tracker::CreateEventTrackerOutput,
97        ::aws_smithy_runtime_api::client::result::SdkError<
98            crate::operation::create_event_tracker::CreateEventTrackerError,
99            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
100        >,
101    > {
102        let input = self
103            .inner
104            .build()
105            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
106        let runtime_plugins = crate::operation::create_event_tracker::CreateEventTracker::operation_runtime_plugins(
107            self.handle.runtime_plugins.clone(),
108            &self.handle.conf,
109            self.config_override,
110        );
111        crate::operation::create_event_tracker::CreateEventTracker::orchestrate(&runtime_plugins, input).await
112    }
113
114    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
115    pub fn customize(
116        self,
117    ) -> crate::client::customize::CustomizableOperation<
118        crate::operation::create_event_tracker::CreateEventTrackerOutput,
119        crate::operation::create_event_tracker::CreateEventTrackerError,
120        Self,
121    > {
122        crate::client::customize::CustomizableOperation::new(self)
123    }
124    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
125        self.set_config_override(::std::option::Option::Some(config_override.into()));
126        self
127    }
128
129    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
130        self.config_override = config_override;
131        self
132    }
133    /// <p>The name for the event tracker.</p>
134    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.name(input.into());
136        self
137    }
138    /// <p>The name for the event tracker.</p>
139    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_name(input);
141        self
142    }
143    /// <p>The name for the event tracker.</p>
144    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_name()
146    }
147    /// <p>The Amazon Resource Name (ARN) of the dataset group that receives the event data.</p>
148    pub fn dataset_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.dataset_group_arn(input.into());
150        self
151    }
152    /// <p>The Amazon Resource Name (ARN) of the dataset group that receives the event data.</p>
153    pub fn set_dataset_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_dataset_group_arn(input);
155        self
156    }
157    /// <p>The Amazon Resource Name (ARN) of the dataset group that receives the event data.</p>
158    pub fn get_dataset_group_arn(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_dataset_group_arn()
160    }
161    ///
162    /// Appends an item to `tags`.
163    ///
164    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
165    ///
166    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the event tracker.</p>
167    pub fn tags(mut self, input: crate::types::Tag) -> Self {
168        self.inner = self.inner.tags(input);
169        self
170    }
171    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the event tracker.</p>
172    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
173        self.inner = self.inner.set_tags(input);
174        self
175    }
176    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the event tracker.</p>
177    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
178        self.inner.get_tags()
179    }
180}