aws_sdk_pinpoint/types/
_endpoint_batch_request.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies a batch of endpoints to create or update and the settings and attributes to set or change for each endpoint.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EndpointBatchRequest {
7    /// <p>An array that defines the endpoints to create or update and, for each endpoint, the property values to set or change. An array can contain a maximum of 100 items.</p>
8    pub item: ::std::option::Option<::std::vec::Vec<crate::types::EndpointBatchItem>>,
9}
10impl EndpointBatchRequest {
11    /// <p>An array that defines the endpoints to create or update and, for each endpoint, the property values to set or change. An array can contain a maximum of 100 items.</p>
12    ///
13    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.item.is_none()`.
14    pub fn item(&self) -> &[crate::types::EndpointBatchItem] {
15        self.item.as_deref().unwrap_or_default()
16    }
17}
18impl EndpointBatchRequest {
19    /// Creates a new builder-style object to manufacture [`EndpointBatchRequest`](crate::types::EndpointBatchRequest).
20    pub fn builder() -> crate::types::builders::EndpointBatchRequestBuilder {
21        crate::types::builders::EndpointBatchRequestBuilder::default()
22    }
23}
24
25/// A builder for [`EndpointBatchRequest`](crate::types::EndpointBatchRequest).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct EndpointBatchRequestBuilder {
29    pub(crate) item: ::std::option::Option<::std::vec::Vec<crate::types::EndpointBatchItem>>,
30}
31impl EndpointBatchRequestBuilder {
32    /// Appends an item to `item`.
33    ///
34    /// To override the contents of this collection use [`set_item`](Self::set_item).
35    ///
36    /// <p>An array that defines the endpoints to create or update and, for each endpoint, the property values to set or change. An array can contain a maximum of 100 items.</p>
37    pub fn item(mut self, input: crate::types::EndpointBatchItem) -> Self {
38        let mut v = self.item.unwrap_or_default();
39        v.push(input);
40        self.item = ::std::option::Option::Some(v);
41        self
42    }
43    /// <p>An array that defines the endpoints to create or update and, for each endpoint, the property values to set or change. An array can contain a maximum of 100 items.</p>
44    pub fn set_item(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndpointBatchItem>>) -> Self {
45        self.item = input;
46        self
47    }
48    /// <p>An array that defines the endpoints to create or update and, for each endpoint, the property values to set or change. An array can contain a maximum of 100 items.</p>
49    pub fn get_item(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndpointBatchItem>> {
50        &self.item
51    }
52    /// Consumes the builder and constructs a [`EndpointBatchRequest`](crate::types::EndpointBatchRequest).
53    pub fn build(self) -> crate::types::EndpointBatchRequest {
54        crate::types::EndpointBatchRequest { item: self.item }
55    }
56}