1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EvaluateFeatureOutput {
/// <p>The name of the variation that was served to the user session.</p>
pub variation: ::std::option::Option<::std::string::String>,
/// <p>The value assigned to this variation to differentiate it from the other variations of this feature.</p>
pub value: ::std::option::Option<crate::types::VariableValue>,
/// <p>Specifies the reason that the user session was assigned this variation. Possible values include <code>DEFAULT</code>, meaning the user was served the default variation; <code>LAUNCH_RULE_MATCH</code>, if the user session was enrolled in a launch; <code>EXPERIMENT_RULE_MATCH</code>, if the user session was enrolled in an experiment; or <code>ENTITY_OVERRIDES_MATCH</code>, if the user's <code>entityId</code> matches an override rule.</p>
pub reason: ::std::option::Option<::std::string::String>,
/// <p>If this user was assigned to a launch or experiment, this field lists the launch or experiment name.</p>
pub details: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl EvaluateFeatureOutput {
/// <p>The name of the variation that was served to the user session.</p>
pub fn variation(&self) -> ::std::option::Option<&str> {
self.variation.as_deref()
}
/// <p>The value assigned to this variation to differentiate it from the other variations of this feature.</p>
pub fn value(&self) -> ::std::option::Option<&crate::types::VariableValue> {
self.value.as_ref()
}
/// <p>Specifies the reason that the user session was assigned this variation. Possible values include <code>DEFAULT</code>, meaning the user was served the default variation; <code>LAUNCH_RULE_MATCH</code>, if the user session was enrolled in a launch; <code>EXPERIMENT_RULE_MATCH</code>, if the user session was enrolled in an experiment; or <code>ENTITY_OVERRIDES_MATCH</code>, if the user's <code>entityId</code> matches an override rule.</p>
pub fn reason(&self) -> ::std::option::Option<&str> {
self.reason.as_deref()
}
/// <p>If this user was assigned to a launch or experiment, this field lists the launch or experiment name.</p>
pub fn details(&self) -> ::std::option::Option<&str> {
self.details.as_deref()
}
}
impl ::aws_types::request_id::RequestId for EvaluateFeatureOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl EvaluateFeatureOutput {
/// Creates a new builder-style object to manufacture [`EvaluateFeatureOutput`](crate::operation::evaluate_feature::EvaluateFeatureOutput).
pub fn builder() -> crate::operation::evaluate_feature::builders::EvaluateFeatureOutputBuilder {
crate::operation::evaluate_feature::builders::EvaluateFeatureOutputBuilder::default()
}
}
/// A builder for [`EvaluateFeatureOutput`](crate::operation::evaluate_feature::EvaluateFeatureOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EvaluateFeatureOutputBuilder {
pub(crate) variation: ::std::option::Option<::std::string::String>,
pub(crate) value: ::std::option::Option<crate::types::VariableValue>,
pub(crate) reason: ::std::option::Option<::std::string::String>,
pub(crate) details: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl EvaluateFeatureOutputBuilder {
/// <p>The name of the variation that was served to the user session.</p>
pub fn variation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.variation = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the variation that was served to the user session.</p>
pub fn set_variation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.variation = input;
self
}
/// <p>The name of the variation that was served to the user session.</p>
pub fn get_variation(&self) -> &::std::option::Option<::std::string::String> {
&self.variation
}
/// <p>The value assigned to this variation to differentiate it from the other variations of this feature.</p>
pub fn value(mut self, input: crate::types::VariableValue) -> Self {
self.value = ::std::option::Option::Some(input);
self
}
/// <p>The value assigned to this variation to differentiate it from the other variations of this feature.</p>
pub fn set_value(mut self, input: ::std::option::Option<crate::types::VariableValue>) -> Self {
self.value = input;
self
}
/// <p>The value assigned to this variation to differentiate it from the other variations of this feature.</p>
pub fn get_value(&self) -> &::std::option::Option<crate::types::VariableValue> {
&self.value
}
/// <p>Specifies the reason that the user session was assigned this variation. Possible values include <code>DEFAULT</code>, meaning the user was served the default variation; <code>LAUNCH_RULE_MATCH</code>, if the user session was enrolled in a launch; <code>EXPERIMENT_RULE_MATCH</code>, if the user session was enrolled in an experiment; or <code>ENTITY_OVERRIDES_MATCH</code>, if the user's <code>entityId</code> matches an override rule.</p>
pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reason = ::std::option::Option::Some(input.into());
self
}
/// <p>Specifies the reason that the user session was assigned this variation. Possible values include <code>DEFAULT</code>, meaning the user was served the default variation; <code>LAUNCH_RULE_MATCH</code>, if the user session was enrolled in a launch; <code>EXPERIMENT_RULE_MATCH</code>, if the user session was enrolled in an experiment; or <code>ENTITY_OVERRIDES_MATCH</code>, if the user's <code>entityId</code> matches an override rule.</p>
pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reason = input;
self
}
/// <p>Specifies the reason that the user session was assigned this variation. Possible values include <code>DEFAULT</code>, meaning the user was served the default variation; <code>LAUNCH_RULE_MATCH</code>, if the user session was enrolled in a launch; <code>EXPERIMENT_RULE_MATCH</code>, if the user session was enrolled in an experiment; or <code>ENTITY_OVERRIDES_MATCH</code>, if the user's <code>entityId</code> matches an override rule.</p>
pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.reason
}
/// <p>If this user was assigned to a launch or experiment, this field lists the launch or experiment name.</p>
pub fn details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.details = ::std::option::Option::Some(input.into());
self
}
/// <p>If this user was assigned to a launch or experiment, this field lists the launch or experiment name.</p>
pub fn set_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.details = input;
self
}
/// <p>If this user was assigned to a launch or experiment, this field lists the launch or experiment name.</p>
pub fn get_details(&self) -> &::std::option::Option<::std::string::String> {
&self.details
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`EvaluateFeatureOutput`](crate::operation::evaluate_feature::EvaluateFeatureOutput).
pub fn build(self) -> crate::operation::evaluate_feature::EvaluateFeatureOutput {
crate::operation::evaluate_feature::EvaluateFeatureOutput {
variation: self.variation,
value: self.value,
reason: self.reason,
details: self.details,
_request_id: self._request_id,
}
}
}