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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
use anyhow::Result;
use crate::Client;
pub struct SigningGroups {
pub client: Client,
}
impl SigningGroups {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
SigningGroups { client }
}
/**
* Gets a list of the Signing Groups in an account.
*
* This function performs a `GET` to the `/v2.1/accounts/{accountId}/signing_groups` endpoint.
*
* Retrieves a list of all signing groups in the specified account.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `group_type: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `include_users: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn get(
&self,
account_id: &str,
group_type: &str,
include_users: &str,
) -> Result<crate::types::SigningGroupInformation> {
let mut query_args: Vec<(String, String)> = Default::default();
if !group_type.is_empty() {
query_args.push(("group_type".to_string(), group_type.to_string()));
}
if !include_users.is_empty() {
query_args.push(("include_users".to_string(), include_users.to_string()));
}
let query_ = serde_urlencoded::to_string(&query_args).unwrap();
let url = format!(
"/v2.1/accounts/{}/signing_groups?{}",
crate::progenitor_support::encode_path(account_id),
query_
);
self.client.get(&url, None).await
}
/**
* Updates signing group names.
*
* This function performs a `PUT` to the `/v2.1/accounts/{accountId}/signing_groups` endpoint.
*
* Updates the name of one or more existing signing groups.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn put(
&self,
account_id: &str,
body: &crate::types::SigningGroupInformation,
) -> Result<crate::types::SigningGroupInformation> {
let url = format!(
"/v2.1/accounts/{}/signing_groups",
crate::progenitor_support::encode_path(account_id),
);
self.client
.put(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
/**
* Creates a signing group. .
*
* This function performs a `POST` to the `/v2.1/accounts/{accountId}/signing_groups` endpoint.
*
* Creates one or more signing groups.
*
* Multiple signing groups can be created in one call. Only users with account administrator privileges can create signing groups.
*
* An account can have a maximum of 50 signing groups. Each signing group can have a maximum of 50 group members.
*
* Signing groups can be used by any account user.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn post(
&self,
account_id: &str,
body: &crate::types::SigningGroupInformation,
) -> Result<crate::types::SigningGroupInformation> {
let url = format!(
"/v2.1/accounts/{}/signing_groups",
crate::progenitor_support::encode_path(account_id),
);
self.client
.post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
/**
* Deletes one or more signing groups.
*
* This function performs a `DELETE` to the `/v2.1/accounts/{accountId}/signing_groups` endpoint.
*
* Deletes one or more signing groups in the specified account.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn delete(
&self,
account_id: &str,
body: &crate::types::SigningGroupInformation,
) -> Result<crate::types::SigningGroupInformation> {
let url = format!(
"/v2.1/accounts/{}/signing_groups",
crate::progenitor_support::encode_path(account_id),
);
self.client
.delete(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
/**
* Gets information about a signing group. .
*
* This function performs a `GET` to the `/v2.1/accounts/{accountId}/signing_groups/{signingGroupId}` endpoint.
*
* Retrieves information, including group member information, for the specified signing group.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `signing_group_id: &str` -- Optional. The ID of the [signing group](https://support.docusign.com/en/guides/ndse-user-guide-signing-groups).
*
* **Note**: When you send an envelope to a signing group, anyone in the group can open it and sign it with their own signature. For this reason, we recommend that you do not include non-signer recipients (such as carbon copy recipients) in the same signing group as signer recipients. However, you could create a second signing group for the non-signer recipients and change the default action of Needs to Sign to a different value, such as Receives a Copy.
*/
pub async fn get_group(
&self,
account_id: &str,
signing_group_id: &str,
) -> Result<crate::types::SigningGroup> {
let url = format!(
"/v2.1/accounts/{}/signing_groups/{}",
crate::progenitor_support::encode_path(account_id),
crate::progenitor_support::encode_path(signing_group_id),
);
self.client.get(&url, None).await
}
/**
* Updates a signing group. .
*
* This function performs a `PUT` to the `/v2.1/accounts/{accountId}/signing_groups/{signingGroupId}` endpoint.
*
* Updates signing group name and member information. You can also add new members to the signing group. A signing group can have a maximum of 50 members.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `signing_group_id: &str` -- Optional. The ID of the [signing group](https://support.docusign.com/en/guides/ndse-user-guide-signing-groups).
*
* **Note**: When you send an envelope to a signing group, anyone in the group can open it and sign it with their own signature. For this reason, we recommend that you do not include non-signer recipients (such as carbon copy recipients) in the same signing group as signer recipients. However, you could create a second signing group for the non-signer recipients and change the default action of Needs to Sign to a different value, such as Receives a Copy.
*/
pub async fn put_group(
&self,
account_id: &str,
signing_group_id: &str,
body: &crate::types::SigningGroup,
) -> Result<crate::types::SigningGroup> {
let url = format!(
"/v2.1/accounts/{}/signing_groups/{}",
crate::progenitor_support::encode_path(account_id),
crate::progenitor_support::encode_path(signing_group_id),
);
self.client
.put(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
}