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
use anyhow::Result;
use crate::Client;
pub struct TemplateDocumentFields {
pub client: Client,
}
impl TemplateDocumentFields {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
TemplateDocumentFields { client }
}
/**
* Gets the custom document fields for a an existing template document.
*
* This function performs a `GET` to the `/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields` endpoint.
*
* This method retrieves the custom document fields for an existing template document.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `document_id: &str` -- The `documentId` is set by the API client. It is an integer that falls between `1` and 2,147,483,647. The value is encoded as a string without commas. The values `1`, `2`, `3`, and so on are typically used to identify the first few documents in an envelope. Tab definitions include a `documentId` property that specifies the document on which to place the tab.
* * `template_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn document_fields_get_template(
&self,
account_id: &str,
document_id: &str,
template_id: &str,
) -> Result<crate::types::DocumentFieldsInformation> {
let url = format!(
"/v2.1/accounts/{}/templates/{}/documents/{}/fields",
crate::progenitor_support::encode_path(account_id),
crate::progenitor_support::encode_path(template_id),
crate::progenitor_support::encode_path(document_id),
);
self.client.get(&url, None).await
}
/**
* Updates existing custom document fields in an existing template document.
*
* This function performs a `PUT` to the `/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields` endpoint.
*
* Updates existing custom document fields in an existing template document.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `document_id: &str` -- The `documentId` is set by the API client. It is an integer that falls between `1` and 2,147,483,647. The value is encoded as a string without commas. The values `1`, `2`, `3`, and so on are typically used to identify the first few documents in an envelope. Tab definitions include a `documentId` property that specifies the document on which to place the tab.
* * `template_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn document_fields_put_template(
&self,
account_id: &str,
document_id: &str,
template_id: &str,
body: &crate::types::DocumentFieldsInformation,
) -> Result<crate::types::DocumentFieldsInformation> {
let url = format!(
"/v2.1/accounts/{}/templates/{}/documents/{}/fields",
crate::progenitor_support::encode_path(account_id),
crate::progenitor_support::encode_path(template_id),
crate::progenitor_support::encode_path(document_id),
);
self.client
.put(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
/**
* Creates custom document fields in an existing template document.
*
* This function performs a `POST` to the `/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields` endpoint.
*
* Creates custom document fields in an existing template document.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `document_id: &str` -- The `documentId` is set by the API client. It is an integer that falls between `1` and 2,147,483,647. The value is encoded as a string without commas. The values `1`, `2`, `3`, and so on are typically used to identify the first few documents in an envelope. Tab definitions include a `documentId` property that specifies the document on which to place the tab.
* * `template_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn document_fields_post_template(
&self,
account_id: &str,
document_id: &str,
template_id: &str,
body: &crate::types::DocumentFieldsInformation,
) -> Result<crate::types::DocumentFieldsInformation> {
let url = format!(
"/v2.1/accounts/{}/templates/{}/documents/{}/fields",
crate::progenitor_support::encode_path(account_id),
crate::progenitor_support::encode_path(template_id),
crate::progenitor_support::encode_path(document_id),
);
self.client
.post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
/**
* Deletes custom document fields from an existing template document.
*
* This function performs a `DELETE` to the `/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields` endpoint.
*
* Deletes custom document fields from an existing template document.
*
* **Parameters:**
*
* * `account_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
* * `document_id: &str` -- The `documentId` is set by the API client. It is an integer that falls between `1` and 2,147,483,647. The value is encoded as a string without commas. The values `1`, `2`, `3`, and so on are typically used to identify the first few documents in an envelope. Tab definitions include a `documentId` property that specifies the document on which to place the tab.
* * `template_id: &str` -- The brand that envelope recipients see when a brand is not explicitly set.
*/
pub async fn document_fields_delete_template(
&self,
account_id: &str,
document_id: &str,
template_id: &str,
body: &crate::types::DocumentFieldsInformation,
) -> Result<crate::types::DocumentFieldsInformation> {
let url = format!(
"/v2.1/accounts/{}/templates/{}/documents/{}/fields",
crate::progenitor_support::encode_path(account_id),
crate::progenitor_support::encode_path(template_id),
crate::progenitor_support::encode_path(document_id),
);
self.client
.delete(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
}