forked from jfcote87/esign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
future.go
244 lines (210 loc) · 9.77 KB
/
future.go
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
// Copyright 2019 James Cote
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated by gen-esign; DO NOT EDIT.
// Package future implements the DocuSign SDK
// category Future.
//
//
//
// Api documentation may be found at:
// https://developers.docusign.com/esign/esign-rest-api/v2/reference/Future
// Usage example:
//
// import (
// "github.com/pwaterz/esign"
// "github.com/pwaterz/esign//future"
// )
// ...
// futureService := future.New(esignCredential)
package future
import (
"context"
"net/url"
"strings"
"github.com/pwaterz/esign"
"github.com/pwaterz/esign/v2/model"
)
// Service implements DocuSign Future Category API operations
type Service struct {
credential esign.Credential
}
// New initializes a future service using cred to authorize ops.
func New(cred esign.Credential) *Service {
return &Service{credential: cred}
}
// CommentsGet is SDK Method Future::getCommentsTranscript
//
// https://developers.docusign.com/esign/restapi/Future/Comments/get
func (s *Service) CommentsGet(envelopeID string) *CommentsGetOp {
return &CommentsGetOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"envelopes", envelopeID, "comments", "transcript"}, "/"),
Accept: "application/pdf",
QueryOpts: make(url.Values),
}
}
// CommentsGetOp implements DocuSign API SDK Future::getCommentsTranscript
type CommentsGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *CommentsGetOp) Do(ctx context.Context) (*esign.Download, error) {
var res *esign.Download
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Encoding set the call query parameter encoding
func (op *CommentsGetOp) Encoding(val string) *CommentsGetOp {
if op != nil {
op.QueryOpts.Set("encoding", val)
}
return op
}
// DocumentResponsiveHTMLPreviewCreate is SDK Method Future::createDocumentResponsiveHtmlPreview
//
// https://developers.docusign.com/esign/restapi/Future/DocumentResponsiveHtmlPreview/create
func (s *Service) DocumentResponsiveHTMLPreviewCreate(documentID string, envelopeID string, documentHTMLDefinition *model.DocumentHTMLDefinition) *DocumentResponsiveHTMLPreviewCreateOp {
return &DocumentResponsiveHTMLPreviewCreateOp{
Credential: s.credential,
Method: "POST",
Path: strings.Join([]string{"envelopes", envelopeID, "documents", documentID, "responsive_html_preview"}, "/"),
Payload: documentHTMLDefinition,
QueryOpts: make(url.Values),
}
}
// DocumentResponsiveHTMLPreviewCreateOp implements DocuSign API SDK Future::createDocumentResponsiveHtmlPreview
type DocumentResponsiveHTMLPreviewCreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *DocumentResponsiveHTMLPreviewCreateOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitions, error) {
var res *model.DocumentHTMLDefinitions
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// EnvelopeDocumentHTMLDefinitionsGet is SDK Method Future::getEnvelopeDocumentHtmlDefinitions
//
// https://developers.docusign.com/esign/restapi/Future/EnvelopeDocumentHtmlDefinitions/get
func (s *Service) EnvelopeDocumentHTMLDefinitionsGet(documentID string, envelopeID string) *EnvelopeDocumentHTMLDefinitionsGetOp {
return &EnvelopeDocumentHTMLDefinitionsGetOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"envelopes", envelopeID, "documents", documentID, "html_definitions"}, "/"),
QueryOpts: make(url.Values),
}
}
// EnvelopeDocumentHTMLDefinitionsGetOp implements DocuSign API SDK Future::getEnvelopeDocumentHtmlDefinitions
type EnvelopeDocumentHTMLDefinitionsGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *EnvelopeDocumentHTMLDefinitionsGetOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitionOriginals, error) {
var res *model.DocumentHTMLDefinitionOriginals
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// EnvelopeHTMLDefinitionsList is SDK Method Future::getEnvelopeHtmlDefinitions
//
// https://developers.docusign.com/esign/restapi/Future/EnvelopeHtmlDefinitions/list
func (s *Service) EnvelopeHTMLDefinitionsList(envelopeID string) *EnvelopeHTMLDefinitionsListOp {
return &EnvelopeHTMLDefinitionsListOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"envelopes", envelopeID, "html_definitions"}, "/"),
QueryOpts: make(url.Values),
}
}
// EnvelopeHTMLDefinitionsListOp implements DocuSign API SDK Future::getEnvelopeHtmlDefinitions
type EnvelopeHTMLDefinitionsListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *EnvelopeHTMLDefinitionsListOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitionOriginals, error) {
var res *model.DocumentHTMLDefinitionOriginals
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// ResponsiveHTMLPreviewCreate is SDK Method Future::createResponsiveHtmlPreview
//
// https://developers.docusign.com/esign/restapi/Future/ResponsiveHtmlPreview/create
func (s *Service) ResponsiveHTMLPreviewCreate(envelopeID string, documentHTMLDefinition *model.DocumentHTMLDefinition) *ResponsiveHTMLPreviewCreateOp {
return &ResponsiveHTMLPreviewCreateOp{
Credential: s.credential,
Method: "POST",
Path: strings.Join([]string{"envelopes", envelopeID, "responsive_html_preview"}, "/"),
Payload: documentHTMLDefinition,
QueryOpts: make(url.Values),
}
}
// ResponsiveHTMLPreviewCreateOp implements DocuSign API SDK Future::createResponsiveHtmlPreview
type ResponsiveHTMLPreviewCreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *ResponsiveHTMLPreviewCreateOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitions, error) {
var res *model.DocumentHTMLDefinitions
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// TemplateDocumentHTMLDefinitionsList is SDK Method Future::getTemplateDocumentHtmlDefinitions
//
// https://developers.docusign.com/esign/restapi/Future/TemplateDocumentHtmlDefinitions/list
func (s *Service) TemplateDocumentHTMLDefinitionsList(documentID string, templateID string) *TemplateDocumentHTMLDefinitionsListOp {
return &TemplateDocumentHTMLDefinitionsListOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"templates", templateID, "documents", documentID, "html_definitions"}, "/"),
QueryOpts: make(url.Values),
}
}
// TemplateDocumentHTMLDefinitionsListOp implements DocuSign API SDK Future::getTemplateDocumentHtmlDefinitions
type TemplateDocumentHTMLDefinitionsListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *TemplateDocumentHTMLDefinitionsListOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitionOriginals, error) {
var res *model.DocumentHTMLDefinitionOriginals
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// TemplateDocumentResponsiveHTMLPreviewCreate is SDK Method Future::createTemplateDocumentResponsiveHtmlPreview
//
// https://developers.docusign.com/esign/restapi/Future/TemplateDocumentResponsiveHtmlPreview/create
func (s *Service) TemplateDocumentResponsiveHTMLPreviewCreate(documentID string, templateID string, documentHTMLDefinition *model.DocumentHTMLDefinition) *TemplateDocumentResponsiveHTMLPreviewCreateOp {
return &TemplateDocumentResponsiveHTMLPreviewCreateOp{
Credential: s.credential,
Method: "POST",
Path: strings.Join([]string{"templates", templateID, "documents", documentID, "responsive_html_preview"}, "/"),
Payload: documentHTMLDefinition,
QueryOpts: make(url.Values),
}
}
// TemplateDocumentResponsiveHTMLPreviewCreateOp implements DocuSign API SDK Future::createTemplateDocumentResponsiveHtmlPreview
type TemplateDocumentResponsiveHTMLPreviewCreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *TemplateDocumentResponsiveHTMLPreviewCreateOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitions, error) {
var res *model.DocumentHTMLDefinitions
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// TemplateHTMLDefinitionsList is SDK Method Future::getTemplateHtmlDefinitions
//
// https://developers.docusign.com/esign/restapi/Future/TemplateHtmlDefinitions/list
func (s *Service) TemplateHTMLDefinitionsList(templateID string) *TemplateHTMLDefinitionsListOp {
return &TemplateHTMLDefinitionsListOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"templates", templateID, "html_definitions"}, "/"),
QueryOpts: make(url.Values),
}
}
// TemplateHTMLDefinitionsListOp implements DocuSign API SDK Future::getTemplateHtmlDefinitions
type TemplateHTMLDefinitionsListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *TemplateHTMLDefinitionsListOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitionOriginals, error) {
var res *model.DocumentHTMLDefinitionOriginals
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// TemplateResponsiveHTMLPreviewCreate is SDK Method Future::createTemplateResponsiveHtmlPreview
//
// https://developers.docusign.com/esign/restapi/Future/TemplateResponsiveHtmlPreview/create
func (s *Service) TemplateResponsiveHTMLPreviewCreate(templateID string, documentHTMLDefinition *model.DocumentHTMLDefinition) *TemplateResponsiveHTMLPreviewCreateOp {
return &TemplateResponsiveHTMLPreviewCreateOp{
Credential: s.credential,
Method: "POST",
Path: strings.Join([]string{"templates", templateID, "responsive_html_preview"}, "/"),
Payload: documentHTMLDefinition,
QueryOpts: make(url.Values),
}
}
// TemplateResponsiveHTMLPreviewCreateOp implements DocuSign API SDK Future::createTemplateResponsiveHtmlPreview
type TemplateResponsiveHTMLPreviewCreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *TemplateResponsiveHTMLPreviewCreateOp) Do(ctx context.Context) (*model.DocumentHTMLDefinitions, error) {
var res *model.DocumentHTMLDefinitions
return res, ((*esign.Op)(op)).Do(ctx, &res)
}