aws_sdk_osis/operation/validate_pipeline/
_validate_pipeline_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 ValidatePipelineOutput {
6    /// <p>A boolean indicating whether or not the pipeline configuration is valid.</p>
7    pub is_valid: ::std::option::Option<bool>,
8    /// <p>A list of errors if the configuration is invalid.</p>
9    pub errors: ::std::option::Option<::std::vec::Vec<crate::types::ValidationMessage>>,
10    _request_id: Option<String>,
11}
12impl ValidatePipelineOutput {
13    /// <p>A boolean indicating whether or not the pipeline configuration is valid.</p>
14    pub fn is_valid(&self) -> ::std::option::Option<bool> {
15        self.is_valid
16    }
17    /// <p>A list of errors if the configuration is invalid.</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 `.errors.is_none()`.
20    pub fn errors(&self) -> &[crate::types::ValidationMessage] {
21        self.errors.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for ValidatePipelineOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl ValidatePipelineOutput {
30    /// Creates a new builder-style object to manufacture [`ValidatePipelineOutput`](crate::operation::validate_pipeline::ValidatePipelineOutput).
31    pub fn builder() -> crate::operation::validate_pipeline::builders::ValidatePipelineOutputBuilder {
32        crate::operation::validate_pipeline::builders::ValidatePipelineOutputBuilder::default()
33    }
34}
35
36/// A builder for [`ValidatePipelineOutput`](crate::operation::validate_pipeline::ValidatePipelineOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct ValidatePipelineOutputBuilder {
40    pub(crate) is_valid: ::std::option::Option<bool>,
41    pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::ValidationMessage>>,
42    _request_id: Option<String>,
43}
44impl ValidatePipelineOutputBuilder {
45    /// <p>A boolean indicating whether or not the pipeline configuration is valid.</p>
46    pub fn is_valid(mut self, input: bool) -> Self {
47        self.is_valid = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>A boolean indicating whether or not the pipeline configuration is valid.</p>
51    pub fn set_is_valid(mut self, input: ::std::option::Option<bool>) -> Self {
52        self.is_valid = input;
53        self
54    }
55    /// <p>A boolean indicating whether or not the pipeline configuration is valid.</p>
56    pub fn get_is_valid(&self) -> &::std::option::Option<bool> {
57        &self.is_valid
58    }
59    /// Appends an item to `errors`.
60    ///
61    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
62    ///
63    /// <p>A list of errors if the configuration is invalid.</p>
64    pub fn errors(mut self, input: crate::types::ValidationMessage) -> Self {
65        let mut v = self.errors.unwrap_or_default();
66        v.push(input);
67        self.errors = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>A list of errors if the configuration is invalid.</p>
71    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ValidationMessage>>) -> Self {
72        self.errors = input;
73        self
74    }
75    /// <p>A list of errors if the configuration is invalid.</p>
76    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ValidationMessage>> {
77        &self.errors
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`ValidatePipelineOutput`](crate::operation::validate_pipeline::ValidatePipelineOutput).
89    pub fn build(self) -> crate::operation::validate_pipeline::ValidatePipelineOutput {
90        crate::operation::validate_pipeline::ValidatePipelineOutput {
91            is_valid: self.is_valid,
92            errors: self.errors,
93            _request_id: self._request_id,
94        }
95    }
96}