forked from jfcote87/esign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signinggroups.go
274 lines (239 loc) · 8.56 KB
/
signinggroups.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
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
// 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 signinggroups implements the DocuSign SDK
// category SigningGroups.
//
// Use the SigningGroup category to manage signing groups that allow you anyone in the group to sign a document.
//
// The category allows you create the signing group and manage the users in the group.
//
// Service Api documentation may be found at:
// https://developers.docusign.com/esign-rest-api/v2/reference/SigningGroups
// Usage example:
//
// import (
// "github.com/bradwheel/esign"
// "github.com/bradwheel/esign/v2/signinggroups"
// "github.com/bradwheel/esign/v2/model"
// )
// ...
// signinggroupsService := signinggroups.New(esignCredential)
package signinggroups // import "github.com/bradwheel/esign/v2/signinggroups"
import (
"context"
"net/url"
"strings"
"github.com/bradwheel/esign"
"github.com/bradwheel/esign/v2/model"
)
// Service implements DocuSign SigningGroups Category API operations
type Service struct {
credential esign.Credential
}
// New initializes a signinggroups service using cred to authorize ops.
func New(cred esign.Credential) *Service {
return &Service{credential: cred}
}
// UsersDelete deletes one or more members from a signing group.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroupusers/delete
//
// SDK Method SigningGroups::deleteUsers
func (s *Service) UsersDelete(signingGroupID string, signingGroupUsers *model.SigningGroupUsers) *UsersDeleteOp {
return &UsersDeleteOp{
Credential: s.credential,
Method: "DELETE",
Path: strings.Join([]string{"signing_groups", signingGroupID, "users"}, "/"),
Payload: signingGroupUsers,
QueryOpts: make(url.Values),
}
}
// UsersDeleteOp implements DocuSign API SDK SigningGroups::deleteUsers
type UsersDeleteOp esign.Op
// Do executes the op. A nil context will return error.
func (op *UsersDeleteOp) Do(ctx context.Context) (*model.SigningGroupUsers, error) {
var res *model.SigningGroupUsers
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// UsersList gets a list of members in a Signing Group.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroupusers/list
//
// SDK Method SigningGroups::listUsers
func (s *Service) UsersList(signingGroupID string) *UsersListOp {
return &UsersListOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"signing_groups", signingGroupID, "users"}, "/"),
QueryOpts: make(url.Values),
}
}
// UsersListOp implements DocuSign API SDK SigningGroups::listUsers
type UsersListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *UsersListOp) Do(ctx context.Context) (*model.SigningGroupUsers, error) {
var res *model.SigningGroupUsers
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// UsersUpdate adds members to a signing group.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroupusers/update
//
// SDK Method SigningGroups::updateUsers
func (s *Service) UsersUpdate(signingGroupID string, signingGroupUsers *model.SigningGroupUsers) *UsersUpdateOp {
return &UsersUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"signing_groups", signingGroupID, "users"}, "/"),
Payload: signingGroupUsers,
QueryOpts: make(url.Values),
}
}
// UsersUpdateOp implements DocuSign API SDK SigningGroups::updateUsers
type UsersUpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *UsersUpdateOp) Do(ctx context.Context) (*model.SigningGroupUsers, error) {
var res *model.SigningGroupUsers
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Create creates a signing group.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroups/create
//
// SDK Method SigningGroups::createList
func (s *Service) Create(signingGroupInformation *model.SigningGroupInformation) *CreateOp {
return &CreateOp{
Credential: s.credential,
Method: "POST",
Path: "signing_groups",
Payload: signingGroupInformation,
QueryOpts: make(url.Values),
}
}
// CreateOp implements DocuSign API SDK SigningGroups::createList
type CreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *CreateOp) Do(ctx context.Context) (*model.SigningGroupInformation, error) {
var res *model.SigningGroupInformation
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Delete deletes one or more signing groups.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroups/delete
//
// SDK Method SigningGroups::deleteList
func (s *Service) Delete(signingGroupInformation *model.SigningGroupInformation) *DeleteOp {
return &DeleteOp{
Credential: s.credential,
Method: "DELETE",
Path: "signing_groups",
Payload: signingGroupInformation,
QueryOpts: make(url.Values),
}
}
// DeleteOp implements DocuSign API SDK SigningGroups::deleteList
type DeleteOp esign.Op
// Do executes the op. A nil context will return error.
func (op *DeleteOp) Do(ctx context.Context) (*model.SigningGroupInformation, error) {
var res *model.SigningGroupInformation
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Get gets information about a signing group.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroups/get
//
// SDK Method SigningGroups::get
func (s *Service) Get(signingGroupID string) *GetOp {
return &GetOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"signing_groups", signingGroupID}, "/"),
QueryOpts: make(url.Values),
}
}
// GetOp implements DocuSign API SDK SigningGroups::get
type GetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *GetOp) Do(ctx context.Context) (*model.SigningGroup, error) {
var res *model.SigningGroup
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// List gets a list of the Signing Groups in an account.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroups/list
//
// SDK Method SigningGroups::list
func (s *Service) List() *ListOp {
return &ListOp{
Credential: s.credential,
Method: "GET",
Path: "signing_groups",
QueryOpts: make(url.Values),
}
}
// ListOp implements DocuSign API SDK SigningGroups::list
type ListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *ListOp) Do(ctx context.Context) (*model.SigningGroupInformation, error) {
var res *model.SigningGroupInformation
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// GroupType set the call query parameter group_type
func (op *ListOp) GroupType(val string) *ListOp {
if op != nil {
op.QueryOpts.Set("group_type", val)
}
return op
}
// IncludeUsers when set to **true**, the response includes the signing group members.
func (op *ListOp) IncludeUsers() *ListOp {
if op != nil {
op.QueryOpts.Set("include_users", "true")
}
return op
}
// Update updates a signing group.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroups/update
//
// SDK Method SigningGroups::update
func (s *Service) Update(signingGroupID string, signingGroups *model.SigningGroup) *UpdateOp {
return &UpdateOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"signing_groups", signingGroupID}, "/"),
Payload: signingGroups,
QueryOpts: make(url.Values),
}
}
// UpdateOp implements DocuSign API SDK SigningGroups::update
type UpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *UpdateOp) Do(ctx context.Context) (*model.SigningGroup, error) {
var res *model.SigningGroup
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// UpdateList updates signing group names.
//
// https://developers.docusign.com/esign-rest-api/v2/reference/signinggroups/signinggroups/updatelist
//
// SDK Method SigningGroups::updateList
func (s *Service) UpdateList(signingGroupInformation *model.SigningGroupInformation) *UpdateListOp {
return &UpdateListOp{
Credential: s.credential,
Method: "PUT",
Path: "signing_groups",
Payload: signingGroupInformation,
QueryOpts: make(url.Values),
}
}
// UpdateListOp implements DocuSign API SDK SigningGroups::updateList
type UpdateListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *UpdateListOp) Do(ctx context.Context) (*model.SigningGroupInformation, error) {
var res *model.SigningGroupInformation
return res, ((*esign.Op)(op)).Do(ctx, &res)
}