aws_sdk_evidently/operation/evaluate_feature/
_evaluate_feature_input.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 EvaluateFeatureInput {
6    /// <p>The name or ARN of the project that contains this feature.</p>
7    pub project: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the feature being evaluated.</p>
9    pub feature: ::std::option::Option<::std::string::String>,
10    /// <p>An internal ID that represents a unique user of the application. This <code>entityID</code> is checked against any override rules assigned for this feature.</p>
11    pub entity_id: ::std::option::Option<::std::string::String>,
12    /// <p>A JSON object of attributes that you can optionally pass in as part of the evaluation event sent to Evidently from the user session. Evidently can use this value to match user sessions with defined audience segments. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html">Use segments to focus your audience</a>.</p>
13    /// <p>If you include this parameter, the value must be a JSON object. A JSON array is not supported.</p>
14    pub evaluation_context: ::std::option::Option<::std::string::String>,
15}
16impl EvaluateFeatureInput {
17    /// <p>The name or ARN of the project that contains this feature.</p>
18    pub fn project(&self) -> ::std::option::Option<&str> {
19        self.project.as_deref()
20    }
21    /// <p>The name of the feature being evaluated.</p>
22    pub fn feature(&self) -> ::std::option::Option<&str> {
23        self.feature.as_deref()
24    }
25    /// <p>An internal ID that represents a unique user of the application. This <code>entityID</code> is checked against any override rules assigned for this feature.</p>
26    pub fn entity_id(&self) -> ::std::option::Option<&str> {
27        self.entity_id.as_deref()
28    }
29    /// <p>A JSON object of attributes that you can optionally pass in as part of the evaluation event sent to Evidently from the user session. Evidently can use this value to match user sessions with defined audience segments. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html">Use segments to focus your audience</a>.</p>
30    /// <p>If you include this parameter, the value must be a JSON object. A JSON array is not supported.</p>
31    pub fn evaluation_context(&self) -> ::std::option::Option<&str> {
32        self.evaluation_context.as_deref()
33    }
34}
35impl EvaluateFeatureInput {
36    /// Creates a new builder-style object to manufacture [`EvaluateFeatureInput`](crate::operation::evaluate_feature::EvaluateFeatureInput).
37    pub fn builder() -> crate::operation::evaluate_feature::builders::EvaluateFeatureInputBuilder {
38        crate::operation::evaluate_feature::builders::EvaluateFeatureInputBuilder::default()
39    }
40}
41
42/// A builder for [`EvaluateFeatureInput`](crate::operation::evaluate_feature::EvaluateFeatureInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct EvaluateFeatureInputBuilder {
46    pub(crate) project: ::std::option::Option<::std::string::String>,
47    pub(crate) feature: ::std::option::Option<::std::string::String>,
48    pub(crate) entity_id: ::std::option::Option<::std::string::String>,
49    pub(crate) evaluation_context: ::std::option::Option<::std::string::String>,
50}
51impl EvaluateFeatureInputBuilder {
52    /// <p>The name or ARN of the project that contains this feature.</p>
53    /// This field is required.
54    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.project = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The name or ARN of the project that contains this feature.</p>
59    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.project = input;
61        self
62    }
63    /// <p>The name or ARN of the project that contains this feature.</p>
64    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
65        &self.project
66    }
67    /// <p>The name of the feature being evaluated.</p>
68    /// This field is required.
69    pub fn feature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.feature = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The name of the feature being evaluated.</p>
74    pub fn set_feature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.feature = input;
76        self
77    }
78    /// <p>The name of the feature being evaluated.</p>
79    pub fn get_feature(&self) -> &::std::option::Option<::std::string::String> {
80        &self.feature
81    }
82    /// <p>An internal ID that represents a unique user of the application. This <code>entityID</code> is checked against any override rules assigned for this feature.</p>
83    /// This field is required.
84    pub fn entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.entity_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>An internal ID that represents a unique user of the application. This <code>entityID</code> is checked against any override rules assigned for this feature.</p>
89    pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.entity_id = input;
91        self
92    }
93    /// <p>An internal ID that represents a unique user of the application. This <code>entityID</code> is checked against any override rules assigned for this feature.</p>
94    pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.entity_id
96    }
97    /// <p>A JSON object of attributes that you can optionally pass in as part of the evaluation event sent to Evidently from the user session. Evidently can use this value to match user sessions with defined audience segments. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html">Use segments to focus your audience</a>.</p>
98    /// <p>If you include this parameter, the value must be a JSON object. A JSON array is not supported.</p>
99    pub fn evaluation_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.evaluation_context = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>A JSON object of attributes that you can optionally pass in as part of the evaluation event sent to Evidently from the user session. Evidently can use this value to match user sessions with defined audience segments. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html">Use segments to focus your audience</a>.</p>
104    /// <p>If you include this parameter, the value must be a JSON object. A JSON array is not supported.</p>
105    pub fn set_evaluation_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.evaluation_context = input;
107        self
108    }
109    /// <p>A JSON object of attributes that you can optionally pass in as part of the evaluation event sent to Evidently from the user session. Evidently can use this value to match user sessions with defined audience segments. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments.html">Use segments to focus your audience</a>.</p>
110    /// <p>If you include this parameter, the value must be a JSON object. A JSON array is not supported.</p>
111    pub fn get_evaluation_context(&self) -> &::std::option::Option<::std::string::String> {
112        &self.evaluation_context
113    }
114    /// Consumes the builder and constructs a [`EvaluateFeatureInput`](crate::operation::evaluate_feature::EvaluateFeatureInput).
115    pub fn build(
116        self,
117    ) -> ::std::result::Result<crate::operation::evaluate_feature::EvaluateFeatureInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::evaluate_feature::EvaluateFeatureInput {
119            project: self.project,
120            feature: self.feature,
121            entity_id: self.entity_id,
122            evaluation_context: self.evaluation_context,
123        })
124    }
125}