Skip to main content

aws_sdk_cloudwatchevents/types/
_api_destination.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains details about an API destination.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ApiDestination {
7    /// <p>The ARN of the API destination.</p>
8    pub api_destination_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the API destination.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The state of the API destination.</p>
12    pub api_destination_state: ::std::option::Option<crate::types::ApiDestinationState>,
13    /// <p>The ARN of the connection specified for the API destination.</p>
14    pub connection_arn: ::std::option::Option<::std::string::String>,
15    /// <p>The URL to the endpoint for the API destination.</p>
16    pub invocation_endpoint: ::std::option::Option<::std::string::String>,
17    /// <p>The method to use to connect to the HTTP endpoint.</p>
18    pub http_method: ::std::option::Option<crate::types::ApiDestinationHttpMethod>,
19    /// <p>The maximum number of invocations per second to send to the HTTP endpoint.</p>
20    pub invocation_rate_limit_per_second: ::std::option::Option<i32>,
21    /// <p>A time stamp for the time that the API destination was created.</p>
22    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
23    /// <p>A time stamp for the time that the API destination was last modified.</p>
24    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
25}
26impl ApiDestination {
27    /// <p>The ARN of the API destination.</p>
28    pub fn api_destination_arn(&self) -> ::std::option::Option<&str> {
29        self.api_destination_arn.as_deref()
30    }
31    /// <p>The name of the API destination.</p>
32    pub fn name(&self) -> ::std::option::Option<&str> {
33        self.name.as_deref()
34    }
35    /// <p>The state of the API destination.</p>
36    pub fn api_destination_state(&self) -> ::std::option::Option<&crate::types::ApiDestinationState> {
37        self.api_destination_state.as_ref()
38    }
39    /// <p>The ARN of the connection specified for the API destination.</p>
40    pub fn connection_arn(&self) -> ::std::option::Option<&str> {
41        self.connection_arn.as_deref()
42    }
43    /// <p>The URL to the endpoint for the API destination.</p>
44    pub fn invocation_endpoint(&self) -> ::std::option::Option<&str> {
45        self.invocation_endpoint.as_deref()
46    }
47    /// <p>The method to use to connect to the HTTP endpoint.</p>
48    pub fn http_method(&self) -> ::std::option::Option<&crate::types::ApiDestinationHttpMethod> {
49        self.http_method.as_ref()
50    }
51    /// <p>The maximum number of invocations per second to send to the HTTP endpoint.</p>
52    pub fn invocation_rate_limit_per_second(&self) -> ::std::option::Option<i32> {
53        self.invocation_rate_limit_per_second
54    }
55    /// <p>A time stamp for the time that the API destination was created.</p>
56    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
57        self.creation_time.as_ref()
58    }
59    /// <p>A time stamp for the time that the API destination was last modified.</p>
60    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
61        self.last_modified_time.as_ref()
62    }
63}
64impl ApiDestination {
65    /// Creates a new builder-style object to manufacture [`ApiDestination`](crate::types::ApiDestination).
66    pub fn builder() -> crate::types::builders::ApiDestinationBuilder {
67        crate::types::builders::ApiDestinationBuilder::default()
68    }
69}
70
71/// A builder for [`ApiDestination`](crate::types::ApiDestination).
72#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
73#[non_exhaustive]
74pub struct ApiDestinationBuilder {
75    pub(crate) api_destination_arn: ::std::option::Option<::std::string::String>,
76    pub(crate) name: ::std::option::Option<::std::string::String>,
77    pub(crate) api_destination_state: ::std::option::Option<crate::types::ApiDestinationState>,
78    pub(crate) connection_arn: ::std::option::Option<::std::string::String>,
79    pub(crate) invocation_endpoint: ::std::option::Option<::std::string::String>,
80    pub(crate) http_method: ::std::option::Option<crate::types::ApiDestinationHttpMethod>,
81    pub(crate) invocation_rate_limit_per_second: ::std::option::Option<i32>,
82    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
83    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
84}
85impl ApiDestinationBuilder {
86    /// <p>The ARN of the API destination.</p>
87    pub fn api_destination_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.api_destination_arn = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The ARN of the API destination.</p>
92    pub fn set_api_destination_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.api_destination_arn = input;
94        self
95    }
96    /// <p>The ARN of the API destination.</p>
97    pub fn get_api_destination_arn(&self) -> &::std::option::Option<::std::string::String> {
98        &self.api_destination_arn
99    }
100    /// <p>The name of the API destination.</p>
101    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.name = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The name of the API destination.</p>
106    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.name = input;
108        self
109    }
110    /// <p>The name of the API destination.</p>
111    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
112        &self.name
113    }
114    /// <p>The state of the API destination.</p>
115    pub fn api_destination_state(mut self, input: crate::types::ApiDestinationState) -> Self {
116        self.api_destination_state = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>The state of the API destination.</p>
120    pub fn set_api_destination_state(mut self, input: ::std::option::Option<crate::types::ApiDestinationState>) -> Self {
121        self.api_destination_state = input;
122        self
123    }
124    /// <p>The state of the API destination.</p>
125    pub fn get_api_destination_state(&self) -> &::std::option::Option<crate::types::ApiDestinationState> {
126        &self.api_destination_state
127    }
128    /// <p>The ARN of the connection specified for the API destination.</p>
129    pub fn connection_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.connection_arn = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>The ARN of the connection specified for the API destination.</p>
134    pub fn set_connection_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.connection_arn = input;
136        self
137    }
138    /// <p>The ARN of the connection specified for the API destination.</p>
139    pub fn get_connection_arn(&self) -> &::std::option::Option<::std::string::String> {
140        &self.connection_arn
141    }
142    /// <p>The URL to the endpoint for the API destination.</p>
143    pub fn invocation_endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.invocation_endpoint = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>The URL to the endpoint for the API destination.</p>
148    pub fn set_invocation_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.invocation_endpoint = input;
150        self
151    }
152    /// <p>The URL to the endpoint for the API destination.</p>
153    pub fn get_invocation_endpoint(&self) -> &::std::option::Option<::std::string::String> {
154        &self.invocation_endpoint
155    }
156    /// <p>The method to use to connect to the HTTP endpoint.</p>
157    pub fn http_method(mut self, input: crate::types::ApiDestinationHttpMethod) -> Self {
158        self.http_method = ::std::option::Option::Some(input);
159        self
160    }
161    /// <p>The method to use to connect to the HTTP endpoint.</p>
162    pub fn set_http_method(mut self, input: ::std::option::Option<crate::types::ApiDestinationHttpMethod>) -> Self {
163        self.http_method = input;
164        self
165    }
166    /// <p>The method to use to connect to the HTTP endpoint.</p>
167    pub fn get_http_method(&self) -> &::std::option::Option<crate::types::ApiDestinationHttpMethod> {
168        &self.http_method
169    }
170    /// <p>The maximum number of invocations per second to send to the HTTP endpoint.</p>
171    pub fn invocation_rate_limit_per_second(mut self, input: i32) -> Self {
172        self.invocation_rate_limit_per_second = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>The maximum number of invocations per second to send to the HTTP endpoint.</p>
176    pub fn set_invocation_rate_limit_per_second(mut self, input: ::std::option::Option<i32>) -> Self {
177        self.invocation_rate_limit_per_second = input;
178        self
179    }
180    /// <p>The maximum number of invocations per second to send to the HTTP endpoint.</p>
181    pub fn get_invocation_rate_limit_per_second(&self) -> &::std::option::Option<i32> {
182        &self.invocation_rate_limit_per_second
183    }
184    /// <p>A time stamp for the time that the API destination was created.</p>
185    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
186        self.creation_time = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>A time stamp for the time that the API destination was created.</p>
190    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
191        self.creation_time = input;
192        self
193    }
194    /// <p>A time stamp for the time that the API destination was created.</p>
195    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
196        &self.creation_time
197    }
198    /// <p>A time stamp for the time that the API destination was last modified.</p>
199    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
200        self.last_modified_time = ::std::option::Option::Some(input);
201        self
202    }
203    /// <p>A time stamp for the time that the API destination was last modified.</p>
204    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
205        self.last_modified_time = input;
206        self
207    }
208    /// <p>A time stamp for the time that the API destination was last modified.</p>
209    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
210        &self.last_modified_time
211    }
212    /// Consumes the builder and constructs a [`ApiDestination`](crate::types::ApiDestination).
213    pub fn build(self) -> crate::types::ApiDestination {
214        crate::types::ApiDestination {
215            api_destination_arn: self.api_destination_arn,
216            name: self.name,
217            api_destination_state: self.api_destination_state,
218            connection_arn: self.connection_arn,
219            invocation_endpoint: self.invocation_endpoint,
220            http_method: self.http_method,
221            invocation_rate_limit_per_second: self.invocation_rate_limit_per_second,
222            creation_time: self.creation_time,
223            last_modified_time: self.last_modified_time,
224        }
225    }
226}