aws_sdk_apigateway/operation/create_resource/
_create_resource_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateResourceOutput {
7 pub id: ::std::option::Option<::std::string::String>,
9 pub parent_id: ::std::option::Option<::std::string::String>,
11 pub path_part: ::std::option::Option<::std::string::String>,
13 pub path: ::std::option::Option<::std::string::String>,
15 pub resource_methods: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Method>>,
17 _request_id: Option<String>,
18}
19impl CreateResourceOutput {
20 pub fn id(&self) -> ::std::option::Option<&str> {
22 self.id.as_deref()
23 }
24 pub fn parent_id(&self) -> ::std::option::Option<&str> {
26 self.parent_id.as_deref()
27 }
28 pub fn path_part(&self) -> ::std::option::Option<&str> {
30 self.path_part.as_deref()
31 }
32 pub fn path(&self) -> ::std::option::Option<&str> {
34 self.path.as_deref()
35 }
36 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 pub fn builder() -> crate::operation::create_resource::builders::CreateResourceOutputBuilder {
49 crate::operation::create_resource::builders::CreateResourceOutputBuilder::default()
50 }
51}
52
53#[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 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 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.id = input;
73 self
74 }
75 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
77 &self.id
78 }
79 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 pub fn set_parent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.parent_id = input;
87 self
88 }
89 pub fn get_parent_id(&self) -> &::std::option::Option<::std::string::String> {
91 &self.parent_id
92 }
93 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 pub fn set_path_part(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.path_part = input;
101 self
102 }
103 pub fn get_path_part(&self) -> &::std::option::Option<::std::string::String> {
105 &self.path_part
106 }
107 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 pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.path = input;
115 self
116 }
117 pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
119 &self.path
120 }
121 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 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 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 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}