Skip to main content

aws_sdk_cloudwatchlogs/operation/create_delivery/
_create_delivery_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 CreateDeliveryInput {
6    /// <p>The name of the delivery source to use for this delivery.</p>
7    pub delivery_source_name: ::std::option::Option<::std::string::String>,
8    /// <p>The ARN of the delivery destination to use for this delivery.</p>
9    pub delivery_destination_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The list of record fields to be delivered to the destination, in order. If the delivery's log source has mandatory fields, they must be included in this list.</p>
11    pub record_fields: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The field delimiter to use between record fields when the final output format of a delivery is in <code>Plain</code>, <code>W3C</code>, or <code>Raw</code> format.</p>
13    pub field_delimiter: ::std::option::Option<::std::string::String>,
14    /// <p>This structure contains parameters that are valid only when the delivery's delivery destination is an S3 bucket.</p>
15    pub s3_delivery_configuration: ::std::option::Option<crate::types::S3DeliveryConfiguration>,
16    /// <p>An optional list of key-value pairs to associate with the resource.</p>
17    /// <p>For more information about tagging, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a></p>
18    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
19}
20impl CreateDeliveryInput {
21    /// <p>The name of the delivery source to use for this delivery.</p>
22    pub fn delivery_source_name(&self) -> ::std::option::Option<&str> {
23        self.delivery_source_name.as_deref()
24    }
25    /// <p>The ARN of the delivery destination to use for this delivery.</p>
26    pub fn delivery_destination_arn(&self) -> ::std::option::Option<&str> {
27        self.delivery_destination_arn.as_deref()
28    }
29    /// <p>The list of record fields to be delivered to the destination, in order. If the delivery's log source has mandatory fields, they must be included in this list.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.record_fields.is_none()`.
32    pub fn record_fields(&self) -> &[::std::string::String] {
33        self.record_fields.as_deref().unwrap_or_default()
34    }
35    /// <p>The field delimiter to use between record fields when the final output format of a delivery is in <code>Plain</code>, <code>W3C</code>, or <code>Raw</code> format.</p>
36    pub fn field_delimiter(&self) -> ::std::option::Option<&str> {
37        self.field_delimiter.as_deref()
38    }
39    /// <p>This structure contains parameters that are valid only when the delivery's delivery destination is an S3 bucket.</p>
40    pub fn s3_delivery_configuration(&self) -> ::std::option::Option<&crate::types::S3DeliveryConfiguration> {
41        self.s3_delivery_configuration.as_ref()
42    }
43    /// <p>An optional list of key-value pairs to associate with the resource.</p>
44    /// <p>For more information about tagging, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a></p>
45    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
46        self.tags.as_ref()
47    }
48}
49impl CreateDeliveryInput {
50    /// Creates a new builder-style object to manufacture [`CreateDeliveryInput`](crate::operation::create_delivery::CreateDeliveryInput).
51    pub fn builder() -> crate::operation::create_delivery::builders::CreateDeliveryInputBuilder {
52        crate::operation::create_delivery::builders::CreateDeliveryInputBuilder::default()
53    }
54}
55
56/// A builder for [`CreateDeliveryInput`](crate::operation::create_delivery::CreateDeliveryInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateDeliveryInputBuilder {
60    pub(crate) delivery_source_name: ::std::option::Option<::std::string::String>,
61    pub(crate) delivery_destination_arn: ::std::option::Option<::std::string::String>,
62    pub(crate) record_fields: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
63    pub(crate) field_delimiter: ::std::option::Option<::std::string::String>,
64    pub(crate) s3_delivery_configuration: ::std::option::Option<crate::types::S3DeliveryConfiguration>,
65    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
66}
67impl CreateDeliveryInputBuilder {
68    /// <p>The name of the delivery source to use for this delivery.</p>
69    /// This field is required.
70    pub fn delivery_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.delivery_source_name = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The name of the delivery source to use for this delivery.</p>
75    pub fn set_delivery_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.delivery_source_name = input;
77        self
78    }
79    /// <p>The name of the delivery source to use for this delivery.</p>
80    pub fn get_delivery_source_name(&self) -> &::std::option::Option<::std::string::String> {
81        &self.delivery_source_name
82    }
83    /// <p>The ARN of the delivery destination to use for this delivery.</p>
84    /// This field is required.
85    pub fn delivery_destination_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.delivery_destination_arn = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The ARN of the delivery destination to use for this delivery.</p>
90    pub fn set_delivery_destination_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.delivery_destination_arn = input;
92        self
93    }
94    /// <p>The ARN of the delivery destination to use for this delivery.</p>
95    pub fn get_delivery_destination_arn(&self) -> &::std::option::Option<::std::string::String> {
96        &self.delivery_destination_arn
97    }
98    /// Appends an item to `record_fields`.
99    ///
100    /// To override the contents of this collection use [`set_record_fields`](Self::set_record_fields).
101    ///
102    /// <p>The list of record fields to be delivered to the destination, in order. If the delivery's log source has mandatory fields, they must be included in this list.</p>
103    pub fn record_fields(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        let mut v = self.record_fields.unwrap_or_default();
105        v.push(input.into());
106        self.record_fields = ::std::option::Option::Some(v);
107        self
108    }
109    /// <p>The list of record fields to be delivered to the destination, in order. If the delivery's log source has mandatory fields, they must be included in this list.</p>
110    pub fn set_record_fields(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
111        self.record_fields = input;
112        self
113    }
114    /// <p>The list of record fields to be delivered to the destination, in order. If the delivery's log source has mandatory fields, they must be included in this list.</p>
115    pub fn get_record_fields(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
116        &self.record_fields
117    }
118    /// <p>The field delimiter to use between record fields when the final output format of a delivery is in <code>Plain</code>, <code>W3C</code>, or <code>Raw</code> format.</p>
119    pub fn field_delimiter(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.field_delimiter = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>The field delimiter to use between record fields when the final output format of a delivery is in <code>Plain</code>, <code>W3C</code>, or <code>Raw</code> format.</p>
124    pub fn set_field_delimiter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.field_delimiter = input;
126        self
127    }
128    /// <p>The field delimiter to use between record fields when the final output format of a delivery is in <code>Plain</code>, <code>W3C</code>, or <code>Raw</code> format.</p>
129    pub fn get_field_delimiter(&self) -> &::std::option::Option<::std::string::String> {
130        &self.field_delimiter
131    }
132    /// <p>This structure contains parameters that are valid only when the delivery's delivery destination is an S3 bucket.</p>
133    pub fn s3_delivery_configuration(mut self, input: crate::types::S3DeliveryConfiguration) -> Self {
134        self.s3_delivery_configuration = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>This structure contains parameters that are valid only when the delivery's delivery destination is an S3 bucket.</p>
138    pub fn set_s3_delivery_configuration(mut self, input: ::std::option::Option<crate::types::S3DeliveryConfiguration>) -> Self {
139        self.s3_delivery_configuration = input;
140        self
141    }
142    /// <p>This structure contains parameters that are valid only when the delivery's delivery destination is an S3 bucket.</p>
143    pub fn get_s3_delivery_configuration(&self) -> &::std::option::Option<crate::types::S3DeliveryConfiguration> {
144        &self.s3_delivery_configuration
145    }
146    /// Adds a key-value pair to `tags`.
147    ///
148    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
149    ///
150    /// <p>An optional list of key-value pairs to associate with the resource.</p>
151    /// <p>For more information about tagging, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a></p>
152    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
153        let mut hash_map = self.tags.unwrap_or_default();
154        hash_map.insert(k.into(), v.into());
155        self.tags = ::std::option::Option::Some(hash_map);
156        self
157    }
158    /// <p>An optional list of key-value pairs to associate with the resource.</p>
159    /// <p>For more information about tagging, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a></p>
160    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
161        self.tags = input;
162        self
163    }
164    /// <p>An optional list of key-value pairs to associate with the resource.</p>
165    /// <p>For more information about tagging, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a></p>
166    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
167        &self.tags
168    }
169    /// Consumes the builder and constructs a [`CreateDeliveryInput`](crate::operation::create_delivery::CreateDeliveryInput).
170    pub fn build(
171        self,
172    ) -> ::std::result::Result<crate::operation::create_delivery::CreateDeliveryInput, ::aws_smithy_types::error::operation::BuildError> {
173        ::std::result::Result::Ok(crate::operation::create_delivery::CreateDeliveryInput {
174            delivery_source_name: self.delivery_source_name,
175            delivery_destination_arn: self.delivery_destination_arn,
176            record_fields: self.record_fields,
177            field_delimiter: self.field_delimiter,
178            s3_delivery_configuration: self.s3_delivery_configuration,
179            tags: self.tags,
180        })
181    }
182}