aws_sdk_eventbridge/operation/create_partner_event_source/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_partner_event_source::_create_partner_event_source_output::CreatePartnerEventSourceOutputBuilder;
3
4pub use crate::operation::create_partner_event_source::_create_partner_event_source_input::CreatePartnerEventSourceInputBuilder;
5
6impl crate::operation::create_partner_event_source::builders::CreatePartnerEventSourceInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_partner_event_source::CreatePartnerEventSourceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_partner_event_source::CreatePartnerEventSourceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_partner_event_source();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreatePartnerEventSource`.
24///
25/// <p>Called by an SaaS partner to create a partner event source. This operation is not used by Amazon Web Services customers.</p>
26/// <p>Each partner event source can be used by one Amazon Web Services account to create a matching partner event bus in that Amazon Web Services account. A SaaS partner must create one partner event source for each Amazon Web Services account that wants to receive those event types.</p>
27/// <p>A partner event source creates events based on resources within the SaaS partner's service or application.</p>
28/// <p>An Amazon Web Services account that creates a partner event bus that matches the partner event source can use that event bus to receive events from the partner, and then process them using Amazon Web Services Events rules and targets.</p>
29/// <p>Partner event source names follow this format:</p>
30/// <p><code> <i>partner_name</i>/<i>event_namespace</i>/<i>event_name</i> </code></p>
31/// <ul>
32/// <li>
33/// <p><i>partner_name</i> is determined during partner registration, and identifies the partner to Amazon Web Services customers.</p></li>
34/// <li>
35/// <p><i>event_namespace</i> is determined by the partner, and is a way for the partner to categorize their events.</p></li>
36/// <li>
37/// <p><i>event_name</i> is determined by the partner, and should uniquely identify an event-generating resource within the partner system.</p>
38/// <p>The <i>event_name</i> must be unique across all Amazon Web Services customers. This is because the event source is a shared resource between the partner and customer accounts, and each partner event source unique in the partner account.</p></li>
39/// </ul>
40/// <p>The combination of <i>event_namespace</i> and <i>event_name</i> should help Amazon Web Services customers decide whether to create an event bus to receive these events.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct CreatePartnerEventSourceFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::create_partner_event_source::builders::CreatePartnerEventSourceInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::create_partner_event_source::CreatePartnerEventSourceOutput,
50        crate::operation::create_partner_event_source::CreatePartnerEventSourceError,
51    > for CreatePartnerEventSourceFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::create_partner_event_source::CreatePartnerEventSourceOutput,
59            crate::operation::create_partner_event_source::CreatePartnerEventSourceError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl CreatePartnerEventSourceFluentBuilder {
66    /// Creates a new `CreatePartnerEventSourceFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the CreatePartnerEventSource as a reference.
75    pub fn as_input(&self) -> &crate::operation::create_partner_event_source::builders::CreatePartnerEventSourceInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::create_partner_event_source::CreatePartnerEventSourceOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::create_partner_event_source::CreatePartnerEventSourceError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::create_partner_event_source::CreatePartnerEventSource::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::create_partner_event_source::CreatePartnerEventSource::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::create_partner_event_source::CreatePartnerEventSourceOutput,
112        crate::operation::create_partner_event_source::CreatePartnerEventSourceError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The name of the partner event source. This name must be unique and must be in the format <code> <i>partner_name</i>/<i>event_namespace</i>/<i>event_name</i> </code>. The Amazon Web Services account that wants to use this partner event source must create a partner event bus with a name that matches the name of the partner event source.</p>
127    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.name(input.into());
129        self
130    }
131    /// <p>The name of the partner event source. This name must be unique and must be in the format <code> <i>partner_name</i>/<i>event_namespace</i>/<i>event_name</i> </code>. The Amazon Web Services account that wants to use this partner event source must create a partner event bus with a name that matches the name of the partner event source.</p>
132    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_name(input);
134        self
135    }
136    /// <p>The name of the partner event source. This name must be unique and must be in the format <code> <i>partner_name</i>/<i>event_namespace</i>/<i>event_name</i> </code>. The Amazon Web Services account that wants to use this partner event source must create a partner event bus with a name that matches the name of the partner event source.</p>
137    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_name()
139    }
140    /// <p>The Amazon Web Services account ID that is permitted to create a matching partner event bus for this partner event source.</p>
141    pub fn account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.account(input.into());
143        self
144    }
145    /// <p>The Amazon Web Services account ID that is permitted to create a matching partner event bus for this partner event source.</p>
146    pub fn set_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_account(input);
148        self
149    }
150    /// <p>The Amazon Web Services account ID that is permitted to create a matching partner event bus for this partner event source.</p>
151    pub fn get_account(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_account()
153    }
154}