aws_sdk_lookoutequipment/operation/list_model_versions/
_list_model_versions_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 ListModelVersionsOutput {
6    /// <p>If the total number of results exceeds the limit that the response can display, the response returns an opaque pagination token indicating where to continue the listing of machine learning model versions. Use this token in the <code>NextToken</code> field in the request to list the next page of results.</p>
7    pub next_token: ::std::option::Option<::std::string::String>,
8    /// <p>Provides information on the specified model version, including the created time, model and dataset ARNs, and status.</p><note>
9    /// <p>If you don't supply the <code>ModelName</code> request parameter, or if you supply the name of a model that doesn't exist, <code>ListModelVersions</code> returns an empty array in <code>ModelVersionSummaries</code>.</p>
10    /// </note>
11    pub model_version_summaries: ::std::option::Option<::std::vec::Vec<crate::types::ModelVersionSummary>>,
12    _request_id: Option<String>,
13}
14impl ListModelVersionsOutput {
15    /// <p>If the total number of results exceeds the limit that the response can display, the response returns an opaque pagination token indicating where to continue the listing of machine learning model versions. Use this token in the <code>NextToken</code> field in the request to list the next page of results.</p>
16    pub fn next_token(&self) -> ::std::option::Option<&str> {
17        self.next_token.as_deref()
18    }
19    /// <p>Provides information on the specified model version, including the created time, model and dataset ARNs, and status.</p><note>
20    /// <p>If you don't supply the <code>ModelName</code> request parameter, or if you supply the name of a model that doesn't exist, <code>ListModelVersions</code> returns an empty array in <code>ModelVersionSummaries</code>.</p>
21    /// </note>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.model_version_summaries.is_none()`.
24    pub fn model_version_summaries(&self) -> &[crate::types::ModelVersionSummary] {
25        self.model_version_summaries.as_deref().unwrap_or_default()
26    }
27}
28impl ::aws_types::request_id::RequestId for ListModelVersionsOutput {
29    fn request_id(&self) -> Option<&str> {
30        self._request_id.as_deref()
31    }
32}
33impl ListModelVersionsOutput {
34    /// Creates a new builder-style object to manufacture [`ListModelVersionsOutput`](crate::operation::list_model_versions::ListModelVersionsOutput).
35    pub fn builder() -> crate::operation::list_model_versions::builders::ListModelVersionsOutputBuilder {
36        crate::operation::list_model_versions::builders::ListModelVersionsOutputBuilder::default()
37    }
38}
39
40/// A builder for [`ListModelVersionsOutput`](crate::operation::list_model_versions::ListModelVersionsOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct ListModelVersionsOutputBuilder {
44    pub(crate) next_token: ::std::option::Option<::std::string::String>,
45    pub(crate) model_version_summaries: ::std::option::Option<::std::vec::Vec<crate::types::ModelVersionSummary>>,
46    _request_id: Option<String>,
47}
48impl ListModelVersionsOutputBuilder {
49    /// <p>If the total number of results exceeds the limit that the response can display, the response returns an opaque pagination token indicating where to continue the listing of machine learning model versions. Use this token in the <code>NextToken</code> field in the request to list the next page of results.</p>
50    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51        self.next_token = ::std::option::Option::Some(input.into());
52        self
53    }
54    /// <p>If the total number of results exceeds the limit that the response can display, the response returns an opaque pagination token indicating where to continue the listing of machine learning model versions. Use this token in the <code>NextToken</code> field in the request to list the next page of results.</p>
55    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
56        self.next_token = input;
57        self
58    }
59    /// <p>If the total number of results exceeds the limit that the response can display, the response returns an opaque pagination token indicating where to continue the listing of machine learning model versions. Use this token in the <code>NextToken</code> field in the request to list the next page of results.</p>
60    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
61        &self.next_token
62    }
63    /// Appends an item to `model_version_summaries`.
64    ///
65    /// To override the contents of this collection use [`set_model_version_summaries`](Self::set_model_version_summaries).
66    ///
67    /// <p>Provides information on the specified model version, including the created time, model and dataset ARNs, and status.</p><note>
68    /// <p>If you don't supply the <code>ModelName</code> request parameter, or if you supply the name of a model that doesn't exist, <code>ListModelVersions</code> returns an empty array in <code>ModelVersionSummaries</code>.</p>
69    /// </note>
70    pub fn model_version_summaries(mut self, input: crate::types::ModelVersionSummary) -> Self {
71        let mut v = self.model_version_summaries.unwrap_or_default();
72        v.push(input);
73        self.model_version_summaries = ::std::option::Option::Some(v);
74        self
75    }
76    /// <p>Provides information on the specified model version, including the created time, model and dataset ARNs, and status.</p><note>
77    /// <p>If you don't supply the <code>ModelName</code> request parameter, or if you supply the name of a model that doesn't exist, <code>ListModelVersions</code> returns an empty array in <code>ModelVersionSummaries</code>.</p>
78    /// </note>
79    pub fn set_model_version_summaries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModelVersionSummary>>) -> Self {
80        self.model_version_summaries = input;
81        self
82    }
83    /// <p>Provides information on the specified model version, including the created time, model and dataset ARNs, and status.</p><note>
84    /// <p>If you don't supply the <code>ModelName</code> request parameter, or if you supply the name of a model that doesn't exist, <code>ListModelVersions</code> returns an empty array in <code>ModelVersionSummaries</code>.</p>
85    /// </note>
86    pub fn get_model_version_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModelVersionSummary>> {
87        &self.model_version_summaries
88    }
89    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
90        self._request_id = Some(request_id.into());
91        self
92    }
93
94    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
95        self._request_id = request_id;
96        self
97    }
98    /// Consumes the builder and constructs a [`ListModelVersionsOutput`](crate::operation::list_model_versions::ListModelVersionsOutput).
99    pub fn build(self) -> crate::operation::list_model_versions::ListModelVersionsOutput {
100        crate::operation::list_model_versions::ListModelVersionsOutput {
101            next_token: self.next_token,
102            model_version_summaries: self.model_version_summaries,
103            _request_id: self._request_id,
104        }
105    }
106}