aws_sdk_appsync/operation/update_api/
_update_api_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateApiInput {
6    /// <p>The <code>Api</code> ID.</p>
7    pub api_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the Api.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The owner contact information for the <code>Api</code>.</p>
11    pub owner_contact: ::std::option::Option<::std::string::String>,
12    /// <p>The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.</p>
13    pub event_config: ::std::option::Option<crate::types::EventConfig>,
14}
15impl UpdateApiInput {
16    /// <p>The <code>Api</code> ID.</p>
17    pub fn api_id(&self) -> ::std::option::Option<&str> {
18        self.api_id.as_deref()
19    }
20    /// <p>The name of the Api.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>The owner contact information for the <code>Api</code>.</p>
25    pub fn owner_contact(&self) -> ::std::option::Option<&str> {
26        self.owner_contact.as_deref()
27    }
28    /// <p>The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.</p>
29    pub fn event_config(&self) -> ::std::option::Option<&crate::types::EventConfig> {
30        self.event_config.as_ref()
31    }
32}
33impl UpdateApiInput {
34    /// Creates a new builder-style object to manufacture [`UpdateApiInput`](crate::operation::update_api::UpdateApiInput).
35    pub fn builder() -> crate::operation::update_api::builders::UpdateApiInputBuilder {
36        crate::operation::update_api::builders::UpdateApiInputBuilder::default()
37    }
38}
39
40/// A builder for [`UpdateApiInput`](crate::operation::update_api::UpdateApiInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct UpdateApiInputBuilder {
44    pub(crate) api_id: ::std::option::Option<::std::string::String>,
45    pub(crate) name: ::std::option::Option<::std::string::String>,
46    pub(crate) owner_contact: ::std::option::Option<::std::string::String>,
47    pub(crate) event_config: ::std::option::Option<crate::types::EventConfig>,
48}
49impl UpdateApiInputBuilder {
50    /// <p>The <code>Api</code> ID.</p>
51    /// This field is required.
52    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.api_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The <code>Api</code> ID.</p>
57    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.api_id = input;
59        self
60    }
61    /// <p>The <code>Api</code> ID.</p>
62    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.api_id
64    }
65    /// <p>The name of the Api.</p>
66    /// This field is required.
67    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.name = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The name of the Api.</p>
72    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.name = input;
74        self
75    }
76    /// <p>The name of the Api.</p>
77    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.name
79    }
80    /// <p>The owner contact information for the <code>Api</code>.</p>
81    pub fn owner_contact(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.owner_contact = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The owner contact information for the <code>Api</code>.</p>
86    pub fn set_owner_contact(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.owner_contact = input;
88        self
89    }
90    /// <p>The owner contact information for the <code>Api</code>.</p>
91    pub fn get_owner_contact(&self) -> &::std::option::Option<::std::string::String> {
92        &self.owner_contact
93    }
94    /// <p>The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.</p>
95    pub fn event_config(mut self, input: crate::types::EventConfig) -> Self {
96        self.event_config = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.</p>
100    pub fn set_event_config(mut self, input: ::std::option::Option<crate::types::EventConfig>) -> Self {
101        self.event_config = input;
102        self
103    }
104    /// <p>The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.</p>
105    pub fn get_event_config(&self) -> &::std::option::Option<crate::types::EventConfig> {
106        &self.event_config
107    }
108    /// Consumes the builder and constructs a [`UpdateApiInput`](crate::operation::update_api::UpdateApiInput).
109    pub fn build(self) -> ::std::result::Result<crate::operation::update_api::UpdateApiInput, ::aws_smithy_types::error::operation::BuildError> {
110        ::std::result::Result::Ok(crate::operation::update_api::UpdateApiInput {
111            api_id: self.api_id,
112            name: self.name,
113            owner_contact: self.owner_contact,
114            event_config: self.event_config,
115        })
116    }
117}