// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_record::_put_record_input::PutRecordInputBuilder;
pub use crate::operation::put_record::_put_record_output::PutRecordOutputBuilder;
impl crate::operation::put_record::builders::PutRecordInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::put_record::PutRecordOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::put_record::PutRecordError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.put_record();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `PutRecord`.
///
/// <p>The <code>PutRecord</code> API is used to ingest a list of <code>Records</code> into your feature group.</p>
/// <p>If a new record’s <code>EventTime</code> is greater, the new record is written to both the <code>OnlineStore</code> and <code>OfflineStore</code>. Otherwise, the record is a historic record and it is written only to the <code>OfflineStore</code>.</p>
/// <p>You can specify the ingestion to be applied to the <code>OnlineStore</code>, <code>OfflineStore</code>, or both by using the <code>TargetStores</code> request parameter.</p>
/// <p>You can set the ingested record to expire at a given time to live (TTL) duration after the record’s event time, <code>ExpiresAt</code> = <code>EventTime</code> + <code>TtlDuration</code>, by specifying the <code>TtlDuration</code> parameter. A record level <code>TtlDuration</code> is set when specifying the <code>TtlDuration</code> parameter using the <code>PutRecord</code> API call. If the input <code>TtlDuration</code> is <code>null</code> or unspecified, <code>TtlDuration</code> is set to the default feature group level <code>TtlDuration</code>. A record level <code>TtlDuration</code> supersedes the group level <code>TtlDuration</code>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutRecordFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::put_record::builders::PutRecordInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl crate::client::customize::internal::CustomizableSend<crate::operation::put_record::PutRecordOutput, crate::operation::put_record::PutRecordError>
for PutRecordFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<crate::operation::put_record::PutRecordOutput, crate::operation::put_record::PutRecordError>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl PutRecordFluentBuilder {
/// Creates a new `PutRecordFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the PutRecord as a reference.
pub fn as_input(&self) -> &crate::operation::put_record::builders::PutRecordInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::put_record::PutRecordOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::put_record::PutRecordError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::put_record::PutRecord::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::put_record::PutRecord::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::put_record::PutRecordOutput,
crate::operation::put_record::PutRecordError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The name or Amazon Resource Name (ARN) of the feature group that you want to insert the record into.</p>
pub fn feature_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.feature_group_name(input.into());
self
}
/// <p>The name or Amazon Resource Name (ARN) of the feature group that you want to insert the record into.</p>
pub fn set_feature_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_feature_group_name(input);
self
}
/// <p>The name or Amazon Resource Name (ARN) of the feature group that you want to insert the record into.</p>
pub fn get_feature_group_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_feature_group_name()
}
///
/// Appends an item to `Record`.
///
/// To override the contents of this collection use [`set_record`](Self::set_record).
///
/// <p>List of FeatureValues to be inserted. This will be a full over-write. If you only want to update few of the feature values, do the following:</p>
/// <ul>
/// <li>
/// <p>Use <code>GetRecord</code> to retrieve the latest record.</p></li>
/// <li>
/// <p>Update the record returned from <code>GetRecord</code>.</p></li>
/// <li>
/// <p>Use <code>PutRecord</code> to update feature values.</p></li>
/// </ul>
pub fn record(mut self, input: crate::types::FeatureValue) -> Self {
self.inner = self.inner.record(input);
self
}
/// <p>List of FeatureValues to be inserted. This will be a full over-write. If you only want to update few of the feature values, do the following:</p>
/// <ul>
/// <li>
/// <p>Use <code>GetRecord</code> to retrieve the latest record.</p></li>
/// <li>
/// <p>Update the record returned from <code>GetRecord</code>.</p></li>
/// <li>
/// <p>Use <code>PutRecord</code> to update feature values.</p></li>
/// </ul>
pub fn set_record(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FeatureValue>>) -> Self {
self.inner = self.inner.set_record(input);
self
}
/// <p>List of FeatureValues to be inserted. This will be a full over-write. If you only want to update few of the feature values, do the following:</p>
/// <ul>
/// <li>
/// <p>Use <code>GetRecord</code> to retrieve the latest record.</p></li>
/// <li>
/// <p>Update the record returned from <code>GetRecord</code>.</p></li>
/// <li>
/// <p>Use <code>PutRecord</code> to update feature values.</p></li>
/// </ul>
pub fn get_record(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FeatureValue>> {
self.inner.get_record()
}
///
/// Appends an item to `TargetStores`.
///
/// To override the contents of this collection use [`set_target_stores`](Self::set_target_stores).
///
/// <p>A list of stores to which you're adding the record. By default, Feature Store adds the record to all of the stores that you're using for the <code>FeatureGroup</code>.</p>
pub fn target_stores(mut self, input: crate::types::TargetStore) -> Self {
self.inner = self.inner.target_stores(input);
self
}
/// <p>A list of stores to which you're adding the record. By default, Feature Store adds the record to all of the stores that you're using for the <code>FeatureGroup</code>.</p>
pub fn set_target_stores(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetStore>>) -> Self {
self.inner = self.inner.set_target_stores(input);
self
}
/// <p>A list of stores to which you're adding the record. By default, Feature Store adds the record to all of the stores that you're using for the <code>FeatureGroup</code>.</p>
pub fn get_target_stores(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetStore>> {
self.inner.get_target_stores()
}
/// <p>Time to live duration, where the record is hard deleted after the expiration time is reached; <code>ExpiresAt</code> = <code>EventTime</code> + <code>TtlDuration</code>. For information on HardDelete, see the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_DeleteRecord.html">DeleteRecord</a> API in the Amazon SageMaker API Reference guide.</p>
pub fn ttl_duration(mut self, input: crate::types::TtlDuration) -> Self {
self.inner = self.inner.ttl_duration(input);
self
}
/// <p>Time to live duration, where the record is hard deleted after the expiration time is reached; <code>ExpiresAt</code> = <code>EventTime</code> + <code>TtlDuration</code>. For information on HardDelete, see the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_DeleteRecord.html">DeleteRecord</a> API in the Amazon SageMaker API Reference guide.</p>
pub fn set_ttl_duration(mut self, input: ::std::option::Option<crate::types::TtlDuration>) -> Self {
self.inner = self.inner.set_ttl_duration(input);
self
}
/// <p>Time to live duration, where the record is hard deleted after the expiration time is reached; <code>ExpiresAt</code> = <code>EventTime</code> + <code>TtlDuration</code>. For information on HardDelete, see the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_DeleteRecord.html">DeleteRecord</a> API in the Amazon SageMaker API Reference guide.</p>
pub fn get_ttl_duration(&self) -> &::std::option::Option<crate::types::TtlDuration> {
self.inner.get_ttl_duration()
}
}