// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_plan_recommendation::_get_plan_recommendation_input::GetPlanRecommendationInputBuilder;
pub use crate::operation::get_plan_recommendation::_get_plan_recommendation_output::GetPlanRecommendationOutputBuilder;
impl crate::operation::get_plan_recommendation::builders::GetPlanRecommendationInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::get_plan_recommendation::GetPlanRecommendationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_plan_recommendation::GetPlanRecommendationError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.get_plan_recommendation();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `GetPlanRecommendation`.
///
/// Returns a recommended pricing model and plan set for an app, calculated from the billable actions, costs, customer types, alternatives and preferences in the request. Built to be called by an agent working with the developer: most inputs are estimates the agent gathers from the app's code and from the developer (who the users are, what an action saves them, what it costs to serve), and each optional member's documentation says what its absence means, so send only the inputs you have a basis for. Stateless: nothing is stored, no app is required, and repeating a request returns the same recommendation unless the service has been updated in between. Every response carries the rendered texts summary and details. Smallest call (MEDIUM confidence): {"segment":"CONSUMER","appType":"DAILY_WORKFLOW","actions":\[{"unitCost":0.02,"typicalMonthlyUsage":30,"valuePerUse":0.40}\]}.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetPlanRecommendationFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::get_plan_recommendation::builders::GetPlanRecommendationInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::get_plan_recommendation::GetPlanRecommendationOutput,
crate::operation::get_plan_recommendation::GetPlanRecommendationError,
> for GetPlanRecommendationFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::get_plan_recommendation::GetPlanRecommendationOutput,
crate::operation::get_plan_recommendation::GetPlanRecommendationError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl GetPlanRecommendationFluentBuilder {
/// Creates a new `GetPlanRecommendationFluentBuilder`.
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 GetPlanRecommendation as a reference.
pub fn as_input(&self) -> &crate::operation::get_plan_recommendation::builders::GetPlanRecommendationInputBuilder {
&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::get_plan_recommendation::GetPlanRecommendationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_plan_recommendation::GetPlanRecommendationError,
::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::get_plan_recommendation::GetPlanRecommendation::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::get_plan_recommendation::GetPlanRecommendation::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::get_plan_recommendation::GetPlanRecommendationOutput,
crate::operation::get_plan_recommendation::GetPlanRecommendationError,
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
}
/// Display name of the app, used in the rendered text. Absent: `your app`.
pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.app_name(input.into());
self
}
/// Display name of the app, used in the rendered text. Absent: `your app`.
pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_app_name(input);
self
}
/// Display name of the app, used in the rendered text. Absent: `your app`.
pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_app_name()
}
/// Who buys the app.
pub fn segment(mut self, input: crate::types::CustomerSegment) -> Self {
self.inner = self.inner.segment(input);
self
}
/// Who buys the app.
pub fn set_segment(mut self, input: ::std::option::Option<crate::types::CustomerSegment>) -> Self {
self.inner = self.inner.set_segment(input);
self
}
/// Who buys the app.
pub fn get_segment(&self) -> &::std::option::Option<crate::types::CustomerSegment> {
self.inner.get_segment()
}
/// Kind of app. It sets the service's usage and value benchmarks for this kind of app.
pub fn app_type(mut self, input: crate::types::PlanRecommendationAppType) -> Self {
self.inner = self.inner.app_type(input);
self
}
/// Kind of app. It sets the service's usage and value benchmarks for this kind of app.
pub fn set_app_type(mut self, input: ::std::option::Option<crate::types::PlanRecommendationAppType>) -> Self {
self.inner = self.inner.set_app_type(input);
self
}
/// Kind of app. It sets the service's usage and value benchmarks for this kind of app.
pub fn get_app_type(&self) -> &::std::option::Option<crate::types::PlanRecommendationAppType> {
self.inner.get_app_type()
}
/// What kind of value the app gives its users. Absent: PRODUCTIVITY. An experiential app has no time or money value, so with EXPERIENTIAL each of `actions\[\].minutesSaved`, `actions\[\].moneySaved`, `actions\[\].valuePerUse`, `hourlyRate` and `valueShare` that is sent is rejected. With EXPERIENTIAL, no `planOptions.publishedPrice` and no comparables used, a CONSUMER app is valued at the typical monthly price of public apps of its `appType` (there is none for API_WRAPPER), shown as an estimate. That estimate is not used when it is too close to a typical user's usage cost, so the estimate alone never makes the verdict NOT_MONETIZABLE. The estimate exists only for CONSUMER: a PROSUMER or ENTERPRISE experiential app with no `planOptions.publishedPrice` and no usable comparables is priced from cost (verdict COST_ONLY, or COST_NOT_CHECKED when costs are not checked: no `unitCost`, or `costs.source` NONE; confidence LOW).
pub fn value_kind(mut self, input: crate::types::ValueKind) -> Self {
self.inner = self.inner.value_kind(input);
self
}
/// What kind of value the app gives its users. Absent: PRODUCTIVITY. An experiential app has no time or money value, so with EXPERIENTIAL each of `actions\[\].minutesSaved`, `actions\[\].moneySaved`, `actions\[\].valuePerUse`, `hourlyRate` and `valueShare` that is sent is rejected. With EXPERIENTIAL, no `planOptions.publishedPrice` and no comparables used, a CONSUMER app is valued at the typical monthly price of public apps of its `appType` (there is none for API_WRAPPER), shown as an estimate. That estimate is not used when it is too close to a typical user's usage cost, so the estimate alone never makes the verdict NOT_MONETIZABLE. The estimate exists only for CONSUMER: a PROSUMER or ENTERPRISE experiential app with no `planOptions.publishedPrice` and no usable comparables is priced from cost (verdict COST_ONLY, or COST_NOT_CHECKED when costs are not checked: no `unitCost`, or `costs.source` NONE; confidence LOW).
pub fn set_value_kind(mut self, input: ::std::option::Option<crate::types::ValueKind>) -> Self {
self.inner = self.inner.set_value_kind(input);
self
}
/// What kind of value the app gives its users. Absent: PRODUCTIVITY. An experiential app has no time or money value, so with EXPERIENTIAL each of `actions\[\].minutesSaved`, `actions\[\].moneySaved`, `actions\[\].valuePerUse`, `hourlyRate` and `valueShare` that is sent is rejected. With EXPERIENTIAL, no `planOptions.publishedPrice` and no comparables used, a CONSUMER app is valued at the typical monthly price of public apps of its `appType` (there is none for API_WRAPPER), shown as an estimate. That estimate is not used when it is too close to a typical user's usage cost, so the estimate alone never makes the verdict NOT_MONETIZABLE. The estimate exists only for CONSUMER: a PROSUMER or ENTERPRISE experiential app with no `planOptions.publishedPrice` and no usable comparables is priced from cost (verdict COST_ONLY, or COST_NOT_CHECKED when costs are not checked: no `unitCost`, or `costs.source` NONE; confidence LOW).
pub fn get_value_kind(&self) -> &::std::option::Option<crate::types::ValueKind> {
self.inner.get_value_kind()
}
///
/// Appends an item to `actions`.
///
/// To override the contents of this collection use [`set_actions`](Self::set_actions).
///
/// The things that your app charges for, each with its cost to serve, typical usage, and value to a customer. Names must be unique. Give a value basis (`minutesSaved`, `moneySaved` or `valuePerUse`, one per action) on every action or on none: when no action has a value basis and there is no experiential estimate (see `valueKind`), the price is based on cost (and comparables, if opted in, or `planOptions.publishedPrice`) and the confidence is LOW. Give `unitCost` on every action or on none.
pub fn actions(mut self, input: crate::types::BillableAction) -> Self {
self.inner = self.inner.actions(input);
self
}
/// The things that your app charges for, each with its cost to serve, typical usage, and value to a customer. Names must be unique. Give a value basis (`minutesSaved`, `moneySaved` or `valuePerUse`, one per action) on every action or on none: when no action has a value basis and there is no experiential estimate (see `valueKind`), the price is based on cost (and comparables, if opted in, or `planOptions.publishedPrice`) and the confidence is LOW. Give `unitCost` on every action or on none.
pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BillableAction>>) -> Self {
self.inner = self.inner.set_actions(input);
self
}
/// The things that your app charges for, each with its cost to serve, typical usage, and value to a customer. Names must be unique. Give a value basis (`minutesSaved`, `moneySaved` or `valuePerUse`, one per action) on every action or on none: when no action has a value basis and there is no experiential estimate (see `valueKind`), the price is based on cost (and comparables, if opted in, or `planOptions.publishedPrice`) and the confidence is LOW. Give `unitCost` on every action or on none.
pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BillableAction>> {
self.inner.get_actions()
}
/// What one hour of a customer's time is worth, in USD: the hourly rate of the person whose time the app saves. Required when any action has `minutesSaved`. There is no default. It is used only with `actions\[\].minutesSaved`: sent when no action has `minutesSaved`, or with `valueKind` EXPERIENTIAL, it is rejected.
pub fn hourly_rate(mut self, input: f64) -> Self {
self.inner = self.inner.hourly_rate(input);
self
}
/// What one hour of a customer's time is worth, in USD: the hourly rate of the person whose time the app saves. Required when any action has `minutesSaved`. There is no default. It is used only with `actions\[\].minutesSaved`: sent when no action has `minutesSaved`, or with `valueKind` EXPERIENTIAL, it is rejected.
pub fn set_hourly_rate(mut self, input: ::std::option::Option<f64>) -> Self {
self.inner = self.inner.set_hourly_rate(input);
self
}
/// What one hour of a customer's time is worth, in USD: the hourly rate of the person whose time the app saves. Required when any action has `minutesSaved`. There is no default. It is used only with `actions\[\].minutesSaved`: sent when no action has `minutesSaved`, or with `valueKind` EXPERIENTIAL, it is rejected.
pub fn get_hourly_rate(&self) -> &::std::option::Option<f64> {
self.inner.get_hourly_rate()
}
/// The most a typical customer would pay for the app, as a share of the time value it saves them (`minutesSaved` / 60 times `hourlyRate`). Above 1 when the minutes understate the value. The value of one use of an action with `minutesSaved` is `minutesSaved` / 60 times `hourlyRate` times the share; the share does not apply to `moneySaved` or `valuePerUse`. When an action's value is above 0, each outside option's `monthlyCost` is also weighed at this share (see `OutsideOption`). Absent: the service's benchmark share. For PROSUMER this value scales the service's benchmark share instead of replacing it. With usable comparables the recommended price uses the service's benchmark share for comparables instead, but this value still sets the price from the app's value alone, which the confidence and the texts compare with. Rejected unless an action's `minutesSaved`, `moneySaved` or `valuePerUse` is above 0 and, besides, an action has `minutesSaved` (0 counts) or an outside option's `monthlyCost` is above 0: otherwise it changes nothing (with no value above 0 there is no value estimate, and an outside option counts in full). Rejected with `valueKind` EXPERIENTIAL.
pub fn value_share(mut self, input: f64) -> Self {
self.inner = self.inner.value_share(input);
self
}
/// The most a typical customer would pay for the app, as a share of the time value it saves them (`minutesSaved` / 60 times `hourlyRate`). Above 1 when the minutes understate the value. The value of one use of an action with `minutesSaved` is `minutesSaved` / 60 times `hourlyRate` times the share; the share does not apply to `moneySaved` or `valuePerUse`. When an action's value is above 0, each outside option's `monthlyCost` is also weighed at this share (see `OutsideOption`). Absent: the service's benchmark share. For PROSUMER this value scales the service's benchmark share instead of replacing it. With usable comparables the recommended price uses the service's benchmark share for comparables instead, but this value still sets the price from the app's value alone, which the confidence and the texts compare with. Rejected unless an action's `minutesSaved`, `moneySaved` or `valuePerUse` is above 0 and, besides, an action has `minutesSaved` (0 counts) or an outside option's `monthlyCost` is above 0: otherwise it changes nothing (with no value above 0 there is no value estimate, and an outside option counts in full). Rejected with `valueKind` EXPERIENTIAL.
pub fn set_value_share(mut self, input: ::std::option::Option<f64>) -> Self {
self.inner = self.inner.set_value_share(input);
self
}
/// The most a typical customer would pay for the app, as a share of the time value it saves them (`minutesSaved` / 60 times `hourlyRate`). Above 1 when the minutes understate the value. The value of one use of an action with `minutesSaved` is `minutesSaved` / 60 times `hourlyRate` times the share; the share does not apply to `moneySaved` or `valuePerUse`. When an action's value is above 0, each outside option's `monthlyCost` is also weighed at this share (see `OutsideOption`). Absent: the service's benchmark share. For PROSUMER this value scales the service's benchmark share instead of replacing it. With usable comparables the recommended price uses the service's benchmark share for comparables instead, but this value still sets the price from the app's value alone, which the confidence and the texts compare with. Rejected unless an action's `minutesSaved`, `moneySaved` or `valuePerUse` is above 0 and, besides, an action has `minutesSaved` (0 counts) or an outside option's `monthlyCost` is above 0: otherwise it changes nothing (with no value above 0 there is no value estimate, and an outside option counts in full). Rejected with `valueKind` EXPERIENTIAL.
pub fn get_value_share(&self) -> &::std::option::Option<f64> {
self.inner.get_value_share()
}
/// How this app scores on the characteristics customers decide on, and how much each one matters. Required when a comparable or an outside option in `alternatives` is scored by `features`, and used only then: sent when no comparable and no outside option is scored by `features`, it is rejected. A comparable with `alternatives.comparablesOptIn` OPTED_OUT is validated but not used, so `features` scored only against such comparables is validated with them and changes nothing. Absent: every comparable and outside option is scored by its `quality`.
pub fn features(mut self, input: crate::types::FeatureScores) -> Self {
self.inner = self.inner.features(input);
self
}
/// How this app scores on the characteristics customers decide on, and how much each one matters. Required when a comparable or an outside option in `alternatives` is scored by `features`, and used only then: sent when no comparable and no outside option is scored by `features`, it is rejected. A comparable with `alternatives.comparablesOptIn` OPTED_OUT is validated but not used, so `features` scored only against such comparables is validated with them and changes nothing. Absent: every comparable and outside option is scored by its `quality`.
pub fn set_features(mut self, input: ::std::option::Option<crate::types::FeatureScores>) -> Self {
self.inner = self.inner.set_features(input);
self
}
/// How this app scores on the characteristics customers decide on, and how much each one matters. Required when a comparable or an outside option in `alternatives` is scored by `features`, and used only then: sent when no comparable and no outside option is scored by `features`, it is rejected. A comparable with `alternatives.comparablesOptIn` OPTED_OUT is validated but not used, so `features` scored only against such comparables is validated with them and changes nothing. Absent: every comparable and outside option is scored by its `quality`.
pub fn get_features(&self) -> &::std::option::Option<crate::types::FeatureScores> {
self.inner.get_features()
}
/// Cost inputs beyond each action's `unitCost`: where the costs came from, any costs that could not be priced, fixed monthly cost and target margins. Absent: `costs.source` is inferred from `actions\[\].unitCost`, and the costs count as complete but unconfirmed (see `costs.unknown`).
pub fn costs(mut self, input: crate::types::CostInputs) -> Self {
self.inner = self.inner.costs(input);
self
}
/// Cost inputs beyond each action's `unitCost`: where the costs came from, any costs that could not be priced, fixed monthly cost and target margins. Absent: `costs.source` is inferred from `actions\[\].unitCost`, and the costs count as complete but unconfirmed (see `costs.unknown`).
pub fn set_costs(mut self, input: ::std::option::Option<crate::types::CostInputs>) -> Self {
self.inner = self.inner.set_costs(input);
self
}
/// Cost inputs beyond each action's `unitCost`: where the costs came from, any costs that could not be priced, fixed monthly cost and target margins. Absent: `costs.source` is inferred from `actions\[\].unitCost`, and the costs count as complete but unconfirmed (see `costs.unknown`).
pub fn get_costs(&self) -> &::std::option::Option<crate::types::CostInputs> {
self.inner.get_costs()
}
/// What customers could use instead of the app: comparable apps and what they do without any product. Absent: no comparables (`comparablesOptIn` OPTED_OUT) and no outside options.
pub fn alternatives(mut self, input: crate::types::AlternativeInputs) -> Self {
self.inner = self.inner.alternatives(input);
self
}
/// What customers could use instead of the app: comparable apps and what they do without any product. Absent: no comparables (`comparablesOptIn` OPTED_OUT) and no outside options.
pub fn set_alternatives(mut self, input: ::std::option::Option<crate::types::AlternativeInputs>) -> Self {
self.inner = self.inner.set_alternatives(input);
self
}
/// What customers could use instead of the app: comparable apps and what they do without any product. Absent: no comparables (`comparablesOptIn` OPTED_OUT) and no outside options.
pub fn get_alternatives(&self) -> &::std::option::Option<crate::types::AlternativeInputs> {
self.inner.get_alternatives()
}
/// Who the customers are, how many there are and, for a deployed app, how many pay today; and any checkout drop-off rates to use instead of the benchmarks. Absent: each member's default (see `MarketInputs`).
pub fn market(mut self, input: crate::types::MarketInputs) -> Self {
self.inner = self.inner.market(input);
self
}
/// Who the customers are, how many there are and, for a deployed app, how many pay today; and any checkout drop-off rates to use instead of the benchmarks. Absent: each member's default (see `MarketInputs`).
pub fn set_market(mut self, input: ::std::option::Option<crate::types::MarketInputs>) -> Self {
self.inner = self.inner.set_market(input);
self
}
/// Who the customers are, how many there are and, for a deployed app, how many pay today; and any checkout drop-off rates to use instead of the benchmarks. Absent: each member's default (see `MarketInputs`).
pub fn get_market(&self) -> &::std::option::Option<crate::types::MarketInputs> {
self.inner.get_market()
}
/// The pricing model and optional plans to consider, prices to evaluate, and the developer's own price (`publishedPrice`). Absent: each member's default (see `PlanOptions`); the service chooses the pricing model and plans.
pub fn plan_options(mut self, input: crate::types::PlanOptions) -> Self {
self.inner = self.inner.plan_options(input);
self
}
/// The pricing model and optional plans to consider, prices to evaluate, and the developer's own price (`publishedPrice`). Absent: each member's default (see `PlanOptions`); the service chooses the pricing model and plans.
pub fn set_plan_options(mut self, input: ::std::option::Option<crate::types::PlanOptions>) -> Self {
self.inner = self.inner.set_plan_options(input);
self
}
/// The pricing model and optional plans to consider, prices to evaluate, and the developer's own price (`publishedPrice`). Absent: each member's default (see `PlanOptions`); the service chooses the pricing model and plans.
pub fn get_plan_options(&self) -> &::std::option::Option<crate::types::PlanOptions> {
self.inner.get_plan_options()
}
/// Where the inputs came from, and notes on them. Changes no price, plan, verdict or confidence label: only how `summary` and `details` label and word the inputs. Absent: the rendered text uses default labels.
pub fn context(mut self, input: crate::types::RequestContext) -> Self {
self.inner = self.inner.context(input);
self
}
/// Where the inputs came from, and notes on them. Changes no price, plan, verdict or confidence label: only how `summary` and `details` label and word the inputs. Absent: the rendered text uses default labels.
pub fn set_context(mut self, input: ::std::option::Option<crate::types::RequestContext>) -> Self {
self.inner = self.inner.set_context(input);
self
}
/// Where the inputs came from, and notes on them. Changes no price, plan, verdict or confidence label: only how `summary` and `details` label and word the inputs. Absent: the rendered text uses default labels.
pub fn get_context(&self) -> &::std::option::Option<crate::types::RequestContext> {
self.inner.get_context()
}
}