Skip to main content

aws_sdk_iot/types/
_indexing_filter.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides additional selections for named shadows and geolocation data.</p>
4/// <p>To add named shadows to your fleet indexing configuration, set <code>namedShadowIndexingMode</code> to be ON and specify your shadow names in <code>namedShadowNames</code> filter.</p>
5/// <p>To add geolocation data to your fleet indexing configuration:</p>
6/// <ul>
7/// <li>
8/// <p>If you store geolocation data in a class/unnamed shadow, set <code>thingIndexingMode</code> to be <code>REGISTRY_AND_SHADOW</code> and specify your geolocation data in <code>geoLocations</code> filter.</p></li>
9/// <li>
10/// <p>If you store geolocation data in a named shadow, set <code>namedShadowIndexingMode</code> to be <code>ON</code>, add the shadow name in <code>namedShadowNames</code> filter, and specify your geolocation data in <code>geoLocations</code> filter. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/managing-fleet-index.html">Managing fleet indexing</a>.</p></li>
11/// </ul>
12#[non_exhaustive]
13#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
14pub struct IndexingFilter {
15    /// <p>The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
16    pub named_shadow_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
17    /// <p>The list of geolocation targets that you select to index. The default maximum number of geolocation targets for indexing is <code>1</code>. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
18    pub geo_locations: ::std::option::Option<::std::vec::Vec<crate::types::GeoLocationTarget>>,
19}
20impl IndexingFilter {
21    /// <p>The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
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 `.named_shadow_names.is_none()`.
24    pub fn named_shadow_names(&self) -> &[::std::string::String] {
25        self.named_shadow_names.as_deref().unwrap_or_default()
26    }
27    /// <p>The list of geolocation targets that you select to index. The default maximum number of geolocation targets for indexing is <code>1</code>. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.geo_locations.is_none()`.
30    pub fn geo_locations(&self) -> &[crate::types::GeoLocationTarget] {
31        self.geo_locations.as_deref().unwrap_or_default()
32    }
33}
34impl IndexingFilter {
35    /// Creates a new builder-style object to manufacture [`IndexingFilter`](crate::types::IndexingFilter).
36    pub fn builder() -> crate::types::builders::IndexingFilterBuilder {
37        crate::types::builders::IndexingFilterBuilder::default()
38    }
39}
40
41/// A builder for [`IndexingFilter`](crate::types::IndexingFilter).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct IndexingFilterBuilder {
45    pub(crate) named_shadow_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
46    pub(crate) geo_locations: ::std::option::Option<::std::vec::Vec<crate::types::GeoLocationTarget>>,
47}
48impl IndexingFilterBuilder {
49    /// Appends an item to `named_shadow_names`.
50    ///
51    /// To override the contents of this collection use [`set_named_shadow_names`](Self::set_named_shadow_names).
52    ///
53    /// <p>The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
54    pub fn named_shadow_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        let mut v = self.named_shadow_names.unwrap_or_default();
56        v.push(input.into());
57        self.named_shadow_names = ::std::option::Option::Some(v);
58        self
59    }
60    /// <p>The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
61    pub fn set_named_shadow_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
62        self.named_shadow_names = input;
63        self
64    }
65    /// <p>The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
66    pub fn get_named_shadow_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
67        &self.named_shadow_names
68    }
69    /// Appends an item to `geo_locations`.
70    ///
71    /// To override the contents of this collection use [`set_geo_locations`](Self::set_geo_locations).
72    ///
73    /// <p>The list of geolocation targets that you select to index. The default maximum number of geolocation targets for indexing is <code>1</code>. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
74    pub fn geo_locations(mut self, input: crate::types::GeoLocationTarget) -> Self {
75        let mut v = self.geo_locations.unwrap_or_default();
76        v.push(input);
77        self.geo_locations = ::std::option::Option::Some(v);
78        self
79    }
80    /// <p>The list of geolocation targets that you select to index. The default maximum number of geolocation targets for indexing is <code>1</code>. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
81    pub fn set_geo_locations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GeoLocationTarget>>) -> Self {
82        self.geo_locations = input;
83        self
84    }
85    /// <p>The list of geolocation targets that you select to index. The default maximum number of geolocation targets for indexing is <code>1</code>. To increase the limit, see <a href="https://docs.aws.amazon.com/general/latest/gr/iot_device_management.html#fleet-indexing-limits">Amazon Web Services IoT Device Management Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>
86    pub fn get_geo_locations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GeoLocationTarget>> {
87        &self.geo_locations
88    }
89    /// Consumes the builder and constructs a [`IndexingFilter`](crate::types::IndexingFilter).
90    pub fn build(self) -> crate::types::IndexingFilter {
91        crate::types::IndexingFilter {
92            named_shadow_names: self.named_shadow_names,
93            geo_locations: self.geo_locations,
94        }
95    }
96}