1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use super::link::LinkType;
use super::list_members::{ListMember, ListMemberParams};
///
///  Batch subscribe or unsubscribe list members Response
///
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ListBatchParam {
    /// An array of objects, each representing an email address and
    /// the subscription status for a specific list. Up to 500 members
    /// may be added or updated with each API call.
    #[serde(default)]
    pub members: Vec<ListMemberParams>,
    ///
    /// Whether this batch operation will change existing members’ subscription status.
    ///
    #[serde(default)]
    pub update_existing: bool,
}

///
/// Representing an email address that could not be added to the list or updated
/// and an error message providing more details.
///
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ListBatchErrors {
    ///
    /// The email address that could not be added or updated.
    ///
    #[serde(default)]
    pub email_address: String,
    ///
    /// The error message indicating why the email address could not be added or updated.
    ///
    #[serde(default)]
    pub error: String,
}

///
///  Batch subscribe or unsubscribe list members Response
///
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ListBatchResponse {
    ///
    /// An array of objects, each representing a new member
    /// that was added to the list.
    ///
    #[serde(default)]
    pub new_members: Vec<ListMember>,
    ///
    /// An array of objects, each representing an existing list member
    /// whose subscription status was updated.
    ///
    #[serde(default)]
    pub updated_members: Vec<ListMember>,
    ///
    /// An array of objects, each representing an email address that
    /// could not be added to the list or updated and an error message
    /// providing more details.
    ///
    #[serde(default)]
    pub errors: Vec<ListBatchErrors>,
    ///
    /// The total number of items matching the query, irrespective of pagination.
    ///
    #[serde(default)]
    pub total_created: u64,
    ///
    /// The total number of items matching the query, irrespective of pagination.
    ///
    #[serde(default)]
    pub total_updated: u64,
    ///
    /// The total number of items matching the query, irrespective of pagination.
    ///
    #[serde(default)]
    pub error_count: u64,
    ///
    /// A list of link types and descriptions for the API schema documents.
    ///
    #[serde(default)]
    pub _links: Vec<LinkType>,
}