/
connect_events.ex
325 lines (271 loc) · 12 KB
/
connect_events.ex
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# NOTE: This file is auto generated by OpenAPI Generator 6.4.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule DocuSign.Api.ConnectEvents do
@moduledoc """
API calls for all endpoints tagged `ConnectEvents`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Deletes a Connect failure log entry.
Deletes the Connect failure log information for the specified entry. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `failure_id` (String.t): The ID of the Connect post failure. Use `all` to delete all failures for the account.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, map()}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_failures_delete_connect_failure_log(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) :: {:ok, Map.t()} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def connect_failures_delete_connect_failure_log(connection, account_id, failure_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/connect/failures/#{failure_id}")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets the Connect failure log information.
Retrieves the Connect failure log information. You can use this log to determine which envelopes failed to post, in order to create a republish request. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:from_date` (String.t): The start date for a date range in UTC DateTime format. **Note:** If this property is null, no date filtering is applied.
- `:to_date` (String.t): The end of a search date range in UTC DateTime format. When you use this parameter, only templates created up to this date and time are returned. **Note:** If this property is null, the value defaults to the current date.
### Returns
- `{:ok, DocuSign.Model.ConnectLogs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_failures_get_connect_logs(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectLogs.t()}
| {:error, Tesla.Env.t()}
def connect_failures_get_connect_logs(connection, account_id, opts \\ []) do
optional_params = %{
:from_date => :query,
:to_date => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/connect/failures")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectLogs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Deletes a specified Connect log entry.
Deletes a specified entry from the Connect Log. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `log_id` (String.t): The ID of the Connect log entry.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_delete_connect_log(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def connect_log_delete_connect_log(connection, account_id, log_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/connect/logs/#{log_id}")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Deletes a list of Connect log entries.
Deletes a list of Connect log entries for your account. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_delete_connect_logs(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def connect_log_delete_connect_logs(connection, account_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/connect/logs")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets a Connect log entry.
Retrieves the specified Connect log entry for your account. The `enableLog` setting in the Connect configuration must be set to **true** to enable logging. If logging is not enabled, then no log entries are recorded. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `log_id` (String.t): The ID of the Connect log entry.
- `opts` (keyword): Optional parameters
- `:additional_info` (String.t): When **true,** the response includes the `connectDebugLog` information.
### Returns
- `{:ok, DocuSign.Model.ConnectLog.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_get_connect_log(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ConnectLog.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def connect_log_get_connect_log(connection, account_id, log_id, opts \\ []) do
optional_params = %{
:additional_info => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/connect/logs/#{log_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectLog{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets the Connect log.
Retrieves a list of the 100 most recent connect log entries for your account. The `enableLog` setting in the Connect configuration must be set to **true** to enable logging. If logging is not enabled, then no log entries are recorded. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:from_date` (String.t): The start date for a date range in UTC DateTime format. **Note:** If this property is null, no date filtering is applied.
- `:to_date` (String.t): The end of a search date range in UTC DateTime format. When you use this parameter, only templates created up to this date and time are returned. **Note:** If this property is null, the value defaults to the current date.
### Returns
- `{:ok, DocuSign.Model.ConnectLogs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_get_connect_logs(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectLogs.t()}
| {:error, Tesla.Env.t()}
def connect_log_get_connect_logs(connection, account_id, opts \\ []) do
optional_params = %{
:from_date => :query,
:to_date => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/connect/logs")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectLogs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Republishes Connect information for multiple envelopes.
Republishes Connect information for the specified set of envelopes. The primary use is to republish Connect post failures by including envelope IDs for the envelopes that failed to post in the request. The list of envelope IDs that failed to post correctly can be retrieved by calling to [Connect::listEventLogs](/docs/esign-rest-api/reference/connect/connectevents/list/) retrieve the failure log. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:body` (ConnectFailureFilter):
### Returns
- `{:ok, DocuSign.Model.ConnectFailureResults.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_publish_put_connect_retry(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectFailureResults.t()}
| {:error, Tesla.Env.t()}
def connect_publish_put_connect_retry(connection, account_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/connect/envelopes/retry_queue")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectFailureResults{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Republishes Connect information for the specified envelope.
Republishes Connect information for the specified envelope. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `envelope_id` (String.t): The envelope's GUID. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.ConnectFailureResults.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_publish_put_connect_retry_by_envelope(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectFailureResults.t()}
| {:error, Tesla.Env.t()}
def connect_publish_put_connect_retry_by_envelope(
connection,
account_id,
envelope_id,
_opts \\ []
) do
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/connect/envelopes/#{envelope_id}/retry_queue")
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectFailureResults{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
end