aws_sdk_iotthingsgraph/operation/get_entities/_get_entities_input.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 GetEntitiesInput {
6 /// <p>An array of entity IDs.</p>
7 /// <p>The IDs should be in the following format.</p>
8 /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
9 pub ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
11 pub namespace_version: ::std::option::Option<i64>,
12}
13impl GetEntitiesInput {
14 /// <p>An array of entity IDs.</p>
15 /// <p>The IDs should be in the following format.</p>
16 /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
17 ///
18 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ids.is_none()`.
19 pub fn ids(&self) -> &[::std::string::String] {
20 self.ids.as_deref().unwrap_or_default()
21 }
22 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
23 pub fn namespace_version(&self) -> ::std::option::Option<i64> {
24 self.namespace_version
25 }
26}
27impl GetEntitiesInput {
28 /// Creates a new builder-style object to manufacture [`GetEntitiesInput`](crate::operation::get_entities::GetEntitiesInput).
29 pub fn builder() -> crate::operation::get_entities::builders::GetEntitiesInputBuilder {
30 crate::operation::get_entities::builders::GetEntitiesInputBuilder::default()
31 }
32}
33
34/// A builder for [`GetEntitiesInput`](crate::operation::get_entities::GetEntitiesInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GetEntitiesInputBuilder {
38 pub(crate) ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
39 pub(crate) namespace_version: ::std::option::Option<i64>,
40}
41impl GetEntitiesInputBuilder {
42 /// Appends an item to `ids`.
43 ///
44 /// To override the contents of this collection use [`set_ids`](Self::set_ids).
45 ///
46 /// <p>An array of entity IDs.</p>
47 /// <p>The IDs should be in the following format.</p>
48 /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
49 pub fn ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50 let mut v = self.ids.unwrap_or_default();
51 v.push(input.into());
52 self.ids = ::std::option::Option::Some(v);
53 self
54 }
55 /// <p>An array of entity IDs.</p>
56 /// <p>The IDs should be in the following format.</p>
57 /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
58 pub fn set_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
59 self.ids = input;
60 self
61 }
62 /// <p>An array of entity IDs.</p>
63 /// <p>The IDs should be in the following format.</p>
64 /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
65 pub fn get_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
66 &self.ids
67 }
68 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
69 pub fn namespace_version(mut self, input: i64) -> Self {
70 self.namespace_version = ::std::option::Option::Some(input);
71 self
72 }
73 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
74 pub fn set_namespace_version(mut self, input: ::std::option::Option<i64>) -> Self {
75 self.namespace_version = input;
76 self
77 }
78 /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
79 pub fn get_namespace_version(&self) -> &::std::option::Option<i64> {
80 &self.namespace_version
81 }
82 /// Consumes the builder and constructs a [`GetEntitiesInput`](crate::operation::get_entities::GetEntitiesInput).
83 pub fn build(self) -> ::std::result::Result<crate::operation::get_entities::GetEntitiesInput, ::aws_smithy_types::error::operation::BuildError> {
84 ::std::result::Result::Ok(crate::operation::get_entities::GetEntitiesInput {
85 ids: self.ids,
86 namespace_version: self.namespace_version,
87 })
88 }
89}