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