aws_sdk_firehose/types/
_http_endpoint_request_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The configuration of the HTTP endpoint request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct HttpEndpointRequestConfiguration {
7    /// <p>Firehose uses the content encoding to compress the body of a request before sending the request to the destination. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding">Content-Encoding</a> in MDN Web Docs, the official Mozilla documentation.</p>
8    pub content_encoding: ::std::option::Option<crate::types::ContentEncoding>,
9    /// <p>Describes the metadata sent to the HTTP endpoint destination.</p>
10    pub common_attributes: ::std::option::Option<::std::vec::Vec<crate::types::HttpEndpointCommonAttribute>>,
11}
12impl HttpEndpointRequestConfiguration {
13    /// <p>Firehose uses the content encoding to compress the body of a request before sending the request to the destination. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding">Content-Encoding</a> in MDN Web Docs, the official Mozilla documentation.</p>
14    pub fn content_encoding(&self) -> ::std::option::Option<&crate::types::ContentEncoding> {
15        self.content_encoding.as_ref()
16    }
17    /// <p>Describes the metadata sent to the HTTP endpoint destination.</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 `.common_attributes.is_none()`.
20    pub fn common_attributes(&self) -> &[crate::types::HttpEndpointCommonAttribute] {
21        self.common_attributes.as_deref().unwrap_or_default()
22    }
23}
24impl HttpEndpointRequestConfiguration {
25    /// Creates a new builder-style object to manufacture [`HttpEndpointRequestConfiguration`](crate::types::HttpEndpointRequestConfiguration).
26    pub fn builder() -> crate::types::builders::HttpEndpointRequestConfigurationBuilder {
27        crate::types::builders::HttpEndpointRequestConfigurationBuilder::default()
28    }
29}
30
31/// A builder for [`HttpEndpointRequestConfiguration`](crate::types::HttpEndpointRequestConfiguration).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct HttpEndpointRequestConfigurationBuilder {
35    pub(crate) content_encoding: ::std::option::Option<crate::types::ContentEncoding>,
36    pub(crate) common_attributes: ::std::option::Option<::std::vec::Vec<crate::types::HttpEndpointCommonAttribute>>,
37}
38impl HttpEndpointRequestConfigurationBuilder {
39    /// <p>Firehose uses the content encoding to compress the body of a request before sending the request to the destination. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding">Content-Encoding</a> in MDN Web Docs, the official Mozilla documentation.</p>
40    pub fn content_encoding(mut self, input: crate::types::ContentEncoding) -> Self {
41        self.content_encoding = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>Firehose uses the content encoding to compress the body of a request before sending the request to the destination. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding">Content-Encoding</a> in MDN Web Docs, the official Mozilla documentation.</p>
45    pub fn set_content_encoding(mut self, input: ::std::option::Option<crate::types::ContentEncoding>) -> Self {
46        self.content_encoding = input;
47        self
48    }
49    /// <p>Firehose uses the content encoding to compress the body of a request before sending the request to the destination. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding">Content-Encoding</a> in MDN Web Docs, the official Mozilla documentation.</p>
50    pub fn get_content_encoding(&self) -> &::std::option::Option<crate::types::ContentEncoding> {
51        &self.content_encoding
52    }
53    /// Appends an item to `common_attributes`.
54    ///
55    /// To override the contents of this collection use [`set_common_attributes`](Self::set_common_attributes).
56    ///
57    /// <p>Describes the metadata sent to the HTTP endpoint destination.</p>
58    pub fn common_attributes(mut self, input: crate::types::HttpEndpointCommonAttribute) -> Self {
59        let mut v = self.common_attributes.unwrap_or_default();
60        v.push(input);
61        self.common_attributes = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>Describes the metadata sent to the HTTP endpoint destination.</p>
65    pub fn set_common_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::HttpEndpointCommonAttribute>>) -> Self {
66        self.common_attributes = input;
67        self
68    }
69    /// <p>Describes the metadata sent to the HTTP endpoint destination.</p>
70    pub fn get_common_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::HttpEndpointCommonAttribute>> {
71        &self.common_attributes
72    }
73    /// Consumes the builder and constructs a [`HttpEndpointRequestConfiguration`](crate::types::HttpEndpointRequestConfiguration).
74    pub fn build(self) -> crate::types::HttpEndpointRequestConfiguration {
75        crate::types::HttpEndpointRequestConfiguration {
76            content_encoding: self.content_encoding,
77            common_attributes: self.common_attributes,
78        }
79    }
80}