Skip to main content

aws_sdk_deadline/operation/create_queue/
_create_queue_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Mixin that adds an optional ARN field to response structures. Apply to SummaryMixins (flows into Get, Summary, and BatchGet) and Create outputs.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateQueueOutput {
7    /// <p>The queue ID.</p>
8    pub queue_id: ::std::string::String,
9    _request_id: Option<String>,
10}
11impl CreateQueueOutput {
12    /// <p>The queue ID.</p>
13    pub fn queue_id(&self) -> &str {
14        use std::ops::Deref;
15        self.queue_id.deref()
16    }
17}
18impl ::aws_types::request_id::RequestId for CreateQueueOutput {
19    fn request_id(&self) -> Option<&str> {
20        self._request_id.as_deref()
21    }
22}
23impl CreateQueueOutput {
24    /// Creates a new builder-style object to manufacture [`CreateQueueOutput`](crate::operation::create_queue::CreateQueueOutput).
25    pub fn builder() -> crate::operation::create_queue::builders::CreateQueueOutputBuilder {
26        crate::operation::create_queue::builders::CreateQueueOutputBuilder::default()
27    }
28}
29
30/// A builder for [`CreateQueueOutput`](crate::operation::create_queue::CreateQueueOutput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreateQueueOutputBuilder {
34    pub(crate) queue_id: ::std::option::Option<::std::string::String>,
35    _request_id: Option<String>,
36}
37impl CreateQueueOutputBuilder {
38    /// <p>The queue ID.</p>
39    /// This field is required.
40    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.queue_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The queue ID.</p>
45    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.queue_id = input;
47        self
48    }
49    /// <p>The queue ID.</p>
50    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.queue_id
52    }
53    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
54        self._request_id = Some(request_id.into());
55        self
56    }
57
58    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
59        self._request_id = request_id;
60        self
61    }
62    /// Consumes the builder and constructs a [`CreateQueueOutput`](crate::operation::create_queue::CreateQueueOutput).
63    /// This method will fail if any of the following fields are not set:
64    /// - [`queue_id`](crate::operation::create_queue::builders::CreateQueueOutputBuilder::queue_id)
65    pub fn build(self) -> ::std::result::Result<crate::operation::create_queue::CreateQueueOutput, ::aws_smithy_types::error::operation::BuildError> {
66        ::std::result::Result::Ok(crate::operation::create_queue::CreateQueueOutput {
67            queue_id: self.queue_id.ok_or_else(|| {
68                ::aws_smithy_types::error::operation::BuildError::missing_field(
69                    "queue_id",
70                    "queue_id was not specified but it is required when building CreateQueueOutput",
71                )
72            })?,
73            _request_id: self._request_id,
74        })
75    }
76}