aws_sdk_forecast/types/
_predictor_execution.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The algorithm used to perform a backtest and the status of those tests.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PredictorExecution {
7    /// <p>The ARN of the algorithm used to test the predictor.</p>
8    pub algorithm_arn: ::std::option::Option<::std::string::String>,
9    /// <p>An array of test windows used to evaluate the algorithm. The <code>NumberOfBacktestWindows</code> from the object determines the number of windows in the array.</p>
10    pub test_windows: ::std::option::Option<::std::vec::Vec<crate::types::TestWindowSummary>>,
11}
12impl PredictorExecution {
13    /// <p>The ARN of the algorithm used to test the predictor.</p>
14    pub fn algorithm_arn(&self) -> ::std::option::Option<&str> {
15        self.algorithm_arn.as_deref()
16    }
17    /// <p>An array of test windows used to evaluate the algorithm. The <code>NumberOfBacktestWindows</code> from the object determines the number of windows in the array.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.test_windows.is_none()`.
20    pub fn test_windows(&self) -> &[crate::types::TestWindowSummary] {
21        self.test_windows.as_deref().unwrap_or_default()
22    }
23}
24impl PredictorExecution {
25    /// Creates a new builder-style object to manufacture [`PredictorExecution`](crate::types::PredictorExecution).
26    pub fn builder() -> crate::types::builders::PredictorExecutionBuilder {
27        crate::types::builders::PredictorExecutionBuilder::default()
28    }
29}
30
31/// A builder for [`PredictorExecution`](crate::types::PredictorExecution).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct PredictorExecutionBuilder {
35    pub(crate) algorithm_arn: ::std::option::Option<::std::string::String>,
36    pub(crate) test_windows: ::std::option::Option<::std::vec::Vec<crate::types::TestWindowSummary>>,
37}
38impl PredictorExecutionBuilder {
39    /// <p>The ARN of the algorithm used to test the predictor.</p>
40    pub fn algorithm_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.algorithm_arn = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The ARN of the algorithm used to test the predictor.</p>
45    pub fn set_algorithm_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.algorithm_arn = input;
47        self
48    }
49    /// <p>The ARN of the algorithm used to test the predictor.</p>
50    pub fn get_algorithm_arn(&self) -> &::std::option::Option<::std::string::String> {
51        &self.algorithm_arn
52    }
53    /// Appends an item to `test_windows`.
54    ///
55    /// To override the contents of this collection use [`set_test_windows`](Self::set_test_windows).
56    ///
57    /// <p>An array of test windows used to evaluate the algorithm. The <code>NumberOfBacktestWindows</code> from the object determines the number of windows in the array.</p>
58    pub fn test_windows(mut self, input: crate::types::TestWindowSummary) -> Self {
59        let mut v = self.test_windows.unwrap_or_default();
60        v.push(input);
61        self.test_windows = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>An array of test windows used to evaluate the algorithm. The <code>NumberOfBacktestWindows</code> from the object determines the number of windows in the array.</p>
65    pub fn set_test_windows(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TestWindowSummary>>) -> Self {
66        self.test_windows = input;
67        self
68    }
69    /// <p>An array of test windows used to evaluate the algorithm. The <code>NumberOfBacktestWindows</code> from the object determines the number of windows in the array.</p>
70    pub fn get_test_windows(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TestWindowSummary>> {
71        &self.test_windows
72    }
73    /// Consumes the builder and constructs a [`PredictorExecution`](crate::types::PredictorExecution).
74    pub fn build(self) -> crate::types::PredictorExecution {
75        crate::types::PredictorExecution {
76            algorithm_arn: self.algorithm_arn,
77            test_windows: self.test_windows,
78        }
79    }
80}