aws_sdk_apigateway/operation/update_model/
_update_model_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateModelInput {
7 pub rest_api_id: ::std::option::Option<::std::string::String>,
9 pub model_name: ::std::option::Option<::std::string::String>,
11 pub patch_operations: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>,
13}
14impl UpdateModelInput {
15 pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
17 self.rest_api_id.as_deref()
18 }
19 pub fn model_name(&self) -> ::std::option::Option<&str> {
21 self.model_name.as_deref()
22 }
23 pub fn patch_operations(&self) -> &[crate::types::PatchOperation] {
27 self.patch_operations.as_deref().unwrap_or_default()
28 }
29}
30impl UpdateModelInput {
31 pub fn builder() -> crate::operation::update_model::builders::UpdateModelInputBuilder {
33 crate::operation::update_model::builders::UpdateModelInputBuilder::default()
34 }
35}
36
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct UpdateModelInputBuilder {
41 pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
42 pub(crate) model_name: ::std::option::Option<::std::string::String>,
43 pub(crate) patch_operations: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>,
44}
45impl UpdateModelInputBuilder {
46 pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.rest_api_id = ::std::option::Option::Some(input.into());
50 self
51 }
52 pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.rest_api_id = input;
55 self
56 }
57 pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
59 &self.rest_api_id
60 }
61 pub fn model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64 self.model_name = ::std::option::Option::Some(input.into());
65 self
66 }
67 pub fn set_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.model_name = input;
70 self
71 }
72 pub fn get_model_name(&self) -> &::std::option::Option<::std::string::String> {
74 &self.model_name
75 }
76 pub fn patch_operations(mut self, input: crate::types::PatchOperation) -> Self {
82 let mut v = self.patch_operations.unwrap_or_default();
83 v.push(input);
84 self.patch_operations = ::std::option::Option::Some(v);
85 self
86 }
87 pub fn set_patch_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>) -> Self {
89 self.patch_operations = input;
90 self
91 }
92 pub fn get_patch_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>> {
94 &self.patch_operations
95 }
96 pub fn build(self) -> ::std::result::Result<crate::operation::update_model::UpdateModelInput, ::aws_smithy_types::error::operation::BuildError> {
98 ::std::result::Result::Ok(crate::operation::update_model::UpdateModelInput {
99 rest_api_id: self.rest_api_id,
100 model_name: self.model_name,
101 patch_operations: self.patch_operations,
102 })
103 }
104}