aws_sdk_apigateway/operation/update_integration/
_update_integration_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents an update integration request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateIntegrationInput {
7    /// <p>The string identifier of the associated RestApi.</p>
8    pub rest_api_id: ::std::option::Option<::std::string::String>,
9    /// <p>Represents an update integration request's resource identifier.</p>
10    pub resource_id: ::std::option::Option<::std::string::String>,
11    /// <p>Represents an update integration request's HTTP method.</p>
12    pub http_method: ::std::option::Option<::std::string::String>,
13    /// <p>For more information about supported patch operations, see <a href="https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html">Patch Operations</a>.</p>
14    pub patch_operations: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>,
15}
16impl UpdateIntegrationInput {
17    /// <p>The string identifier of the associated RestApi.</p>
18    pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
19        self.rest_api_id.as_deref()
20    }
21    /// <p>Represents an update integration request's resource identifier.</p>
22    pub fn resource_id(&self) -> ::std::option::Option<&str> {
23        self.resource_id.as_deref()
24    }
25    /// <p>Represents an update integration request's HTTP method.</p>
26    pub fn http_method(&self) -> ::std::option::Option<&str> {
27        self.http_method.as_deref()
28    }
29    /// <p>For more information about supported patch operations, see <a href="https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html">Patch Operations</a>.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.patch_operations.is_none()`.
32    pub fn patch_operations(&self) -> &[crate::types::PatchOperation] {
33        self.patch_operations.as_deref().unwrap_or_default()
34    }
35}
36impl UpdateIntegrationInput {
37    /// Creates a new builder-style object to manufacture [`UpdateIntegrationInput`](crate::operation::update_integration::UpdateIntegrationInput).
38    pub fn builder() -> crate::operation::update_integration::builders::UpdateIntegrationInputBuilder {
39        crate::operation::update_integration::builders::UpdateIntegrationInputBuilder::default()
40    }
41}
42
43/// A builder for [`UpdateIntegrationInput`](crate::operation::update_integration::UpdateIntegrationInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct UpdateIntegrationInputBuilder {
47    pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
48    pub(crate) resource_id: ::std::option::Option<::std::string::String>,
49    pub(crate) http_method: ::std::option::Option<::std::string::String>,
50    pub(crate) patch_operations: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>,
51}
52impl UpdateIntegrationInputBuilder {
53    /// <p>The string identifier of the associated RestApi.</p>
54    /// This field is required.
55    pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.rest_api_id = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>The string identifier of the associated RestApi.</p>
60    pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.rest_api_id = input;
62        self
63    }
64    /// <p>The string identifier of the associated RestApi.</p>
65    pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
66        &self.rest_api_id
67    }
68    /// <p>Represents an update integration request's resource identifier.</p>
69    /// This field is required.
70    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.resource_id = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>Represents an update integration request's resource identifier.</p>
75    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.resource_id = input;
77        self
78    }
79    /// <p>Represents an update integration request's resource identifier.</p>
80    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
81        &self.resource_id
82    }
83    /// <p>Represents an update integration request's HTTP method.</p>
84    /// This field is required.
85    pub fn http_method(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.http_method = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>Represents an update integration request's HTTP method.</p>
90    pub fn set_http_method(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.http_method = input;
92        self
93    }
94    /// <p>Represents an update integration request's HTTP method.</p>
95    pub fn get_http_method(&self) -> &::std::option::Option<::std::string::String> {
96        &self.http_method
97    }
98    /// Appends an item to `patch_operations`.
99    ///
100    /// To override the contents of this collection use [`set_patch_operations`](Self::set_patch_operations).
101    ///
102    /// <p>For more information about supported patch operations, see <a href="https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html">Patch Operations</a>.</p>
103    pub fn patch_operations(mut self, input: crate::types::PatchOperation) -> Self {
104        let mut v = self.patch_operations.unwrap_or_default();
105        v.push(input);
106        self.patch_operations = ::std::option::Option::Some(v);
107        self
108    }
109    /// <p>For more information about supported patch operations, see <a href="https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html">Patch Operations</a>.</p>
110    pub fn set_patch_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>) -> Self {
111        self.patch_operations = input;
112        self
113    }
114    /// <p>For more information about supported patch operations, see <a href="https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html">Patch Operations</a>.</p>
115    pub fn get_patch_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>> {
116        &self.patch_operations
117    }
118    /// Consumes the builder and constructs a [`UpdateIntegrationInput`](crate::operation::update_integration::UpdateIntegrationInput).
119    pub fn build(
120        self,
121    ) -> ::std::result::Result<crate::operation::update_integration::UpdateIntegrationInput, ::aws_smithy_types::error::operation::BuildError> {
122        ::std::result::Result::Ok(crate::operation::update_integration::UpdateIntegrationInput {
123            rest_api_id: self.rest_api_id,
124            resource_id: self.resource_id,
125            http_method: self.http_method,
126            patch_operations: self.patch_operations,
127        })
128    }
129}