aws-sdk-datapipeline 1.104.0

AWS SDK for AWS Data Pipeline
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Defines the query to run against an object.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Query {
    /// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
    pub selectors: ::std::option::Option<::std::vec::Vec<crate::types::Selector>>,
}
impl Query {
    /// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.selectors.is_none()`.
    pub fn selectors(&self) -> &[crate::types::Selector] {
        self.selectors.as_deref().unwrap_or_default()
    }
}
impl Query {
    /// Creates a new builder-style object to manufacture [`Query`](crate::types::Query).
    pub fn builder() -> crate::types::builders::QueryBuilder {
        crate::types::builders::QueryBuilder::default()
    }
}

/// A builder for [`Query`](crate::types::Query).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct QueryBuilder {
    pub(crate) selectors: ::std::option::Option<::std::vec::Vec<crate::types::Selector>>,
}
impl QueryBuilder {
    /// Appends an item to `selectors`.
    ///
    /// To override the contents of this collection use [`set_selectors`](Self::set_selectors).
    ///
    /// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
    pub fn selectors(mut self, input: crate::types::Selector) -> Self {
        let mut v = self.selectors.unwrap_or_default();
        v.push(input);
        self.selectors = ::std::option::Option::Some(v);
        self
    }
    /// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
    pub fn set_selectors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Selector>>) -> Self {
        self.selectors = input;
        self
    }
    /// <p>List of selectors that define the query. An object must satisfy all of the selectors to match the query.</p>
    pub fn get_selectors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Selector>> {
        &self.selectors
    }
    /// Consumes the builder and constructs a [`Query`](crate::types::Query).
    pub fn build(self) -> crate::types::Query {
        crate::types::Query { selectors: self.selectors }
    }
}