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