// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Sets additional capacity units configured for your rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the <code>Rescore</code> API. You can add and remove capacity units to fit your usage requirements.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CapacityUnitsConfiguration {
/// <p>The amount of extra capacity for your rescore execution plan.</p>
/// <p>A single extra capacity unit for a rescore execution plan provides 0.01 rescore requests per second. You can add up to 1000 extra capacity units.</p>
#[doc(hidden)]
pub rescore_capacity_units: std::option::Option<i32>,
}
impl CapacityUnitsConfiguration {
/// <p>The amount of extra capacity for your rescore execution plan.</p>
/// <p>A single extra capacity unit for a rescore execution plan provides 0.01 rescore requests per second. You can add up to 1000 extra capacity units.</p>
pub fn rescore_capacity_units(&self) -> std::option::Option<i32> {
self.rescore_capacity_units
}
}
/// See [`CapacityUnitsConfiguration`](crate::model::CapacityUnitsConfiguration).
pub mod capacity_units_configuration {
/// A builder for [`CapacityUnitsConfiguration`](crate::model::CapacityUnitsConfiguration).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) rescore_capacity_units: std::option::Option<i32>,
}
impl Builder {
/// <p>The amount of extra capacity for your rescore execution plan.</p>
/// <p>A single extra capacity unit for a rescore execution plan provides 0.01 rescore requests per second. You can add up to 1000 extra capacity units.</p>
pub fn rescore_capacity_units(mut self, input: i32) -> Self {
self.rescore_capacity_units = Some(input);
self
}
/// <p>The amount of extra capacity for your rescore execution plan.</p>
/// <p>A single extra capacity unit for a rescore execution plan provides 0.01 rescore requests per second. You can add up to 1000 extra capacity units.</p>
pub fn set_rescore_capacity_units(mut self, input: std::option::Option<i32>) -> Self {
self.rescore_capacity_units = input;
self
}
/// Consumes the builder and constructs a [`CapacityUnitsConfiguration`](crate::model::CapacityUnitsConfiguration).
pub fn build(self) -> crate::model::CapacityUnitsConfiguration {
crate::model::CapacityUnitsConfiguration {
rescore_capacity_units: self.rescore_capacity_units,
}
}
}
}
impl CapacityUnitsConfiguration {
/// Creates a new builder-style object to manufacture [`CapacityUnitsConfiguration`](crate::model::CapacityUnitsConfiguration).
pub fn builder() -> crate::model::capacity_units_configuration::Builder {
crate::model::capacity_units_configuration::Builder::default()
}
}
/// <p>A key-value pair that identifies or categorizes a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the <code>Rescore</code> API. You can also use a tag to help control access to a rescore execution plan. A tag key and value can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Tag {
/// <p>The key for the tag. Keys are not case sensitive and must be unique.</p>
#[doc(hidden)]
pub key: std::option::Option<std::string::String>,
/// <p>The value associated with the tag. The value can be an empty string but it can't be null.</p>
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl Tag {
/// <p>The key for the tag. Keys are not case sensitive and must be unique.</p>
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
/// <p>The value associated with the tag. The value can be an empty string but it can't be null.</p>
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
/// See [`Tag`](crate::model::Tag).
pub mod tag {
/// A builder for [`Tag`](crate::model::Tag).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The key for the tag. Keys are not case sensitive and must be unique.</p>
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
/// <p>The key for the tag. Keys are not case sensitive and must be unique.</p>
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
/// <p>The value associated with the tag. The value can be an empty string but it can't be null.</p>
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
/// <p>The value associated with the tag. The value can be an empty string but it can't be null.</p>
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
/// Consumes the builder and constructs a [`Tag`](crate::model::Tag).
pub fn build(self) -> crate::model::Tag {
crate::model::Tag {
key: self.key,
value: self.value,
}
}
}
}
impl Tag {
/// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
pub fn builder() -> crate::model::tag::Builder {
crate::model::tag::Builder::default()
}
}
/// <p>A result item for a document with a new relevancy score.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RescoreResultItem {
/// <p>The identifier of the document from the search service.</p>
#[doc(hidden)]
pub document_id: std::option::Option<std::string::String>,
/// <p>The relevancy score or rank that Amazon Kendra Intelligent Ranking gives to the result.</p>
#[doc(hidden)]
pub score: std::option::Option<f32>,
}
impl RescoreResultItem {
/// <p>The identifier of the document from the search service.</p>
pub fn document_id(&self) -> std::option::Option<&str> {
self.document_id.as_deref()
}
/// <p>The relevancy score or rank that Amazon Kendra Intelligent Ranking gives to the result.</p>
pub fn score(&self) -> std::option::Option<f32> {
self.score
}
}
/// See [`RescoreResultItem`](crate::model::RescoreResultItem).
pub mod rescore_result_item {
/// A builder for [`RescoreResultItem`](crate::model::RescoreResultItem).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) document_id: std::option::Option<std::string::String>,
pub(crate) score: std::option::Option<f32>,
}
impl Builder {
/// <p>The identifier of the document from the search service.</p>
pub fn document_id(mut self, input: impl Into<std::string::String>) -> Self {
self.document_id = Some(input.into());
self
}
/// <p>The identifier of the document from the search service.</p>
pub fn set_document_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.document_id = input;
self
}
/// <p>The relevancy score or rank that Amazon Kendra Intelligent Ranking gives to the result.</p>
pub fn score(mut self, input: f32) -> Self {
self.score = Some(input);
self
}
/// <p>The relevancy score or rank that Amazon Kendra Intelligent Ranking gives to the result.</p>
pub fn set_score(mut self, input: std::option::Option<f32>) -> Self {
self.score = input;
self
}
/// Consumes the builder and constructs a [`RescoreResultItem`](crate::model::RescoreResultItem).
pub fn build(self) -> crate::model::RescoreResultItem {
crate::model::RescoreResultItem {
document_id: self.document_id,
score: self.score,
}
}
}
}
impl RescoreResultItem {
/// Creates a new builder-style object to manufacture [`RescoreResultItem`](crate::model::RescoreResultItem).
pub fn builder() -> crate::model::rescore_result_item::Builder {
crate::model::rescore_result_item::Builder::default()
}
}
/// <p>Information about a document from a search service such as OpenSearch (self managed). Amazon Kendra Intelligent Ranking uses this information to rank and score on.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Document {
/// <p>The identifier of the document from the search service.</p>
#[doc(hidden)]
pub id: std::option::Option<std::string::String>,
/// <p>The optional group identifier of the document from the search service. Documents with the same group identifier are grouped together and processed as one document within the service.</p>
#[doc(hidden)]
pub group_id: std::option::Option<std::string::String>,
/// <p>The title of the search service's document.</p>
#[doc(hidden)]
pub title: std::option::Option<std::string::String>,
/// <p>The body text of the search service's document.</p>
#[doc(hidden)]
pub body: std::option::Option<std::string::String>,
/// <p>The title of the search service's document represented as a list of tokens or words. You must choose to provide <code>Title</code> or <code>TokenizedTitle</code>. You cannot provide both.</p>
#[doc(hidden)]
pub tokenized_title: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The body text of the search service's document represented as a list of tokens or words. You must choose to provide <code>Body</code> or <code>TokenizedBody</code>. You cannot provide both.</p>
#[doc(hidden)]
pub tokenized_body: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The original document score or rank from the search service. Amazon Kendra Intelligent Ranking gives the document a new score or rank based on its intelligent search algorithms.</p>
#[doc(hidden)]
pub original_score: std::option::Option<f32>,
}
impl Document {
/// <p>The identifier of the document from the search service.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The optional group identifier of the document from the search service. Documents with the same group identifier are grouped together and processed as one document within the service.</p>
pub fn group_id(&self) -> std::option::Option<&str> {
self.group_id.as_deref()
}
/// <p>The title of the search service's document.</p>
pub fn title(&self) -> std::option::Option<&str> {
self.title.as_deref()
}
/// <p>The body text of the search service's document.</p>
pub fn body(&self) -> std::option::Option<&str> {
self.body.as_deref()
}
/// <p>The title of the search service's document represented as a list of tokens or words. You must choose to provide <code>Title</code> or <code>TokenizedTitle</code>. You cannot provide both.</p>
pub fn tokenized_title(&self) -> std::option::Option<&[std::string::String]> {
self.tokenized_title.as_deref()
}
/// <p>The body text of the search service's document represented as a list of tokens or words. You must choose to provide <code>Body</code> or <code>TokenizedBody</code>. You cannot provide both.</p>
pub fn tokenized_body(&self) -> std::option::Option<&[std::string::String]> {
self.tokenized_body.as_deref()
}
/// <p>The original document score or rank from the search service. Amazon Kendra Intelligent Ranking gives the document a new score or rank based on its intelligent search algorithms.</p>
pub fn original_score(&self) -> std::option::Option<f32> {
self.original_score
}
}
/// See [`Document`](crate::model::Document).
pub mod document {
/// A builder for [`Document`](crate::model::Document).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) id: std::option::Option<std::string::String>,
pub(crate) group_id: std::option::Option<std::string::String>,
pub(crate) title: std::option::Option<std::string::String>,
pub(crate) body: std::option::Option<std::string::String>,
pub(crate) tokenized_title: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) tokenized_body: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) original_score: std::option::Option<f32>,
}
impl Builder {
/// <p>The identifier of the document from the search service.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The identifier of the document from the search service.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The optional group identifier of the document from the search service. Documents with the same group identifier are grouped together and processed as one document within the service.</p>
pub fn group_id(mut self, input: impl Into<std::string::String>) -> Self {
self.group_id = Some(input.into());
self
}
/// <p>The optional group identifier of the document from the search service. Documents with the same group identifier are grouped together and processed as one document within the service.</p>
pub fn set_group_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.group_id = input;
self
}
/// <p>The title of the search service's document.</p>
pub fn title(mut self, input: impl Into<std::string::String>) -> Self {
self.title = Some(input.into());
self
}
/// <p>The title of the search service's document.</p>
pub fn set_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.title = input;
self
}
/// <p>The body text of the search service's document.</p>
pub fn body(mut self, input: impl Into<std::string::String>) -> Self {
self.body = Some(input.into());
self
}
/// <p>The body text of the search service's document.</p>
pub fn set_body(mut self, input: std::option::Option<std::string::String>) -> Self {
self.body = input;
self
}
/// Appends an item to `tokenized_title`.
///
/// To override the contents of this collection use [`set_tokenized_title`](Self::set_tokenized_title).
///
/// <p>The title of the search service's document represented as a list of tokens or words. You must choose to provide <code>Title</code> or <code>TokenizedTitle</code>. You cannot provide both.</p>
pub fn tokenized_title(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tokenized_title.unwrap_or_default();
v.push(input.into());
self.tokenized_title = Some(v);
self
}
/// <p>The title of the search service's document represented as a list of tokens or words. You must choose to provide <code>Title</code> or <code>TokenizedTitle</code>. You cannot provide both.</p>
pub fn set_tokenized_title(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tokenized_title = input;
self
}
/// Appends an item to `tokenized_body`.
///
/// To override the contents of this collection use [`set_tokenized_body`](Self::set_tokenized_body).
///
/// <p>The body text of the search service's document represented as a list of tokens or words. You must choose to provide <code>Body</code> or <code>TokenizedBody</code>. You cannot provide both.</p>
pub fn tokenized_body(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tokenized_body.unwrap_or_default();
v.push(input.into());
self.tokenized_body = Some(v);
self
}
/// <p>The body text of the search service's document represented as a list of tokens or words. You must choose to provide <code>Body</code> or <code>TokenizedBody</code>. You cannot provide both.</p>
pub fn set_tokenized_body(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tokenized_body = input;
self
}
/// <p>The original document score or rank from the search service. Amazon Kendra Intelligent Ranking gives the document a new score or rank based on its intelligent search algorithms.</p>
pub fn original_score(mut self, input: f32) -> Self {
self.original_score = Some(input);
self
}
/// <p>The original document score or rank from the search service. Amazon Kendra Intelligent Ranking gives the document a new score or rank based on its intelligent search algorithms.</p>
pub fn set_original_score(mut self, input: std::option::Option<f32>) -> Self {
self.original_score = input;
self
}
/// Consumes the builder and constructs a [`Document`](crate::model::Document).
pub fn build(self) -> crate::model::Document {
crate::model::Document {
id: self.id,
group_id: self.group_id,
title: self.title,
body: self.body,
tokenized_title: self.tokenized_title,
tokenized_body: self.tokenized_body,
original_score: self.original_score,
}
}
}
}
impl Document {
/// Creates a new builder-style object to manufacture [`Document`](crate::model::Document).
pub fn builder() -> crate::model::document::Builder {
crate::model::document::Builder::default()
}
}
/// <p>Summary information for a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the <code>Rescore</code> API.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RescoreExecutionPlanSummary {
/// <p>The name of the rescore execution plan.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>The identifier of the rescore execution plan.</p>
#[doc(hidden)]
pub id: std::option::Option<std::string::String>,
/// <p>The Unix timestamp when the rescore execution plan was created.</p>
#[doc(hidden)]
pub created_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The Unix timestamp when the rescore execution plan was last updated.</p>
#[doc(hidden)]
pub updated_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The current status of the rescore execution plan. When the value is <code>ACTIVE</code>, the rescore execution plan is ready for use.</p>
#[doc(hidden)]
pub status: std::option::Option<crate::model::RescoreExecutionPlanStatus>,
}
impl RescoreExecutionPlanSummary {
/// <p>The name of the rescore execution plan.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The identifier of the rescore execution plan.</p>
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The Unix timestamp when the rescore execution plan was created.</p>
pub fn created_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
/// <p>The Unix timestamp when the rescore execution plan was last updated.</p>
pub fn updated_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
/// <p>The current status of the rescore execution plan. When the value is <code>ACTIVE</code>, the rescore execution plan is ready for use.</p>
pub fn status(&self) -> std::option::Option<&crate::model::RescoreExecutionPlanStatus> {
self.status.as_ref()
}
}
/// See [`RescoreExecutionPlanSummary`](crate::model::RescoreExecutionPlanSummary).
pub mod rescore_execution_plan_summary {
/// A builder for [`RescoreExecutionPlanSummary`](crate::model::RescoreExecutionPlanSummary).
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) id: std::option::Option<std::string::String>,
pub(crate) created_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) updated_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) status: std::option::Option<crate::model::RescoreExecutionPlanStatus>,
}
impl Builder {
/// <p>The name of the rescore execution plan.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>The name of the rescore execution plan.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The identifier of the rescore execution plan.</p>
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
/// <p>The identifier of the rescore execution plan.</p>
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The Unix timestamp when the rescore execution plan was created.</p>
pub fn created_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.created_at = Some(input);
self
}
/// <p>The Unix timestamp when the rescore execution plan was created.</p>
pub fn set_created_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.created_at = input;
self
}
/// <p>The Unix timestamp when the rescore execution plan was last updated.</p>
pub fn updated_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.updated_at = Some(input);
self
}
/// <p>The Unix timestamp when the rescore execution plan was last updated.</p>
pub fn set_updated_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.updated_at = input;
self
}
/// <p>The current status of the rescore execution plan. When the value is <code>ACTIVE</code>, the rescore execution plan is ready for use.</p>
pub fn status(mut self, input: crate::model::RescoreExecutionPlanStatus) -> Self {
self.status = Some(input);
self
}
/// <p>The current status of the rescore execution plan. When the value is <code>ACTIVE</code>, the rescore execution plan is ready for use.</p>
pub fn set_status(
mut self,
input: std::option::Option<crate::model::RescoreExecutionPlanStatus>,
) -> Self {
self.status = input;
self
}
/// Consumes the builder and constructs a [`RescoreExecutionPlanSummary`](crate::model::RescoreExecutionPlanSummary).
pub fn build(self) -> crate::model::RescoreExecutionPlanSummary {
crate::model::RescoreExecutionPlanSummary {
name: self.name,
id: self.id,
created_at: self.created_at,
updated_at: self.updated_at,
status: self.status,
}
}
}
}
impl RescoreExecutionPlanSummary {
/// Creates a new builder-style object to manufacture [`RescoreExecutionPlanSummary`](crate::model::RescoreExecutionPlanSummary).
pub fn builder() -> crate::model::rescore_execution_plan_summary::Builder {
crate::model::rescore_execution_plan_summary::Builder::default()
}
}
/// When writing a match expression against `RescoreExecutionPlanStatus`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let rescoreexecutionplanstatus = unimplemented!();
/// match rescoreexecutionplanstatus {
/// RescoreExecutionPlanStatus::Active => { /* ... */ },
/// RescoreExecutionPlanStatus::Creating => { /* ... */ },
/// RescoreExecutionPlanStatus::Deleting => { /* ... */ },
/// RescoreExecutionPlanStatus::Failed => { /* ... */ },
/// RescoreExecutionPlanStatus::Updating => { /* ... */ },
/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
/// _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `rescoreexecutionplanstatus` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `RescoreExecutionPlanStatus::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `RescoreExecutionPlanStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `RescoreExecutionPlanStatus::NewFeature` is defined.
/// Specifically, when `rescoreexecutionplanstatus` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `RescoreExecutionPlanStatus::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum RescoreExecutionPlanStatus {
#[allow(missing_docs)] // documentation missing in model
Active,
#[allow(missing_docs)] // documentation missing in model
Creating,
#[allow(missing_docs)] // documentation missing in model
Deleting,
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
Updating,
/// `Unknown` contains new variants that have been added since this code was generated.
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for RescoreExecutionPlanStatus {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => RescoreExecutionPlanStatus::Active,
"CREATING" => RescoreExecutionPlanStatus::Creating,
"DELETING" => RescoreExecutionPlanStatus::Deleting,
"FAILED" => RescoreExecutionPlanStatus::Failed,
"UPDATING" => RescoreExecutionPlanStatus::Updating,
other => RescoreExecutionPlanStatus::Unknown(crate::types::UnknownVariantValue(
other.to_owned(),
)),
}
}
}
impl std::str::FromStr for RescoreExecutionPlanStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(RescoreExecutionPlanStatus::from(s))
}
}
impl RescoreExecutionPlanStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
RescoreExecutionPlanStatus::Active => "ACTIVE",
RescoreExecutionPlanStatus::Creating => "CREATING",
RescoreExecutionPlanStatus::Deleting => "DELETING",
RescoreExecutionPlanStatus::Failed => "FAILED",
RescoreExecutionPlanStatus::Updating => "UPDATING",
RescoreExecutionPlanStatus::Unknown(value) => value.as_str(),
}
}
/// Returns all the `&str` values of the enum members.
pub const fn values() -> &'static [&'static str] {
&["ACTIVE", "CREATING", "DELETING", "FAILED", "UPDATING"]
}
}
impl AsRef<str> for RescoreExecutionPlanStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}