Struct aws_sdk_kendraranking::client::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon Kendra Intelligent Ranking
Client for invoking operations on Amazon Kendra Intelligent Ranking. Each operation on Amazon Kendra Intelligent Ranking is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_kendraranking::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_kendraranking::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateRescoreExecutionPlan
operation has
a Client::create_rescore_execution_plan
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_rescore_execution_plan()
.name("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn create_rescore_execution_plan(
&self
) -> CreateRescoreExecutionPlanFluentBuilder
pub fn create_rescore_execution_plan( &self ) -> CreateRescoreExecutionPlanFluentBuilder
Constructs a fluent builder for the CreateRescoreExecutionPlan
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueA name for the rescore execution plan.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA description for the rescore execution plan.
capacity_units(CapacityUnitsConfiguration)
/set_capacity_units(Option<CapacityUnitsConfiguration>)
:
required: falseYou can set additional capacity units to meet the needs of your rescore execution plan. You are given a single capacity unit by default. If you want to use the default capacity, you don’t set additional capacity units. For more information on the default capacity and additional capacity units, see Adjusting capacity.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseA list of key-value pairs that identify or categorize your rescore execution plan. You can also use tags to help control access to the rescore execution plan. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA token that you provide to identify the request to create a rescore execution plan. Multiple calls to the
CreateRescoreExecutionPlanRequest
API with the same client token will create only one rescore execution plan.
- On success, responds with
CreateRescoreExecutionPlanOutput
with field(s):id(String)
:The identifier of the rescore execution plan.
arn(String)
:The Amazon Resource Name (ARN) of the rescore execution plan.
- On failure, responds with
SdkError<CreateRescoreExecutionPlanError>
source§impl Client
impl Client
sourcepub fn delete_rescore_execution_plan(
&self
) -> DeleteRescoreExecutionPlanFluentBuilder
pub fn delete_rescore_execution_plan( &self ) -> DeleteRescoreExecutionPlanFluentBuilder
Constructs a fluent builder for the DeleteRescoreExecutionPlan
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe identifier of the rescore execution plan that you want to delete.
- On success, responds with
DeleteRescoreExecutionPlanOutput
- On failure, responds with
SdkError<DeleteRescoreExecutionPlanError>
source§impl Client
impl Client
sourcepub fn describe_rescore_execution_plan(
&self
) -> DescribeRescoreExecutionPlanFluentBuilder
pub fn describe_rescore_execution_plan( &self ) -> DescribeRescoreExecutionPlanFluentBuilder
Constructs a fluent builder for the DescribeRescoreExecutionPlan
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe identifier of the rescore execution plan that you want to get information on.
- On success, responds with
DescribeRescoreExecutionPlanOutput
with field(s):id(Option<String>)
:The identifier of the rescore execution plan.
arn(Option<String>)
:The Amazon Resource Name (ARN) of the rescore execution plan.
name(Option<String>)
:The name for the rescore execution plan.
description(Option<String>)
:The description for the rescore execution plan.
capacity_units(Option<CapacityUnitsConfiguration>)
:The capacity units set for the rescore execution plan. A capacity of zero indicates that the rescore execution plan is using the default capacity. For more information on the default capacity and additional capacity units, see Adjusting capacity.
created_at(Option<DateTime>)
:The Unix timestamp of when the rescore execution plan was created.
updated_at(Option<DateTime>)
:The Unix timestamp of when the rescore execution plan was last updated.
status(Option<RescoreExecutionPlanStatus>)
:The current status of the rescore execution plan. When the value is
ACTIVE
, the rescore execution plan is ready for use. If theStatus
field value isFAILED
, theErrorMessage
field contains a message that explains why.error_message(Option<String>)
:When the
Status
field value isFAILED
, theErrorMessage
field contains a message that explains why.
- On failure, responds with
SdkError<DescribeRescoreExecutionPlanError>
source§impl Client
impl Client
sourcepub fn list_rescore_execution_plans(
&self
) -> ListRescoreExecutionPlansFluentBuilder
pub fn list_rescore_execution_plans( &self ) -> ListRescoreExecutionPlansFluentBuilder
Constructs a fluent builder for the ListRescoreExecutionPlans
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the response is truncated, Amazon Kendra Intelligent Ranking returns a pagination token in the response. You can use this pagination token to retrieve the next set of rescore execution plans.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of rescore execution plans to return.
- On success, responds with
ListRescoreExecutionPlansOutput
with field(s):summary_items(Option<Vec::<RescoreExecutionPlanSummary>>)
:An array of summary information for one or more rescore execution plans.
next_token(Option<String>)
:If the response is truncated, Amazon Kendra Intelligent Ranking returns a pagination token in the response.
- On failure, responds with
SdkError<ListRescoreExecutionPlansError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the rescore execution plan to get a list of tags for.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:A list of tags associated with the rescore execution plan.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn rescore(&self) -> RescoreFluentBuilder
pub fn rescore(&self) -> RescoreFluentBuilder
Constructs a fluent builder for the Rescore
operation.
- The fluent builder is configurable:
rescore_execution_plan_id(impl Into<String>)
/set_rescore_execution_plan_id(Option<String>)
:
required: trueThe identifier of the rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the
Rescore
API.search_query(impl Into<String>)
/set_search_query(Option<String>)
:
required: trueThe input query from the search service.
documents(Document)
/set_documents(Option<Vec::<Document>>)
:
required: trueThe list of documents for Amazon Kendra Intelligent Ranking to rescore or rank on.
- On success, responds with
RescoreOutput
with field(s):rescore_id(Option<String>)
:The identifier associated with the scores that Amazon Kendra Intelligent Ranking gives to the results. Amazon Kendra Intelligent Ranking rescores or re-ranks the results for the search service.
result_items(Option<Vec::<RescoreResultItem>>)
:A list of result items for documents with new relevancy scores. The results are in descending order.
- On failure, responds with
SdkError<RescoreError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the rescore execution plan to tag.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueA list of tag keys to add to a rescore execution plan. If a tag already exists, the existing value is replaced with the new value.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the rescore execution plan to remove the tag.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueA list of tag keys to remove from the rescore execution plan. If a tag key does not exist on the resource, it is ignored.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_rescore_execution_plan(
&self
) -> UpdateRescoreExecutionPlanFluentBuilder
pub fn update_rescore_execution_plan( &self ) -> UpdateRescoreExecutionPlanFluentBuilder
Constructs a fluent builder for the UpdateRescoreExecutionPlan
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe identifier of the rescore execution plan that you want to update.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseA new name for the rescore execution plan.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA new description for the rescore execution plan.
capacity_units(CapacityUnitsConfiguration)
/set_capacity_units(Option<CapacityUnitsConfiguration>)
:
required: falseYou can set additional capacity units to meet the needs of your rescore execution plan. You are given a single capacity unit by default. If you want to use the default capacity, you don’t set additional capacity units. For more information on the default capacity and additional capacity units, see Adjusting capacity.
- On success, responds with
UpdateRescoreExecutionPlanOutput
- On failure, responds with
SdkError<UpdateRescoreExecutionPlanError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more