aws-sdk-iottwinmaker 1.101.0

AWS SDK for AWS IoT TwinMaker
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetPropertyValueOutput {
    /// <p>An object that maps strings to the properties and latest property values in the response. Each string in the mapping must be unique to this object.</p>
    pub property_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyLatestValue>>,
    /// <p>The string that specifies the next page of results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>A table of property values.</p>
    pub tabular_property_values:
        ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::DataValue>>>>,
    _request_id: Option<String>,
}
impl GetPropertyValueOutput {
    /// <p>An object that maps strings to the properties and latest property values in the response. Each string in the mapping must be unique to this object.</p>
    pub fn property_values(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::PropertyLatestValue>> {
        self.property_values.as_ref()
    }
    /// <p>The string that specifies the next page of results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>A table of property values.</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 `.tabular_property_values.is_none()`.
    pub fn tabular_property_values(&self) -> &[::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::DataValue>>] {
        self.tabular_property_values.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for GetPropertyValueOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetPropertyValueOutput {
    /// Creates a new builder-style object to manufacture [`GetPropertyValueOutput`](crate::operation::get_property_value::GetPropertyValueOutput).
    pub fn builder() -> crate::operation::get_property_value::builders::GetPropertyValueOutputBuilder {
        crate::operation::get_property_value::builders::GetPropertyValueOutputBuilder::default()
    }
}

/// A builder for [`GetPropertyValueOutput`](crate::operation::get_property_value::GetPropertyValueOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetPropertyValueOutputBuilder {
    pub(crate) property_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyLatestValue>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) tabular_property_values:
        ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::DataValue>>>>,
    _request_id: Option<String>,
}
impl GetPropertyValueOutputBuilder {
    /// Adds a key-value pair to `property_values`.
    ///
    /// To override the contents of this collection use [`set_property_values`](Self::set_property_values).
    ///
    /// <p>An object that maps strings to the properties and latest property values in the response. Each string in the mapping must be unique to this object.</p>
    pub fn property_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PropertyLatestValue) -> Self {
        let mut hash_map = self.property_values.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.property_values = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>An object that maps strings to the properties and latest property values in the response. Each string in the mapping must be unique to this object.</p>
    pub fn set_property_values(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyLatestValue>>,
    ) -> Self {
        self.property_values = input;
        self
    }
    /// <p>An object that maps strings to the properties and latest property values in the response. Each string in the mapping must be unique to this object.</p>
    pub fn get_property_values(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyLatestValue>> {
        &self.property_values
    }
    /// <p>The string that specifies the next page of results.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The string that specifies the next page of results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The string that specifies the next page of results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Appends an item to `tabular_property_values`.
    ///
    /// To override the contents of this collection use [`set_tabular_property_values`](Self::set_tabular_property_values).
    ///
    /// <p>A table of property values.</p>
    pub fn tabular_property_values(
        mut self,
        input: ::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::DataValue>>,
    ) -> Self {
        let mut v = self.tabular_property_values.unwrap_or_default();
        v.push(input);
        self.tabular_property_values = ::std::option::Option::Some(v);
        self
    }
    /// <p>A table of property values.</p>
    pub fn set_tabular_property_values(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::DataValue>>>>,
    ) -> Self {
        self.tabular_property_values = input;
        self
    }
    /// <p>A table of property values.</p>
    pub fn get_tabular_property_values(
        &self,
    ) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::DataValue>>>> {
        &self.tabular_property_values
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetPropertyValueOutput`](crate::operation::get_property_value::GetPropertyValueOutput).
    pub fn build(self) -> crate::operation::get_property_value::GetPropertyValueOutput {
        crate::operation::get_property_value::GetPropertyValueOutput {
            property_values: self.property_values,
            next_token: self.next_token,
            tabular_property_values: self.tabular_property_values,
            _request_id: self._request_id,
        }
    }
}