aws_sdk_eventbridge/operation/put_events/
_put_events_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 PutEventsInput {
6    /// <p>The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.</p>
7    pub entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>>,
8    /// <p>The URL subdomain of the endpoint. For example, if the URL for Endpoint is https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is <code>abcde.veo</code>.</p><important>
9    /// <p>When using Java, you must include <code>auth-crt</code> on the class path.</p>
10    /// </important>
11    pub endpoint_id: ::std::option::Option<::std::string::String>,
12}
13impl PutEventsInput {
14    /// <p>The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.</p>
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entries.is_none()`.
17    pub fn entries(&self) -> &[crate::types::PutEventsRequestEntry] {
18        self.entries.as_deref().unwrap_or_default()
19    }
20    /// <p>The URL subdomain of the endpoint. For example, if the URL for Endpoint is https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is <code>abcde.veo</code>.</p><important>
21    /// <p>When using Java, you must include <code>auth-crt</code> on the class path.</p>
22    /// </important>
23    pub fn endpoint_id(&self) -> ::std::option::Option<&str> {
24        self.endpoint_id.as_deref()
25    }
26}
27impl PutEventsInput {
28    /// Creates a new builder-style object to manufacture [`PutEventsInput`](crate::operation::put_events::PutEventsInput).
29    pub fn builder() -> crate::operation::put_events::builders::PutEventsInputBuilder {
30        crate::operation::put_events::builders::PutEventsInputBuilder::default()
31    }
32}
33
34/// A builder for [`PutEventsInput`](crate::operation::put_events::PutEventsInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct PutEventsInputBuilder {
38    pub(crate) entries: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>>,
39    pub(crate) endpoint_id: ::std::option::Option<::std::string::String>,
40}
41impl PutEventsInputBuilder {
42    /// Appends an item to `entries`.
43    ///
44    /// To override the contents of this collection use [`set_entries`](Self::set_entries).
45    ///
46    /// <p>The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.</p>
47    pub fn entries(mut self, input: crate::types::PutEventsRequestEntry) -> Self {
48        let mut v = self.entries.unwrap_or_default();
49        v.push(input);
50        self.entries = ::std::option::Option::Some(v);
51        self
52    }
53    /// <p>The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.</p>
54    pub fn set_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>>) -> Self {
55        self.entries = input;
56        self
57    }
58    /// <p>The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.</p>
59    pub fn get_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PutEventsRequestEntry>> {
60        &self.entries
61    }
62    /// <p>The URL subdomain of the endpoint. For example, if the URL for Endpoint is https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is <code>abcde.veo</code>.</p><important>
63    /// <p>When using Java, you must include <code>auth-crt</code> on the class path.</p>
64    /// </important>
65    pub fn endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.endpoint_id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The URL subdomain of the endpoint. For example, if the URL for Endpoint is https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is <code>abcde.veo</code>.</p><important>
70    /// <p>When using Java, you must include <code>auth-crt</code> on the class path.</p>
71    /// </important>
72    pub fn set_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.endpoint_id = input;
74        self
75    }
76    /// <p>The URL subdomain of the endpoint. For example, if the URL for Endpoint is https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is <code>abcde.veo</code>.</p><important>
77    /// <p>When using Java, you must include <code>auth-crt</code> on the class path.</p>
78    /// </important>
79    pub fn get_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.endpoint_id
81    }
82    /// Consumes the builder and constructs a [`PutEventsInput`](crate::operation::put_events::PutEventsInput).
83    pub fn build(self) -> ::std::result::Result<crate::operation::put_events::PutEventsInput, ::aws_smithy_types::error::operation::BuildError> {
84        ::std::result::Result::Ok(crate::operation::put_events::PutEventsInput {
85            entries: self.entries,
86            endpoint_id: self.endpoint_id,
87        })
88    }
89}