aws_sdk_iotwireless/operation/update_position/
_update_position_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#[deprecated(note = "This operation is no longer supported.")]
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdatePositionInput {
7    /// <p>Resource identifier of the resource for which position is updated.</p>
8    pub resource_identifier: ::std::option::Option<::std::string::String>,
9    /// <p>Resource type of the resource for which position is updated.</p>
10    pub resource_type: ::std::option::Option<crate::types::PositionResourceType>,
11    /// <p>The position information of the resource.</p>
12    pub position: ::std::option::Option<::std::vec::Vec<f32>>,
13}
14impl UpdatePositionInput {
15    /// <p>Resource identifier of the resource for which position is updated.</p>
16    pub fn resource_identifier(&self) -> ::std::option::Option<&str> {
17        self.resource_identifier.as_deref()
18    }
19    /// <p>Resource type of the resource for which position is updated.</p>
20    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::PositionResourceType> {
21        self.resource_type.as_ref()
22    }
23    /// <p>The position information of the resource.</p>
24    ///
25    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.position.is_none()`.
26    pub fn position(&self) -> &[f32] {
27        self.position.as_deref().unwrap_or_default()
28    }
29}
30impl UpdatePositionInput {
31    /// Creates a new builder-style object to manufacture [`UpdatePositionInput`](crate::operation::update_position::UpdatePositionInput).
32    pub fn builder() -> crate::operation::update_position::builders::UpdatePositionInputBuilder {
33        crate::operation::update_position::builders::UpdatePositionInputBuilder::default()
34    }
35}
36
37/// A builder for [`UpdatePositionInput`](crate::operation::update_position::UpdatePositionInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct UpdatePositionInputBuilder {
41    pub(crate) resource_identifier: ::std::option::Option<::std::string::String>,
42    pub(crate) resource_type: ::std::option::Option<crate::types::PositionResourceType>,
43    pub(crate) position: ::std::option::Option<::std::vec::Vec<f32>>,
44}
45impl UpdatePositionInputBuilder {
46    /// <p>Resource identifier of the resource for which position is updated.</p>
47    /// This field is required.
48    pub fn resource_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.resource_identifier = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>Resource identifier of the resource for which position is updated.</p>
53    pub fn set_resource_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.resource_identifier = input;
55        self
56    }
57    /// <p>Resource identifier of the resource for which position is updated.</p>
58    pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::string::String> {
59        &self.resource_identifier
60    }
61    /// <p>Resource type of the resource for which position is updated.</p>
62    /// This field is required.
63    pub fn resource_type(mut self, input: crate::types::PositionResourceType) -> Self {
64        self.resource_type = ::std::option::Option::Some(input);
65        self
66    }
67    /// <p>Resource type of the resource for which position is updated.</p>
68    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::PositionResourceType>) -> Self {
69        self.resource_type = input;
70        self
71    }
72    /// <p>Resource type of the resource for which position is updated.</p>
73    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::PositionResourceType> {
74        &self.resource_type
75    }
76    /// Appends an item to `position`.
77    ///
78    /// To override the contents of this collection use [`set_position`](Self::set_position).
79    ///
80    /// <p>The position information of the resource.</p>
81    pub fn position(mut self, input: f32) -> Self {
82        let mut v = self.position.unwrap_or_default();
83        v.push(input);
84        self.position = ::std::option::Option::Some(v);
85        self
86    }
87    /// <p>The position information of the resource.</p>
88    pub fn set_position(mut self, input: ::std::option::Option<::std::vec::Vec<f32>>) -> Self {
89        self.position = input;
90        self
91    }
92    /// <p>The position information of the resource.</p>
93    pub fn get_position(&self) -> &::std::option::Option<::std::vec::Vec<f32>> {
94        &self.position
95    }
96    /// Consumes the builder and constructs a [`UpdatePositionInput`](crate::operation::update_position::UpdatePositionInput).
97    pub fn build(
98        self,
99    ) -> ::std::result::Result<crate::operation::update_position::UpdatePositionInput, ::aws_smithy_types::error::operation::BuildError> {
100        ::std::result::Result::Ok(crate::operation::update_position::UpdatePositionInput {
101            resource_identifier: self.resource_identifier,
102            resource_type: self.resource_type,
103            position: self.position,
104        })
105    }
106}