Skip to main content

aws_sdk_apigateway/operation/update_vpc_link/
_update_vpc_link_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Updates an existing VpcLink of a specified identifier.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateVpcLinkInput {
7    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
8    pub vpc_link_id: ::std::option::Option<::std::string::String>,
9    /// <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>
10    pub patch_operations: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>,
11}
12impl UpdateVpcLinkInput {
13    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
14    pub fn vpc_link_id(&self) -> ::std::option::Option<&str> {
15        self.vpc_link_id.as_deref()
16    }
17    /// <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>
18    ///
19    /// 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()`.
20    pub fn patch_operations(&self) -> &[crate::types::PatchOperation] {
21        self.patch_operations.as_deref().unwrap_or_default()
22    }
23}
24impl UpdateVpcLinkInput {
25    /// Creates a new builder-style object to manufacture [`UpdateVpcLinkInput`](crate::operation::update_vpc_link::UpdateVpcLinkInput).
26    pub fn builder() -> crate::operation::update_vpc_link::builders::UpdateVpcLinkInputBuilder {
27        crate::operation::update_vpc_link::builders::UpdateVpcLinkInputBuilder::default()
28    }
29}
30
31/// A builder for [`UpdateVpcLinkInput`](crate::operation::update_vpc_link::UpdateVpcLinkInput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct UpdateVpcLinkInputBuilder {
35    pub(crate) vpc_link_id: ::std::option::Option<::std::string::String>,
36    pub(crate) patch_operations: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>,
37}
38impl UpdateVpcLinkInputBuilder {
39    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
40    /// This field is required.
41    pub fn vpc_link_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.vpc_link_id = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
46    pub fn set_vpc_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47        self.vpc_link_id = input;
48        self
49    }
50    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
51    pub fn get_vpc_link_id(&self) -> &::std::option::Option<::std::string::String> {
52        &self.vpc_link_id
53    }
54    /// Appends an item to `patch_operations`.
55    ///
56    /// To override the contents of this collection use [`set_patch_operations`](Self::set_patch_operations).
57    ///
58    /// <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>
59    pub fn patch_operations(mut self, input: crate::types::PatchOperation) -> Self {
60        let mut v = self.patch_operations.unwrap_or_default();
61        v.push(input);
62        self.patch_operations = ::std::option::Option::Some(v);
63        self
64    }
65    /// <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>
66    pub fn set_patch_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>>) -> Self {
67        self.patch_operations = input;
68        self
69    }
70    /// <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>
71    pub fn get_patch_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOperation>> {
72        &self.patch_operations
73    }
74    /// Consumes the builder and constructs a [`UpdateVpcLinkInput`](crate::operation::update_vpc_link::UpdateVpcLinkInput).
75    pub fn build(
76        self,
77    ) -> ::std::result::Result<crate::operation::update_vpc_link::UpdateVpcLinkInput, ::aws_smithy_types::error::operation::BuildError> {
78        ::std::result::Result::Ok(crate::operation::update_vpc_link::UpdateVpcLinkInput {
79            vpc_link_id: self.vpc_link_id,
80            patch_operations: self.patch_operations,
81        })
82    }
83}