aws_sdk_apigateway/operation/create_resource/
_create_resource_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents an API resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateResourceOutput {
7    /// <p>The resource's identifier.</p>
8    pub id: ::std::option::Option<::std::string::String>,
9    /// <p>The parent resource's identifier.</p>
10    pub parent_id: ::std::option::Option<::std::string::String>,
11    /// <p>The last path segment for this resource.</p>
12    pub path_part: ::std::option::Option<::std::string::String>,
13    /// <p>The full path for this resource.</p>
14    pub path: ::std::option::Option<::std::string::String>,
15    /// <p>Gets an API resource's method of a given HTTP verb.</p>
16    pub resource_methods: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Method>>,
17    _request_id: Option<String>,
18}
19impl CreateResourceOutput {
20    /// <p>The resource's identifier.</p>
21    pub fn id(&self) -> ::std::option::Option<&str> {
22        self.id.as_deref()
23    }
24    /// <p>The parent resource's identifier.</p>
25    pub fn parent_id(&self) -> ::std::option::Option<&str> {
26        self.parent_id.as_deref()
27    }
28    /// <p>The last path segment for this resource.</p>
29    pub fn path_part(&self) -> ::std::option::Option<&str> {
30        self.path_part.as_deref()
31    }
32    /// <p>The full path for this resource.</p>
33    pub fn path(&self) -> ::std::option::Option<&str> {
34        self.path.as_deref()
35    }
36    /// <p>Gets an API resource's method of a given HTTP verb.</p>
37    pub fn resource_methods(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::Method>> {
38        self.resource_methods.as_ref()
39    }
40}
41impl ::aws_types::request_id::RequestId for CreateResourceOutput {
42    fn request_id(&self) -> Option<&str> {
43        self._request_id.as_deref()
44    }
45}
46impl CreateResourceOutput {
47    /// Creates a new builder-style object to manufacture [`CreateResourceOutput`](crate::operation::create_resource::CreateResourceOutput).
48    pub fn builder() -> crate::operation::create_resource::builders::CreateResourceOutputBuilder {
49        crate::operation::create_resource::builders::CreateResourceOutputBuilder::default()
50    }
51}
52
53/// A builder for [`CreateResourceOutput`](crate::operation::create_resource::CreateResourceOutput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct CreateResourceOutputBuilder {
57    pub(crate) id: ::std::option::Option<::std::string::String>,
58    pub(crate) parent_id: ::std::option::Option<::std::string::String>,
59    pub(crate) path_part: ::std::option::Option<::std::string::String>,
60    pub(crate) path: ::std::option::Option<::std::string::String>,
61    pub(crate) resource_methods: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Method>>,
62    _request_id: Option<String>,
63}
64impl CreateResourceOutputBuilder {
65    /// <p>The resource's identifier.</p>
66    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The resource's identifier.</p>
71    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.id = input;
73        self
74    }
75    /// <p>The resource's identifier.</p>
76    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.id
78    }
79    /// <p>The parent resource's identifier.</p>
80    pub fn parent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.parent_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The parent resource's identifier.</p>
85    pub fn set_parent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.parent_id = input;
87        self
88    }
89    /// <p>The parent resource's identifier.</p>
90    pub fn get_parent_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.parent_id
92    }
93    /// <p>The last path segment for this resource.</p>
94    pub fn path_part(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.path_part = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The last path segment for this resource.</p>
99    pub fn set_path_part(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.path_part = input;
101        self
102    }
103    /// <p>The last path segment for this resource.</p>
104    pub fn get_path_part(&self) -> &::std::option::Option<::std::string::String> {
105        &self.path_part
106    }
107    /// <p>The full path for this resource.</p>
108    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.path = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The full path for this resource.</p>
113    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.path = input;
115        self
116    }
117    /// <p>The full path for this resource.</p>
118    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
119        &self.path
120    }
121    /// Adds a key-value pair to `resource_methods`.
122    ///
123    /// To override the contents of this collection use [`set_resource_methods`](Self::set_resource_methods).
124    ///
125    /// <p>Gets an API resource's method of a given HTTP verb.</p>
126    pub fn resource_methods(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Method) -> Self {
127        let mut hash_map = self.resource_methods.unwrap_or_default();
128        hash_map.insert(k.into(), v);
129        self.resource_methods = ::std::option::Option::Some(hash_map);
130        self
131    }
132    /// <p>Gets an API resource's method of a given HTTP verb.</p>
133    pub fn set_resource_methods(
134        mut self,
135        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Method>>,
136    ) -> Self {
137        self.resource_methods = input;
138        self
139    }
140    /// <p>Gets an API resource's method of a given HTTP verb.</p>
141    pub fn get_resource_methods(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Method>> {
142        &self.resource_methods
143    }
144    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
145        self._request_id = Some(request_id.into());
146        self
147    }
148
149    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
150        self._request_id = request_id;
151        self
152    }
153    /// Consumes the builder and constructs a [`CreateResourceOutput`](crate::operation::create_resource::CreateResourceOutput).
154    pub fn build(self) -> crate::operation::create_resource::CreateResourceOutput {
155        crate::operation::create_resource::CreateResourceOutput {
156            id: self.id,
157            parent_id: self.parent_id,
158            path_part: self.path_part,
159            path: self.path,
160            resource_methods: self.resource_methods,
161            _request_id: self._request_id,
162        }
163    }
164}