aws_sdk_iot/operation/delete_thing/_delete_thing_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The input for the DeleteThing operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteThingInput {
7 /// <p>The name of the thing to delete.</p>
8 pub thing_name: ::std::option::Option<::std::string::String>,
9 /// <p>The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the <code>DeleteThing</code> request is rejected with a <code>VersionConflictException</code>.</p>
10 pub expected_version: ::std::option::Option<i64>,
11}
12impl DeleteThingInput {
13 /// <p>The name of the thing to delete.</p>
14 pub fn thing_name(&self) -> ::std::option::Option<&str> {
15 self.thing_name.as_deref()
16 }
17 /// <p>The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the <code>DeleteThing</code> request is rejected with a <code>VersionConflictException</code>.</p>
18 pub fn expected_version(&self) -> ::std::option::Option<i64> {
19 self.expected_version
20 }
21}
22impl DeleteThingInput {
23 /// Creates a new builder-style object to manufacture [`DeleteThingInput`](crate::operation::delete_thing::DeleteThingInput).
24 pub fn builder() -> crate::operation::delete_thing::builders::DeleteThingInputBuilder {
25 crate::operation::delete_thing::builders::DeleteThingInputBuilder::default()
26 }
27}
28
29/// A builder for [`DeleteThingInput`](crate::operation::delete_thing::DeleteThingInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct DeleteThingInputBuilder {
33 pub(crate) thing_name: ::std::option::Option<::std::string::String>,
34 pub(crate) expected_version: ::std::option::Option<i64>,
35}
36impl DeleteThingInputBuilder {
37 /// <p>The name of the thing to delete.</p>
38 /// This field is required.
39 pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40 self.thing_name = ::std::option::Option::Some(input.into());
41 self
42 }
43 /// <p>The name of the thing to delete.</p>
44 pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45 self.thing_name = input;
46 self
47 }
48 /// <p>The name of the thing to delete.</p>
49 pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
50 &self.thing_name
51 }
52 /// <p>The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the <code>DeleteThing</code> request is rejected with a <code>VersionConflictException</code>.</p>
53 pub fn expected_version(mut self, input: i64) -> Self {
54 self.expected_version = ::std::option::Option::Some(input);
55 self
56 }
57 /// <p>The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the <code>DeleteThing</code> request is rejected with a <code>VersionConflictException</code>.</p>
58 pub fn set_expected_version(mut self, input: ::std::option::Option<i64>) -> Self {
59 self.expected_version = input;
60 self
61 }
62 /// <p>The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the <code>DeleteThing</code> request is rejected with a <code>VersionConflictException</code>.</p>
63 pub fn get_expected_version(&self) -> &::std::option::Option<i64> {
64 &self.expected_version
65 }
66 /// Consumes the builder and constructs a [`DeleteThingInput`](crate::operation::delete_thing::DeleteThingInput).
67 pub fn build(self) -> ::std::result::Result<crate::operation::delete_thing::DeleteThingInput, ::aws_smithy_types::error::operation::BuildError> {
68 ::std::result::Result::Ok(crate::operation::delete_thing::DeleteThingInput {
69 thing_name: self.thing_name,
70 expected_version: self.expected_version,
71 })
72 }
73}